commit ddb20c3d14eda120c4fbfac7eb59ac2ed58c22f6 parent 024290fbb07355b4bc1c73cb8047ab81ed9427af Author: regexghost <dev@regexghost.com> Date: Wed, 17 Jun 2026 20:33:39 +0100 jwm-scratchpad (bound to Super+X) Diffstat:
| M | jwm/.config/jwm/jwmrc | | | 1 | + |
| M | wm-scripts/Makefile | | | 1 | + |
| A | wm-scripts/jwm-scratchpad.sh | | | 37 | +++++++++++++++++++++++++++++++++++++ |
3 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/jwm/.config/jwm/jwmrc b/jwm/.config/jwm/jwmrc @@ -178,6 +178,7 @@ <Key mask="4" key="f">exec:~/.local/share/regexghost/wm-scripts/dmenu-programs.sh</Key> <Key mask="4" key="s">exec:st -t Soundboard -e soundboard</Key> <Key mask="4S" key="c">exec:dunstctl close-all</Key> + <Key mask="4" key="x">exec:~/.local/share/regexghost/wm-scripts/jwm-scratchpad.sh</Key> <!-- Mouse bindings --> <!-- <Mouse context="root" button="4">ldesktop</Mouse> --> diff --git a/wm-scripts/Makefile b/wm-scripts/Makefile @@ -9,3 +9,4 @@ normal: cp bookmarks.sh ${PREFIX}/bookmarks.sh cp keyboard-settings.sh ${PREFIX}/keyboard-settings.sh cp jwm-xinit.sh ${PREFIX}/jwm-xinit.sh + cp jwm-scratchpad.sh ${PREFIX}/jwm-scratchpad.sh diff --git a/wm-scripts/jwm-scratchpad.sh b/wm-scripts/jwm-scratchpad.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +scratchpad="$(xdotool search --class "scratchpad")" + +launch_window () { + tmux new-session -d -s "buffer_tmux" 'nano ~/Downloads/buffer.md; bash' + setsid /usr/local/bin/st -c "scratchpad" -t "buffer" -e tmux attach -t "buffer_tmux" & + sleep 0.5 + scratchpad="$(xdotool search --class "scratchpad")" + xdotool windowmove "$scratchpad" 610 300 +} + +hide_window () { + xdotool windowmove "$scratchpad" -1000 -1000 +# xdotool set_desktop_for_window "$scratchpad" 5 + xdotool windowminimize "$scratchpad" +} + +show_window () { + desktop="$(xdotool get_desktop)" + xdotool set_desktop_for_window "$scratchpad" "$desktop" + xdotool windowmove "$scratchpad" 610 300 + xdotool windowactivate "$scratchpad" +} + +if [ "$scratchpad" = "" ]; then + launch_window + exit +fi + +focus="$(xdotool getwindowfocus)" +if [ "$focus" = "$scratchpad" ]; then + hide_window +else + show_window +fi +