idempotent "scratchpad show" command needed
Author: duzheCreated Dec 9, 2025Updated Jan 27, 2026
Labelsenhancement
Welcome
- Yes, I've searched similar issues and discussions on GitHub and didn't find any.
Impact
- This feature requires new configuration and/or commands
Current Behavior
command "scratchpad show" is a toggle command.
Desired Behavior
i'm using scratchpad with a dictionary tool, here is my config
for_window [title = "KDTerm"] move scratchpad
#bindsym --release $mod+w exec sh -c 'xclip -o | socat - unix-connect:/tmp/kd.sock'; scratchpad show
bindsym --release $mod+w exec sh -c 'xclip -o | socat - unix-connect:/tmp/kd.sock'; scratchpad show ;exec xdotool search --name "KDTerm" windowactivate
exec xfce4-terminal -T "KDTerm" -e 'bash -c "while true; do w=$(socat unix-listen:/tmp/kd.sock -);clear;kd "$w";done"'(for test , you can replace the kd command to echo)
so when i select a word and press mod+w, it will show the translate to the word, but i have use an extra
exec xdotool search --name "KDTerm" windowactivateto ensure the window is showed。without the xdotool command, "scratchpad show" will hide the scratchpad the second time when i press mod+w .
to remove the dependency to xdotool, it's best for i3 to provide an idempotent scratchpad show command, like "scratchpad show nohide", or something like that.
i3 version
Binary i3 version: 4.24 (2024-11-06) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.24 (2024-11-06) (pid 2817957)
Loaded i3 config:
/home/du/.config/i3/config (main) (last modified: Mon 08 Dec 2025 10:59:38 PM CST, 44184 seconds ago)
The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: /usr/bin/i3Source: i3/i3