Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #PinePhone postmarketOS Phosh ModemManager Linux 5.5 auto call audio routing
- # This script will switch to Earpiece/Mic when a call is added (not actually answered)
- # and turn loudspeaker on/mic off when call ended. Call waiting may screw this up.
- # It's so dirty to handle it like this, but it works for the time being :P
- MONITOR1="type='signal', sender='org.freedesktop.ModemManager1', interface='org.freedesktop.ModemManager1.Modem.Voice', member='CallAdded'"
- MONITOR2="type='signal', sender='org.freedesktop.ModemManager1', interface='org.freedesktop.ModemManager1.Modem.Voice', member='CallDeleted'"
- DISPLAY=:0.0 dbus-monitor --system "${WATCH1}" "${WATCH2}" | \
- awk '
- /member=CallAdded/ { system("pactl set-card-profile alsa_card.platform-sound VoiceCall && echo \"Call Added\"") }
- /member=CallDeleted/ { system("pactl set-card-profile alsa_card.platform-sound HiFi && echo \"Call Ended\"") }
- '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement