Add brightness control scripts
This commit is contained in:
parent
ef74b0e660
commit
b99e5a5ec3
@ -45,8 +45,8 @@ bindsym XF86AudioPause exec playerctl play-pause
|
|||||||
bindsym XF86AudioNext exec playerctl next
|
bindsym XF86AudioNext exec playerctl next
|
||||||
bindsym XF86AudioPrev exec playerctl previous
|
bindsym XF86AudioPrev exec playerctl previous
|
||||||
|
|
||||||
bindsym XF86MonBrightnessUp exec brightnessctl set +5%
|
bindsym XF86MonBrightnessUp exec /bin/sh -c ~/.config/sway/scripts/increase_brightness
|
||||||
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
|
bindsym XF86MonBrightnessDown exec /bin/sh -c ~/.config/sway/scripts/decrease_brightness
|
||||||
|
|
||||||
|
|
||||||
bindsym $mod+c exec kitty -e python
|
bindsym $mod+c exec kitty -e python
|
||||||
|
|||||||
18
sway/.config/sway/scripts/decrease_brightness
Executable file
18
sway/.config/sway/scripts/decrease_brightness
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export BRIGHTNESS=`brightnessctl g`
|
||||||
|
if [ $BRIGHTNESS -gt 0 ]; then
|
||||||
|
brightnessctl set 5%-
|
||||||
|
else
|
||||||
|
killall gammastep &> /dev/null
|
||||||
|
|
||||||
|
export BRIGHTNESS=`cat /tmp/brightness 2> /dev/null || echo 1`
|
||||||
|
if [ `echo "$BRIGHTNESS > 0.1" | bc -l` == 1 ]; then
|
||||||
|
export BRIGHTNESS=`echo "$BRIGHTNESS - 0.1" | bc`
|
||||||
|
echo $BRIGHTNESS > /tmp/brightness
|
||||||
|
gammastep -O 6500 -b $BRIGHTNESS:0.1 &
|
||||||
|
else
|
||||||
|
gammastep -O 6500 -b 0.1:0.1 &
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
18
sway/.config/sway/scripts/increase_brightness
Executable file
18
sway/.config/sway/scripts/increase_brightness
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export BRIGHTNESS=`brightnessctl g`
|
||||||
|
if [ $BRIGHTNESS == 0 ]; then
|
||||||
|
killall gammastep &> /dev/null
|
||||||
|
|
||||||
|
export BRIGHTNESS=`cat /tmp/brightness 2> /dev/null || echo 1`
|
||||||
|
if [ `echo "$BRIGHTNESS < 1.0" | bc -l` == 1 ]; then
|
||||||
|
export BRIGHTNESS=`echo "$BRIGHTNESS + 0.1" | bc`
|
||||||
|
echo $BRIGHTNESS > /tmp/brightness
|
||||||
|
gammastep -O 6500 -b $BRIGHTNESS:0.1 &
|
||||||
|
else
|
||||||
|
brightnessctl set 5%
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
brightnessctl set +5%
|
||||||
|
fi
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user