969 Commits

Author SHA1 Message Date
ArenM
d1e025f1f7 Don't wait multiple times
The wait command will wait for all process known to the shell if no
arguments are passed, so in these cases looping does nothing.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-20 10:48:24 +01:00
Peter John Hartman
283d626b85 SXMO_NO_ICON was no longer used. 2022-02-18 21:30:46 -06:00
Bruno Dupuis
42498f8803 Sway scale as a configuration variable
Set the sway scale factor in a variable.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-18 19:20:02 -06:00
Miles Alan
2d199c3f6a Remove legacy sxmo_gpsutil.sh script; and remove foxtrotgps from main menu
Mepo is better - this sxmo_gpsutil.sh was hack script for foxtrotgps.
All of this stuff can be accomplished with mepo in a better way; also
this old script was X-compatible-only.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-18 19:15:43 -06:00
Peter John Hartman
4fb7d7d30d wob: rm stray wobsocket
This would likely only be the case in case of a crash, but
also if someone does sxmo_audio.sh or sxmo_brightness.sh
in start hook before sxmo_wob.sh it'll write a websocket
file so wob will fail.
2022-02-18 19:15:16 -06:00
Bruno Dupuis
22cd405b68 Implement sxmo_hook_tailtext.log.
This will allow for cool stuff like:
https://lists.sr.ht/~mil/sxmo-devel/patches/29543

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-18 06:58:52 -06:00
Zach DeCook
b9fe06d97b hookmenu: Rewrite and fix for directory/symlink structure
Now, the menu defaults to editing the hook that you click on
(because that's why you went into the menu in the first place).
A separate menu is given for deleting the hooks.

This also shows the hook name rather than the file name.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-16 21:13:48 -06:00
Stacy Harper
88efb42f70 Revert "SXMO_DEBUG"
This reverts commit b3eb4f15b0.
2022-02-16 09:55:20 +01:00
Stacy Harper
84a97cf751 Revert "sxmo_mutex: add debug statements"
This reverts commit ac5c0bb874.
2022-02-16 09:52:13 +01:00
Peter John Hartman
b3eb4f15b0 SXMO_DEBUG
If set, then print sxmo_debug lines, otherwise don't.  Default is unset.
2022-02-15 19:16:21 -06:00
Peter John Hartman
ac5c0bb874 sxmo_mutex: add debug statements
This places the debug statements a little better, also adds a comment to
alert the user not to rem stuff out of sxmo_hook_check_state_mutexes
without running freeall.
2022-02-15 19:09:17 -06:00
Peter John Hartman
dbdabf22cb sxmo_log in rtcwake 2022-02-15 19:04:21 -06:00
Peter John Hartman
9a931313ef sxmo_mutex: use /dev/shm for fallback XDG_RUNTIME_DIR
As with sxmo_init.sh.  This is especially important if we run from
cronjob (ie sxmo_rtcwake.sh).
2022-02-15 19:04:21 -06:00
Stacy Harper
d3e56c2c1a Fix sxmo_mutex lock file 2022-02-15 12:00:53 +01:00
Stacy Harper
9a6a347a1c Revert "Avoid race caused by sed -i"
This reverts commit 4a0d47fa4d.
2022-02-15 12:00:52 +01:00
Stacy Harper
1821e5eebb Enforce busybox flock and sed 2022-02-15 09:42:07 +01:00
ArenM
4a0d47fa4d Avoid race caused by sed -i
For some reason if we use sed -i flock drops it's lock before sed has
finished writing data. By emulating this with a tempfile and mv we
somehow avoid this condition.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-15 09:42:07 +01:00
ArenM
1aec0d9666 Make claiming or releasing mutexes atomic
If one sed process started before the previous one finished, the changes
of all but the last one to finish would be lost.

Also I think if the grep is run at the same time as another sed process
it will might generate an outdated line number, causing sed to remove
the wrong lock item.

This is a relatively crude method for avoiding these race conditions,
until a method that doesn't need to lock it's lock can be developed.

I also also added compatibility with gnu xargs

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-15 09:39:47 +01:00
ArenM
119dc6c2bc Add tests for sxmo_mutex.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-15 09:39:46 +01:00
Zach DeCook
b4813b93c6 migration: Don't use difftool if it doesn't exist
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-14 19:49:49 -06:00
Zach DeCook
ffcfa6f6a4 icons: Change into a hook
Fixes the icons hook to be where the migration script moved it.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 18:18:55 +01:00
Peter John Hartman
c15fb89e4c suspend: add sxmo_hook_suspend.sh
On my laptop, rtcwake -m mem -s YEARS8 is too big and throws an error.
Fix: if suspend time is > YEARS8 just do rtcwake -m mem with no supsend
time.

However, I also thought making this a hook would be good.  Users can
then either use systemctl or whatever they want to do the actual
suspend, or they can implement some smart check to hibernate instead of
suspend if battery is low, etc.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 14:29:18 +01:00
Stacy Harper
5681366a0a Load correctly sxmo_hook_icons.sh 2022-02-14 14:22:48 +01:00
Peter John Hartman
85baef7915 debug statements
I changed the sxmo_log calls in sxmo_daemons.sh to sxmo_debug, and I
added some sxmo_debug statements in inputhandlers and in check mutex.
These messages are useful for debug but not normal users.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 14:17:28 +01:00
Peter John Hartman
2309335e3e wob: SXMO_WOB_DISABLE
On eink in sway the wob strip is buggy.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 14:08:16 +01:00
Peter John Hartman
31df7f0ec1 pinennote: various fixups
1. This patch tweaks the deviceprofile for pinenote.

2. It adds a COVERRTC check so that we can tell if we wake up via an
   'open cover' signal.

3. It implements a simple locking mechanism: we have two states (unlock
   and suspend).  After SXMO_UNLOCK_IDLE_TIMEOUT (default is 30s) it
   go into suspend.  Before it suspends, we pretend to be in "SUSPEND"
   state (update to statusbar).  After suspend, we go back into unlock
   state.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 14:04:11 +01:00
Peter John Hartman
0f897e86eb rotate: add 180
On pinenote 180 is the place to be for the little cover stand to work.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 14:01:43 +01:00
Anjandev Momi
f6ac47fc91 sxmo_migrate.sh: use vimdiff by default
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 13:59:20 +01:00
Anjandev Momi
ae2e39d892 sxmo_migrate.sh: migrate dwm/sway if 'interactive' or 'all'
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 13:58:16 +01:00
Anjandev Momi
501d317405 load env vars in sxmo_migrate.sh even if sxmo is not running
This allows users with broken sxmo installs to still run
sxmo_migrate.sh to rescue their installs.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-02-13 22:52:06 +01:00
Andrew Bates
180332ae7a Added new hook for when screen is rotated.
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-12 17:42:33 +01:00
Peter John Hartman
2a4a614be7 fix shellcheck err 2022-02-12 17:42:33 +01:00
Stacy Harper
131fdd8ae0 Inform the user if the input device doesnt exists
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-12 09:13:19 -06:00
Stacy Harper
d410d546c8 Make swaydpms to control all outputs
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-12 09:13:19 -06:00
Stacy Harper
282660b113 Make sway rotation to works on every focused output
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-12 09:13:19 -06:00
Peter John Hartman
8bfd364dda busybox pkill 2>/dev/null
If a system actually doesn't have busybox pkill, then this'll spam up
the logs with pkill: applet not found

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-12 11:37:16 +01:00
Peter John Hartman
6beb27b34f rfkill: switch the wifi checks to use busybox rfkil
An earlier patch switched us over to busybox rfkill, but didn't
switchover all rfkill instants to use new syntax.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-12 11:30:37 +01:00
Stacy Harper
18517369c0 Run the script instead of just stdout it ! 2022-02-12 10:43:46 +01:00
Stacy Harper
a8065e578b Make sure we start migrations in the correct numeric order 2022-02-12 10:22:23 +01:00
Stacy Harper
cdaa1f3a81 Move migrations outside of path and execute them automatically 2022-02-12 10:15:48 +01:00
Stacy Harper
572320805f Cleanup alsa configs
As we now use pipewire by default, I think most of our alsa configs are
useless now. At least removing them seems to not have any consequences.

- Remove unused alsa_sxmo_enable_dmix.conf
- Remove useless default_alsa_sound.conf
- Remove useless audio setup in the start hook

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-11 15:16:49 -06:00
Stacy Harper
dc0ceea8b0 Bring sxmo-common-bluetooth pipewire config in sxmo-utils
We need this at least to start wireplumber and have pulse compatible api.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-11 15:16:49 -06:00
Stacy Harper
bceab1bf1c Make alsa control device device specific
I think this should supersed : https://lists.sr.ht/~mil/sxmo-devel/patches/29287

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-11 15:16:49 -06:00
Zach DeCook
c764af4a75 sxmo_migrate: automatically migrate hooks to new location
Follow up for 92c258f9, 9af2fd3f, 66b5e58f,
which moved the hooks.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-11 15:16:49 -06:00
Stacy Harper
5adbd90734 Do not check device hooks if not device detected 2022-02-11 17:55:57 +01:00
Stacy Harper
f4b3fedc5c Make setpermissions files device specific 2022-02-11 17:04:14 +01:00
Stacy Harper
66b5e58fe0 Make the existing inputhandler a pinephone specific hook 2022-02-11 17:04:13 +01:00
Stacy Harper
877a0c9d55 sxmo_migrate.sh check also device specific hooks 2022-02-11 17:04:13 +01:00
Stacy Harper
a74d1c7d76 De-indent this whole function 2022-02-11 17:04:12 +01:00
Stacy Harper
92c258f990 Make sxmo hooks scripts in PATH
We then add /usr/share/sxmo/default_hooks/ to the PATH (see
sxmo_init.sh)
2022-02-11 17:04:11 +01:00