Systemd starts a dbus session bus automatically, and runs user services
on it. When we create our own session bus, we can't talk to those
services.
Signed-off-by: Anjandev Momi <anjan@momi.ca>
xdg-user-dirs-update is responsible for creating directories such as
~/Pictures, and is intended to be run during the startup process of the
desktop environment. This adds a dependency on it.
https://freedesktop.org/wiki/Software/xdg-user-dirs/
This also sets up the XDG_PICTURES_DIR environment variable, so we don't
need to do that.
This patch is intended to fix https://todo.sr.ht/~mil/sxmo-tickets/350
Signed-off-by: Anjandev Momi <anjan@momi.ca>
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>
This patch ensures that user customisations to configuration files and
hooks can be more easily kept up to date when we make changes with new
sxmo releases. We need this because our hooks are modified both by us
and the user, to ensure the user has maximal flexibility and freedom in
adjusting the system to his/her needs; needing a mechanism like this
is the cost for that.
Each config file carries a 'configversion' comment that signals the version of
that particular configuration file. The version is unique for each file
and can be anything (as long it wasn't used before); I suggest a simple
incrementing integer.
Configurations that are out of date are moved out of the way when Sxmo
starts, presenting the system-default for that file instead. This
ensures that users always have a working system after an upgrade. Users
need to run sxmo_migrate.sh to 'merge' the changes.
sxmo_migrate.sh now has several modes (1st parameter):
* interactive: the default mode, shows diffs and prompts the user to
merge changes for file that are out of date. Like before, but makes
sure to use the file that were 'moved out of the way' earlier.
* all: same as interactive, but prompts for all files even if not
out of date
* reset: removes all user hooks and reverts to default configurations, good
option if a user is stuck somehow
* sync: this is a non-interactive mode automatically invoked from
sxmo_[xw]init.sh, it takes care of making sure default
configuration files exist and it checks the configversion, moving
outdated configs out of the way in favour of defaults.
* state: returns the current state, i.e. lists the files
that have been marked as needing revision.
(does not sync by itself)
Signed-off-by: Stacy Harper <contact@stacyharper.net>
The "set -o allexport" was preventing $DBUS_SESSION_BUS_ADDRESS to be
available on the xinit then the start hook.
We move and simplify the dbus setup in the init scripts.
Wart removed the quote to allow TERMCMD with arguments to not being
wrongly detected as absent. But then, empty TERMCMD trigger command -v
without argument and that exit 0. To avoid the cases, we add a last
argument "" as fallback.
- Move sxmo icons in sxmo_icons.sh
This script should be loaded when icons are needed
- Move init env variable setups in a /etc/profile.d/sxmo_init.sh
This script is loaded by tinydm and for ssh/tty logins.
The logged in user can re-trigger check_sxmo_wm if they toggle wm.
- sxmo_commons.sh now only load aliases. It can be loaded by scripts to
ensure busybox compatibility
- moved some parts of ~/.config/sxmo/xinit to ~/.config/sxmo/profile
This file also is loaded just before starting sway. It goal is to setup
env variables dedicated to sxmo
~/.config/sxmo/xinit only goal is now to trigger some dwm dedicated
things (as ~/.config/sxmo/sway can start exec commands to)
To recap, loads orders are :
tinydm:
/etc/profile.d/* # do not set SXMO_WM
~/.profile
sxmo_winit.sh:
~/.config/sxmo/profile
sxmo_xinit.sh:
~/.config/sxmo/profile
~/.config/sxmo/xinit # to start sxmo_hooks.sh
ssh/tty:
/etc/profile.d/* # will set SXMO_WM
~/.profile
- unify sxmo_winit.sh and sxmo_init.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Add a sxmo_daemons to manage all sxmo daemons
$ sxmo_daemons.sh start mmsd mmsdtng
$ sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh
$ sxmo_daemons.sh start sleepy sleep 2
$ sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh
-> This will stop the old daemon and start a new one
$ sxmo_daemons.sh running network_monitor
network_monitor is still running
$ echo $?
0
$ sxmo_daemons.sh running unknown
unknown is not running
$ echo $?
1
$ sxmo_daemons.sh running sleepy
sleepy is not running anymore
$ echo $?
2
$ sxmo_daemons.sh running network_monitor -q && echo "tada !"
tada !
$ sxmo_daemons.sh stop network_monitor
$ sxmo_daemons.sh stop all # to stop every managed daemons
We can now start, stop and check daemons status with ease. When
dwm/sway shutdown, we stop all daemons. Restarting or toggleing window
manager cannot leave any dangling daemons anymore.
As you can see, all daemons now start from the start hook. We gave the
full power on the user to disable or add daemons.
This patch is painfull cause I had to make sure every daemons behave
correctly and shutdown gracefully when killed (which was definitely not
the case !).
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
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>
If sway crashes, or something else happens such that the stopsway
function and stop hook is not executed, there are a lot of leftover
processes from the previous session.
I renamed swaystop to swaycleanup in this patch, and call it when
starting sway and after sway has stopped. This should make sure that
there are no residual sxmo/sway processes from the previous session when
starting a new session.
Signed-off-by: Anjandev Momi <anjan@momi.ca>
Any sane linux system will have a posix compliant shell at /bin/sh
This change will allow us to better detect running scripts using pgrep.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
First, it was annoying to have to switch logs when on ssh and one
toggles WM.
Second, several apps are WM agnostic: cronjobs,
sxmo_screenlock_deeper.sh, and others. Rather than force them to guess
the WM just to log their activities, it seems easier to just have "One
Log to Rule Them All", namely, sxmo.log.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
1. Our original version of sxmo_networkmonitor.sh was checking
interface 'org.freedesktop.NetworkManager' when it should be
'org.freedesktop.NetworkMananger.Device'. By chance, the 'up'
detection worked, but the others (down, pre-down) did not.
2. It also did not check for pre-up.
3. Also, the /etc/NetworkMananger/dispatcher.d/10-statusbarupdate.sh
is both not needed and actually wouldn't have been working, since
it would have run as root.
4. Finally, sxmo_networkmonitor.sh was not being stopped when the wm
ended (so it would break if you did Toggle WM).
Hence, this patch fixes all of the above. We *could* down the road
move all of this into /etc/NetworkMananger/dispatcher.d / pre-up.d,
etc., since what we do here is basically what those scripts do.
However, that would require somewhat complicated doas rules, since
those scripts run as root.
I kind of think this is the simpler approach after all.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Some soft are handled by sxmo itself (and not by the user). Some stop
should then occurs from inside sxmo.
We also add some stop as notification monitor, etc.
We dont use guesswm and rely on a SXMO_WM env variable. We now use
guesswm for non wm action (from ssh, console, rtc wakes, etc). It will
try to setup needed variables.
This way, we avoid to run sxmo_wm.sh and to check variables everytime.
This allow the user to manage sxmo_screenlock.sh from ssh and to run a
desktop software with "sxmo_wm.sh exec foot" by example.
We remove the "ssh" wm cause it does not really make sense anyway.
The sxmo_rtcwake.sh dont try to setup variables anymore cause the user
must use "sxmo_wm.sh exec" if they want to start a destkop software
anyway.
We remove the "xorg" check everywhere cause that make no sense. We
keep the xorg prefixed methods for common xorgs cases.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
We dont need those config and this prevent the user mpv config to take
priority by default.
We just drop this completly.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
We remove the audiostart hook to add two consistent wm hooks to start
and stop user services and handle initial configs.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This allow the user .profile to switch case depending on the default
values. It is mandatory by example to setup custom wvkbd or svkbd,
depending on the wm we use.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
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>