mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
Fix: check for correct sv path and runsvdir improvements
1. The previous commit didn't account for correct "sv" path. 2. The previous setup gave priority to artix runit setup, but sv path was incorrect - Its "/etc/runit/sv", but accidentaly gave "/etc/sv" which dosen't exist. - So, improve it by adding various other check and make it a branch "if-elif" check. - Called '_runit_sv'. 3. Improve on/default to first check for current running system dir's insted. - Prioritise current running insted of Not/Enabled symlinked "/etc/runit/runsvdir/default". - Above should only gave priority if it is not enabled/running. - So, not recommended. link of ref: [1]: https://docs.voidlinux.org/config/services/index.html | Enabling Services [2]: https://wiki.gentoo.org/wiki/Runit#Runit_and_service_management | 3.4.2 [3]: https://wiki.artixlinux.org/Main/Runit | Basic usage Signed-off-by: Noname Blank <nonameblank007@gmail.com>
This commit is contained in:
@@ -181,8 +181,19 @@ _disable_dm_dinit() {
|
||||
done
|
||||
}
|
||||
|
||||
_runit_sv() {
|
||||
if [ -d /etc/sv ]; then echo "/etc/sv"
|
||||
elif [ -d /etc/runit/sv ]; then echo "/etc/runit/sv"
|
||||
else
|
||||
error "Cannot find runit service configuration files directory"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
_runit_runsvdir() {
|
||||
if [ -d /run/runit/service ]; then echo "/run/runit/service"
|
||||
if [ -d /service ]; then echo "/service" # legacy/upstream symlink
|
||||
elif [ -d /var/service ]; then echo "/var/service"
|
||||
elif [ -d /run/runit/service ]; then echo "/run/runit/service"
|
||||
elif [ -d /etc/runit/runsvdir/default ]; then echo "/etc/runit/runsvdir/default"
|
||||
else
|
||||
error "Cannot find runit service directory"
|
||||
@@ -230,16 +241,18 @@ enable_sddm() {
|
||||
;;
|
||||
|
||||
runit)
|
||||
local sv
|
||||
local runsvdir
|
||||
sv=$(_runit_sv)
|
||||
runsvdir=$(_runit_runsvdir)
|
||||
|
||||
if [ ! -d /etc/sv/sddm ]; then
|
||||
error "/etc/sv/sddm not found - is sddm-runit (or equivalent) installed?"
|
||||
if [ ! -d "$sv/sddm" ]; then
|
||||
error "$sv/sddm not found - is sddm-runit (or equivalent) installed?"
|
||||
return 1
|
||||
fi
|
||||
|
||||
_disable_dm_runit
|
||||
sudo ln -sf /etc/sv/sddm "$runsvdir/sddm"
|
||||
sudo ln -sf "$sv/sddm" "$runsvdir/"
|
||||
info "sddm symlinked into $runsvdir"
|
||||
;;
|
||||
|
||||
@@ -268,7 +281,7 @@ enable_sddm() {
|
||||
echo ""
|
||||
echo " systemd - sudo systemctl enable --now sddm"
|
||||
echo " openrc - sudo rc-update add sddm default"
|
||||
echo " runit - sudo ln -s /etc/sv/sddm /run/runit/service/"
|
||||
echo " runit - sudo ln -s /etc/sv/sddm /var/service/ || sudo ln -s /etc/runit/sv/sddm /run/runit/service/"
|
||||
echo " dinit - sudo ln -s /etc/dinit.d/sddm /etc/dinit.d/boot.d/sddm"
|
||||
return 1
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user