From f11281a3e6bc81dba4985d42ed2890516d344f9f Mon Sep 17 00:00:00 2001 From: dabruh <11458706-dabruh@users.noreply.gitlab.com> Date: Fri, 21 Oct 2022 23:15:25 +0200 Subject: [PATCH] Abort on unknown action --- .local/bin/dmenuexit | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/dmenuexit b/.local/bin/dmenuexit index 27f3929..3f4bce8 100755 --- a/.local/bin/dmenuexit +++ b/.local/bin/dmenuexit @@ -10,6 +10,7 @@ DMENU_ARGS="-i -nb #e74c3c -nf #303030 -sb #c0392b -sf #ecf0f1" COMMANDS="$(i3exit commands | sed 's/\,/\ /g' | sed 's/.*/\L&/; s/[a-z]*/\u&/g')" ACTION="$(xargs -n 1 <<<"$COMMANDS" | dmenu $DMENU_ARGS -p "exitctl")" [ -z "$ACTION" ] && exit 1 +i3exit commands | tr ',' '\n' | grep -q "^$ACTION$" || exit 1 echo "INFO: Selected action $ACTION." CONFIRMATION="$(xargs -n 1 <<<"Yes No" | dmenu $DMENU_ARGS -p "Are you sure you want to ${ACTION,,}?")"