(in-package :stumpwm) (let ((gkeycodes '(177 152 190 208 129 178)) ;; These are the keycodes G keys in order (mediakeycodes '((144 "Prev") (153 "Next") (160 "Mute") (162 "Play") (164 "Stop") (174 "LowerVolume") (176 "RaiseVolume")))) (dotimes (i (length gkeycodes)) (run-shell-command (concatenate 'string "xmodmap -e 'keycode " (write-to-string (nth i gkeycodes)) " = XF86Launch" (write-to-string (1+ i)) "'")) (define-keysym (+ (keysym-name->keysym "XF86Launch1") i) (concatenate 'string "G" (write-to-string (1+ i))))) (dotimes (i (length mediakeycodes)) (run-shell-command (concatenate 'string "xmodmap -e 'keycode " (write-to-string (first (nth i mediakeycodes))) " = XF86Audio" (second (nth i mediakeycodes)) "'"))))