diff options
| author | Derek J. Clark <derkejohn.clark@gmail.com> | 2022-08-08 11:32:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-08 11:32:14 -0700 |
| commit | 20094c5f752046a33287ef372fa973e919e83226 (patch) | |
| tree | ed298251be183fc5f3151b19a10f7499c7d66e0d /dist/install_nightly.sh | |
| parent | 198591dbd7b0b6dd311ab9265d4cda4a733ee280 (diff) | |
| download | decky-loader-20094c5f752046a33287ef372fa973e919e83226.tar.gz decky-loader-20094c5f752046a33287ef372fa973e919e83226.zip | |
Use Environment Variables (#123)
Uses environment variables instead of hard coding the "deck" user/group.
This adds support for systems other than the steam deck that are using the DeckUI.
* Use Environment Variables
* Use method to get USER from a systemd root process
* Fix imports. Add get_user and get_user_group methods in helpers.py. Removed duplicated code
* Add separate setters/getters for user vars. Ensure sleep prevents race condition of user setter in while loop
Diffstat (limited to 'dist/install_nightly.sh')
| -rw-r--r-- | dist/install_nightly.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dist/install_nightly.sh b/dist/install_nightly.sh index 7fc34195..ca80cb27 100644 --- a/dist/install_nightly.sh +++ b/dist/install_nightly.sh @@ -4,12 +4,13 @@ echo "Installing Steam Deck Plugin Loader nightly..." -HOMEBREW_FOLDER=/home/deck/homebrew +USER_DIR="$(getent passwd $SUDO_USER | cut -d: -f6)" +HOMEBREW_FOLDER="${USER_DIR}/homebrew" # Create folder structure rm -rf ${HOMEBREW_FOLDER}/services -sudo -u deck mkdir -p ${HOMEBREW_FOLDER}/services -sudo -u deck mkdir -p ${HOMEBREW_FOLDER}/plugins +sudo -u $SUDO_USER mkdir -p "${HOMEBREW_FOLDER}/services" +sudo -u $SUDO_USER mkdir -p "${HOMEBREW_FOLDER}/plugins" # Download latest nightly build and install it rm -rf /tmp/plugin_loader @@ -22,7 +23,7 @@ chmod +x ${HOMEBREW_FOLDER}/services/PluginLoader systemctl --user stop plugin_loader 2> /dev/null systemctl --user disable plugin_loader 2> /dev/null -rm -f /home/deck/.config/systemd/user/plugin_loader.service +rm -f ${USER_DIR}/.config/systemd/user/plugin_loader.service systemctl stop plugin_loader 2> /dev/null systemctl disable plugin_loader 2> /dev/null @@ -37,10 +38,9 @@ Type=simple User=root Restart=always -ExecStart=/home/deck/homebrew/services/PluginLoader -WorkingDirectory=/home/deck/homebrew/services - -Environment=PLUGIN_PATH=/home/deck/homebrew/plugins +ExecStart=${HOMEBREW_FOLDER}/services/PluginLoader +WorkingDirectory=${HOMEBREW_FOLDER}/services +Environment=PLUGIN_PATH=${HOMEBREW_FOLDER}/plugins [Install] WantedBy=multi-user.target |
