Added wob support for brightness & volume.

Project is early, but I'm hoping this will be a proper replacement for
xob.
https://github.com/francma/wob
This commit is contained in:
James Patrick 2019-10-06 00:15:30 -04:00
parent ea49a908f7
commit ae3dd9681e
3 changed files with 20 additions and 5 deletions

View File

@ -192,12 +192,12 @@ bindsym $mod+r mode "resize"
#
# Media Keys
#
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pamixer --get-volume > /tmp/wobpipe
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pamixer --get-volume > /tmp/wobpipe
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ( `pamixer --get-mute` && echo 0 || pamixer --get-volume ) > /tmp/wobpipe
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessDown exec light -U 5
bindsym XF86MonBrightnessUp exec light -A 5
bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > /tmp/wobpipe
bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > /tmp/wobpipe
bindsym Pause exec playerctl play-pause
bindsym Shift+Pause exec bash ~/.config/rofi/scripts/media_controls

View File

@ -12,6 +12,13 @@ exec mako
# https://github.com/nwg-piotr/autotiling
exec --no-startup-id autotiling
# wob configuration
exec_always {
killall -q wob || true
mkfifo /tmp/wobpipe
tail -f /tmp/wobpipe | ~/.config/sway/scripts/sanitize_wob | wob
}
### Clipboard manager
# https://github.com/yory8/clipman
#exec clipman -d

8
sway/scripts/sanitize_wob Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
while read IN
do
[[ ! $IN =~ ^[+-]?[0-9]+$ ]] && IN=0
[[ $IN -gt 100 ]] && IN=100
[[ $IN -lt 0 ]] && IN=0
echo $IN
done < "${1:-/dev/stdin}"