Avoid bashism
This commit is contained in:
parent
fd7c65f8ff
commit
48c6ea530a
1 changed files with 5 additions and 3 deletions
|
@ -7,11 +7,13 @@
|
||||||
|
|
||||||
[ -z "$1" ] && exit
|
[ -z "$1" ] && exit
|
||||||
|
|
||||||
if xwininfo -tree -root | grep "(\"dropdown_$1\" ";
|
script=$1
|
||||||
|
shift
|
||||||
|
if xwininfo -tree -root | grep "(\"dropdown_$script\" ";
|
||||||
then
|
then
|
||||||
echo "Window detected."
|
echo "Window detected."
|
||||||
i3 "[instance=\"dropdown_$1\"] scratchpad show; [instance=\"dropdown_$1\"] move position center"
|
i3 "[instance=\"dropdown_$script\"] scratchpad show; [instance=\"dropdown_$script\"] move position center"
|
||||||
else
|
else
|
||||||
echo "Window not detected... spawning."
|
echo "Window not detected... spawning."
|
||||||
i3 "exec --no-startup-id $TERMINAL -n dropdown_$1 ${@:2} -e $1"
|
i3 "exec --no-startup-id $TERMINAL -n dropdown_$script $@ -e $script"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue