From 03dd8b3cd8d03300ee85377ea40fa486819d2ebc Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Wed, 6 Mar 2024 14:59:00 -0500 Subject: Update shortcutgen env and misc others --- .local/bin/dropdowntoggle | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to '.local/bin/dropdowntoggle') diff --git a/.local/bin/dropdowntoggle b/.local/bin/dropdowntoggle index f4a4705..91e834e 100755 --- a/.local/bin/dropdowntoggle +++ b/.local/bin/dropdowntoggle @@ -8,11 +8,23 @@ name="$1" class="dropdown" title="dropdown_$name" -active="$(xdotool search --name $title | wc -l)" +active="$(xdotool search --name "$title" | wc -l)" shift +case "$TERMINAL" in +*st) + classflag="-c" + titleflag="-t" + cmdflag="-e" + ;; +*alacritty) + classflag="--class" + titleflag="--title" + cmdflag="--command" + ;; +esac case "$active" in - 0) $TERMINAL --class "dropdown" --title "$title" --command "$@" & ;; - *) kill -9 `xdotool search --name "$class" getwindowpid` ;; +0) $TERMINAL "$classflag" "dropdown" "$titleflag" "$title" "$cmdflag" "$@" & ;; +*) kill -9 "$(xdotool search --name "$class" getwindowpid)" ;; esac -- cgit v1.2.3