LoganDungeon 727d2c4baf
Added note to change parameter for urxvt users
It took me a while to realize the error, so this might spare some time of other urxvt users.
2019-01-20 18:32:25 +01:00

19 lines
636 B
Bash
Executable File

#!/bin/sh
# Toggle floating dropdown terminal in i3, or start if non-existing.
# $1 is the script run in the terminal.
# All other args are terminal settings.
# Terminal names are in dropdown_* to allow easily setting i3 settings.
[ -z "$1" ] && exit
if xwininfo -tree -root | grep "(\"dropdown_$1\" ";
then
echo "Window detected."
i3 "[instance=\"dropdown_$1\"] scratchpad show; [instance=\"dropdown_$1\"] move position center"
else
echo "Window not detected... spawning."
# urxvt users have to specify the name via -name instead of -n
i3 "exec --no-startup-id $TERMINAL -n dropdown_$1 $(echo "$@" | cut -d ' ' -f2-) -e $1"
fi