diff --git a/.config/setup/01-install-packages.sh b/.config/setup/01-install-packages.sh index 575bf11..447f98c 100755 --- a/.config/setup/01-install-packages.sh +++ b/.config/setup/01-install-packages.sh @@ -19,6 +19,7 @@ make \ mpv \ network-manager \ postfix \ +pulseaudio-utils \ python3-venv sway \ swayidle \ diff --git a/.config/sway/config b/.config/sway/config index 5c10302..67edc61 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -232,9 +232,9 @@ bindsym Mod4+4 exec fcitx5-remote -s keyboard-fr # bindsym XF86TouchpadToggle exec swaymsg input type:touchpad events toggle enabled disabled -bindsym XF86AudioMute exec amixer set Master toggle -bindsym XF86AudioLowerVolume exec amixer set Master 5%- -bindsym XF86AudioRaiseVolume exec amixer set Master 5%+ +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% # # Start a password manager in the scratchpad diff --git a/.local/bin/print-status b/.local/bin/print-status index c8ad8e6..bc818d5 100755 --- a/.local/bin/print-status +++ b/.local/bin/print-status @@ -3,13 +3,12 @@ today=$(date +'%Y-%m-%d') now=$(date +'%H:%M:%S') -audio_state=$(amixer get Master | tail -n 1) -audio_volume=$(echo "$audio_state" | grep -o '[0-9]*%' | tr -d %) -audio_mute=$(echo "$audio_state" | grep -o '\[o.*\]' | tr -d \[\]) +audio_mute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') +audio_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | head -n 1 | tr -d %) audio_symbol="❔" -if [ "${audio_mute}" = "off" ]; then +if [ "${audio_mute}" = "yes" ]; then audio_symbol="🔇" -elif [ "${audio_mute}" = "on" ]; then +elif [ "${audio_mute}" = "no" ]; then if [ "${audio_volume}" = "0" ]; then audio_symbol="🔈" elif [ "${audio_volume}" -lt 50 ]; then