From 3eb3f677282ba8bedae7348655255200929d7de9 Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Tue, 25 Jul 2023 09:58:46 -0600 Subject: [PATCH] fix(decky): Ensure we retrieve the user's home directory Each newline in a just recipe instantiates a new shell unless we explicitly define the environment. Similarly, because of this limitation, we need to retrieve the users home directory (since we are executing this recipe with sudo) so that it does not assume that the user is root We will have to do this in the future for other recipes that depend on the environment being preserved. Further, I ran into a limitation where global env variables must be strings/characters. We can not reuse these variables either so they must be declared for each recipe See: https://just.systems/man/en/chapter_44.html --- system_files/deck/usr/share/ublue-os/just/custom.just | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system_files/deck/usr/share/ublue-os/just/custom.just b/system_files/deck/usr/share/ublue-os/just/custom.just index c7e9eb31..5ac44200 100644 --- a/system_files/deck/usr/share/ublue-os/just/custom.just +++ b/system_files/deck/usr/share/ublue-os/just/custom.just @@ -15,6 +15,8 @@ create-steam-shortcuts: cp /etc/skel.d/Desktop/Return.desktop ~/Desktop get-decky: + #!/usr/bin/env bash + export HOME=$(getent passwd ${SUDO_USER:-$USER} | cut -d: -f6) curl -L https://github.com/SteamDeckHomebrew/decky-installer/releases/latest/download/install_release.sh | sh sudo chcon -R -t bin_t $HOME/homebrew/services/PluginLoader