From e371d9edd474bcf89cf5d462eaccb8638900b390 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sat, 3 Oct 2020 19:27:15 -0400 Subject: Initial commit --- .local/bin/dropdowntoggle | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 .local/bin/dropdowntoggle (limited to '.local/bin/dropdowntoggle') diff --git a/.local/bin/dropdowntoggle b/.local/bin/dropdowntoggle new file mode 100755 index 0000000..056a716 --- /dev/null +++ b/.local/bin/dropdowntoggle @@ -0,0 +1,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 -- cgit v1.2.3