summaryrefslogtreecommitdiff
path: root/.local/bin/dropdowntoggle
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-03-06 14:59:00 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-03-06 14:59:00 -0500
commit03dd8b3cd8d03300ee85377ea40fa486819d2ebc (patch)
treecdeffd7721bb73918184a83c2f9c034142381564 /.local/bin/dropdowntoggle
parentb9581d702f388489725ff7d5a7394009124b5154 (diff)
Update shortcutgen env and misc others
Diffstat (limited to '.local/bin/dropdowntoggle')
-rwxr-xr-x.local/bin/dropdowntoggle18
1 files changed, 15 insertions, 3 deletions
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