dotfiles

shared miscellaneous configuration files between my systems
git clone git://git.eonn.xyz/dotfiles.git
Log | Files | Refs

commit fe23174ee1c731a42e4e4df2e6a4da8251307a1e
parent 92b499d0ae4c1cc036ed4d83538455af533f5de5
Author: Ian Ressa <ian@eonn.xyz>
Date:   Fri,  9 Sep 2022 03:12:23 -0400

hook new lock, suspend, reboot, shutdown options into stumpwm

Diffstat:
M.stumpwm.d/init.lisp | 39++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/.stumpwm.d/init.lisp b/.stumpwm.d/init.lisp @@ -8,6 +8,40 @@ (read-line stream nil)) "% battery")) +(defcommand shutdown-confirm () () + "Prompt the user to confirm shutdown via elogind." + (if (y-or-n-p (format nil "~@{~a~^~%~}" + "You are about to shutdown the computer." + "Really ^1^Bshutdown^b^n?" + "^B^6Confirm?^n ")) + (shutdown) + (xlib:unmap-window (screen-message-window (current-screen))))) + +(defcommand reboot-confirm () () + "Prompt the user to confirm reboot via elogind." + (if (y-or-n-p (format nil "~@{~a~^~%~}" + "You are about to reboot the computer." + "Really ^1^Breboot^b^n?" + "^B^6Confirm?^n ")) + (reboot) + (xlib:unmap-window (screen-message-window (current-screen))))) + +(defcommand shutdown () () + "Shutdown the computer via elogind." + (run-shell-command "/home/ian/bin/session-shutdown")) + +(defcommand reboot () () + "Reboot the computer via elogind." + (run-shell-command "/home/ian/bin/session-reboot")) + +(defcommand suspend () () + "Suspend the computer via elogind." + (run-shell-command "/home/ian/bin/session-suspend")) + +(defcommand lock-screen () () + "Lock the screen however I've decided to do that." + (run-shell-command "/home/ian/bin/lockscreen.sh")) + (defcommand toggle-my-mode-line () () (stumpwm:toggle-mode-line (stumpwm:current-screen) (stumpwm:current-head) @@ -42,7 +76,10 @@ (define-key *root-map* (kbd "l") "toggle-my-mode-line") (define-key *root-map* (kbd "C-space") "toggle-float") (define-key *root-map* (kbd "SunPrint_Screen") "exec flameshot gui") -(define-key *root-map* (kbd "End") "exec /home/ian/bin/lockscreen.sh") +(define-key *root-map* (kbd "End") "lock-screen") +(define-key *root-map* (kbd "C-End") "suspend") +(define-key *root-map* (kbd "ESC") "shutdown-confirm") +(define-key *root-map* (kbd "S-ESC") "reboot-confirm") (define-key *top-map* (kbd "XF86MonBrightnessUp") "exec light -A 10") (define-key *top-map* (kbd "XF86MonBrightnessDown") "exec light -U 10") (define-key *top-map* (kbd "XF86AudioMute") "exec pactl set-sink-mute 0 toggle")