Commit Graph

15 Commits

Author SHA1 Message Date
ArenM
f630b2bbdb sxmo_status.sh add locking
Watch was spitting out no such file or directory errors, that I think
were caused by a race between updating the status bar, and removing
items.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-31 19:29:15 +02:00
Willow Barraco
8edb83ef70 Fix shellspec
Do not shift when Included, cause for some reason, it fails.
2023-02-01 17:26:10 +01:00
Willow Barraco
d9abb19977 sxmo_status.sh: value can be empty 2023-02-01 17:05:30 +01:00
Willow Barraco
549da4b83d fix sxmo_status.sh shellspecs
sxmo_status.sh do not usage on empty args
2023-02-01 17:02:44 +01:00
Willow Barraco
de87fdf427 Fix sxmo_status.sh subcommand usages 2023-02-01 17:02:44 +01:00
Stacy Harper
4a4e5cd6cc move to sxmobar
This also alias sxmobar to the old adapted script in case the dependency
is missing. The api of sxmo_status.sh changed to be sxmobar compatible.
2023-02-01 16:42:21 +01:00
Stacy Harper
08fe32d492 Shellcheck fixes 2022-12-17 10:34:45 +01:00
Tzafrir Cohen
d79b985804 bashism fixes
Several places where dash behaves differently than bash:
* read in dash has to have a variable.
* use command -v as type is not POSIX

Signed-off-by: Tzafrir Cohen <tzafrir@debian.org>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-12-05 11:46:43 -08:00
Tzafrir Cohen
4a15176782 GNU find: -mindepth should come before -exec
Fixes: find: warning: you have specified the global option -mindepth
after the argument -exec, but global options are not positional, i.e.,
 -mindepth affects tests specified before it as well as those specified
after it.  Please specify global options before other arguments.

Originally busybox find was used and it probably does not give this
warning.

Signed-off-by: Tzafrir Cohen <tzafrir@debian.org>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-12-05 11:46:42 -08:00
ArenM
846eef58fb sxmo_status: don't attempt to find XDG_RUNTIME_DIR
jk_000 on irc had a issue with the led script hanging, during the
process of debugging it it seemed to be looking for the led lock in
~/.local/run.

I don't know if this is related, but it should be changed now that we
make sure to always initialize XDG_RUNTIME_DIR, and don't use
.local/run.

v1 of this patch caused the tests to fail because XDG_RUNTIME_DIR isn't
set in the test environment. This sets it to a temporary directory
before the test run.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-04-03 12:23:23 +02:00
Bruno Dupuis
825aeeb14e 'sxmo_status.sh del' help typo
Another patch in the set didn't pass shellcheck. I splitted
this out.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-04-03 11:50:42 +02:00
Anjandev Momi
1123c0f072 Change license to AGPL-3.0-only 2022-03-15 08:00:00 -04:00
ArenM
2ece6379f0 Fix warning from gnu find
-mindepth applies to all arguments not just ones that come after it, so
gnu find prints a warning. I guess to flag possible misuses?
2022-02-08 20:28:26 +01:00
noneofyourbusiness
c7c9233be8 remove uncompliant -h from sort
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-04 16:11:12 +01:00
Stacy Harper
57c5ee2352 Refact: status bar
The current sxmo status bar cause a high cpu usage periodically. It was
working by triggering a script that build the whole line.

This is a proposition to improve this implementation:

The design is very simple. We got a root dir that contains files. We
will cat those file contents sorted by the file names.

This way we can update a specific part and the rewriting will then be
very light.

Some abstraction to make it simple:

$ sxmo_status.sh show

To display the current content

$ sxmo_status.sh debug

To help fuzzy developpers like me

$ sxmo_status.sh watch

To watch updates of the component files. Will stdout the new line on
change.

$ sxmo_status.sh add 99-time "11:35" # or
$ printf "11:35" | sxmo_status.sh add 99-time

To add or re-write the component 99-time with the content "11:35"

$ sxmo_status.sh del 99-time

To drop a component

Then, to wrap some of the sxmo status bar component we will still use
the statusbar hook. It make it easy for the user to override or drop
some components.

$ sxmo_hooks.sh statusbar time

To set the time based on the current time. Here other existing
components:

$ sxmo_hooks.sh statusbar call_duration
$ sxmo_hooks.sh statusbar modem
$ sxmo_hooks.sh statusbar modem_monitor
$ sxmo_hooks.sh statusbar wifi
$ sxmo_hooks.sh statusbar vpn
$ sxmo_hooks.sh statusbar battery
$ sxmo_hooks.sh statusbar volume

Or to rewrite everything:

$ sxmo_hooks.sh statusbar all

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-01-15 11:30:40 +01:00