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:
Marty Oehme 2019-09-05 13:04:18 +02:00
parent 16cb8f092e
commit 3d9ea5cffe
3 changed files with 24 additions and 32 deletions

View file

@ -1,31 +1,22 @@
# universal x key bindings # universal x key bindings
# Open terminal emulator (TODO find way to not hard-code alacritty, perhaps ENV vars) # Open terminal emulator (TODO find way to not hard-code alacritty, perhaps ENV vars)
mod4 + Return super + Return
exec alacritty exec alacritty
# open quick start menu # open quick start menu
mod4 + space super + space
exec i3-dmenu-desktop exec i3-dmenu-desktop
# System functionality # System functionality
# Enable lock screen (TODO does not stop music, etc yet # Enable lock screen (TODO does not stop music, etc yet
# see https://github.com/LukeSmithxyz/voidrice/blob/archi3/.config/sxhkd/sxhkdrc for that)
super + x super + x
i3lock -e -f -c 1d2021 lockscreen
# Shut down system # Open System Power Menu
super + shift + x
dmenuprompt "SHUT DOWN computer?" "sudo -A shutdown -h now" danger
# Exit X session
super + BackSpace super + BackSpace
dmenuprompt "Log out of X Session?" "i3-msg exit" warn rofi-powermenu
# Restart system
super + shift + BackSpace
dmenuprompt "Reboot computer?" "sudo reboot" danger
# enable function (/media) key functionality # enable function (/media) key functionality
# TODO: set up next song, previous song, pause, etc # TODO: set up next song, previous song, pause, etc

8
.local/bin/lockscreen Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env sh
# In case we want to pause any players
# (see https://github.com/LukeSmithxyz/voidrice/blob/archi3/.config/sxhkd/sxhkdrc for that)
# mpc -q pause
# amixer set Master mute
i3lock -e -f -c 1d2021

View file

@ -1,4 +1,4 @@
#!/usr/bin/sh #!/usr/bin/env sh
rofi_command="rofi -theme themes/powermenu.rasi" rofi_command="rofi -theme themes/powermenu.rasi"
@ -13,25 +13,18 @@ logout_btn=""
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)" 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 case $chosen in
$power_off) $power_off)
printf "poweroff" systemctl poweroff
# systemctl poweroff ;;
;;
$reboot) $reboot)
printf "reboot" systemctl reboot
# systemctl reboot ;;
;;
$lock) $lock)
printf "lock" lockscreen
# light-locker-command -l ;;
;;
$suspend_btn) $suspend_btn)
printf "suspend" systemctl suspend
# mpc -q pause ;;
# amixer set Master mute
# systemctl suspend
;;
$logout_btn) $logout_btn)
printf "logout_btn" i3-msg exit
# i3-msg exit ;;
;;
esac esac