Added mute key functionality

Changed brightness keys to show notification (if dunstify present)
Changed brightness scale to 10 steps
This commit is contained in:
vorboyvo 2024-02-06 16:39:03 -05:00
parent 65bc49f77c
commit 8a52644414
3 changed files with 14 additions and 5 deletions

View file

@ -40,6 +40,8 @@ in {
} // { # Function Media Keys } // { # Function Media Keys
XF86MonBrightnessUp = "exec bash ${changebrightness} 1"; XF86MonBrightnessUp = "exec bash ${changebrightness} 1";
XF86MonBrightnessDown = "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+"; XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+";
XF86AudioLowerVolume = "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+"; "${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+";

View file

@ -1,16 +1,23 @@
#!/bin/bash
bright=`cat /sys/class/backlight/amdgpu_bl0/brightness` bright=`cat /sys/class/backlight/amdgpu_bl0/brightness`
state=-1 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 for i in ${!thresh[@]}; do
if [ $bright -ge ${thresh[$i]} ] if [[ $bright -ge ${thresh[$i]} ]]
then then
state=$i state=$i
fi fi
done done
new=$(($1 + $state)) new=$(($1 + $state))
if [ $new -ge 0 ] && [ $new -le 20 ]
if [[ $new -ge 0 ]] && [[ $new -le 10 ]]
then then
echo ${thresh[$new]} | tee /sys/class/backlight/amdgpu_bl0/brightness 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 fi

4
todo
View file

@ -5,5 +5,5 @@ i3status bar
bluetooth setup bluetooth setup
media player daemon media player daemon
dmenu files dmenu files
background (used feh on i3) notifications timeout and other assorted settings
add pandoc support for markdown rendering