Commit graph

612 commits

Author SHA1 Message Date
Stacy Harper
1c9a139d74
Cleanup unused sxmo_unlocklistener 2021-07-07 20:27:12 +02:00
Stacy Harper
1acab51003
Adapt the suspend appmenu entry with recent reworks
This menu should lock the phone then crust the phone cause we rely on
the lock state after waking up to have a consistent workflow.
2021-07-07 20:24:00 +02:00
Anjandev Momi
23acd8a8c2 magic number: make 8 years in seconds a constant 2021-07-06 22:14:30 -04:00
Stacy Harper
11f2777e0f Fix rtcwake when there is no cronjob
rtcwake can't take the default value of mnc when there is no cron job
cause it is too big.

We limit this value to 8 years, a working value.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-07-06 22:10:53 -04:00
Max Schillinger
4557aa59b8 Add device profile for Nexus 5 (battery device)
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-07-06 19:17:04 -04:00
Galen Abell
50f1c4e102
Add context menu for cmus
Requires the `set_term_title` in cmus to be set to false, otherwise cmus
will set the WM_TITLE to the currently playing song / album, which makes
it hard to determine that the current app is cmus.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-06 21:44:17 +02:00
noneofyourbusiness
9abfa620fe
add usb power as an unsuspend reason to sxmo_screenlock.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-05 09:45:24 +02:00
Stacy Harper
672566c206 Remove -a cause it can break the system.
If the apk cache is outdated (first installation) and you try to upgrade
with this "-a" argument without configuring a network, then apk will
just strip every packages that are not available.

It then leave the phone in a very broken state.

The -a was used to handle mainlining software from pmaport to aport
(where pmaport uses 9999 version numbers). As we do not rely that much
on those softwares (that are now mainlined), we strip this unsafe
argument.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-07-05 00:43:54 -04:00
Peter John Hartman
a2653f741d
I removed -X from less call. This is not in busybox less.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-01 14:47:36 +02:00
Maarten van Gompel
7318e2b5cf shellscript fix after applying last patches 2021-06-29 22:50:40 +02:00
Stacy Harper
e6ea657634 Cleanup hooks
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>
2021-06-29 22:43:16 +02:00
Stacy Harper
0ed27f8538 Handle cron tasks while in crust
mnc goal is to display when will occurs the next cron job.

We drop the "sxmo_screenlock.sh rtc" command and the
SXMO_RTCWAKEINTERVAL variable. We will now only use
"sxmo_screenlock.sh crust" which mean suspend until next cron job
(-2 seconds).

To replicate the old behavior of the blinking phone then returning to
suspension (if needed) we now use a new script.

By example:

*/15 * * * * DISPLAY=:0 sxmo_rtcwake.sh sleep 10

This will trigger a 10s sleep task every 15 minutes (the old default
rtcwake hook).

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-29 22:43:09 +02:00
Stacy Harper
02a37c9dea Add back a notification when receiving a call
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>
2021-06-29 22:42:32 +02:00
Anjandev Momi
0df2ae3c95 always use busybox grep in scripts
This fixes a bug where I was getting "binary file
~/.local/modem/modemlog.tsv matches" instead of getting a list of recent
contacts in sxmo_modemtext.sh. Turns out, having gnu grep breaks the behaviour
of showing a list of contacts. This patch ensures we are always using busybox
grep.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-29 22:17:27 +02:00
Stacy Harper
ae784d0ab0 Fix the notification menu usage when notification are doubled
For some reason, some notifications get doubled (probably cause of
a modemmonitor issue). Those doubled notifications cant be used with the
current notificationsmenu cause the two entry matches the picked text.

This make the first one to be picked.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-22 15:01:32 +02:00
Maarten van Gompel
a5acd7fcd5 made pmos-tweaks optional 2021-06-22 15:01:32 +02:00
Anjandev Momi
92ad227b65 add pmos-tweaks to config menu
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-22 14:54:08 +02:00
Maarten van Gompel
35e39dbb90 implemented sxmo_networkmonitor to monitor when the network goes up/down and execute hooks
This implement a dbus monitor for networkamanger and is useful to
start/stop/restart certain things in user-defined hooks when
connectivity is gained/lost. By default all
it does is ensure the status bar is updated quickly to reflect the
network status.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 23:03:48 +02:00
Stacy Harper
f28a81a10c Contextual gesture for amfora
This make gestures convenient enough to use the app only with gestures.

All the scroll direction are used :

Prev link       Scroll Up     Open in new tab

Back prev page                Open link

Close tab       Scroll Down   Next Link

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 23:02:28 +02:00
noneofyourbusiness
c7e0e3b656 add a configurable daemon that warns on low battery
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 23:01:48 +02:00
Stacy Harper
60dd08fa27 Fix sxmo_modemtext in terminal mode
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>
2021-06-21 22:59:55 +02:00
Stacy Harper
e428d0c4a4 Simplify the termmode detection
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>
2021-06-21 22:59:20 +02:00
Fernando Ramos
a10d556993 Add pure-maps to app menu (and new map icon to 'sxmo_common.sh')
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 22:58:42 +02:00
Stacy Harper
4e36154aef
fix going back to crust after sms or missed call
RTC loops was storing the good wake up reason but not the classic crust.

We fix it to notify the modemmonitor with the reason of the wake. This
should solve the issue and put the phone back to crust after sms.
2021-06-21 08:54:17 +02:00
Stacy Harper
574509115c
Prevent incompatible contact number to be added
In the last commits I added the country code in the early stages of the
phone numbe validation.

I think it was a mistake as it make ad non prefixed phone number to be
added in the tsv file.

I revert this part here.
2021-06-18 17:45:46 +02:00
Stacy Harper
af35294af6
Do not enforce the matching recent number
Prefer the typed value over the first matching one.
2021-06-18 10:43:20 +02:00
Stacy Harper
c928097412
Allow the user to force an invalid phone number
It is usefull for some provider dedicated short phone numbers as 666,
123 or whatever.
2021-06-18 10:43:20 +02:00
Stacy Harper
469f7cbd13
Fixup inconsistent usage of default country on phone numbers 2021-06-18 10:32:32 +02:00
noneofyourbusiness
03b7a9d59f
fix power button double tap by removing -e flag from inputhandler
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-06-17 17:24:51 +02:00
Stacy Harper
28e05440d7 Add a migration script to update default configs
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-13 21:31:27 +02:00
Stacy Harper
70820d5f16 Add missing default hooks installation on first run
We also simplify some code.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-13 21:28:53 +02:00
Stacy Harper
7cf1dadf5f Fix the notification for outgoing call hanged up by the contact
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>
2021-06-13 21:15:08 +02:00
Miles Alan
f63852a801 scripts/appscripts/sxmo_youtube.sh: Switch back to using codemadness-frontends
We originally switched off codemadness-frontends / idiotbox because it was
no longer functional. Nowadays it works again and is substantially faster
then ytdl.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-13 21:06:37 +02:00
Stacy Harper
c427a0eb7b Cleanup input handling
We now use uncontextualized event name from lisgd as leftrightcorner. We
will determine the action name only in the input handler. It allow
events to match multiple action depending on contexts.

We also add some basics events as left/rigth/up/down and
twoleft/tworight/twoup/twodown and use some of them.

Use use twoup and twodown to scroll in less and right left to
change the page.

We also prefer use case switch instead of if conditions.

We remove this HANDLE variable usage and exit directly when the event
has been handled.

We also add some methods as type, key or typeenter to simplify some
code.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-13 21:00:50 +02:00
Stacy Harper
a3d13c6c7d
Fix shellcheck error 2021-06-13 08:51:53 +02:00
Stacy Harper
3687ffacd4
sxmo_contacts now can search a contact 2021-06-12 13:35:30 +02:00
Stacy Harper
0ec4280c8d
Display the hidden entry in showcontact 2021-06-12 13:15:34 +02:00
Stacy Harper
c5c5537873
Do not enforce -e TERMCMD args and fix TERMMODE
Enforcing -e break some possibilities to use TERMCMD that dont use it.

TERMCMD should be setup in xinit. This way, in ssh mode, the value still
is empty. This way, some custom bash or tmux config could use
it, configuring it.
2021-06-09 08:42:51 +02:00
Maarten van Gompel
77420ebaf2
added some output verbosity in sxmo_screenlock and optimised some things
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-06-09 08:42:51 +02:00
noneofyourbusiness
3599be95f4
verify numbers with pn 2021-06-09 08:37:20 +02:00
Stacy Harper
e444553ae4
Optimize sxmo_modemtext contact listing
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.
2021-06-09 08:37:19 +02:00
noneofyourbusiness
823ad95477 add scrot script & add scrot to appmenu
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-06 22:23:15 +02:00
Maarten van Gompel
f10d6cddaa various minor shellcheck fixes 2021-06-06 15:39:38 +02:00
noneofyourbusiness
875e4b6f3a add battery percentage to status bar
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-06 15:32:35 +02:00
Stacy Harper
98bd4b2f0d Make sxmo_modemtext killeable with gesture
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-06 10:39:00 +02:00
Stacy Harper
b4686caa9c Handle outgoing terminated calls as well
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>
2021-06-06 10:22:41 +02:00
Maarten van Gompel
67d512c924
make the hide-menu gesture double as an action for closing all notifications
I regularly had situations where I received a whole pile of
notifications that were hard to close. Dunst is configured to
open the notification upon click and close upon right click, but
we can't do a right click on our touchscreens, and I didn't want to
override the default left-click behaviour that might be useful.
This should hopefully solve it.

(this solution requires dbus-x11 to be installed)

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-06-06 10:09:57 +02:00
Anjandev Momi
725d89d6d6
Rework the sxmo screenlock 2021-06-06 09:41:36 +02:00
Maarten van Gompel
7fbc1d347a st alias no longer needed now we use sxmo_terminal.sh explicitly 2021-06-05 18:55:05 +02:00
Maarten van Gompel
198462764f small patch to reconcile the last two commits 2021-06-04 21:54:35 +02:00