From a0edc709685bf942d7df11118ad60f99be6188df Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 31 May 2023 08:54:18 -0700 Subject: [PATCH] [xbindkeys] Update to latest modifications Add a bunch of comments mostly. --- xbindkeys/.xbindkeysrc.scm | 116 ++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 33 deletions(-) diff --git a/xbindkeys/.xbindkeysrc.scm b/xbindkeys/.xbindkeysrc.scm index 48ee938..07453f3 100644 --- a/xbindkeys/.xbindkeysrc.scm +++ b/xbindkeys/.xbindkeysrc.scm @@ -10,6 +10,88 @@ (define (first-binding) "First binding" + ;; These are dangerous keybindings, they could be very annoying if they're + ;; accidentally pressed, so using Shift here to make it a little less easy to + ;; do this is a good idea. + (xbindkey `(,modkey q) "shutdown-rofi") + (xbindkey `(,modkey shift r) "herbstclient reload") + + ;; Usually I close the applications I use through a menu or keybinding inside + ;; the application, but not all applications offer this. Sometimes need to + ;; tell the window manager to do so. + (xbindkey `(,modkey k) "herbstclient close") + + ;; Normally I try to have frames set-up the way I like them programmatically, + ;; not manually, but sometimes I need to do it manually anyway and remove them + ;; afterwards. + (xbindkey `(,modkey mod1 k) "herbstclient remove") + + ;; Always spawn an instance of kitty. + (xbindkey `(,modkey Return) "herbstclient spawn kitty") + ;; Switch to a running instance of URxvt, Hyper, or kitty or start one. + (xbindkey `(,modkey t) "herbstclient spawn hlwm-run-or-raise \"\\(URxvt\\|Hyper\\|kitty\\)\" kitty") + ;; Switch to a running instance of Conceror, Firefox, Chromium, Nyxt, or + ;; qutebrowser or start one. + (xbindkey `(,modkey b) "herbstclient spawn hlwm-run-or-raise \"\\(Conkeror\\|[Ff]irefox\\|Chromium\\|Nyxt\\|qutebrowser\\)\" firefox") + ;; Switch to a running instance of Emacs, or create an Emacs client frame. + (xbindkey `(,modkey e) "herbstclient spawn hlwm-run-or-raise Emacs emacsclient --create-frame") + ;; Lock the screen with C-M-l. + (xbindkey '(control mod1 l) "herbstclient spawn i3lock") + ;; Swap visible tags + (xbindkey `(,modkey x) "herbstclient spawn hlwm-switch-tags") + + ;; Since I use the colemak keyboard layout, hjkl doesn't make much sense. I + ;; use bnpf instead since that is what I'm used to using in Emacs. I try to + ;; use my run-or-raise script as much as I can, and have the layouts set-up + ;; correctly already, but sometimes I still need to move around, resize and + ;; move clients. + (xbindkey `(,modkey shift b) "herbstclient shift left") + (xbindkey `(,modkey shift n) "herbstclient shift down") + (xbindkey `(,modkey shift p) "herbstclient shift up") + (xbindkey `(,modkey shift f) "herbstclient shift right") + (xbindkey `(,modkey control b) "herbstclient resize left +0.05") + (xbindkey `(,modkey control n) "herbstclient resize down +0.05") + (xbindkey `(,modkey control p) "herbstclient resize up +0.05") + (xbindkey `(,modkey control f) "herbstclient resize right +0.05") + + ;; I usually try to have my layouts set-up programmatically, but this isn't + ;; always possible or practical. + (xbindkey `(,modkey shift underscore) "herbstclient split bottom 0.5") + (xbindkey `(,modkey shift bar) "herbstclient split right 0.5") + + ;; Switching tags by number (key) isn't always practical, sometimes switching + ;; to next/previous tag is easiest. + (xbindkey `(,modkey period) "herbstclient use_index +1 --skip-visible") + (xbindkey `(,modkey comma) "herbstclient use_index -1 --skip-visible") + + ;; Games and sometimes other applications don't always like being forced into + ;; a strangely sized box, floating mode helps. + (xbindkey `(,modkey shift control f) "herbstclient floating toggle") + + ;; Playing games in fullscreen mode can end badly by having the game spread + ;; across both monitors. Also watching a twitch stream with lots of text is + ;; best in fullscreen. + (xbindkey `(,modkey f) "herbstclient cycle_layout 1 vertical max") + (xbindkey `(,modkey m) "herbstclient fullscreen toggle") + (xbindkey `(,modkey p) "herbstclient pseudotile toggle") + + ;; The following cycles through the available layouts within a frame, but + ;; skips layouts, if the layout change wouldn't affect the actual window + ;; positions. I.e. if there are two windows within a frame, the grid layout is + ;; skipped. + (xbindkey `(,modkey space) "herbstclient or , and . compare tags.focus.curframe_wcount = 2 . cycle_layout +1 vertical horizontal max vertical grid , cycle_layout +1") + + ;; focus + (xbindkey `(,modkey BackSpace) "herbstclient cycle_monitor") + + ;; Use u because i is already used by by navigation commands. + (xbindkey `(,modkey u) "herbstclient jumpto urgent") + + ;; Add some media key bindings for MPD. + (xbindkey '(XF86AudioPlay) "herbstclient spawn mpc toggle") + (xbindkey '(XF86AudioNext) "herbstclient spawn mpc next") + (xbindkey '(XF86AudioPrev) "herbstclient spawn mpc prev") + (xbindkey-function `(,modkey c) move-bindings) (xbindkey-function `(,modkey s) screenshot-bindings) (xbindkey `(,modkey bracketleft) "herbstclient use_index 0") @@ -22,39 +104,7 @@ (xbindkey `(,modkey shift equal) "herbstclient use_index 7") (xbindkey `(,modkey bracketright) "herbstclient use_index 8") (xbindkey `(,modkey shift "1") "herbstclient use_index 9") - (xbindkey `(,modkey shift q) "herbstclient quit") - (xbindkey `(,modkey shift r) "herbstclient reload") - (xbindkey `(,modkey k) "herbstclient close") - (xbindkey `(,modkey mod1 k) "herbstclient remove") - (xbindkey `(,modkey Return) "herbstclient spawn kitty") - (xbindkey `(,modkey t) "herbstclient spawn hlwm-run-or-raise \"\\(URxvt\\|Hyper\\|kitty\\)\" kitty") - (xbindkey `(,modkey b) "herbstclient spawn hlwm-run-or-raise \"\\(Conkeror\\|[Ff]irefox\\|Chromium\\|Next\\|qutebrowser\\)\" firefox") - (xbindkey `(,modkey e) "herbstclient spawn hlwm-run-or-raise Emacs emacsclient --create-frame") - (xbindkey '(control mod1 l) "herbstclient spawn i3lock") - (xbindkey `(,modkey x) "herbstclient spawn hlwm-switch-tags") - (xbindkey `(,modkey shift b) "herbstclient shift left") - (xbindkey `(,modkey shift n) "herbstclient shift down") - (xbindkey `(,modkey shift p) "herbstclient shift up") - (xbindkey `(,modkey shift f) "herbstclient shift right") - (xbindkey `(,modkey control b) "herbstclient resize left +0.05") - (xbindkey `(,modkey control n) "herbstclient resize down +0.05") - (xbindkey `(,modkey control p) "herbstclient resize up +0.05") - (xbindkey `(,modkey control f) "herbstclient resize right +0.05") - (xbindkey `(,modkey shift underscore) "herbstclient split bottom 0.5") - (xbindkey `(,modkey shift bar) "herbstclient split right 0.5") - (xbindkey `(,modkey period) "herbstclient use_index +1 --skip-visible") - (xbindkey `(,modkey comma) "herbstclient use_index -1 --skip-visible") - (xbindkey `(,modkey shift control f) "herbstclient floating toggle") - (xbindkey `(,modkey f) "herbstclient cycle_layout 1 vertical max") - (xbindkey `(,modkey m) "herbstclient fullscreen toggle") - (xbindkey `(,modkey p) "herbstclient pseudotile toggle") - (xbindkey `(,modkey space) "herbstclient or , and . compare tags.focus.curframe_wcount = 2 . cycle_layout +1 vertical horizontal max vertical grid , cycle_layout +1") - (xbindkey `(,modkey BackSpace) "herbstclient cycle_monitor") - (xbindkey `(,modkey u) "herbstclient jumpto urgent") - (xbindkey '(XF86AudioPlay) "herbstclient spawn mpc toggle") - (xbindkey '(XF86AudioNext) "herbstclient spawn mpc next") - (xbindkey '(XF86AudioPrev) "herbstclient spawn mpc prev") - (xbindkey `(,modkey r) "herbstclient spawn rofi -show run") + (xbindkey `(,modkey r) "herbstclient spawn rofi -modi drun -show drun -config /home/chelys/.config/rofi/rofi.rasi") (xbindkey `(,modkey w) "herbstclient spawn rofi -show window -window-command \"/home/chelys/usr/bin/hlwm-switch-to-window {window}\" -config /home/chelys/.config/rofi/windows.rasi")) (define (move-bindings)