Advertisement
Guest User

PinePhone postmarketOS Phosh ModemManager call audio routing

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