dotfiles/pkgs/scripts/powermenu.sh
delta 27c9f432a5 linux-cachyos 6.9 kernel
unbound dns caching
some hyprland bash scripts
fix graphical glitches on laptop
tailsacle no accept dns
2024-06-18 22:29:17 +03:00

35 lines
751 B
Bash
Executable file

#!/usr/bin/env bash
# Define the options
options="Hibernate\nShutdown\nReboot\nSuspend\nLogout\nLock"
# Use dmenu to get the user's choice
choice=$(echo -e "$options" | fzfmenuft)
# Execute the corresponding command based on the user's choice
case "$choice" in
Hibernate)
systemctl hibernate
;;
Shutdown)
systemctl poweroff
;;
Reboot)
systemctl reboot
;;
Suspend)
systemctl suspend
;;
Logout)
# Assuming you're using a desktop environment that supports 'logout'
# Adjust the command according to your DE/WM
pkill -KILL -u $USER
;;
Lock)
hyprlock
;;
*)
echo "Invalid option" && exit 1
;;
esac