From f387c75ce32356ccd3705a87e45e3f5c272535cb Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 14 Oct 2022 22:49:58 +0200 Subject: [PATCH] [audio] feat: use pipewire instead of pulseaudio --- .config/mpd/mpd.conf | 6 +++--- .config/sxhkd/sxhkdrc | 4 ++-- .local/bin/audio-notify | 6 +++--- .local/bin/statusbar/sb-volume | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index afedc3a..b1bea44 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -17,13 +17,13 @@ pid_file "~/.config/mpd/pid" sticker_file "~/.config/mpd/sticker.sql" audio_output { - type "pulse" - name "pulse audio" + type "pipewire" + name "PipeWire Sound Server" } audio_output { type "fifo" - name "my_fifo" + name "Visualizer feed" path "/tmp/mpd.fifo" format "44100:16:2" } diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 13a75cf..52dc75c 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -3,10 +3,10 @@ # System stuff XF86AudioMute - pulsemixer --toggle-mute; audio-notify + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; audio-notify {XF86AudioLowerVolume, XF86AudioRaiseVolume} - pulsemixer --change-volume {-5, +5}; audio-notify + wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%{-,+}; audio-notify super + u dmenumount diff --git a/.local/bin/audio-notify b/.local/bin/audio-notify index f015fb1..ae32f09 100755 --- a/.local/bin/audio-notify +++ b/.local/bin/audio-notify @@ -10,10 +10,10 @@ ###################################################################### -level="$(pulsemixer --get-volume | awk -F " " '{ printf "%d", $1 }')" -muted="$(pulsemixer --get-mute)" +level="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $2*100}')" +muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $3}')" -if [ "1" = "$muted" ]; then +if [ "[MUTED]" = "$muted" ]; then dunstify -r 100002 "Sound muted" "$level%" else case "$level" in diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index b7b0c08..d33e85c 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -9,17 +9,17 @@ # @description : volume block for dwmblocks ###################################################################### -[ "1" = $(pulsemixer --get-mute) ] && echo " 婢 --- " && exit +level="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $2*100}')" +muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $3}')" -vol="$(pulsemixer --get-volume | awk -F " " '{ printf "%d", $1 }')" +[ "[MUTED]" = "$muted" ] && echo " 婢 --- " && exit -if [ "$vol" -gt "70" ]; then +if [ "$level" -gt "70" ]; then icon="墳" -elif [ "$vol" -lt "30" ]; then +elif [ "$level" -lt "30" ]; then icon="奄" else icon="奔" fi -printf " %s %3d%% " $icon $vol - +printf " %s %3d%% " $icon $level