Elektrine lite

← Feed

@communist@lemmy.frozeninferno.xyz

2025-10-02 03:55 UTC

A pure wireplumber way to switch audio devices, no pactl $sinkswitch = bash -c 'set -euo pipefail; declare -A m=(); declare -a n=(); ex="^(easyeffects_sink|filter-chain|loopback|null-sink)([-_.].*)?$"; exec 3/dev/null); exec 4/dev/null); cur=; while IFS= read -r l /dev/null & s=/run/current-system/sw/share/sounds/freedesktop/stereo/audio-volume-change.oga; [[ -r $s ]] && pw-play --volume=0.2 "$s" >/dev/null 2>&1 & notify-send -u low -i /run/current-system/sw/share/icons/Flat-Remix-Red-Dark/panel/audio-volume-high-symbolic.svg "${c% \[*\]}" -h string:x-canonical-private-synchronous:sink-state >/dev/null 2>&1 &' or, escaped for waybar: "on-click-middle": "bash -c 'set -euo pipefail; declare -A m=(); declare -a n=(); ex=\"^(easyeffects_sink|filter-chain|loopback|null-sink)([-_.].*)?$\"; exec 3/dev/null); exec 4/dev/null); cur=; while IFS= read -r l /dev/null & s=/run/current-system/sw/share/sounds/freedesktop/stereo/audio-volume-change.oga; [[ -r $s ]] && pw-play --volume=0.2 \"$s\" >/dev/null 2>&1 & notify-send -u low -i /run/current-system/sw/share/icons/Flat-Remix-Red-Dark/panel/audio-volume-high-symbolic.svg \"${c% \\[*\\]}\" -h string:x-canonical-private-synchronous:sink-state >/dev/null 2>&1 &'", there’s probably a lot to improve here, took forever to get this working, did not do a cleanup pass, jfc this took forever, replace walker with your menu of choice, thought people should have this. wishlist: change the icon based on volume level edit: updated to a script that’s basically a million times faster old version: real 0m0.050s user 0m0.043s sys 0m0.037s new version: real 0m0.021s user 0m0.013s sys 0m0.012s

Replies (0)

No replies.