punktdateien/install.sh

114 lines
3.9 KiB
Bash
Executable file

#!/bin/bash
# jeremystartm's dotfiles "installer"
if [ ! -f "$HOME/.config/.jstm_dotfiles" ]; then
echo ":: Removing files"
./uninstall.sh &> /dev/null
fi
# utility function
function link() {
if [ -a "${HOME}/${2}" ]; then
[[ -n "$VERBOSE_WARNING" ]] && echo ":: Warning: ${2} already exists."
else
echo ":: Linking ${2}"
ln -s "$(pwd)/${1}" "${HOME}/${2}"
fi
}
# update/clone repositories
[[ ! -d "repositories/dracula-mc" ]] && git clone "https://github.com/dracula/midnight-commander.git" repositories/dracula-mc
(
cd repositories/dracula-mc || (
echo ":: Error: Can't cd into repositories/dracula-mc"
exit 1
)
git pull
)
[[ ! -d "repositories/jstmbash" ]] && git clone "https://git.staropensource.de/JeremyStarTM/jstmbash.git" repositories/jstmbash
(
cd repositories/jstmbash || (
echo ":: Error: Can't cd into repositories/jstmbash"
exit 1
)
git pull
)
# create directories
mkdir -p "${HOME}/.local/share/mc/skins" "${HOME}/.local/bin" "${HOME}/.config/xdg-desktop-portal" "/home/jeremystartm/.config/GIMP/2.10"
# repositories
link "repositories/dracula-mc/skins/dracula.ini" ".local/share/mc/skins/dracula.ini"
link "repositories/dracula-mc/skins/dracula256.ini" ".local/share/mc/skins/dracula256.ini"
link "repositories/jstmbash" ".jstmbash"
# bash
link "bash/bashrc" ".bashrc"
link "bash/bashrc.d" ".bashrc.d"
link "bash/bin/launch-menu" ".local/bin/launch-menu"
link "bash/jobrunner/daemon.sh" ".local/bin/jobrunner"
link "bash/jobrunner/runjob.sh" ".local/bin/jobrunner-runjob"
link "bash/jstmbash.config.env" ".config/jstmbash.env"
link "bash/starship.toml" ".config/starship.toml"
# programs
link "programs/btop" ".config/btop"
link "programs/gitui" ".config/gitui"
link "programs/gimp/splashes" ".config/GIMP/2.10/splashes"
link "programs/konsole" ".local/share/konsole"
link "programs/midnightcommander/config" ".config/mc"
link "programs/midnightcommander/share" ".local/share/mc"
link "programs/mpv" ".config/mpv"
# gui
link "gui/fnott" ".config/fnott"
link "gui/hypr" ".config/hypr"
link "gui/hypr/hyprland-portals.conf" ".config/xdg-desktop-portal/hyprland-portals.conf"
link "gui/waybar" ".config/waybar"
link "gui/kde/aurorae" ".local/share/aurorae"
link "gui/kde/color-schemes" ".local/share/color-schemes"
link "gui/kde/kdedefaults" ".config/kdedefaults"
link "gui/kde/plasma" ".local/share/plasma"
link "gui/kde/rcfiles/dolphinrc" ".config/dolphinrc"
link "gui/kde/rcfiles/kglobalshortcutsrc" ".config/kglobalshortcutsrc"
link "gui/kde/rcfiles/kiorc" ".config/kiorc"
link "gui/kde/rcfiles/konsolerc" ".config/konsolerc"
link "gui/kde/rcfiles/krunnerrc" ".config/krunnerrc"
link "gui/kde/rcfiles/kservicemenurc" ".config/kservicemenurc"
link "gui/kde/rcfiles/ksplashrc" ".config/ksplashrc"
link "gui/kde/rcfiles/ktimezonedrc" ".config/ktimezonedrc"
link "gui/kde/rcfiles/plasma-localerc" ".config/plasma-localrc"
link "gui/kde/rcfiles/plasma-org.kde.plasma.desktop-appletsrc" ".config/plasma-org.kde.plasma.desktop-appletsrc"
# theming
link "theming/cursors" ".icons"
link "theming/fonts" ".fonts"
link "theming/fontconfig" ".config/fontconfig"
link "theming/icons" ".local/share/icons"
link "theming/kvantum" ".config/Kvantum"
link "theming/neofetch" ".config/neofetch"
link "theming/nwg-look" ".config/nwg-look"
link "theming/qt5ct" ".config/qt5ct"
link "theming/qt6ct" ".config/qt6ct"
link "theming/wallpapers" ".local/share/wallpapers"
# punktdateien scripts
link "bin/install-software" ".local/bin/dotfiles-install-software"
link "bin/updatechecker" ".local/bin/dotfiles-updatechecker"
link "bin/updater" ".local/bin/dotfiles-updater"
# write install file
echo "pls don't remove" > "$HOME/.config/.jstm_dotfiles"
# check for executables
if ! which qt5ct &> /dev/null; then
echo ":: Warning: qt5ct is not in your PATH."
fi
if ! which qt6ct &> /dev/null; then
echo ":: Warning: qt6ct is not in your PATH."
fi
if ! which nwg-look &> /dev/null; then
echo ":: Warning: nwg-look is not in your PATH."
fi