Sxmo - Simple X Mobile Released for the Pinephone (new minimalistic UI & image)
(12-27-2020, 06:10 AM)lat Wrote:
(12-22-2020, 10:39 PM)hiimtye Wrote: user guide lists some files to put scripts into that you can add a one liner to play an audio file using your favourite lightweight player for sms and calls
Thanks for the tip!  Now, I have 2 scripts:
1. ring
Code:
mpv --loop ringtone1.wav
2. pickup
Code:
pkill mpv
These work well, except when I miss the incoming call - the phone keeps ringing indefinitely.  Is another hook required?  How to do it in order to stop the phone ringing on a missed call?

This is what I have in ring and pickup hooks. This checks if incoming call is still active and stops ring when the call has disconnected.

ring:-
Code:
#!/usr/bin/env sh


incallmonitor() {
        CALLRINGING=$(mmcli -m "$(modem_n)" --voice-list-calls)    
        echo $CALLRINGING
                if [[ "$CALLRINGING" == "No calls were found" ]]; then
                    exit 1
        fi
}
modem_n() {
        MODEMS="$(mmcli -L)"
        echo "$MODEMS" | grep -qoE 'Modem\/([0-9]+)' || finish "Couldn't find modem - is your modem enabled?"
        echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}


sxmo_audioout.sh Speaker
amixer sset 'Line Out' 100%
while true; do
    mpv /home/mo/Music/message_tone.mp3 --no-video
    sxmo_vibratepine 1000
    notify-send $1
    incallmonitor "$1"
done




pickup:-
Code:
ID=$(ps -ef|grep ring|grep -v grep|perl -ne '$_=~ m/^ *(.*) mo.*/;print $1')
kill -9 $ID
pkill mpv
sxmo_audioout.sh


Messages In This Thread
RE: Sxmo - Simple X Mobile Released for the Pinephone (new minimalistic UI & image) - by aithal - 12-27-2020, 09:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PostmarketOS sxmo pinephone keyboard keymaps? afwtioane 2 2,104 09-11-2022, 04:37 AM
Last Post: manubert
  sxmo pim nextcloud Uturn 8 6,196 02-22-2022, 03:23 PM
Last Post: TRS-80
  Battery life on sxmo xark 1 2,132 02-12-2022, 10:07 AM
Last Post: TRS-80
  Official Channels for Sxmo Support anjanmomi 2 3,127 02-12-2022, 09:50 AM
Last Post: TRS-80
  sxmo & php --- 2 1,826 01-31-2022, 01:45 PM
Last Post: ---
  sxmo improvements unrealb2 7 5,809 11-17-2021, 06:43 AM
Last Post: fdlamotte
  SXMO on Debian IVp 0 2,210 08-21-2021, 02:33 PM
Last Post: IVp
  Megi's multiboot sxmo image aithal 1 2,218 06-14-2021, 08:07 AM
Last Post: fdlamotte
  SXMO svkbd with joypad layout [for basic dosbox play] streak 0 1,511 05-27-2021, 08:47 AM
Last Post: streak
  Sxmo on Arch IVp 4 6,512 05-19-2021, 03:18 AM
Last Post: dukla2000

Forum Jump:


Users browsing this thread: 3 Guest(s)