PortValhalla/scripts/Common/Config/UserProfile/install.sh

50 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
NEXTCLOUD_DIR="${NEXTCLOUD_DIR:-Nextcloud}";
PROTON_DIR="${PROTON_DIR:-Proton}";
INSTALL_FONTS="${INSTALL_FONTS}";
if [ "$XDG_SESSION_TYPE" = "tty" ]
then
entryPoint=~/.config/autostart/PortValhallaProfile.desktop;
mkdir -p "$(dirname "$entryPoint")";
{
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";
rm ~/.config/plasma-welcomerc;
else
dir="${BASH_SOURCE%/*}";
pushd "$dir" > /dev/null;
. "../../Scripts/is-truthy.sh";
# 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" "2w";
if isTruthy "$INSTALL_FONTS"
then
# Install fonts
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Fonts/NerdFont/install.sh";
fi;
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Oh My Posh/install.sh";
echo "You are done! Please log out!";
read;
popd > /dev/null;
fi;