diff --git a/programs/sway.nix b/programs/sway.nix index a184dc5..12cc729 100644 --- a/programs/sway.nix +++ b/programs/sway.nix @@ -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+"; diff --git a/scripts/changebrightness.sh b/scripts/changebrightness.sh index 3e747d5..631032b 100644 --- a/scripts/changebrightness.sh +++ b/scripts/changebrightness.sh @@ -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 + diff --git a/todo b/todo index 4a6c591..66dd3a3 100644 --- a/todo +++ b/todo @@ -5,5 +5,5 @@ i3status bar bluetooth setup media player daemon dmenu files -background (used feh on i3) - +notifications timeout and other assorted settings +add pandoc support for markdown rendering