sway: Add missing sway-scratchpad script

This commit is contained in:
elenapan 2025-05-01 11:07:33 +03:00
parent 5c59c137df
commit 02345f2723
2 changed files with 13 additions and 1 deletions

View file

@ -143,7 +143,7 @@ bindsym --to-code {
# Scratchpads
$mod+i exec $sway/scratchpad-toggle "[app_id=^scratchpad_input$]" "$term --class scratchpad_input -e nvim /tmp/scratchpad.md"
$mod+q exec $sway/scratchpad-toggle "[app_id=^scratchpad$]" "$term --class scratchpad -e sway-scratchpad"
$mod+q exec $sway/scratchpad-toggle "[app_id=^scratchpad$]" "$term --class scratchpad -e $sway/sway-scratchpad"
# Eww keybinds
# $mod+grave exec "$eww/manage show sidebar"

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Terminal window with class/app_id = 'scratchpad' needs to exist already
SCRATCHPAD_SESSION="$(tmux ls | grep '^sway-scratchpad')"
# If the session does not exist, create a new one
if [ ${#SCRATCHPAD_SESSION} -eq "0" ]; then
tmux -2 new-session -s sway-scratchpad
else
# Else attach to the session
tmux -2 attach -t sway-scratchpad
fi