1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2026-05-30 07:01:35 +02:00

Audio: improved script for tapping secondary audio device

This commit is contained in:
2026-05-30 05:06:34 +02:00
parent d06a7bddf4
commit 6e00342044

View File

@@ -7,8 +7,8 @@
device=${LOOPBACK_DEVICE:-Easy Effects Source}
name=$(wpctl status | sed -n '/Sources/,$p' | sed -n '/Filter/q;p' | grep "$device" | sed -e "s/*/\ /g")
id=$( echo $name | cut -d '.' -f 1 | cut -c 5-)
node=$(wpctl inspect $id | grep node.name | cut -d '=' -f 2)
ident=$(wpctl status | sed -n '/Sources/,$p' | sed -n '/Filter/q;p' | grep "$device" | grep -oE '[0-9]+\.' | tr -d '.')
node=$(wpctl inspect $ident | grep node.name | cut -d '=' -f 2)
[ -z "$2" ] && num="5" || num="$2"
@@ -61,7 +61,7 @@ case "$1" in
loop) playerctl loop none
sleep 1
pkill -RTMIN+9 $STATUSBAR ;;
tap) wpctl set-volume $id 1.0
tap) wpctl set-volume $ident 1.0
touch ~/.local/state/loopback.lock
pw-loopback -C $node &
notify-send -u low 'sxhkd' "Started loopback of $device" ;;