From dedcf874c93cd8c34b49dca097da814e7c06065c Mon Sep 17 00:00:00 2001 From: lelgenio Date: Sun, 27 Feb 2022 20:07:56 -0300 Subject: [PATCH] runit: be smarter about how to setup daemons --- config.yaml | 43 ++++++++++--------------------- dotfiles/fish/config.fish | 4 ++- dotfiles/runit_sv/dbus-daemon/run | 2 -- dotfiles/runit_sv/geoclue/run | 5 ---- dotfiles/runit_sv/light/once | 0 dotfiles/runit_sv/light/run | 2 -- dotfiles/runit_sv/redshift/run | 2 -- dotfiles/scripts/_runit_config | 42 ------------------------------ dotfiles/sway/config | 3 ++- root/config.yaml | 37 ++++++++++++++------------ 10 files changed, 38 insertions(+), 102 deletions(-) delete mode 100755 dotfiles/runit_sv/dbus-daemon/run delete mode 100755 dotfiles/runit_sv/geoclue/run delete mode 100644 dotfiles/runit_sv/light/once delete mode 100755 dotfiles/runit_sv/light/run delete mode 100755 dotfiles/runit_sv/redshift/run delete mode 100755 dotfiles/scripts/_runit_config diff --git a/config.yaml b/config.yaml index cbde839..4ef1b63 100644 --- a/config.yaml +++ b/config.yaml @@ -56,6 +56,10 @@ variables: ############################################################### profiles: +############################################################### + +############################################################### +# Accents ############################################################### dark: @@ -163,10 +167,8 @@ profiles: ############################################################### -# Os profiles -############################################################### - common: +############################################################### variables: # gtk_theme: "Mint-Y{{@@ '-Dark' if color.type == 'dark' else '' @@}}-{{@@ accent_color_name.capitalize() @@}}" gtk_theme: "Orchis-{{@@ accent_color_name.lower() @@}}-{{@@ 'dark' if color.type == 'dark' else 'light' @@}}" @@ -231,33 +233,18 @@ profiles: - xdpw - zathura +############################################################### +# Os profiles +############################################################### + voidlinux: include: - "common" variables: + user_svdir: $HOME/.config/runit supervisor: runit - runit_enable: - - gammastep - - kanshi - - kdeconnect-indicator - - kdeconnectd - - libinput-gestures - - mako - - mpDris2 - - mpd - - notify-mail - - pipewire - - pipewire-media-session - - pulseaudio - - swayidle - - syncthing - - telegram - - udiskie - - waybar - - xdpw - - xsettingsd dotfiles: - - services + - runit_services artixlinux: include: @@ -358,8 +345,6 @@ actions: https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons - enable_runit_services: _runit_config "{{@@ _dotfile_abs_dst @@}}" {{@@ ' '.join(runit_enable) @@}} - # bootstrap scripts pam_gpg: _pam-gpg-strap make_theme: _make_theme @@ -485,11 +470,9 @@ dotfiles: # Just a bunch of paths and action mappings - make_theme - groups_install - services: + runit_services: src: runit_sv - dst: ~/.config/runit/sv - actions: - - enable_runit_services + dst: ~/.config/runit libinput-gestures: src: libinput-gestures.conf diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 59884e4..3fe8df8 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -15,7 +15,9 @@ if status is-interactive source {$__fish_config_dir}/keys.fish source {$__fish_config_dir}/tmux.fish source {$__fish_config_dir}/colors.fish - source {$__fish_config_dir}/plugins.fish + if test "$USER" != root + source {$__fish_config_dir}/plugins.fish + end end diff --git a/dotfiles/runit_sv/dbus-daemon/run b/dotfiles/runit_sv/dbus-daemon/run deleted file mode 100755 index b6a21c4..0000000 --- a/dotfiles/runit_sv/dbus-daemon/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec _start_dbus-daemon diff --git a/dotfiles/runit_sv/geoclue/run b/dotfiles/runit_sv/geoclue/run deleted file mode 100755 index 3875c40..0000000 --- a/dotfiles/runit_sv/geoclue/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -PATH="/usr/lib/geoclue-2.0/demos/:/usr/libexec/geoclue-2.0/demos/" - -exec agent diff --git a/dotfiles/runit_sv/light/once b/dotfiles/runit_sv/light/once deleted file mode 100644 index e69de29..0000000 diff --git a/dotfiles/runit_sv/light/run b/dotfiles/runit_sv/light/run deleted file mode 100755 index ad6eb63..0000000 --- a/dotfiles/runit_sv/light/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec light -N 1 diff --git a/dotfiles/runit_sv/redshift/run b/dotfiles/runit_sv/redshift/run deleted file mode 100755 index 35aca5a..0000000 --- a/dotfiles/runit_sv/redshift/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec redshift diff --git a/dotfiles/scripts/_runit_config b/dotfiles/scripts/_runit_config deleted file mode 100755 index ff0099f..0000000 --- a/dotfiles/scripts/_runit_config +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -set -ex - -mkdir -p "$1" -cd `dirname $1` && shift - -create_logger() { - pushd sv/ - for svd in */; do - pushd "$svd" - - if ! test -d log; then - mkdir -p log - ln -s "$(which _default_logger)" log/run - fi - - popd - done - popd -} - -enable_defaults() { - - mkdir -p "runsvdir/default" - pushd "runsvdir/default" - - svdir="$(readlink -f ../../sv)" - - for sv; do - ln -fs "$svdir/$sv" . - done - popd -} - -create_logger - -test -f .inited && exit 0 - -enable_defaults "$@" - -touch .inited diff --git a/dotfiles/sway/config b/dotfiles/sway/config index 688944c..9bc574a 100644 --- a/dotfiles/sway/config +++ b/dotfiles/sway/config @@ -42,7 +42,7 @@ include modes include assigns {%@@ if profile in ["voidlinux"] @@%} - set $user_svd "$HOME/.config/runit/runsvdir/default" + set $user_svd "{{@@ user_svdir @@}}" exec_always pgrep -u "$USER" "^runsvdir$" || runsvdir $user_svd exec_always env SVDIR=$user_svd sv hup kanshi exec_always env SVDIR=$user_svd sv hup waybar @@ -51,6 +51,7 @@ include assigns include daemons {%@@ endif @@%} +exec light -N 1 exec dbus-update-activation-environment DISPLAY XAUTHORITY SWAYSOCK I3SOCK WAYLAND_DISPLAY # Prevent the screen from locking if fullscreen diff --git a/root/config.yaml b/root/config.yaml index 1c3046b..2d2ed25 100644 --- a/root/config.yaml +++ b/root/config.yaml @@ -43,7 +43,7 @@ actions: dbus_uuidgen: dbus-uuidgen --ensure sysctl_apply: sysctl -a mkinitcpio: mkinitcpio -P - enable_runit_services: _runit_config "{{@@ _dotfile_abs_dst @@}}" {{@@ ' '.join(runit_autostart) @@}} + enable_runit_services: ln -sf "{{@@ sys_services @@}}/{0}" "{{@@ sys_svdir @@}}/{0}" ############################################################### profiles: @@ -63,25 +63,15 @@ profiles: voidlinux: variables: - runit_autostart: - - acpid - - bluetoothd - - crond - - dbus - - dhcpcd - - docker - - iwd - - ntpd - - rundird - - seatd - - socklog-unix - - tlp + sys_services: /etc/sv + sys_svdir: /etc/runit/runsvdir/default/ include: - "common" dotfiles: - elogind - libc_locales - runit_services + - runit_services_enable artixlinux: include: @@ -198,7 +188,20 @@ dotfiles: runit_services: src: runit_sv dst: /etc/runit/sv + + runit_services_enable: + src: + dst: actions: - - enable_runit_services - - + - enable_runit_services acpid + - enable_runit_services bluetoothd + - enable_runit_services crond + - enable_runit_services dbus + - enable_runit_services dhcpcd + - enable_runit_services docker + - enable_runit_services iwd + - enable_runit_services ntpd + - enable_runit_services rundird + - enable_runit_services seatd + - enable_runit_services socklog-unix + - enable_runit_services tlp