From 8574dbcb02d85d58b63e3e1bd16027b008ebd975 Mon Sep 17 00:00:00 2001 From: Elysia <1391048988@qq.com> Date: Sun, 16 Nov 2025 19:45:59 +0800 Subject: [PATCH] This may improve compatibility --- sdata/subcmd-install/2.setups.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sdata/subcmd-install/2.setups.sh b/sdata/subcmd-install/2.setups.sh index 2e585832c..adb7c08a5 100644 --- a/sdata/subcmd-install/2.setups.sh +++ b/sdata/subcmd-install/2.setups.sh @@ -2,19 +2,22 @@ # 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" + if [[ ! -e "/usr/lib/systemd/user/ydotool.service" ]]; then + x ln -s /usr/lib/systemd/{system,user}/ydotool.service fi } function setup_user_group(){ - if [[ -z $(getent group i2c) ]]; then + if [[ -z $(getent group i2c) ]] && [[ "$OS_GROUP_ID" != "fedora" ]]; then x sudo groupadd i2c fi - x sudo usermod -aG video,i2c,input "$(whoami)" + + if [[ "$OS_GROUP_ID" == "fedora" ]]; then + # TODO: I'm not sure what the video group is for. I didn't join it, and it doesn't seem to be affecting anything. I may need to remove it later + x sudo usermod -aG video,input "$(whoami)" + else + x sudo usermod -aG video,i2c,input "$(whoami)" + 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.