Skip to content

Commit 74941d1

Browse files
committed
Not use setups-selector but 2.setups.sh
1 parent fb7dbaa commit 74941d1

File tree

8 files changed

+66
-224
lines changed

8 files changed

+66
-224
lines changed

sdata/dist-arch/install-setups.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

sdata/dist-fallback/install-setups.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

sdata/dist-fedora/install-setups.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

sdata/dist-gentoo/install-setups.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

sdata/dist-nix/install-setups.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

sdata/subcmd-install/2.setups-selector.sh

Lines changed: 0 additions & 95 deletions
This file was deleted.

sdata/subcmd-install/2.setups.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This script is meant to be sourced.
2+
# It's not for directly running.
3+
4+
function prepare_systemd_user_service(){
5+
if [[ ! -d "${XDG_CONFIG_HOME}/systemd/user" ]]; then
6+
x mkdir -p "${XDG_CONFIG_HOME}/systemd/user"
7+
fi
8+
if [[ ! -e "${XDG_CONFIG_HOME}/systemd/user/ydotool.service" ]]; then
9+
x ln -s /usr/lib/systemd/system/ydotool.service "${XDG_CONFIG_HOME}/systemd/user/ydotool.service"
10+
fi
11+
}
12+
#####################################################################################
13+
# 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.
14+
showfun install-python-packages
15+
v install-python-packages
16+
17+
if [[ -z $(getent group i2c) ]]; then
18+
v sudo groupadd i2c
19+
fi
20+
v sudo usermod -aG video,i2c,input "$(whoami)"
21+
22+
if [[ ! -z $(systemctl --version) ]]; then
23+
if [[ "$OS_DISTRO_ID" == "fedora" ]]; then
24+
v bash -c "echo uinput | sudo tee /etc/modules-load.d/uinput.conf"
25+
v bash -c 'echo SUBSYSTEM==\"misc\", KERNEL==\"uinput\", MODE=\"0660\", GROUP=\"input\" | sudo tee /etc/udev/rules.d/99-uinput.rules'
26+
else
27+
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
28+
fi
29+
# 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".
30+
if [[ ! "${INSTALL_VIA_NIX}" == true ]]; then
31+
if [[ "$OS_DISTRO_ID" == "fedora" ]]; then
32+
v prepare_systemd_user_service
33+
fi
34+
# 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.
35+
if [[ ! -z "${DBUS_SESSION_BUS_ADDRESS}" ]]; then
36+
v systemctl --user enable ydotool --now
37+
else
38+
v sudo systemctl --machine=$(whoami)@.host --user enable ydotool --now
39+
fi
40+
fi
41+
v sudo systemctl enable bluetooth --now
42+
elif [[ ! -z $(openrc --version) ]]; then
43+
v bash -c "echo 'modules=i2c-dev' | sudo tee -a /etc/conf.d/modules"
44+
v sudo rc-update add modules boot
45+
v sudo rc-update add ydotool default
46+
v sudo rc-update add bluetooth default
47+
48+
x sudo rc-service ydotool start
49+
x sudo rc-service bluetooth start
50+
else
51+
printf "${STY_RED}"
52+
printf "====================INIT SYSTEM NOT FOUND====================\n"
53+
printf "${STY_RST}"
54+
pause
55+
fi
56+
57+
if [[ "$OS_DISTRO_ID" == "gentoo" ]]; then
58+
v sudo chown -R $(whoami):$(whoami) ~/.config/hypr/
59+
v sudo chown -R $(whoami):$(whoami) ~/.config/quickshell/
60+
fi
61+
62+
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
63+
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
64+
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly

setup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ case ${SUBCMD_NAME} in
7070
source ${SUBCMD_DIR}/1.deps-selector.sh
7171
fi
7272
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
73-
source ${SUBCMD_DIR}/2.setups-selector.sh
73+
source ${SUBCMD_DIR}/2.setups.sh
7474
fi
7575
if [[ "${SKIP_ALLFILES}" != true ]]; then
7676
source ${SUBCMD_DIR}/3.files.sh
@@ -83,7 +83,7 @@ case ${SUBCMD_NAME} in
8383
;;
8484
install-setups)
8585
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
86-
source ${SUBCMD_DIR}/2.setups-selector.sh
86+
source ${SUBCMD_DIR}/2.setups.sh
8787
fi
8888
;;
8989
install-files)

0 commit comments

Comments
 (0)