mirror of
https://codeberg.org/tmayoff/.dotfiles.git
synced 2025-12-06 08:48:34 -05:00
Reorganized
This commit is contained in:
parent
4cd0255ba4
commit
e42e996e75
21 changed files with 2397 additions and 965 deletions
30
dot_config/flake/home/waybar/mechabar/scripts/power-menu.sh
Executable file
30
dot_config/flake/home/waybar/mechabar/scripts/power-menu.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
config="$HOME/.config/rofi/power-menu.rasi"
|
||||
|
||||
actions=$(echo -e " Lock\n Shutdown\n Reboot\n Suspend\n Hibernate\n Logout")
|
||||
|
||||
# Display logout menu
|
||||
selected_option=$(echo -e "$actions" | rofi -dmenu -i -config "${config}" || pkill -x rofi)
|
||||
|
||||
# Perform actions based on the selected option
|
||||
case "$selected_option" in
|
||||
*Lock)
|
||||
loginctl lock-session
|
||||
;;
|
||||
*Shutdown)
|
||||
systemctl poweroff
|
||||
;;
|
||||
*Reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
*Suspend)
|
||||
systemctl suspend
|
||||
;;
|
||||
*Hibernate)
|
||||
systemctl hibernate
|
||||
;;
|
||||
*Logout)
|
||||
loginctl kill-session "$XDG_SESSION_ID"
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue