Commit graph

36 commits

Author SHA1 Message Date
Stacy Harper
55985a8f20 Rework the status bar
Goals of this patch :

- display the signal quality

I used a thermometer icon cause there is no available icon with a
filleable bar o_O

- display the currently used network technology (4g, 3g, etc...)

I used the mapping from:

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blob/master/include/ModemManager-enums.h#L220

Dylan also said:

Anything from POTS to GPRS = 2G
UMTS to EVDOB = 3G
LTE = 4G
5GNR = 5G

- display the modem infos when modemmonitor is disabled

We want to decorelate the modem monitor from the icon. We still want to
know easily if modem monitor is runing but we also want those modem
infos if not.

- simplify the modem state determination (no state file anymore)

The statusbar probe mmcli itself.

- fix the leading timer without call issue

This was caused by the "pgrep -f" command that was matching itself.
Using a simple "pgrep" looks good enough anyway.

- fix some sxmo_statusbar update spaming issues (vol control)

This one point took me a lot of time to findout a good solution. We want
the USR1 kill to be spamable without causing issue to the displayed bar.
We dont want mid rendered bar (half the icons).
We dont want empty bars (empty stdout line).

I use some variable to store pid, smart waits and a better trap function
to make it to works cleanly. Now we can spam statusbarupdate. Only the
last one will actually redraw the bar.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-09-12 19:59:03 +02:00
Maxim Karasev
f7698e4a25
Move operating system detection to sxmo_common
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-09-05 10:07:27 +02:00
Stacy Harper
8a27933c47 SWMO - SXMO over Wayland
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>
2021-08-22 13:23:22 +02:00
Stacy Harper
cfa15765e2
Fix some shellchecks issues 2021-07-25 09:55:46 +02:00
Maarten van Gompel
d1f4561e66
do not use sxmo_hooks.sh for the icon hook (the hook variables don't live long enough)
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 08:48:37 +02:00
Stacy Harper
edeb250083 Specify other default values
This is usefull for cron jobs that would manage sxmo like screenlock by
example.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-07-19 19:03:46 +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
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
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
Maarten van Gompel
f10d6cddaa various minor shellcheck fixes 2021-06-06 15:39:38 +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
88a5079072
ensure there is always an $EDITOR set
It could occur that a user does not have an $EDITOR set when logging in
via SSH.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-05-23 14:37:11 +02:00
Jochen Sprickerhof
cafd100d28 Alias busybox pgrep/pkill only if apples are available
The Debian busybox does not provide those applets. This makes no
difference for PostmarketOS as they are an alias to busybox.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-05-16 13:49:24 +02:00
Stacy Harper
a3e4dc0fa4 Make all sxmo menu SSH mode compatible
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>
2021-04-10 13:20:19 +02:00
Maarten van Gompel
e220a30e15 added some more apps to the app menu 2021-04-05 17:18:52 +02:00
Sam Bowlby
bcde43d369 add VPN/Wireguard symbol to statusbar
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-05 16:41:54 +02:00
Stacy Harper
f9b96d2d28 Update modem status state on errors
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>
2021-04-05 12:04:34 +02:00
Stacy Harper
7c7496c06f Add icons to the contactmenu
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-04 20:56:24 +02:00
Stacy Harper
18361bd681 Revert "Use less as sms pager to allow scrollback"
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>
2021-03-30 19:08:17 +02:00
Stacy Harper
95ac330d0b Add a simple bluetooth menu
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-03-27 14:38:14 +01:00
Stacy Harper
811ea5bd5d Add a contact menu to manage them
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-03-25 22:07:06 +01:00
Maarten van Gompel
a6043ad80d use icons in status bar 2021-03-21 17:00:30 +01:00
Maarten van Gompel
cf97cd783d Added some extra tools to the menu 2021-03-17 18:20:04 +01:00
Maarten van Gompel
2f62b7c446 Moved checkmark to icons 2021-03-16 22:01:41 +01:00
Maarten van Gompel
47c62388e0 fix for bash: force alias expansion 2021-03-15 23:02:48 +01:00
Maarten van Gompel
c9eb7e30b7 more robust test to prevent out of range error 2021-03-06 23:42:57 +01:00
Maarten van Gompel
a8aabcc316 Make sure common include script doesn't output anything to stdout (fixes #203) 2021-03-06 23:40:04 +01:00
Maarten van Gompel
a16b570c3f fix out of range error 2021-03-06 19:49:07 +01:00
Maarten van Gompel
6430537f55 Small optimization to guard against including the common script unnecessarily 2021-02-21 15:14:16 +01:00
Maarten van Gompel
e426cbe823 export the dir variables from the common script 2021-02-21 15:14:16 +01:00
Maarten van Gompel
431d4e9cfb readded the ability to disable menu icons 2021-02-21 15:14:16 +01:00
Maarten van Gompel
fe6bd77b33 ensure busybox xargs is used (#137) + fix icon 2021-02-13 12:31:46 +01:00
Maarten van Gompel
f4ba3978c9 Call common script, moved icons to common script, removed unnecessary aliases from common (let's add them only when there are conflicts), made sure plays along with shellcheck 2021-02-01 18:32:32 +01:00
Anjandev Momi
32c4cb6682 Alias all coreutils programs to busybox
Signed-off-by: Anjandev Momi <anjan@momi.ca>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-02-01 18:32:32 +01:00