Hi, I am trying to find a good way to control output to a projector via stumpwm and am thinking xrandr and a keybinding could be the best option. So far, I have bounf to keys, one to toggle output on and one to toggle off, but it would be nifty to only use one key that loops different states (basically on/off, but possibly a way to loop through a list of resolutions, alternatively choose between some available resolutions after keypress if projector is off, otherwise just turn output off). Unfortunately, my lisp skills are not supporting me in this, so I am wondering if someone has an idea of how this can be done?
The code I am using now: ,---- | (defcommand toggle-screen-out () () | | "Toggle to/from projector out." | | (run-shell-command "xrandr --output DVI-1 --mode 832x624")) | | (defcommand toggle-screen-out-2 () () | | "Toggle to/from projector out." | | (run-shell-command "xrandr --output DVI-1 --off")) | | (define-key *top-map* (kbd "s-SunPageUp") "toggle-screen-out") ; Turn on projector output | | (define-key *top-map* (kbd "s-SunPageDown") "toggle-screen-out-2") ; Turn off projector output | `---- Many thanks! /Johnny _______________________________________________ Stumpwm-devel mailing list Stumpwm-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/stumpwm-devel