File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ WorkingDirectory=/
3
3
# For reasons I don't care to troubleshoot, Fedora 31 won't let me start this
4
4
# unless I use `bash -c` around it. Putting the command line in directly
5
5
# yields a 203 permission denied error with no logs about what it didn't like.
6
- ExecStart =bash -c "/usr/bin/evremap remap /etc/evremap.toml"
6
+ ExecStart =bash -c "/usr/bin/evremap remap /etc/evremap.toml -d 0 "
7
7
Restart =always
8
8
9
9
[Install]
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ enum Opt {
31
31
/// Specify the configuration file to be loaded
32
32
#[ structopt( name = "CONFIG-FILE" ) ]
33
33
config_file : PathBuf ,
34
+
35
+ /// Number of seconds for user to release keys on startup
36
+ #[ structopt( short, long, default_value = "2" ) ]
37
+ delay : f64 ,
34
38
} ,
35
39
}
36
40
@@ -66,14 +70,14 @@ fn main() -> Result<()> {
66
70
match opt {
67
71
Opt :: ListDevices => deviceinfo:: list_devices ( ) ,
68
72
Opt :: ListKeys => list_keys ( ) ,
69
- Opt :: Remap { config_file } => {
73
+ Opt :: Remap { config_file, delay } => {
70
74
let mapping_config = MappingConfig :: from_file ( & config_file) . context ( format ! (
71
75
"loading MappingConfig from {}" ,
72
76
config_file. display( )
73
77
) ) ?;
74
78
75
79
log:: warn!( "Short delay: release any keys now!" ) ;
76
- std:: thread:: sleep ( Duration :: new ( 2 , 0 ) ) ;
80
+ std:: thread:: sleep ( Duration :: from_secs_f64 ( delay ) ) ;
77
81
78
82
let device_info = deviceinfo:: DeviceInfo :: with_name (
79
83
& mapping_config. device_name ,
You can’t perform that action at this time.
0 commit comments