Add battery command to stumpwm config
This commit is contained in:
parent
3c3bc96c20
commit
5d61b4dd6c
@ -19,6 +19,16 @@
|
||||
"-n "
|
||||
"--lock-icon ~/Pictures/lock.png")))
|
||||
|
||||
(defcommand battery () ()
|
||||
(let ((capacity
|
||||
(string-trim
|
||||
'(#\newline)
|
||||
(run-shell-command
|
||||
"cat /sys/class/power_supply/BAT0/capacity"
|
||||
t))))
|
||||
(echo-string (current-screen)
|
||||
(format nil "Battery: ~A%" capacity))))
|
||||
|
||||
;; Keybindings
|
||||
(define-key stumpwm:*root-map* (kbd "C-f") "firefox")
|
||||
(define-key stumpwm:*root-map* (kbd "d") "exec rofi -show run")
|
||||
@ -26,6 +36,7 @@
|
||||
(define-key stumpwm:*root-map* (kbd "P") "exec passmenu")
|
||||
(define-key stumpwm:*root-map* (kbd "N") "exec networkmanager_dmenu")
|
||||
(define-key stumpwm:*root-map* (kbd "L") "lock")
|
||||
(define-key stumpwm:*root-map* (kbd "b") "battery")
|
||||
(define-key *top-map* (kbd "XF86MonBrightnessDown") "exec light -U 5")
|
||||
(define-key *top-map* (kbd "XF86MonBrightnessUp") "exec light -A 5")
|
||||
(define-key *top-map* (kbd "XF86AudioRaiseVolume") "exec pavolume volup")
|
||||
|
Loading…
Reference in New Issue
Block a user