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.