Not use setups-selector but 2.setups.sh

This commit is contained in:
clsty
2025-11-10 08:56:07 +08:00
parent fb7dbaa187
commit 74941d15bf
8 changed files with 66 additions and 224 deletions
-15
View File
@@ -1,15 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
v sudo usermod -aG video,i2c,input "$(whoami)"
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
v systemctl --user enable ydotool --now
v sudo systemctl enable bluetooth --now
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
-15
View File
@@ -1,15 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
v sudo usermod -aG video,i2c,input "$(whoami)"
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
v systemctl --user enable ydotool --now
v sudo systemctl enable bluetooth --now
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
-19
View File
@@ -1,19 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
v sudo usermod -aG video,input "$(whoami)"
v mkdir -p "${XDG_CONFIG_HOME}/systemd/user"
v ln -s /usr/lib/systemd/system/ydotool.service "${XDG_CONFIG_HOME}/systemd/user/ydotool.service"
v bash -c "echo uinput | sudo tee /etc/modules-load.d/uinput.conf"
v bash -c 'echo SUBSYSTEM==\"misc\", KERNEL==\"uinput\", MODE=\"0660\", GROUP=\"input\" |
sudo tee /etc/udev/rules.d/99-uinput.rules'
v systemctl --user enable ydotool
v sudo systemctl enable bluetooth --now
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
-39
View File
@@ -1,39 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
if [[ -z $(getent group i2c) ]]; then
v sudo groupadd i2c
fi
v sudo usermod -aG video,i2c,input "$(whoami)"
if [[ ! -z $(systemctl --version) ]]; then
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
v systemctl --user enable ydotool --now
v sudo systemctl enable bluetooth --now
elif [[ ! -z $(openrc --version) ]]; then
v bash -c "echo 'modules=i2c-dev' | sudo tee -a /etc/conf.d/modules"
v sudo rc-update add modules boot
v sudo rc-update add ydotool default
v sudo rc-update add bluetooth default
x sudo rc-service ydotool start
x sudo rc-service bluetooth start
else
printf "${STY_RED}"
printf "====================INIT SYSTEM NOT FOUND====================\n"
printf "${STY_RST}"
pause
fi
v sudo chown -R $(whoami):$(whoami) ~/.config/hypr/
v sudo chown -R $(whoami):$(whoami) ~/.config/quickshell/
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
-39
View File
@@ -1,39 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
if [[ -z $(getent group i2c) ]]; then
v sudo groupadd i2c
fi
v sudo usermod -aG video,i2c,input "$(whoami)"
if [[ ! -z $(systemctl --version) ]]; then
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
# TODO: find a proper way for enable Nix installed ydotool
if ! [[ "${INSTALL_VIA_NIX}" == true ]]; then
v systemctl --user enable ydotool --now
fi
v sudo systemctl enable bluetooth --now
elif [[ ! -z $(openrc --version) ]]; then
v bash -c "echo 'modules=i2c-dev' | sudo tee -a /etc/conf.d/modules"
v sudo rc-update add modules boot
v sudo rc-update add ydotool default
v sudo rc-update add bluetooth default
x sudo rc-service ydotool start
x sudo rc-service bluetooth start
else
printf "${STY_RED}"
printf "====================INIT SYSTEM NOT FOUND====================\n"
printf "${STY_RST}"
pause
fi
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
-95
View File
@@ -1,95 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
printf "${STY_CYAN}[$0]: 2. Setup for permissions/services etc\n${STY_RST}"
# shellcheck shell=bash
####################
# Detect distro
# Helpful link(s):
# http://stackoverflow.com/questions/29581754
# https://github.com/which-distro/os-release
export OS_RELEASE_FILE=${OS_RELEASE_FILE:-/etc/os-release}
test -f ${OS_RELEASE_FILE} || \
( echo "${OS_RELEASE_FILE} does not exist. Aborting..." ; exit 1 ; )
export OS_DISTRO_ID=$(awk -F'=' '/^ID=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null)
export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null)
if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
TARGET_ID=nix
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "The process is still WIP.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RST}"
pause
source ./sdata/dist-${TARGET_ID}/install-setups.sh
elif [[ "$OS_DISTRO_ID" == "arch" ]]; then
TARGET_ID=arch
printf "${STY_GREEN}"
printf "===INFO===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "\n"
printf "${STY_RST}"
pause
source ./sdata/dist-${TARGET_ID}/install-setups.sh
elif [[ -f "./sdata/dist-${OS_DISTRO_ID}/install-setups.sh" ]]; then
TARGET_ID=${OS_DISTRO_ID}
printf "${STY_PURPLE}"
printf "===NOTICE===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "This file is provided by the community.\n"
printf "It is not officially supported by github:end-4/dots-hyprland .\n"
printf "${STY_INVERT}"
printf "If you find out any problems about it, PR is welcomed if you are able to address it. Or, create a discussion about it, but please do not submit issue, because the developers do not use this distro, therefore they cannot help.${STY_RST}\n"
printf "${STY_PURPLE}"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RST}"
pause
source ./sdata/dist-${TARGET_ID}/install-setups.sh
elif [[ "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then
TARGET_ID=arch
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n"
printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "Ideally, it should also work for your distro.\n"
printf "Still, there is a chance that it not works as expected or even fails.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RST}"
pause
source ./sdata/dist-${TARGET_ID}/install-setups.sh
else
TARGET_ID=fallback
printf "${STY_RED}"
printf "===WARNING===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n"
printf "./sdata/dist-${OS_DISTRO_ID}/install-setups.sh not found.\n"
printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "It might fail or disrupt your system.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RST}"
pause
source ./sdata/dist-${TARGET_ID}/install-setups.sh
fi
+64
View File
@@ -0,0 +1,64 @@
# This script is meant to be sourced.
# It's not for directly running.
function prepare_systemd_user_service(){
if [[ ! -d "${XDG_CONFIG_HOME}/systemd/user" ]]; then
x mkdir -p "${XDG_CONFIG_HOME}/systemd/user"
fi
if [[ ! -e "${XDG_CONFIG_HOME}/systemd/user/ydotool.service" ]]; then
x ln -s /usr/lib/systemd/system/ydotool.service "${XDG_CONFIG_HOME}/systemd/user/ydotool.service"
fi
}
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
if [[ -z $(getent group i2c) ]]; then
v sudo groupadd i2c
fi
v sudo usermod -aG video,i2c,input "$(whoami)"
if [[ ! -z $(systemctl --version) ]]; then
if [[ "$OS_DISTRO_ID" == "fedora" ]]; then
v bash -c "echo uinput | sudo tee /etc/modules-load.d/uinput.conf"
v bash -c 'echo SUBSYSTEM==\"misc\", KERNEL==\"uinput\", MODE=\"0660\", GROUP=\"input\" | sudo tee /etc/udev/rules.d/99-uinput.rules'
else
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
fi
# TODO: find a proper way for enable Nix installed ydotool. When running `systemctl --user enable ydotool, it errors "Failed to enable unit: Unit ydotool.service does not exist".
if [[ ! "${INSTALL_VIA_NIX}" == true ]]; then
if [[ "$OS_DISTRO_ID" == "fedora" ]]; then
v prepare_systemd_user_service
fi
# When $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR are empty, it commonly means that the current user has been logged in with `su - user` or `ssh user@hostname`. In such case `systemctl --user enable <service>` is not usable. It should be `sudo systemctl --machine=$(whoami)@.host --user enable <service>` instead.
if [[ ! -z "${DBUS_SESSION_BUS_ADDRESS}" ]]; then
v systemctl --user enable ydotool --now
else
v sudo systemctl --machine=$(whoami)@.host --user enable ydotool --now
fi
fi
v sudo systemctl enable bluetooth --now
elif [[ ! -z $(openrc --version) ]]; then
v bash -c "echo 'modules=i2c-dev' | sudo tee -a /etc/conf.d/modules"
v sudo rc-update add modules boot
v sudo rc-update add ydotool default
v sudo rc-update add bluetooth default
x sudo rc-service ydotool start
x sudo rc-service bluetooth start
else
printf "${STY_RED}"
printf "====================INIT SYSTEM NOT FOUND====================\n"
printf "${STY_RST}"
pause
fi
if [[ "$OS_DISTRO_ID" == "gentoo" ]]; then
v sudo chown -R $(whoami):$(whoami) ~/.config/hypr/
v sudo chown -R $(whoami):$(whoami) ~/.config/quickshell/
fi
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
+2 -2
View File
@@ -70,7 +70,7 @@ case ${SUBCMD_NAME} in
source ${SUBCMD_DIR}/1.deps-selector.sh
fi
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
source ${SUBCMD_DIR}/2.setups-selector.sh
source ${SUBCMD_DIR}/2.setups.sh
fi
if [[ "${SKIP_ALLFILES}" != true ]]; then
source ${SUBCMD_DIR}/3.files.sh
@@ -83,7 +83,7 @@ case ${SUBCMD_NAME} in
;;
install-setups)
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
source ${SUBCMD_DIR}/2.setups-selector.sh
source ${SUBCMD_DIR}/2.setups.sh
fi
;;
install-files)