Commit Graph

1754 Commits

Author SHA1 Message Date
Willow Barraco
b33c2860df Move build recipe in the directory 2023-02-19 09:53:09 +01:00
Peter John Hartman
d68a6017f6 check mutex: command -v mosh-server
To save a tiny bit of speed (maybe?)
2023-02-18 15:02:10 -06:00
Peter John Hartman
42fffd568b mutex: simplify hotspot check
We already enforce "Hotspot whatever" if they make the hotspot via our
menus, so let's just check for that. It is less processing.
2023-02-18 14:13:05 -06:00
Peter John Hartman
a38ba8b5b1 remove xpropout debug
It was producing a stray line in the log files.
2023-02-18 14:12:24 -06:00
Willow Barraco
74cc79fc7a Add Newsflash as app
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-18 09:55:15 -06:00
Willow Barraco
df5e31fb9b Avoid spam start the poor pipewire
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-18 09:55:15 -06:00
Peter John Hartman
fd8d87cc2c check mutex: change to debug
It spams up the log and it does wc -l which takes up processing, so put
as debug rather than log so its optional.
2023-02-18 09:52:36 -06:00
Willow Barraco
15551ca895 Drop double cal to statusbar refresh 2023-02-18 09:49:19 +01:00
Peter John Hartman
9257c6b5ed proximity lock fixups 2023-02-18 02:26:37 -06:00
Peter John Hartman
18f9fe3385 postwake: fix modem crash
Sometimes, I will receive a wakeup from modem, but then modem (or
modemmanager) will crash, and the phone will go back to sleep before
things can recover. This has the phone stay away for 30s after such
a case.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-18 08:59:45 +01:00
ArenM
d5ba7b87a8 add mutex debug script to monitor mutex usage
This provides more information about why the system isn't suspending
than the icons in the status bar do, and can hopefully replace them
since they seem to cause a lot of confusion.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-18 08:40:03 +01:00
ArenM
3c532c5a8c mutex: log lock and free events
This should be enough information to read the logfile, and determine how
long certain mutexes were held for. Which is probably a useful statistic
if we're going to optimize power usage more.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-18 08:40:02 +01:00
ArenM
c90e513e2d mutex: use flock on file descriptor to avoid shell spawning weirdness
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-18 08:40:02 +01:00
ArenM
190b6e8078 Add three_button_touchscreen to path if device hooks are missing
Most devices use the three_button_touchscreen hooks, so it make sense to
make them the default if there isn't a device specific hooks directory.
Hopefully this will make it simpler for users to get devices running in
sxmo.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-18 08:40:01 +01:00
ArenM
480ee9a946 xdg_data_path: don't always check in /usr/share
The xdg base dir spec specifies that /usr/local/share:/usr/share should
be used as the default, but not that they should always be included. We
set XDG_DATA_DIRS to this in sxmo_init.sh, so we would always duplicate
entries in /user/share without this.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-18 08:40:01 +01:00
Willow Barraco
5427d159b7 Fix proximity lock device detection on other phones 2023-02-18 08:16:32 +01:00
Willow Barraco
0d5e806215 Do not stop previous state_change_bar executions 2023-02-18 08:16:32 +01: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
Willow Barraco
9fc00ee0ac Simplify concurrency sxmo_hook_check_state_mutexes.sh check 2023-02-17 12:47:01 +01:00
Willow Barraco
bab739da98 Prevent concurrent state switch
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-17 05:40:10 -06:00
Willow Barraco
c451ea82df Simplify concurrency sxmo_led.sh check
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-17 05:39:31 -06:00
Peter John Hartman
de28df34f8 networkmonitor: move logs to debugs
Logging each state change spams up the logfile quite a bit, so move it
to debug.
2023-02-17 05:37:47 -06: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
7f96d872ba no need to stop/start lisgd during state transitions
We already have a check in sxmo_hook_inputhandler.sh to disable gestures
in any state other than unlock.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-16 10:02:14 +01:00
Willow Barraco
9e4edfcc9b Don't sucks while being used with logind
This is not a logind support patch. Sxmo doesn't talk logind so using it
with sxmo is pretty much useless. You shouldn't use it.
At least, let's unbreak sxmo while being used with it.

The major problem is that sxmo XDG_RUNTIME_DIR fallback to its default
location when not present. This works for the graphical session, started
by tinydm, but this make ssh session and cronjobs to fails to grab sxmo
session.

We also have to set XDG_RUNTIME_DIR before probing sxmo to be sure to
use the same directory discovery rules.
2023-02-16 09:25:14 +01:00
ArenM
ce91149b7f fix typo in background image name
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-16 09:12:41 +01:00
ArenM
89c8e5cae8 sxmo_daemons: only run one process at a time
There seems to be a race somewhere in sxmo_demons that can cause it to
spawn multiple copies of a task. This patch does the equivalent of using
sxmo_uniq_exec, but it doesn't require changing all the calls to
sxmo_daemons.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-16 09:12:40 +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
9dfb03ad14 restart_modem_daemons fix
>From Modem menu, "Restart Modem Daemons" should restart the daemons.
Right now, it doesn't do anything if the daemons are already running.
But I think it should restart the modem daemons, not just start if not
already started, e.g., if I want to debug something, or restart
modemmanager forcefully.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-02-15 18:22:20 -08:00
Peter John Hartman
07075c255c audio: allow vol above 100 below 0
This might speed things up a little, and why not? user choice, right?

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-02-14 22:15:17 -08:00
Peter John Hartman
703702b621 Add network up/down/pre_up/pre_down scripts.
These are empty for now, but give users a clue what to include in them.
It was annoying to get a lot file not founds.
2023-02-14 05:42:11 -06:00
Peter John Hartman
b1a28f637e sendsms hook: respect noring
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-02-13 19:07:29 -08:00
Peter John Hartman
5c3e3874e4 start hook: check if ModemManager
Soem systems don't have modems, so don't launch modemmonitor on those
systems.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-02-13 19:04:01 -08:00
Willow Barraco
1d22f1a8fa Add mutex while upgrading
This prevent the system to go to suspension while we upgrade it.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-02-09 22:14:00 +01:00
Willow Barraco
9374558dca Fix shellchecks 2023-02-06 10:16:21 +01:00
Peter John Hartman
3ab8dedd42 rtw scan threshold fix.
After scratching my head about this hack, I've decided to (1) document
it in a comment and (2) make it run only when configured explicitly and
(3) removed the != modem check. Why was the != modem check there? We
want to do this all the time.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-06 10:01:33 +01:00
Peter John Hartman
44bcaf718b fixup suspend: add battery wakeup
I was getting ghost wakeups *only* while plugged in, and isolated it to
the battery sending a wakeup which we weren't detecting.
2023-02-04 14:34:47 -06:00
Peter John Hartman
9051fd1caa contextmenu: firefox -> navigator 2023-02-04 14:32:55 -06:00
Willow Barraco
e5db81776f Add a simple mode to bluetooth menu
I'm very proud of this bluetooth menu. It allow us to manage our
connection with ease. But most of the time the only thing I want to do
is to connect to devices. Having this device dedicated submenu as extra
step, forward and backward, just to connect, is really annoying.

This add a simple mode to this bluetooth menu. It is enabled by default.
If you select a device with this mode on, you'll connect/disconnect
automatically without entering the device dedicated submenu. For this
workflows to be confortable, I also added paired/connected icons on the
the device entries.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-04 05:19:21 -06:00
Peter John Hartman
bed99f8702 fixup to checkforstucksms patch 2023-02-04 05:16:40 -06:00
Joshua Murphy
e7c9719d92 Fix typo in profile_template
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-02-04 05:14:26 -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
hazardchem
31724a5a03 xob: default config file
Config file for future xob replacement of dunst as audio and brightness
indicator.

Cloning and building:
https://github.com/florentc/xob
works and displays a bar the same way as wob.

Signed-off-by: hazardchem <pthom44@live.com.au>
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 15:54:19 +01: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
a7be5293f8 Add default font for svkbd.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:49:00 +01:00
Peter John Hartman
9d2a64ecb1 suspend: add battery wakeup
I was getting ghost wakeups *only* while plugged in, and isolated it to
the battery sending a wakeup which we weren't detecting.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:43:15 +01:00
Peter John Hartman
7697937cd0 add sxmo_hook_notifications.sh
This will allow the user to decide what to do when there are or are not
notifications.  Default is the green led. Users already have control over other
led-behavior in sxmo_hook_lock/unlock/screenoff/postwake/presuspend.
They should also be able ot control whether, e.g., notification is green
or blinks or does nothing.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:43:14 +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
158a499720 presuspend: close all notification popups
Moreso because I have a lot of userscripts that send popups, but its
kind of annoying to get stale or old notifications when I resume from
suspend.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-03 13:34:01 +01:00