diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-11-23 16:16:30 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-11-23 16:16:30 -0500 |
| commit | a5e66ac4f45322b3665c944ba34d83b7db43ebc5 (patch) | |
| tree | bed315d0a7f2c180b3eb634ece3a6a2089cdeb6f /.local/bin/i3cmds/ddspawn | |
| parent | 85d353d7963391cd66f23a3e99a66b8b58045e4c (diff) | |
| download | eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.gz eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.zst eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.zip | |
merger of bin
Diffstat (limited to '.local/bin/i3cmds/ddspawn')
| -rwxr-xr-x | .local/bin/i3cmds/ddspawn | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/.local/bin/i3cmds/ddspawn b/.local/bin/i3cmds/ddspawn new file mode 100755 index 0000000..1c4af36 --- /dev/null +++ b/.local/bin/i3cmds/ddspawn @@ -0,0 +1,19 @@ +#!/usr/bin/env 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 + +script=$1 +shift +if xwininfo -tree -root | grep "(\"dropdown_$script\" "; +then + echo "Window detected." + i3 "[instance=\"dropdown_$script\"] scratchpad show; [instance=\"dropdown_$script\"] move position center" +else + echo "Window not detected... spawning." + i3 "exec --no-startup-id $TERMINAL -n dropdown_$script $@ -e $script" +fi |
