aboutsummaryrefslogtreecommitdiff
path: root/dprompt
diff options
context:
space:
mode:
Diffstat (limited to 'dprompt')
-rwxr-xr-xdprompt10
1 files changed, 10 insertions, 0 deletions
diff --git a/dprompt b/dprompt
new file mode 100755
index 0000000..73eda47
--- /dev/null
+++ b/dprompt
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+# Dmenu binary prompt.
+# Gives a dmenu prompt labled with $1 to perform command $2.
+# Example: dprompt "Suspend?" "sudo systemctl suspend"
+
+[ "$(printf 'No\nYes' \
+ | dmenu -p "$1" \
+ -i -nb darkred -sb red -sf black -nf gray)" = 'Yes' ] && $2
+