mirror of
https://github.com/Fluffy-Bean/dots.git
synced 2025-05-28 14:23:11 +00:00
24 lines
465 B
Bash
Executable file
24 lines
465 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
rofi_command="rofi -theme ~/.config/rofi/power.rasi -hover-select"
|
|
uptime=$(uptime -p | sed -e 's/up //g')
|
|
|
|
# Options
|
|
shutdown="Shutdown"
|
|
reboot="Restart"
|
|
lock="Lock"
|
|
|
|
options="$reboot\n$shutdown\n$lock"
|
|
|
|
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
|
|
case $chosen in
|
|
$shutdown)
|
|
systemctl poweroff
|
|
;;
|
|
$reboot)
|
|
systemctl reboot
|
|
;;
|
|
$lock)
|
|
dm-tool lock
|
|
;;
|
|
esac
|