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

58 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/bash
2023-05-03 19:55:25 +00:00
NEXTCLOUD_DIR="${NEXTCLOUD_DIR:-Nextcloud}";
2024-03-05 14:19:14 +00:00
PROTON_DIR="${PROTON_DIR:-Proton}";
2023-04-01 13:39:29 +00:00
INSTALL_FONTS="${INSTALL_FONTS}";
2024-03-09 20:42:26 +00:00
if [ "$XDG_SESSION_TYPE" = "tty" ]
2023-04-05 09:00:26 +00:00
then
2024-03-09 20:42:26 +00:00
entryPoint=~/.config/autostart/PortValhallaProfile.desktop;
2024-03-10 00:20:04 +00:00
mkdir -p "$(dirname "$entryPoint")";
2023-04-05 09:00:26 +00:00
2024-03-09 20:42:26 +00:00
{
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";
2024-03-09 20:42:26 +00:00
chmod a+x "$entryPoint";
dbus-launch --exit-with-session startplasma-wayland > /dev/null 2>&1;
rm "$entryPoint";
rm ~/.config/plasma-welcomerc;
2024-03-09 20:42:26 +00:00
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;
2023-04-01 13:39:29 +00:00
2024-03-09 20:42:26 +00:00
# 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";
2024-03-09 20:42:26 +00:00
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;