dev: automated commit - 2025-11-28 18:32:11
This commit is contained in:
parent
023988b638
commit
d6e088278f
3 changed files with 399 additions and 0 deletions
18
local-bin/.local/bin/niri-scratchpad.sh
Executable file
18
local-bin/.local/bin/niri-scratchpad.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
# Check if scratchpad terminal is already running
|
||||
if pgrep -f "kitty.*scratchpad" > /dev/null; then
|
||||
# Get the window ID of the scratchpad terminal
|
||||
WINDOW_ID=$(niri msg windows | grep -A 10 'app-id="scratchpad"' | head -1 | grep 'Window ID' | cut -d' ' -f3 | cut -d: -f1)
|
||||
|
||||
if [ -n "$WINDOW_ID" ]; then
|
||||
# Focus the existing scratchpad window
|
||||
niri msg action focus-window "$WINDOW_ID"
|
||||
else
|
||||
# If we can't find the window ID, spawn a new one
|
||||
kitty --class scratchpad --title scratchpad &
|
||||
fi
|
||||
else
|
||||
# Spawn a new scratchpad terminal
|
||||
kitty --class scratchpad --title scratchpad &
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue