Skip to content

Commit

Permalink
Added sounds
Browse files Browse the repository at this point in the history
volvofixthis committed May 26, 2024
1 parent c7d1a78 commit c69aad1
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ mkdir -p ~/.config/systemd/user
cp airpods-mute.service ~/.config/systemd/user
systemctl enable airpods-mute
systemctl start airpods-mute
mkdir -p ~/Documents/airpods-mute
cp sounds/* ~/Documents/airpods-mute/
```

### Wireplumber
@@ -23,5 +25,4 @@ Environment=WIREPLUMBER_NO_PW_LOG=1
```

### Deps
You need to install aplay, mpg123, journalctl
Don't forget about your own, custom sounds to mute and unmute
You need to install amixer, mpg123, journalctl
6 changes: 4 additions & 2 deletions airpods-mute.sh
Original file line number Diff line number Diff line change
@@ -15,9 +15,11 @@ function toggle_mic() {
VOLUME="0%"
fi
amixer set Capture $VOLUME
mpg123 ~/Documents/$SOUND.mp3
mpg123 ~/Documents/airpods-mute/$SOUND.mp3
}

journalctl -f --user -u wireplumber | while IFS= read -r line; do
echo "$line" | grep "<< AT+CHUP" && toggle_mic
if [[ "$line" == *"<< AT+CHUP"* ]]; then
toggle_mic
fi
done
Binary file added sounds/iphone_mute.mp3
Binary file not shown.
Binary file added sounds/iphone_unmute.mp3
Binary file not shown.

0 comments on commit c69aad1

Please sign in to comment.