turnstile en vez de elogind

turnstile solo crea XDG_RUNTIME_DIR (backend none, sin exportar el bus de
D-Bus, que lo abre .xinitrc). Xorg ya arranca como root con Xorg.wrap y la
tapa y los botones los lleva acpid, así que elogind sobraba. Fuera su
logind.conf.d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5v1qWDwgkaVM5kjVHGGh8
This commit is contained in:
Alejandro Guerrero 2026-09-28 12:15:50 +02:00
parent 9f3863ac33
commit 1f4a6a8803
Signed by: alejandrogs73
GPG key ID: 1CFF10953BEE333C
6 changed files with 82 additions and 42 deletions

View file

@ -16,7 +16,7 @@ real names you type; this README explains what each one does.
|---|---|
| `suckless/` | The programs, each with its own `config.h` and patches |
| `home/` | Files that go in `~`, at the same path (they are symlinked) |
| `sistema/` | Files that go in `/` (acpid, zzz, elogind, udev, doas, xbps, runit) |
| `sistema/` | Files that go in `/` (acpid, zzz, turnstile, udev, doas, xbps, runit) |
| `install.sh` | Installs everything on a fresh Void system |
## Install
@ -52,27 +52,45 @@ for example) and repeated safely:
does nothing.
6. `sistema` (system): copies `sistema/` into `/`, sets up
`wpa_supplicant.conf` so wheel users can use `wpa_cli` without root and
save networks, enables the runit services (dbus, elogind, wpa_supplicant,
dhcpcd, bluetoothd, acpid, chronyd, tlp, automontaje, cupsd), removes
NetworkManager and polkitd (if something asks for polkit, like udisks2 or
libvirt, D-Bus starts it on its own) and adds the user to the audio,
video, input, network, bluetooth, lpadmin (printer management) and
`_pipewire` (realtime priority for audio without rtkit) groups. `doas.conf`
is checked with `doas -C` before it is installed with mode 400.
save networks, enables the runit services (dbus, turnstiled,
wpa_supplicant, dhcpcd, bluetoothd, acpid, chronyd, tlp, automontaje,
cupsd), removes NetworkManager, elogind and polkitd (if something asks for
polkit, like udisks2 or libvirt, D-Bus starts it on its own) and adds the
user to the audio, video, input, network, bluetooth, lpadmin (printer
management) and `_pipewire` (realtime priority for audio without rtkit)
groups. `doas.conf` is checked with `doas -C` before it is installed with
mode 400.
7. `quitar` (remove): uninstalls what the repo no longer uses because
something else replaces it: sudo (doas), feh (xwallpaper and nsxiv),
gammastep (sct), autorandr (`pantallas`), blueman and pavucontrol (the
`bluetooth` and `volumen` scripts), pinentry-gtk (pinentry-dmenu), vlc
(mpv), btop, NetworkManager and tlp-rdw (wpa_supplicant, dhcpcd and the
`wifi` script) and rtkit. sudo can be removed thanks to
`sistema/etc/xbps.d/sin-sudo.conf` (base-system depends on it), and it is
only removed once `/etc/doas.conf` is installed.
`wifi` script), rtkit and elogind (turnstile). sudo can be removed thanks
to `sistema/etc/xbps.d/sin-sudo.conf` (base-system depends on it), and it
is only removed once `/etc/doas.conf` is installed.
Afterwards, log out and back in (for the groups) and run `startx`.
Nix is not installed: the little that comes from it (webcord) is installed by
hand.
## Without elogind
elogind is systemd's logind on its own, and it is not needed here:
- `XDG_RUNTIME_DIR` (`/run/user/UID`) is created by turnstile at login
(`sistema/etc/turnstile/turnstiled.conf`: only that, no user services).
- Xorg runs as root through `Xorg.wrap` (`needs_root_rights = yes` in
`/etc/X11/Xwrapper.config`, shipped by Void).
- The lid and the power and suspend buttons are handled by acpid, which
calls `zzz`. Power off and reboot are runit's.
- Devices (sound, video, input, bluetooth) are reached through the user's
groups, not through the ACLs elogind gave the active session.
What stops working: mounting disks from a file manager (udisks2 asks polkit
for an active session, and there is none). USB sticks are mounted by
`automontaje`.
## Rebuilding after changing the config
cd suckless/dwm && make && doas make install

View file

@ -12,7 +12,7 @@ Tema Everforest y fuente Fira Code en todos.
|---|---|
| `suckless/` | Los programas, cada uno con su `config.h` y sus parches |
| `home/` | Archivos que van en `~`, con la misma ruta (se enlazan) |
| `sistema/` | Archivos que van en `/` (acpid, zzz, elogind, udev, doas, xbps, runit) |
| `sistema/` | Archivos que van en `/` (acpid, zzz, turnstile, udev, doas, xbps, runit) |
| `install.sh` | Lo instala todo en un Void recién instalado |
## Instalar
@ -47,28 +47,47 @@ Hace siete pasos, que también se pueden lanzar por separado
subclaves de autenticación y hace que recuerde la contraseña una hora.
`.bashrc` ya apunta `SSH_AUTH_SOCK` al agente. Si `~/.gnupg` no existe
todavía, no hace nada.
6. `sistema`: copia `sistema/` en `/`, prepara `wpa_supplicant.conf` para
que los de wheel usen `wpa_cli` sin root y guarden redes, activa los
servicios de runit (dbus, elogind, wpa_supplicant, dhcpcd, bluetoothd,
acpid, chronyd, tlp, automontaje, cupsd), quita NetworkManager y polkitd
6. `sistema`: copia `sistema/` en `/`, prepara `wpa_supplicant.conf` para que
los de wheel usen `wpa_cli` sin root y guarden redes, activa los servicios
de runit (dbus, turnstiled, wpa_supplicant, dhcpcd, bluetoothd, acpid,
chronyd, tlp, automontaje, cupsd), quita NetworkManager, elogind y polkitd
(si algo pide polkit, como udisks2 o libvirt, D-Bus lo arranca solo) y
añade el usuario a los grupos audio, video, input, network, bluetooth,
lpadmin (para gestionar impresoras) y `_pipewire` (prioridad de tiempo
real para el audio sin rtkit). `doas.conf` se
valida con `doas -C` antes de instalarlo con modo 400.
lpadmin (para gestionar impresoras) y `_pipewire` (prioridad de tiempo real
para el audio sin rtkit). `doas.conf` se valida con `doas -C` antes de
instalarlo con modo 400.
7. `quitar`: desinstala lo que el repo ya no usa porque lo sustituye otra
cosa: sudo (doas), feh (xwallpaper y nsxiv), gammastep (sct), autorandr
(`pantallas`), blueman y pavucontrol (scripts `bluetooth` y `volumen`),
pinentry-gtk (pinentry-dmenu), vlc (mpv), btop, NetworkManager y
tlp-rdw (wpa_supplicant, dhcpcd y el script `wifi`) y rtkit. sudo se puede quitar
gracias a `sistema/etc/xbps.d/sin-sudo.conf` (base-system depende de
él), y solo se quita si `/etc/doas.conf` ya está instalado.
pinentry-gtk (pinentry-dmenu), vlc (mpv), btop, NetworkManager y tlp-rdw
(wpa_supplicant, dhcpcd y el script `wifi`), rtkit y elogind (turnstile).
sudo se puede quitar gracias a `sistema/etc/xbps.d/sin-sudo.conf`
(base-system depende de él), y solo se quita si `/etc/doas.conf` ya está
instalado.
Después hay que cerrar sesión y volver a entrar (por los grupos) y lanzar
`startx`.
Nix no se instala: lo poco que viene de ahí (webcord) se instala a mano.
## Sin elogind
elogind es el logind de systemd por separado, y aquí sobra:
- `XDG_RUNTIME_DIR` (`/run/user/UID`) lo crea turnstile al entrar
(`sistema/etc/turnstile/turnstiled.conf`: solo eso, sin servicios de
usuario).
- Xorg arranca como root con `Xorg.wrap` (`needs_root_rights = yes` en
`/etc/X11/Xwrapper.config`, lo trae Void).
- La tapa y los botones de encendido y suspender los lleva acpid, que llama a
`zzz`. Apagar y reiniciar son los de runit.
- Los dispositivos (sonido, vídeo, entrada, bluetooth) van por los grupos del
usuario, no por las ACL que ponía elogind a la sesión activa.
Lo que deja de ir: montar discos desde un gestor de archivos (udisks2 pide a
polkit una sesión activa, que ya no hay). Las memorias USB las monta
`automontaje`.
## Recompilar tras cambiar la configuración
cd suckless/dwm && make && doas make install

View file

@ -1,6 +1,6 @@
#!/bin/sh
# elogind ya crea XDG_RUNTIME_DIR (/run/user/UID); esto es solo por si falta.
# turnstile ya crea XDG_RUNTIME_DIR (/run/user/UID); esto es solo por si falta.
if [ -z "$XDG_RUNTIME_DIR" ]; then
export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir
mkdir -p "$XDG_RUNTIME_DIR"

View file

@ -17,7 +17,7 @@ PAQUETES="
libXfixes-devel libxcb-devel freetype-devel fontconfig-devel harfbuzz-devel
libXrender-devel xorgproto imlib2-devel zlib-devel libxcrypt-devel
xorg xinit setxkbmap xrandr dbus elogind
xorg xinit setxkbmap xrandr dbus turnstile
picom dunst libnotify xwallpaper nsxiv maim xclip sct xss-lock
pipewire wireplumber libspa-bluetooth alsa-pipewire
wpa_supplicant dhcpcd bluez acpid chrony tlp
@ -34,21 +34,23 @@ SUCKLESS="dwm st dmenu slstatus slock scroll clipmenu"
# Tema GTK Everforest, en una versión fija para que siempre salga igual
GTK_TEMA_REPO=https://github.com/Fausto-Korpsvart/Everforest-GTK-Theme
GTK_TEMA_COMMIT=9b8be4d6648ae9eaae3dd550105081f8c9054825
SERVICIOS="dbus elogind wpa_supplicant dhcpcd bluetoothd acpid chronyd tlp automontaje cupsd"
SERVICIOS="dbus turnstiled wpa_supplicant dhcpcd bluetoothd acpid chronyd tlp automontaje cupsd"
# La red la llevan wpa_supplicant y dhcpcd. polkitd no hace falta como
# servicio: si algo lo pide (udisks2, libvirt), D-Bus lo arranca.
SERVICIOS_FUERA="NetworkManager polkitd"
# servicio: si algo lo pide (udisks2, libvirt), D-Bus lo arranca. turnstiled
# sustituye a elogind.
SERVICIOS_FUERA="NetworkManager polkitd elogind"
# _pipewire da prioridad de tiempo real al audio sin rtkit
# (/etc/security/limits.d/25-pw-rlimits.conf, de pipewire).
GRUPOS="audio video input network bluetooth lpadmin _pipewire"
# Lo que sustituyen otras cosas del repo: sudo (doas), feh (xwallpaper y
# nsxiv), gammastep (sct), autorandr (pantallas), blueman y pavucontrol
# (scripts bluetooth y volumen), pinentry-gtk (pinentry-dmenu), vlc (mpv),
# NetworkManager (wpa_supplicant, dhcpcd y el script wifi) y rtkit (el grupo
# _pipewire).
# NetworkManager (wpa_supplicant, dhcpcd y el script wifi), rtkit (el grupo
# _pipewire) y elogind (turnstile; Xorg arranca como root con Xorg.wrap y la
# tapa y los botones ya los lleva acpid).
QUITAR="
sudo feh gammastep autorandr blueman pavucontrol pinentry-gtk
gtk-engine-murrine vlc btop NetworkManager tlp-rdw rtkit
gtk-engine-murrine vlc btop NetworkManager tlp-rdw rtkit elogind
"
msg() { printf '\033[1;32m==>\033[0m %s\n' "$*"; }
@ -249,6 +251,11 @@ quitar() {
msg "Quitando:$fuera"
# shellcheck disable=SC2086
root xbps-remove -Ry $fuera
# Lo que puso aquí una versión anterior de sistema/ para elogind
if [ -e /etc/elogind/logind.conf.d/10-acpid.conf ]; then
root rm /etc/elogind/logind.conf.d/10-acpid.conf
fi
}
[ -f /etc/void-release ] || command -v xbps-install >/dev/null ||

View file

@ -1,11 +0,0 @@
# acpid ya se encarga de la tapa y del botón de suspender (llama a zzz) y del
# botón de encendido. Si elogind también reacciona, el portátil se suspende
# dos veces: al abrir la tapa se enciende, se vuelve a suspender y luego
# arranca. Así solo lo gestiona acpid.
[Login]
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

View file

@ -0,0 +1,7 @@
# turnstile en vez de elogind, solo para crear /run/user/UID
# (XDG_RUNTIME_DIR) al entrar. Sin gestor de servicios de usuario: lo de la
# sesión lo arranca .xinitrc. Tampoco exporta DBUS_SESSION_BUS_ADDRESS,
# porque el bus lo abre .xinitrc con dbus-run-session.
backend = none
manage_rundir = yes
export_dbus_address = no