Regenerated
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Launch a power menu
|
||||
#
|
||||
# Requires fzf and systemd (loginctl, systemctl)
|
||||
#
|
||||
# Author: Jesse Mirabel <sejjymvm@gmail.com>
|
||||
# Date: August 19, 2025
|
||||
# License: MIT
|
||||
|
||||
main() {
|
||||
local list=(
|
||||
"Lock"
|
||||
"Shutdown"
|
||||
"Reboot"
|
||||
"Logout"
|
||||
"Hibernate"
|
||||
"Suspend"
|
||||
)
|
||||
|
||||
local options=(
|
||||
"--border=sharp"
|
||||
"--border-label= Power Menu "
|
||||
"--cycle"
|
||||
"--ghost=Search"
|
||||
"--height=~100%"
|
||||
"--highlight-line"
|
||||
"--info=inline-right"
|
||||
"--pointer="
|
||||
"--reverse"
|
||||
)
|
||||
|
||||
local selected
|
||||
selected=$(printf "%s\n" "${list[@]}" | fzf "${options[@]}")
|
||||
|
||||
case $selected in
|
||||
Lock) loginctl lock-session ;;
|
||||
Shutdown) systemctl poweroff ;;
|
||||
Reboot) systemctl reboot ;;
|
||||
Logout) loginctl terminate-session "$XDG_SESSION_ID" ;;
|
||||
Hibernate) systemctl hibernate ;;
|
||||
Suspend) systemctl suspend ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user