dotfiles/.local/bin/dprompt
2021-02-20 20:14:05 +03:00

10 lines
269 B
Bash
Executable File

#!/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