]> git.earman.xyz Git - stumpwminit.git/commitdiff
Change to module for volume in modeline
authorrush <rush@Thonkbook.com>
Mon, 1 Sep 2025 02:37:21 +0000 (22:37 -0400)
committerrush <rush@Thonkbook.com>
Mon, 1 Sep 2025 02:37:21 +0000 (22:37 -0400)
init.lisp

index aded9d95dfe97b617e5050dbc99fa514fe34d9b8..3eaa7c6a643c22a936692abcc0e325884c6e13de 100644 (file)
--- a/init.lisp
+++ b/init.lisp
@@ -17,6 +17,9 @@
 
 (define-key *top-map* (kbd "s-l") "exec xscreensaver-command --activate")
 (define-key *top-map* (kbd "s-s") "toggle-slynk")
+(define-key *top-map* (kbd "XF86AudioRaiseVolume") "wpctl-volume-up")
+(define-key *top-map* (kbd "XF86AudioLowerVolume") "wpctl-volume-down")
+(define-key *top-map* (kbd "XF86AudioMute") "wpctl-toggle-mute")
 
 (define-key *root-map* (kbd "\-") "vsplit")
 (define-key *root-map* (kbd "\\") "hsplit")
@@ -55,6 +58,7 @@
 (load-module "beckon")
 (load-module "end-session")
 (load-module "pass")
+(load-module "wpctl")
 
 ;; MODE LINE
 (setf *mode-line-timeout* 2
        "^Rnil^r"
        (normalize-string output))))
 
-;; Get the volume
-(defun show-volume ()
-  "show current volume given a (type) argument"
-  (format nil "~,1f%" (* 100 (read-from-string (run-shell-command-and-format "wpctl get-volume @DEFAULT_AUDIO_SINK@ |sed -e 's/Volume//' -e 's/ 0\./ /' -e 's/\.00//'")))))
+(setf wpctl:*modeline-fmt* "%v")
 
-(setf *screen-mode-line-format* (list "^6[%g]^n "
-                                     "%W"
+(setf *screen-mode-line-format* (list "%W"
                                      "^>"
                                      "%S"
                                      "Juice: %B"
                                      " | "
-                                     '(:eval (show-volume))
+                                     "Vol: %P"
                                      " | "
                                      "%d"))