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

  1. #!/bin/bash
  2. 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: ")
  3. 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? ")
  4. if [[ ${answer} == "Yes" ]]
  5. then
  6. if [[ ${option} == "Lock the screen" ]]
  7. then
  8. slock
  9. elif [[ ${option} == "Reboot" ]]
  10. then
  11. systemctl reboot
  12. elif [[ ${option} == "Shutdown" ]]
  13. then
  14. systemctl poweroff
  15. elif [[ ${option} == "Hibernate" ]]
  16. then
  17. systemctl hibernate
  18. fi
  19. fi