stumpwm/sound.lisp @ afc77c6b25b1 default tip
More
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Mon, 01 Dec 2025 13:10:26 -0500 |
| parents | 2e41ef790dc8 |
| children | (none) |
(in-package :stumpwm-user) (defun volume% () (_ (run-shell-command "amixer sget Master" t) (string-grep "Front Left:" _ :first-only t) (string-split "[]" _) second (string-trim "%" _) parse-integer)) (defcached (volume :seconds 30) (volume%)) (defcommand mute () () (run-shell-command "mute") (volume/uncache) (message "Muted.")) (defcommand volume-up () () (run-shell-command "amixer -q sset Master 5%+") (volume/uncache) (message "Volume: ~D%" (volume))) (defcommand volume-down () () (run-shell-command "amixer -q sset Master 5%-") (volume/uncache) (message "Volume: ~D%" (volume))) (defun volume-modeline (ml) (declare (ignore ml)) (format nil "~D%" (volume))) (defcommand bht () () (run-shell-command (format nil "amixer -q sset Master 50%; bht; amixer -q sset Master ~D%" (volume))) (volume/uncache)) (add-screen-mode-line-formatter #\V #'volume-modeline) #; Scratch -------------------------------------------------------------------- (volume)