|
|
@ -1,5 +1,4 @@ |
|
|
|
#!/usr/bin/env sh |
|
|
|
#!/usr/bin/env sh |
|
|
|
TIMEOUT=3 |
|
|
|
|
|
|
|
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem |
|
|
|
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem |
|
|
|
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications |
|
|
|
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications |
|
|
|
trap "gracefulexit" INT TERM |
|
|
|
trap "gracefulexit" INT TERM |
|
|
@ -101,8 +100,8 @@ checkfornewtexts() { |
|
|
|
TEXTDATA="$(mmcli -m "$(modem_n)" -s "$TEXTID" -K)" |
|
|
|
TEXTDATA="$(mmcli -m "$(modem_n)" -s "$TEXTID" -K)" |
|
|
|
TEXT="$(echo "$TEXTDATA" | grep sms.content.text | sed -E 's/^sms\.content\.text\s+:\s+//')" |
|
|
|
TEXT="$(echo "$TEXTDATA" | grep sms.content.text | sed -E 's/^sms\.content\.text\s+:\s+//')" |
|
|
|
NUM="$( |
|
|
|
NUM="$( |
|
|
|
echo "$TEXTDATA" | |
|
|
|
echo "$TEXTDATA" | |
|
|
|
grep sms.content.number | |
|
|
|
grep sms.content.number | |
|
|
|
sed -E 's/^sms\.content\.number\s+:\s+//' |
|
|
|
sed -E 's/^sms\.content\.number\s+:\s+//' |
|
|
|
)" |
|
|
|
)" |
|
|
|
TIME="$(echo "$TEXTDATA" | grep sms.properties.timestamp | sed -E 's/^sms\.properties\.timestamp\s+:\s+//')" |
|
|
|
TIME="$(echo "$TEXTDATA" | grep sms.properties.timestamp | sed -E 's/^sms\.properties\.timestamp\s+:\s+//')" |
|
|
@ -127,12 +126,12 @@ checkfornewtexts() { |
|
|
|
mainloop() { |
|
|
|
mainloop() { |
|
|
|
checkformissedcalls |
|
|
|
checkformissedcalls |
|
|
|
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \ |
|
|
|
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \ |
|
|
|
while read line; do |
|
|
|
while read -r; do |
|
|
|
checkforincomingcalls |
|
|
|
checkforincomingcalls |
|
|
|
checkformissedcalls |
|
|
|
checkformissedcalls |
|
|
|
done & |
|
|
|
done & |
|
|
|
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \ |
|
|
|
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \ |
|
|
|
while read line; do |
|
|
|
while read -r; do |
|
|
|
checkfornewtexts |
|
|
|
checkfornewtexts |
|
|
|
done & |
|
|
|
done & |
|
|
|
wait |
|
|
|
wait |
|
|
|