Configure rofi-powermenu and lockscreen script
Use rofi-powermenu to show options for suspend,reboot, shutdown, lockscreen, log out. Can be invoked with <M-backspace>. Other power option shortcuts have been removed from quick access through sxhkd or i3. Lockscreen can still be quickly set with <M-x>. Lockscreen now resides in its own script to provide one source of truth, and in case it is further customized in the future.
This commit is contained in:
parent
16cb8f092e
commit
3d9ea5cffe
3 changed files with 24 additions and 32 deletions
30
.local/bin/rofi-powermenu
Executable file
30
.local/bin/rofi-powermenu
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
rofi_command="rofi -theme themes/powermenu.rasi"
|
||||
|
||||
### Options ###
|
||||
power_off=""
|
||||
reboot=""
|
||||
lock=""
|
||||
suspend_btn="鈴"
|
||||
logout_btn=""
|
||||
# Variable passed to rofi
|
||||
|
||||
chosen="$(printf "%s\n%s\n%s\n%s\n%s" "$power_off" "$reboot" "$lock" "$suspend_btn" "$logout_btn" | $rofi_command -dmenu -selected-row 2)"
|
||||
case $chosen in
|
||||
$power_off)
|
||||
systemctl poweroff
|
||||
;;
|
||||
$reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
$lock)
|
||||
lockscreen
|
||||
;;
|
||||
$suspend_btn)
|
||||
systemctl suspend
|
||||
;;
|
||||
$logout_btn)
|
||||
i3-msg exit
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue