sway: add displays and shutdown bind
This commit is contained in:
parent
d9bac9d0b7
commit
9625169175
|
@ -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
|
|
@ -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
|
||||
|
|
Reference in New Issue