From a5f91f51ed3010ed37baa3a4010c19fbcd5f84b3 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 9 Mar 2024 21:42:26 +0100 Subject: [PATCH] Configure remotes in plasma session --- scripts/Common/Config/UserProfile/install.sh | 70 ++++++++++++++------ 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/scripts/Common/Config/UserProfile/install.sh b/scripts/Common/Config/UserProfile/install.sh index 6adbb202..3ff6c705 100755 --- a/scripts/Common/Config/UserProfile/install.sh +++ b/scripts/Common/Config/UserProfile/install.sh @@ -2,28 +2,54 @@ NEXTCLOUD_DIR="${NEXTCLOUD_DIR:-Nextcloud}"; PROTON_DIR="${PROTON_DIR:-Proton}"; INSTALL_FONTS="${INSTALL_FONTS}"; -dir="${BASH_SOURCE%/*}"; -pushd "$dir" > /dev/null; -. "../../Scripts/is-truthy.sh"; -if isTruthy "$INSTALL_FONTS" +if [ "$XDG_SESSION_TYPE" = "tty" ] then - # Microsoft Windows Fonts - source "../Fonts/MicrosoftFonts/install.sh"; + entryPoint=~/.config/autostart/PortValhallaProfile.desktop; + + { + echo "#!/usr/bin/env xdg-open"; + echo "[Desktop Entry]"; + echo "Name=PortValhalla Profile"; + echo "Type=Application"; + echo "Terminal=false"; + echo -n "Exec=env " + echo -n "NEXTCLOUD_DIR=\"${NEXTCLOUD_DIR}\" "; + echo -n "PROTON_DIR=\"${PROTON_DIR}\" "; + echo -n "INSTALL_FONTS=\"${INSTALL_FONTS}\" "; + echo -n "konsole -e bash -e $(realpath $BASH_SOURCE)"; + } > "$entryPoint"; + + chmod a+x "$entryPoint"; + dbus-launch --exit-with-session startplasma-wayland > /dev/null 2>&1; + rm "$entryPoint"; +else + dir="${BASH_SOURCE%/*}"; + pushd "$dir" > /dev/null; + . "../../Scripts/is-truthy.sh"; + + if isTruthy "$INSTALL_FONTS" + then + # Microsoft Windows Fonts + source "../Fonts/MicrosoftFonts/install.sh"; + fi; + + # Sync clouds + echo "Please complete the setup of your profile!"; + NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" . "../rclone/InstallSync.sh" nextcloud "$NEXTCLOUD_DIR"; + PROTON_DIR="${PROTON_DIR}" . "../rclone/InstallSync.sh" proton "$PROTON_DIR"; + + if isTruthy "$INSTALL_FONTS" + then + # Install fonts + NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Fonts/NerdFont/install.sh"; + fi; + + source "../bash/oh-my-posh.sh"; + source "../fish/oh-my-posh.sh"; + NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Oh My Posh/install.sh"; + echo "You are done! Please log out!"; + read; + + popd > /dev/null; fi; - -# Sync clouds -NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" . "../rclone/InstallSync.sh" nextcloud "$NEXTCLOUD_DIR"; -PROTON_DIR="${PROTON_DIR}" . "../rclone/InstallSync.sh" proton "$PROTON_DIR"; - -if isTruthy "$INSTALL_FONTS" -then - # Install fonts - NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Fonts/NerdFont/install.sh"; -fi; - -source "../bash/oh-my-posh.sh"; -source "../fish/oh-my-posh.sh"; -NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Oh My Posh/install.sh"; - -popd > /dev/null;