Added mute key functionality
Changed brightness keys to show notification (if dunstify present) Changed brightness scale to 10 steps
This commit is contained in:
parent
65bc49f77c
commit
8a52644414
|
|
@ -40,6 +40,8 @@ in {
|
|||
} // { # Function Media Keys
|
||||
XF86MonBrightnessUp = "exec bash ${changebrightness} 1";
|
||||
XF86MonBrightnessDown = "exec bash ${changebrightness} -1";
|
||||
XF86AudioMute = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
"${mod}+XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||
XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+";
|
||||
XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-";
|
||||
"${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+";
|
||||
|
|
|
|||
|
|
@ -1,16 +1,23 @@
|
|||
#!/bin/bash
|
||||
bright=`cat /sys/class/backlight/amdgpu_bl0/brightness`
|
||||
state=-1
|
||||
thresh=(1 2 3 4 5 6 8 10 13 16 21 27 34 44 57 73 94 120 155 199 255)
|
||||
thresh=(0 1 3 5 9 15 27 48 84 147 255)
|
||||
|
||||
for i in ${!thresh[@]}; do
|
||||
if [ $bright -ge ${thresh[$i]} ]
|
||||
if [[ $bright -ge ${thresh[$i]} ]]
|
||||
then
|
||||
state=$i
|
||||
fi
|
||||
done
|
||||
|
||||
new=$(($1 + $state))
|
||||
if [ $new -ge 0 ] && [ $new -le 20 ]
|
||||
|
||||
if [[ $new -ge 0 ]] && [[ $new -le 10 ]]
|
||||
then
|
||||
echo ${thresh[$new]} | tee /sys/class/backlight/amdgpu_bl0/brightness
|
||||
if [[ $? -eq 0 ]] && [[ -f $(which dunstify) ]]
|
||||
then
|
||||
dunstify -a "changebrightness.sh" -u low -i weather-clear -h string:x-dunst-stack-tag:changebrightness "Brightness: $new"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue