Last active
June 30, 2024 19:03
-
-
Save Nama/8ffc4efea3f91e868a2ded1eb31fda00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
last_hsvol=64 | |
while true; do | |
hsvol=$(headsetcontrol -o json | jq '.devices[0].chatmix') | |
vol=$(echo "scale= 5; $hsvol / 128 * 100" | bc) | |
if (( $hsvol != $last_hsvol )); then | |
wpctl set-volume @DEFAULT_SINK@ $vol% -l 1.0 | |
last_hsvol=$hsvol | |
fi | |
sleep 0.3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment