aboutsummaryrefslogtreecommitdiff
path: root/dprompt
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-05-18 17:56:11 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-05-18 17:56:11 +0200
commit8923a5f27822b2332856ffb71bb625edc4a92da4 (patch)
tree7edbad0fe8171e509f0e766a6784fc5d266f65c7 /dprompt
parentce43b91f3035dcc984ed519920198ef91bf89177 (diff)
downloadscripts-master.tar.gz
scripts-master.tar.bz2
scripts-master.zip
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
+