river: Change to runit-managed user service
Switching to runit (and turnstiled, which in turn activates user-local runit service supervision) we can now have river run supervised by our service manager quite easily. We make use of this, but have to take care to export the river-established wayland variables (DISPLAY, WAYLAND_DISPLAY) back into the user environment for other processes since river will not be the one responsible for spawning them anymore. On finishing the service (i.e. exiting the process), we ensure that the variables get removed from the environment again so it is not polluted in the future. Additionally, we load the (default for void runit) 'turnstile-ready' service which can define core user services that need to exist before others on login, and the session-local dbus service which river and other programs will make use of. It is marked as essential with turnstile-ready.
This commit is contained in:
parent
ea1bd6c573
commit
7c0bd5738f
8 changed files with 35 additions and 1 deletions
|
@ -1,8 +1,14 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# turnstiled user service setup
|
||||
if [ -d "$TURNSTILE_ENV_DIR" ]; then
|
||||
echo "$DISPLAY" >"$TURNSTILE_ENV_DIR/DISPLAY"
|
||||
echo "$WAYLAND_DISPLAY" >"$TURNSTILE_ENV_DIR/WAYLAND_DISPLAY"
|
||||
fi
|
||||
|
||||
mod="Mod4"
|
||||
modemod="Mod1"
|
||||
term=${TERMINAL:-foot}
|
||||
term=${TERMINAL:-wezterm}
|
||||
time_to_lockscreen=300
|
||||
time_to_screendim=600
|
||||
time_to_suspend=900
|
||||
|
|
2
services/sv/dbus/log/run
Executable file
2
services/sv/dbus/log/run
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec vlogger -t dbus_user -p daemon
|
1
services/sv/dbus/run
Symbolic link
1
services/sv/dbus/run
Symbolic link
|
@ -0,0 +1 @@
|
|||
/usr/share/examples/turnstile/dbus.run
|
6
services/sv/river/finish
Executable file
6
services/sv/river/finish
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
if [ -d "$TURNSTILE_ENV_DIR" ]; then
|
||||
[ -r "$TURNSTILE_ENV_DIR/DISPLAY" ] && rm "$TURNSTILE_ENV_DIR/DISPLAY"
|
||||
[ -r "$TURNSTILE_ENV_DIR/WAYLAND_DISPLAY" ] && rm "$TURNSTILE_ENV_DIR/WAYLAND_DISPLAY"
|
||||
fi
|
3
services/sv/river/log/run
Executable file
3
services/sv/river/log/run
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
exec vlogger -t river -p daemon
|
10
services/sv/river/run
Executable file
10
services/sv/river/run
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -r ./conf ] && . ./conf
|
||||
|
||||
if [ -d "$TURNSTILE_ENV_DIR" ]; then
|
||||
echo "$HOME/.local/bin:$PATH" > "$TURNSTILE_ENV_DIR/PATH"
|
||||
fi
|
||||
|
||||
exec 2>&1
|
||||
exec chpst -e "$TURNSTILE_ENV_DIR" river -log-level warning
|
1
services/sv/turnstile-ready/conf
Normal file
1
services/sv/turnstile-ready/conf
Normal file
|
@ -0,0 +1 @@
|
|||
core_services="dbus"
|
5
services/sv/turnstile-ready/run
Executable file
5
services/sv/turnstile-ready/run
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
[ -r ./conf ] && . ./conf
|
||||
[ -n "$core_services" ] && SVDIR=".." sv start $core_services
|
||||
[ -p "/run/turnstiled/1000/ready" ] && printf "/home/marty/.local/state/service/turnstile-ready" > "/run/turnstiled/1000/ready"
|
||||
exec pause
|
Loading…
Reference in a new issue