2022-09-13 01:06:55 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# ***This script was made by Clay Gomera (Drake)***
|
|
|
|
# - Description: A simple power menu rofi script
|
|
|
|
# - Dependencies: rofi, power-profiles-daemon
|
|
|
|
|
|
|
|
## OPTIONS ##
|
2022-12-08 03:13:08 +00:00
|
|
|
option1=" Logout"
|
|
|
|
option2=" Reboot"
|
|
|
|
option3=" Power off"
|
|
|
|
option4="鈴 Suspend"
|
|
|
|
option5=" Lock"
|
2023-01-22 00:57:50 +00:00
|
|
|
option6=" Cancel"
|
2022-09-13 01:06:55 +00:00
|
|
|
|
|
|
|
## OPTIONS ARRAY ##
|
2023-01-22 00:57:50 +00:00
|
|
|
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
|
2022-09-13 01:06:55 +00:00
|
|
|
|
|
|
|
## MAIN ACTION COMMAND ##
|
2022-12-08 03:13:08 +00:00
|
|
|
action=$(echo -e "$options" | rofi -dmenu -p " Power Options ")
|
2022-09-13 01:06:55 +00:00
|
|
|
case "$action" in
|
|
|
|
$option1*)
|
2022-09-14 00:44:31 +00:00
|
|
|
pkill X;;
|
2022-09-13 01:06:55 +00:00
|
|
|
$option2*)
|
2022-09-15 03:42:36 +00:00
|
|
|
systemctl reboot || loginctl reboot;;
|
2022-09-13 01:06:55 +00:00
|
|
|
$option3*)
|
2022-09-15 03:42:36 +00:00
|
|
|
systemctl poweroff || loginctl poweroff;;
|
2022-09-13 01:06:55 +00:00
|
|
|
$option4*)
|
|
|
|
betterlockscreen --suspend;;
|
|
|
|
$option5*)
|
|
|
|
betterlockscreen -l;;
|
|
|
|
$option6*)
|
|
|
|
exit 0
|
|
|
|
esac
|