summaryrefslogtreecommitdiff
path: root/scripts/dprompt
diff options
context:
space:
mode:
authorjustsaumit <justsaumit@draconyan.xyz>2022-03-01 19:54:04 +0530
committerjustsaumit <justsaumit@draconyan.xyz>2022-03-01 19:54:04 +0530
commit98bbe7bd7fcec209e2408ff0b086858715ca89e0 (patch)
treed7597d75bbcc7d2b9621693c89058b77c8d504b2 /scripts/dprompt
parent588af889ea41d9dfeb7f2c47c1a7af4de65b4406 (diff)
updated
Diffstat (limited to 'scripts/dprompt')
-rwxr-xr-xscripts/dprompt9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/dprompt b/scripts/dprompt
new file mode 100755
index 0000000..9549658
--- /dev/null
+++ b/scripts/dprompt
@@ -0,0 +1,9 @@
+#!/bin/sh
+# A dmenu binary prompt script
+# Gives dmenu prompt labeled with $1 to perform command $2
+# For example:
+# './promptquit "Do you really want to quit?" "shutdown -h now"'
+
+[ $(echo -e "No\nYes" | dmenu -i -p "$1") \
+ == "Yes" ] && $2
+