Commit Graph

341 Commits

Author SHA1 Message Date
Anjandev Momi
979815a5ce sxmo_modem.sh: retry if failed to delete sms
On sdm845 devices, I would get the same text multiple times. Even
though, the person sending the text only sent it once.

I ran the sxmo modemmonitor daemon manually and got the following
log:

```
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13225" (uid=10000 pid=24991 comm="dbus-monitor --system interface='org.freedesktop.M") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13227" (uid=10000 pid=24994 comm="dbus-monitor --system interface='org.freedesktop.M") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13226" (uid=10000 pid=24999 comm="dbus-monitor --system interface='org.freedesktop.D") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
Failed to open connection to session bus: Failed to connect to socket /tmp/dbus-QIILCAmZIu: No such file or directory
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13228" (uid=10000 pid=25007 comm="dbus-monitor --system interface='org.freedesktop.M") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
error: couldn't delete SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't delete 1 parts from this SMS'
/home/user/.config/sxmo/hooks/sxmo_hook_sms.sh: line 20: go-sendxmpp: not found
successfully deleted SMS from modem
/home/user/.config/sxmo/hooks/sxmo_hook_sms.sh: line 20: go-sendxmpp: not found
```

The important line is:

```
error: couldn't delete SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't delete 1 parts from this SMS'
```

After applying this patch, I only recieve texts once. I dont know why deleting
text command fails the first time. Moreover, this patch fixes the double
text issue on sdm845 devices.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-06-05 13:41:00 +02:00
ArenM
7ea019e402 Manual fixups for nerd fonts 3.0
* Make icon_prn a nerd-font icons. It was using a font awesome code
  point, which we don't install with sxmo.
* Fix phone locked and laptop icons that weren't automatically updated
* Fix brightness icon in legacy nerd-fonts range and move it to
  sxmo_hook_icons from sxmo_brightness
* Use standard Unicode arrows instead of nerd-fonts ones
* Use icon variables for arrows in sxmo_wmmenu.sh
* Add variable for audio icon & use in sxmo_audio.sh
* Remove no stray break space from sxmo_contactmenu
* Remove up arrow character from reddit script
* use only icon variables in modemtext
* Update icons breakpoints

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-05-29 19:58:29 +02:00
Anjandev Momi
66e20f57af fix editorconfig: remove trailing space and use tabs 2023-05-14 00:19:17 -07:00
Willow Barraco
e26825b803 BEMENU_OPTS: support fixed height and borders 2023-05-12 08:42:45 +02:00
ArenM
01219deadf Fix broken printf statements in modemtext
Gnu printf interprets these to be arguments instead of a format string
which breaks sending mms.

Also ATTACHMENTS_ARG was being overwritten make_attachments_arg causing
messages to not have the description included, only the attachment.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-05-08 04:52:56 -05:00
ArenM
b2c3d97760 Don't kill tailtextlog when changing recipients
The lsof / grep call is broken and causes the script to crash when
adding or removing a recipient.

Lsof also doesn't have a stable output format, and the format is
different between the busybox and gnu versions, so we shouldn't be
trying to parse the output of it.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-05-08 04:52:56 -05:00
Peter John Hartman
cd394d3875 Previously sms messages were not guaranteed to be formatted with the
country code if the carrier didn't provide it. This forces it to use the
DEFAULT_COUNTRY variable if set.

(Thanks to Kyle Eveleth.)
2023-04-02 23:05:01 -05:00
Peter John Hartman
f8c9138739 dialer: don't show group contacts
There's no need since you can't *dial* them, and it makes narrow-as-you-type searches annoying.
2023-03-23 13:42:44 -05:00
Peter John Hartman
10371a66c0 callaudio hook (take two)
This implements simple hooks when we enable / disable callaudio. The
"hack" in our current code is pretty specific to pinephone, and I think
that users might also want to, e.g., bump volume when receiving phone
call, or otherwise tweak some sound settings.
2023-03-23 13:42:44 -05:00
Peter John Hartman
9cadb17a1d treat all messages from firmware as sms
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-10 13:00:14 +01:00
Peter John Hartman
537f579c25 sendsms fixups for mms
Depends on the Massive MMS Rewrite patch. This cleans up sending an mms
dramatically --- we weren't doing proper checks if failure, for
instance.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-10 13:00:13 +01:00
Peter John Hartman
8abac9e22c MMS Massive Rewrite
The problem this MMS rewrite was supposed to address is the fact that
MMS writes the *contact names* and not the *phone numbers* to the log
files, whereas SMS writes the *phone numbers* and uses sed on
tailtextlog to conver these after the fact. SMS was doing things "the
right way" and MMS was doing things "the wrong way", so I wanted to
bring the two into harmony.

Note that this fix will *should* be fully backwards compatible too.

Along the way, I realized that we could split some things out. In
particular, I now have:

sxmo_hook_smslog.sh, which allows a user to change the look-and-feel of
how things get logged. (This might be not used very much.)

I also streamlined MMS code to make it more readable (since I couldn't
read bits of it after a year or so having written it).

I also implemented sxmo_contacts.sh --name-or-number (print the contact
name, and if there is no contact name print the number back at us, as
opposed to '???').  This cleaned up some code in other places.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-10 12:51:09 +01:00
Peter John Hartman
d27f7e108d normalize smslog for mms and sms
This implements sxmo_hook_smslog.sh which allows the user to establish
how logging looks.

We were also inconsistent on this: mms would set the contact names in
the logfile whereas sms ony gave the numbers and used a sed to convert
them.

I tought about setting this in sxmo_hook_tailtextlog.sh, but:

(1) processing on a tail is a PITA
(2) one can get the "raw" data for sms.txt from modelog.tsv.

I implemented a basic and a fancy option, but it is really up to the
user.

I also implemented sxmo_contacts.sh --name-or-number and so was able to
clear out the '???' code all over the place.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-03 16:33:14 +01:00
Willow Barraco
7af66e1ea8 Use unit instead of nanoseconds 2023-02-24 19:21:47 +01:00
Peter John Hartman
9184e50c18 remove the last sxmo_uniq_exec.sh 2023-02-24 05:41:13 -06:00
Peter John Hartman
41502ea358 remove the last sxmo_uniq_exec.sh
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-24 10:46:48 +01:00
Peter John Hartman
a330020496 fixup to wakelock 2023-02-23 17:12:38 -06:00
Willow Barraco
b8e6cf3330 Centralize wakelock management in sxmo_wakelock.sh
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-23 17:12:36 -06:00
Willow Barraco
89a77e6057 Rely on /sys/power/wake_lock
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-23 17:11:48 -06:00
Willow Barraco
79440aaf1e Make proximity lock a real and dedicated sxmo state
This is a new approach to cleanup and fix issues we have with the
proximity lock. Discussed between Peter and me over irc.

We set "proximity[un]lock" in SXMO_STATE. This allow the input handler
to ignore power buttons while in this state. We then can't manually
change states anymore. It become possible to configure dedicated
hardware buttons trigger, or gesture trigger, to manage the current
call while in this state, by example.

The proximitylock also setup exclusive flock over the state lock
file (as other state switcher does). It prevent other state scripts to
trigger and to break the state consistency.

We stop the idle_locker to prevent 120s, and 8s timers to move the sxmo
state deeper.

When proximitylock stop, it execute back the initial state script,
to return to initial state.
2023-02-18 08:16:26 +01:00
Peter John Hartman
eb199202d7 remove system proximity lock
I'm not sure if a user would ever want to just turn on proximity
lock, and it does kind of make the code ugly and complicated.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-16 10:02:14 +01:00
Peter John Hartman
d125c1b206 remove unnecessary sxmo_hook_statusbar.sh volume
These were added a long time ago to remove the ear icon, but this is now
all done via sxmo_modemaudio.sh calls.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-02-15 18:31:51 -08:00
Peter John Hartman
bed99f8702 fixup to checkforstucksms patch 2023-02-04 05:16:40 -06:00
Peter John Hartman
dfdd087b56 sms: add warning if 'stuck' sms found
I found 10 sms in the 'receiving' mode from as far back as february.  I
guess this happens.
2023-02-03 15:24:48 -06:00
Peter John Hartman
45cf92da7b sendsms: if bad number, delete from modem
Only would happen if we sent from the commandline, but still is
necessary.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:49:02 +01:00
Peter John Hartman
a58dd8c094 sms: add warning if 'stuck' sms found
I found 10 sms in the 'receiving' mode from as far back as february.  I
guess this happens.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:49:01 +01:00
Peter John Hartman
cc8167d80a mutex: move statusbar update out
Turning on debug, I noticed that every 8s or so, it'd try to free
everything in sxmo_hook_check_mutexes.sh, which would call
sxmo_mutex.sh:free() which would call flock, grep, cut, xargs, sed, etc.
Importantly, this would also call sxmo_hook_statusbar.sh lockedby, which
sucks up a lot of CPU.

I decided to move the statusbar update out of mutex, and hvae only one
update for all of check mutexes.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:34:19 +01:00
Peter John Hartman
9b9a31e542 SXMO_DEFAULT_DRAFT change
I wanted to have no text at all when I start a text message, but setting
SXMO_DEFAULT_DRAFT="" resulted in the code thinking it was not set and
reverting back to the "Enter new text message here."  This change fixes
that.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-01-25 09:58:40 +01:00
Stacy Harper
375bf69803 allow to open named numbers with spaces
This strip the "logfile" suffix cause it is a pain to strip and pretty
much useless for this menu anyway
2023-01-22 20:36:15 +01:00
Peter John Hartman
79f4132b32 call hooks: minor cleanup
The comments were wrong, and mute_ring was sending CONTACTNAME, which
was also wrong.
2023-01-19 19:43:33 -06:00
Peter John Hartman
7772091bfa minor fixup to missed call message
This fixes a bug with the hook (from a previous commit)
2023-01-19 19:38:09 -06:00
ArenM
f4e8a38eb4 Use superd for modemmonitor
Superd handles cleaning up any child processes we start, that logic can
be removed from this script. Using superd should also make this more
reliable, and provide better logging facilities.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-01-19 19:37:00 -06:00
noneofyourbusiness
5d9bc00912 replace 'pn' with 'pnc'
Signed-off-by: noneofyourbusiness <noneofyourbusiness@kolabnow.ch>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-01-13 20:36:58 -08:00
Peter John Hartman
ad5102f6e1 fixup: Add contextual menu on missed call
Small fixup for c5fea64dda
2023-01-09 06:11:50 -06:00
Stacy Harper
c5fea64dda Add contextual menu on missed call window to call or sms back
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-01-07 02:12:16 -08:00
Peter John Hartman
f950fda54c sendsms: send group / mms id to sxmo_hook_sendsms
This brings sendsms into comformity with sms hook.  This information is
useful in sendsms hook, e.g., if I want to copy out my sent sms/mms to
a logfile or another application (as I do with my received sms), via the
hook.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-12-18 09:08:24 +01:00
Zach DeCook
081225481e modem audio: don't mute mic at call end
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-12-18 09:08:22 +01:00
Stacy Harper
a2405f6d57 Fix shellspec 2022-11-15 13:41:55 +01:00
Peter John Hartman
a0b91310ad modemaudio: error checking
This moves the dbus calls to cleaner functions and adds some
error checking/warnings on failures.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-11-07 20:49:29 +01:00
ArenM
64879b74a0 modemaudio: don't start callaudiod
This is handled by dbus automatically. And the way it's done here causes
the script to hang if callaudiod hasn't been started yet.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-10-31 10:44:04 +01:00
ArenM
4201985e17 Support using a physical keyboard for dtmf tones
Opening a terminal window to read dtmf tones makes it possible to use a
physical keyboard to enter them. Not needing to read keys from
{wvkbd,svkbd} -o should make things generally more robust too.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-10-31 10:26:24 +01:00
Peter John Hartman
a9a0e70844 statusbar: remove call duration
It wasn't working, and I never used it, and statusbar is tight.  We have modem log for that
info.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-10-22 21:22:11 -04:00
Peter John Hartman
4a64e8e999 modemcall: prevent user from making call in call
For now, on pinephone, this will crash the modem. :P

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-10-22 21:04:10 -04:00
Peter John Hartman
2da6057467 modemcall: clean up files on crash
If we attempt to make an outgoing call whilst on an outgoing call, the
modem crashes, and we can't make any new calls until we

rm -rf $XDG_RUNTIME_DIR/sxmo_calls/*

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-10-22 20:51:34 -04:00
Peter John Hartman
08b35c8643 call: change 'Mute' to 'Ignore'
This makes more sense and is less confusing with our actual 'mute'
options.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-10-03 09:42:52 +02:00
Peter John Hartman
3457789d08 callaudio: pipe dbus-send calls to dev null
avoids spammage
2022-10-02 06:31:11 -05:00
Peter John Hartman
278d909772 callaudio: start callaudio on enable 2022-10-02 06:31:05 -05:00
Peter John Hartman
5336a35556 incallmenu: added note about mic not actually work
Didn't notice this comment. Verified that muting mic has no effect
in call!  Placed the comment in a more obvious spot (for me at
least).
2022-10-02 06:19:43 -05:00
Peter John Hartman
655d49ed04 Ring&Vibrate Mode cleanup
This makes two entries and cleans up some code.
2022-10-02 06:19:43 -05:00
Peter John Hartman
1ca1b17be8 Implement pulse functions in menu.
This patch is *just* an implementation of the pulse audio menu.
(The bugfix for call mode is now a separate patch, so too the
additions to statusbar.)

1. Implements the sxmo_audio.sh menu for pulse completely using ONLY
   pactl (so we don't need pamixer).
2. Cleans up the InCall menu.

A further patch will remove extra alsa functions.
2022-10-02 06:19:43 -05:00