config/.scripts/prompt

16 lines
308 B
Bash
Executable File

#!/bin/bash
# A dmenu binary prompt script.
# Gives a dmenu prompt labelled with $1 to perform command $2.
# For example:
# `./prompt "Do you want to shutdown?" "shutdown now"`
# Taken shamelessly from Luke Smith
choice=$(echo -e "No\nYes" | dmenu -bw 0 -i -p "$1")
if [ $choice = "Yes" ]
then
$2
fi