You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
645 B

#!/bin/bash
option=$(echo -e "Lock the screen\nReboot\nShutdown\nHibernate" | dmenu -i -m 0 -fn "Inconsolata:size=10" -nb "#000000" -nf "#bbbbbb" -sb "#0099cc" -sf "#000000" -p "Power menu: ")
answer=$(echo -e "No\nYes" | dmenu -i -m 0 -fn "Inconsolata:size=10" -nb "#000000" -nf "#bbbbbb" -sb "#0099cc" -sf "#000000" -p "Would you like to ${option} now? ")
if [[ ${answer} == "Yes" ]]
then
if [[ ${option} == "Lock the screen" ]]
then
slock
elif [[ ${option} == "Reboot" ]]
then
systemctl reboot
elif [[ ${option} == "Shutdown" ]]
then
systemctl poweroff
elif [[ ${option} == "Hibernate" ]]
then
systemctl hibernate
fi
fi