Compare commits

...

11 Commits

Author SHA1 Message Date
Jaredy899
be1585de70
Merge 9b3092687537af20e36d2256a93f008be4396d74 into c12ae4a8ef3af3ff37b577735ac3717a63149b8c 2025-02-12 07:47:11 -05:00
Chris Titus
c12ae4a8ef dm fixes and posix 2025-02-11 21:00:19 -06:00
Jaredy899
9b30926875
Update common-service-script.sh 2025-01-20 21:28:40 -05:00
Jaredy899
2b27fa217b
replace runit with sv
sv works with runit, and we don't need to sleep command.
2025-01-20 20:18:26 -05:00
Jaredy899
9c71edf061
Update core/tabs/common-service-script.sh
Found it faster than me. Thanks

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2025-01-11 09:25:40 -05:00
Jaredy899
a669ed338f
Update core/tabs/common-service-script.sh
Cool with me. Thanks

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2025-01-11 09:19:09 -05:00
Jaredy899
5746748f52
Update common-service-script.sh 2025-01-10 21:32:51 -05:00
Jaredy899
92bef5fe8d
Merge branch 'ChrisTitusTech:main' into service-script 2025-01-10 16:47:37 -05:00
Jaredy899
d44ce3cdb6
sleep for 5 to allow supervise to run 2025-01-10 00:33:45 -05:00
Jaredy899
83fee492b8
Update common-service-script.sh 2024-12-26 22:21:31 -05:00
Jaredy899
dc61abd3bb
Update common-service-script.sh 2024-12-24 07:51:53 -05:00
2 changed files with 52 additions and 27 deletions

View File

@ -35,8 +35,8 @@ install_nerd_font() {
FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip"
FONT_INSTALLED=$(fc-list | grep -i "Meslo")
# Check if Meslo Nerd-font is already installed
if [ -n "$FONT_INSTALLED" ]; then
# Replace -n test with standard test
if [ ! -z "$FONT_INSTALLED" ]; then
printf "%b\n" "${GREEN}Meslo Nerd-fonts are already installed.${RC}"
return 0
fi
@ -207,29 +207,37 @@ setupDisplayManager() {
done
printf "%b\n" "${GREEN}Current display manager: $currentdm${RC}"
if [ "$currentdm" = "none" ]; then
printf "%b\n" "${YELLOW}--------------------------${RC}"
printf "%b\n" "${YELLOW}Pick your Display Manager ${RC}"
printf "%b\n" "${YELLOW}1. SDDM ${RC}"
printf "%b\n" "${YELLOW}2. LightDM ${RC}"
printf "%b\n" "${YELLOW}3. GDM ${RC}"
printf "%b\n" "${YELLOW} ${RC}"
printf "%b" "${YELLOW}Please select one: ${RC}"
read -r choice
case "$choice" in
1)
DM="sddm"
;;
2)
DM="lightdm"
;;
3)
DM="gdm"
;;
*)
printf "%b\n" "${RED}Invalid selection! Please choose 1, 2, or 3.${RC}"
exit 1
;;
esac
while : ; do
printf "%b\n" "${YELLOW}--------------------------${RC}"
printf "%b\n" "${YELLOW}Pick your Display Manager ${RC}"
printf "%b\n" "${YELLOW}1. SDDM ${RC}"
printf "%b\n" "${YELLOW}2. LightDM ${RC}"
printf "%b\n" "${YELLOW}3. GDM ${RC}"
printf "%b\n" "${YELLOW}4. None ${RC}"
printf "%b" "${YELLOW}Please select one: ${RC}"
read -r choice
case "$choice" in
1)
DM="sddm"
break
;;
2)
DM="lightdm"
break
;;
3)
DM="gdm"
break
;;
4)
printf "%b\n" "${GREEN}No display manager will be installed${RC}"
return 0
;;
*)
printf "%b\n" "${RED}Invalid selection! Please choose 1, 2, 3, or 4.${RC}"
;;
esac
done
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM"

View File

@ -23,6 +23,9 @@ startService() {
rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
;;
sv)
"$ESCALATION_TOOL" sv start "$1"
;;
esac
}
@ -34,6 +37,9 @@ stopService() {
rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
;;
sv)
"$ESCALATION_TOOL" sv stop "$1"
;;
esac
}
@ -45,6 +51,11 @@ enableService() {
rc-service)
"$ESCALATION_TOOL" rc-update add "$1"
;;
sv)
"$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/"
printf "%b\n" "${YELLOW}Waiting 5 seconds...${RC}"
sleep 5
;;
esac
}
@ -56,6 +67,9 @@ disableService() {
rc-service)
"$ESCALATION_TOOL" rc-update del "$1"
;;
sv)
"$ESCALATION_TOOL" rm -f "/var/service/$1"
;;
esac
}
@ -64,7 +78,7 @@ startAndEnableService() {
systemctl)
"$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1"
;;
rc-service)
rc-service | sv)
enableService "$1"
startService "$1"
;;
@ -79,7 +93,10 @@ isServiceActive() {
rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
;;
sv)
"$ESCALATION_TOOL" sv status "$1" >/dev/null 2>&1
;;
esac
}
checkInitManager 'systemctl rc-service'
checkInitManager 'systemctl rc-service sv'