@@ -9,15 +9,11 @@ use dbus::message::MatchRule;
9
9
use dbus:: Message ;
10
10
use dbus:: MessageType ;
11
11
12
- use std:: process:: Command ;
13
12
use std:: time:: Duration ;
14
13
15
- use crate :: utils;
16
-
17
- use inputmodule_control:: inputmodule:: find_serialdevs;
14
+ use clap:: Parser ;
18
15
use inputmodule_control:: commands:: ClapCli ;
19
- use inputmodule_control:: inputmodule:: { serial_commands} ;
20
- use clap:: { Parser , Subcommand } ;
16
+ use inputmodule_control:: inputmodule:: serial_commands;
21
17
22
18
use log:: debug;
23
19
@@ -30,8 +26,14 @@ fn handle_message(msg: &Message) {
30
26
let string_value: String = string_ref. to_string ( ) ;
31
27
debug ! ( "String value: {}" , string_value) ;
32
28
33
- if string_value. contains ( "calendar.google.com" ) {
34
- run_inputmodule_command ( vec ! [ "led-matrix" , "--pattern" , "all-on" , "--blink-n-times" , "3" ] ) ;
29
+ if string_value. contains ( "calendar.google.com" ) {
30
+ run_inputmodule_command ( vec ! [
31
+ "led-matrix" ,
32
+ "--pattern" ,
33
+ "all-on" ,
34
+ "--blink-n-times" ,
35
+ "3" ,
36
+ ] ) ;
35
37
run_inputmodule_command ( vec ! [ "led-matrix" , "--brightness" , "0" ] ) ;
36
38
}
37
39
}
@@ -41,11 +43,11 @@ fn handle_message(msg: &Message) {
41
43
debug ! ( "DBus Message handled" ) ;
42
44
}
43
45
44
- pub fn run_inputmodule_command ( args : Vec < & str > ) {
46
+ pub fn run_inputmodule_command ( args : Vec < & str > ) {
45
47
let bin_placeholder = vec ! [ "bin-placeholder" ] ;
46
48
let full_args = [ & bin_placeholder[ ..] , & args[ ..] ] . concat ( ) ;
47
49
let args = ClapCli :: parse_from ( full_args) ;
48
-
50
+
49
51
serial_commands ( & args) ;
50
52
}
51
53
0 commit comments