Changes for DWL on Arch

This commit is contained in:
2021-05-16 11:31:19 -07:00
parent bd28feb6b8
commit d2386bca8d
6 changed files with 175 additions and 5 deletions

View File

@@ -6,8 +6,14 @@
#
# username ALL=(ALL:ALL) NOPASSWD:/usr/sbin/pm-suspend,/usr/sbin/pm-hibernate,/sbin/reboot,/sbin/shutdown
#
if [[ -v WAYLAND_DISPLAY ]]; then
DMCMD='wofi -d -p'
else
DMCMD='dmenu -p'
fi
confirm() {
ans=$(echo -e "Yes\nNo" | dmenu -p "$1 - Confirm?")
ans=$(echo -e "Yes\nNo" | $DMCMD "$1 - Confirm?")
echo $ans
if [ "$ans" = "Yes" ]; then
echo "Leaving..."
@@ -17,7 +23,7 @@ confirm() {
fi
}
cmd=$(echo -e "hibernate\nsuspend\nreboot\nshutdown" | dmenu -p "Leave session:")
cmd=$(echo -e "hibernate\nsuspend\nreboot\nshutdown" | $DMCMD "Leave session:")
echo $cmd