sway: add displays and shutdown bind

This commit is contained in:
lelgenio 2021-05-21 01:27:05 -03:00
parent d9bac9d0b7
commit 9625169175
2 changed files with 30 additions and 0 deletions

24
dotfiles/scripts/sway-displays Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
get_displays(){
swaymsg -t get_outputs |
jq -r 'map(.name)|join("\n")'
}
actions=(
enable
disable
brightness
)
action=$(printf "%s\n" "${actions[@]}" | wdmenu)
case "$action" in
enable|disable)
output=$(get_displays | wdmenu -p "output")
swaymsg output "$output" "$action"
;;
brightness)
brightness=$(seq 0 5 100 | wdmenu -p "Brightness")
light -S "$brightness"
;;
esac

View File

@ -19,6 +19,9 @@ $mod+Control+Return exec {{@@ file_manager @@}}
# Insert special characters
$mod+g exec emoji
# Insert special characters
$mod+d exec sway-displays
# Kill focused window
$mod+x kill
@ -37,6 +40,9 @@ $mod+Shift+c reload
# Exit sway
Control+Alt+delete exit
# Shutdown
$mod+Alt+delete exec loginctl poweroff || systemctl poweroff
}
# vim: ft=i3