brightness (1420B)
1 #!/usr/bin/env -S guile -e main -s 2 !# 3 4 (use-modules (ice-9 match)) 5 6 (define* (display-help-message #:key (self #f)) 7 (define (make-help-message self) 8 (format #t "Usage: 9 ~a up 10 ~a down 11 " 12 self 13 self)) 14 (if self 15 (make-help-message self) 16 (make-help-message "brightness"))) 17 18 (define (main args) 19 (match args 20 ((self "get") 21 (system* "gdbus" 22 "call" 23 "--session" 24 "--dest" 25 "org.gnome.SettingsDaemon.Power" 26 "--object-path" 27 "/org/gnome/SettingsDaemon/Power" 28 "--method" 29 "org.gnome.SettingsDaemon.Power.Screen.StepUp" 30 )) 31 ((self "up") 32 (system* "gdbus" 33 "call" 34 "--session" 35 "--dest" 36 "org.gnome.SettingsDaemon.Power" 37 "--object-path" 38 "/org/gnome/SettingsDaemon/Power" 39 "--method" 40 "org.gnome.SettingsDaemon.Power.Screen.StepUp" 41 )) 42 ((self "down") 43 (system* "gdbus" 44 "call" 45 "--session" 46 "--dest" 47 "org.gnome.SettingsDaemon.Power" 48 "--object-path" 49 "/org/gnome/SettingsDaemon/Power" 50 "--method" 51 "org.gnome.SettingsDaemon.Power.Screen.StepDown" 52 )) 53 ((self . rest) 54 (display-help-message #:self self))))