summaryrefslogtreecommitdiff
path: root/.local/bin/dropdowntoggle
blob: 056a716cdab2141afeb5f8b71c604a085f5c3fc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Toggle dropdown terminal windows.
# The first argument is the title of the window.
# The rest of it is the program/command to be run
# in the dropdown window.

class="$1"
title="dropdown_$class"
active="$(xdotool search --name $title | wc -l)"
shift


case "$active" in
	0) $TERMINAL -c "dropdown" -t "$class" -e "$@" & ;;
	*) kill -9 `xdotool search --name "$class" getwindowpid` ;;
esac