mirror of https://gitlab.com/dabruh/dotfiles.git
Use common args variable
This commit is contained in:
parent
41f9e43441
commit
bc912ddf77
|
@ -1,14 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
COLORS="-nb #e74c3c -nf #303030 -sb #c0392b -sf #ecf0f1"
|
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')"
|
COMMANDS="$(i3exit commands | sed 's/\,/\ /g' | sed 's/.*/\L&/; s/[a-z]*/\u&/g')"
|
||||||
ACTION="$(xargs -n 1 <<<"$COMMANDS" | dmenu -i -p "exitctl" $COLORS)"
|
ACTION="$(xargs -n 1 <<<"$COMMANDS" | dmenu $DMENU_ARGS -p "exitctl")"
|
||||||
[ -z "$ACTION" ] && exit 1
|
[ -z "$ACTION" ] && exit 1
|
||||||
echo "INFO: Selected action $ACTION."
|
echo "INFO: Selected action $ACTION."
|
||||||
|
|
||||||
CONFIRMATION="$(xargs -n 1 <<<"No Yes" | dmenu -i -p "Are you sure you want to ${ACTION,,}?" $COLORS)"
|
CONFIRMATION="$(xargs -n 1 <<<"No Yes" | dmenu $DMENU_ARGS -p "Are you sure you want to ${ACTION,,}?")"
|
||||||
{ [ -z "$CONFIRMATION" ] || [[ "$CONFIRMATION" != "Yes" ]]; } && exit 1
|
{ [ -z "$CONFIRMATION" ] || [[ "$CONFIRMATION" != "Yes" ]]; } && exit 1
|
||||||
|
|
||||||
echo "INFO: Action confirmed."
|
echo "INFO: Action confirmed."
|
||||||
|
|
Loading…
Reference in New Issue