summaryrefslogtreecommitdiff
path: root/scripts/promptquit
diff options
context:
space:
mode:
authorSaumit Dinesan <79687674+Saumit-D@users.noreply.github.com>2021-11-10 16:01:17 +0530
committerGitHub <noreply@github.com>2021-11-10 16:01:17 +0530
commitaf8cda7385fcd761ceff5fef09401377ed2fbb86 (patch)
tree8d1831bea5328b0ac7e0ec7beceb521068807d93 /scripts/promptquit
parent96fd32a61a08475d686fa5f8187566ccff870da0 (diff)
Add files via upload
Diffstat (limited to 'scripts/promptquit')
-rw-r--r--scripts/promptquit9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/promptquit b/scripts/promptquit
new file mode 100644
index 0000000..cb06659
--- /dev/null
+++ b/scripts/promptquit
@@ -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
+