aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--oni/home/services/stumpwm/pop-os-config.lisp34
1 files changed, 34 insertions, 0 deletions
diff --git a/oni/home/services/stumpwm/pop-os-config.lisp b/oni/home/services/stumpwm/pop-os-config.lisp
index 950a370..fbada5e 100644
--- a/oni/home/services/stumpwm/pop-os-config.lisp
+++ b/oni/home/services/stumpwm/pop-os-config.lisp
@@ -3,6 +3,40 @@
(define-key m (kbd "b") "exec gtk-launch app.zen_browser.zen")
(define-key m (kbd "s") "exec gtk-launch com.slack.Slack")
(define-key m (kbd "t") "exec gtk-launch org.wezfurlong.wezterm")
+ (define-key m (kbd "q") "exec gtk-launch it.fabiodistasio.AntaresSQL")
m))
(define-key *top-map* (kbd "s-a") '*application-bindings*)
+
+(defvar *distraction-hook* nil
+ "Hook where application scan register functions to call when I'm distracted.")
+
+(defcommand distraction! () ()
+ (run-hook *distraction-hook*))
+
+(define-key *top-map* (kbd "s-d") "distraction!")
+
+(defun clock-out ()
+ (sb-ext:run-program
+ *shell-program* '("-c" "emacsclient --no-wait --eval \"(org-clock-out)\"")))
+
+(add-hook *screen-locking-hook* 'clock-out)
+(add-hook *distraction-hook* 'clock-out)
+
+(defun pause-music ()
+ (sb-ext:run-program
+ *shell-program* '("-c" "[ \"$(playerctl status)\" = \"Playing\" ]] && playerctl pause")))
+
+(add-hook *screen-locking-hook* 'pause-music)
+(add-hook *distraction-hook* 'pause-music)
+
+(defun pause-notifications ()
+ (sb-ext:run-program
+ *shell-program* '("-c" "dunstctl set-paused true")))
+
+(defun resume-notifications ()
+ (sb-ext:run-program
+ *shell-program* '("-c" "dunstctl set-paused false")))
+
+(add-hook *screen-locking-hook* 'pause-notifications)
+(add-hook *screen-unlocked-hook* 'resume-notifications)