diff --git a/Makefile b/Makefile index 311525d..4ead5c9 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,8 @@ install-service: make install-service-runit; \ elif command -v rc-update &> /dev/null; then \ make install-service-openrc; \ + elif command -v s6-service &> /dev/null; then \ + make install-service-s6; \ else \ printf '\x1b[1;31m%s\x1b[0m\n' "Unknown init system, skipping service install..."; \ fi @@ -68,3 +70,6 @@ install-service-runit: install-service-openrc: install -m755 ./assets/services/openrc /etc/init.d/lidm @printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'rc-update add lidm'" +install-service-s6: + rsync -a --no-owner --no-group ./assets/services/s6/. /etc/s6/sv/lidm + @printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 's6-service add default lidm' and 's6-db-reload'" diff --git a/README.md b/README.md index fdd00c3..fe369be 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ LiDM is like any [X Display Manager](https://en.wikipedia.org/wiki/X_display_man * Fast and possibly efficient. * Fully customizable, from strings, including action keys, to colors (I hope you know ansi escape codes) * Automatically detects xorg and wayland sessions, plus allowing to launch the default user shell (if enabled in config) -* Starts with many init systems (systemd, dinit, runit and openrc). +* Starts with many init systems (systemd, dinit, runit, openrc and s6). ## WIP * Desktop's file `TryExec` key. diff --git a/assets/services/README.md b/assets/services/README.md index 38c0647..b213f5a 100644 --- a/assets/services/README.md +++ b/assets/services/README.md @@ -24,5 +24,10 @@ The manuall steps for installation are: * Copy `openrc` to `/etc/init.d/lidm` * Enable the service with `rc-update add lidm` +## S6 +* Copy `s6/` to `/etc/s6/sv/lidm/` +* Add the service with `s6-service add default lidm` +* Reload the database with `s6-db-reload` (you might have to run this every time the service file changes) + > [!WARNING] > Make sure to disable any other service that might run on tty7, such us lightdm or most display managers out there. diff --git a/assets/services/s6/dependencies.d/hostname b/assets/services/s6/dependencies.d/hostname new file mode 100644 index 0000000..e69de29 diff --git a/assets/services/s6/dependencies.d/mount-devfs b/assets/services/s6/dependencies.d/mount-devfs new file mode 100644 index 0000000..e69de29 diff --git a/assets/services/s6/run b/assets/services/s6/run new file mode 100755 index 0000000..8d8a29e --- /dev/null +++ b/assets/services/s6/run @@ -0,0 +1,8 @@ +#!/bin/execlineb -P +if { pipeline { s6-rc -ba list } grep -qFx mount-filesystems } +importas -uD "yes" SPAWN SPAWN +importas -sCuD "" ARGS ARGS +importas -sCuD "agetty" GETTY GETTY +if -t { test -e /dev/tty7 } +if -t { test ${SPAWN} = "yes" } + exec agetty -8 tty7 115200 ${ARGS} -nl /bin/lidm -o 7 diff --git a/assets/services/s6/type b/assets/services/s6/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/assets/services/s6/type @@ -0,0 +1 @@ +longrun