Files
2026-07-15 17:24:10 +02:00

38 lines
628 B
Bash
Executable File

#!/usr/bin/sh
uptime="$(uptime -p | sed -e 's/up //g')"
shutdown='⏻ Shutdown'
reboot=' Reboot'
lock=' Lock'
suspend='󰒲 Suspend'
logout='󰈆 Logout'
hibernate=' Hibernate'
rofi_cmd() {
echo -e "$lock\n$suspend\n$logout\n$hibernate\n$shutdown\n$reboot" |
rofi -dmenu -mesg "Uptime: $uptime" -theme ~/.config/rofi/power.rasi
}
chosen="$(rofi_cmd)"
case ${chosen} in
$shutdown)
systemctl poweroff
;;
$reboot)
systemctl reboot
;;
$lock)
hyprlock
;;
$suspend)
systemctl suspend
;;
$logout)
hyprctl dispatch exit
;;
$hibernate)
systemctl hibernate
;;
esac