This is a huge patch for Swmo, Sxmo over Sway.
It is Dwm backward compatible so dwm users should not expect regressions.
If you install all dependencies, you then can toggle between Sway and Dwm using a new config entry. It will reboot the phone.
This commit also contains:
* Make the modemmonitor bullet proof
* various other smaller fixes
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
We also have to remove them on outgoing call. We use find instead of rm
with a wildcard cause wildcard look not expanded here.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Some event file stay present in some case (ex: .initiated) and this can
lead to issues in futures calls.
We remove dedicated cleanup and now we remove all event file related to
the finish call in once. We do it in incoming call cause sometime
modemnager fail to detect terminated calls.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This can happen if an call come while a menu already is open of if the
user kill the dmenu with a top side gesture.
We dont want the notification to be purged to allow the user to manually
open it with the notification appmenu so we have to stop the code here.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
This add a script to use either the user hook or the default one.
Sometime we checked the user hook or a default code. We move this
default code in a defaut hook.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
If a menu already is open while receiving a call, the dedicated menu
could not open itself. It prevent completly the user to pickup the call.
We add a notification to open this menu manually.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
As we rely on the terminal name to use the contextual menu, we used the
st target directly, preventing to use the taillog command in terminal
mode.
Add an optional TERMNAME env variable to manage this smoothly.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
As we now rely on sxmo_terminal.sh and the TERMCMD env variable, we then
can simplify things.
In the sxmo dwm context, TERMCMD="st -e" so sxmo_terminal.sh will run
the command in st.
In the ssh context, we dont have TERMCMD so sxmo_terminal.sh will just
run the command
In a tmux context, we can set TERMCMD="tmux split-window" with
set-environment -g TERMCMD "tmux split-window"
so sxmo_terminal.sh will run the command in a splited window.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
There was a hole in the event logging where we start a call that the
contact hang up. As we dont have an event for outgoing call,
modemmonitor think this is a missed call.
Adding a dedicated event file help modemmonitor to know what happen.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
When you number of conversation start to grow, it rapidly take some
seconds for the menu to open itself. The [ -d "folder" ] test really is
uneficient.
This simplify this part as we now ask sxmo_contacts to only list texted
contacts.
This make cached event to pilles up and prevent some incoming call
events to works correctly.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
* The sxmo_modemmonitor.sh will now run a new sxmo_modemcall.sh
dedicated menu to Pickup, Hangup or Mute the call. It will not write
notifications anymore.
* We now can mute the ring with the new pickup menu. With the default
hook, this will stop the ringtone like the missed_call would do.
* The sxmo_modemcall.sh now use a new sxmo_proximitylock.sh which
will lock the screen when putting the phone in front of the ear. This
script should be smart enough to work smoothly with a crust context.
To achieve this, the proximity_lock will only disable the initial
lock (the one who want to go back in crust after some seconds) if the
phone moved a little bit and is not in your pocket. So forgetting the
phone in a table or not earing the ring in your bag will not empty the
battery. You'll find the phone in crust with notifications.
* The sxmo_modemcall.sh do not monitor finished calls anymore. We leave
it with hangup or being killed by sxmo_modemmonitor.sh. This simplify
the call script and prevent double deleting mmcli calls. I had to use
pids and wait commands to fix and issue and make the script killeable
by the monitor.
Plus, only the monitor will now delete calls. The call script should be
precise on what happen using cached files.
* Discarded and hanged up calls are two different behavior with
different script (by default use the same linked ones)
* Fixed a bug where sometime ringing was started twice. I think this is
cause by the new checkforincomingcalls in the connected state change. We
now use a file to test if the call already has been managed.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
We then simplify the sxmo_modemtext that was already using SSH related
behaviors.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Sometime, the modem will give 0611924312 as incoming text or
call number instead of +33611924312 (example in france).
This cause two issues cause of format missmatch:
* Notifications sometime come from "Unknown" when we actually know
the contact
* Text/Dial menu entries are duplicated with "Unknown" persons
We try here to fix boths issues with a simple idea. We will fallback
to a default prefix when it is missing (on phone like numbers,
composed of 10 numbers).
This prefix is an environment variable that cause 0 impact if missing.
* sxmo_contacts.sh will fix the recent numbers prefixes with the default
* sxmo_modemmonitor.sh will also fix the prefix with the default one
This should solve missmatch issues as both will use country code format
I only recommend to always store contacts in the prefixed format in the
contacts.tsv file.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
If modemmonitor crash for some reason, status bar is not updated. The
reason is that statusbar check if modemmonitor is running, which it is
when trying to shutdown itself.
We change the way modemmonitor is detected using a single modem state
file. If the file is not present, then the monitor is considered not
running.
This single file permit to add more state in the future, without adding
any more files.
We also add a sleep 1, look like it is required to have instand status
bar update.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
* Draft files are assigned to each number:
Stored here ".local/share/modem/+33666666666/draft.txt"
We automatically edit this single file, making crash or unexpected
edition issue to leave intact saved draft.
* Simplification of some logics
Having a known draft file instead of using a TEXT var simplify lots
of things
* EDITOR is not run in a subshell
Some editors as kakoune got issues with that. Futhermore, it will be
usefull for some other development as making all menu ssh mode
compatible
* Remove modem check
As we now got draft, why do we care if modem is up or down ?
* Display the contact name instead of it number in the conversation
Or use "Unknown Number (+337798676)"
* Unify display message notif adding possibilities to bypass the
main menu
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This allow the "Reply" appmenu shortcut to open a new compose message
directly.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This reverts commit 3bb3fb6094.
We cannot use this special less argument as it is not busybox less
compatible.
I add busybox aliases to not reproduce the error in the future.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Another script would use sxmo_modemsendsms and maybe put its error
somewhere. We should not truncate stderr as it would break those
scripts.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>