dotfiles/setup

109 lines
4.1 KiB
Bash
Executable File

#!/bin/sh
# ───────────────────────────────────────────────────────────────────
# ╭────────────────────────────────────────────────╮
# │ Setup Script for janishutz Hyprland │
# ╰────────────────────────────────────────────────╯
# ───────────────────────────────────────────────────────────────────
echo "
_ _ _ _ _ _
_ _ ( ) ( )_ ( ) ( ) (_ ) ( )
(_) _ _ ___ (_) ___| |__ _ _| _)____ | |_| |_ _ _ _ _ __ | | _ _ ___ _| |
| |/ _ ) _ \ | __) _ \ ) ( ) | (_ ) | _ | ) ( ) _ \( __)| | / _ ) _ \/ _ |
| | (_| | ( ) | |__ \ | | | (_) | |_ / /_ | | | | (_) | (_) ) | | |( (_| | ( ) | (_| |
_ | |\__ _)_) (_)_)____/_) (_)\___/ \__)____) (_) (_)\__ | __/(_) (___)\__ _)_) (_)\__ _)
( )_| | ( )_| | |
\___/ \___/(_)
=> Setup script. This script is used to:
-> Set up configs initially
-> Regenerate the themes
-> Install new versions
"
trap 'echo -e "\nCaught Ctrl+C, exiting..."; exit 1' SIGINT
# Read platform to install on (only if no platform file present in ~/.config/)
platform=""
if [[ -f ~/.config/platform ]]; then
echo "Config type already selected, skipping"
platform=$(cat ~/.config/platform)
else
read -p "Choose the configs to install, Laptop or Desktop (l/D): " platform
echo "$platform" > ~/.config/platform
fi
platform=$(echo "$platform" | tr '[:upper:]' '[:lower:]')
# Get user preference for regenerating the styling
regen=""
read -p "Would you like to regenerate styling? (y/N) " regen
if [ $regen == "y" ]; then
cd build
node build.js
if [ $? -ne 0 ]; then
echo -e "\nCaught Ctrl+C, exiting...."
exit 130
fi
cd ..
fi
echo "=> Moving configs to correct destinations"
killall swaybg
cp -r ./config/fish ~/.config/
cp -r ./config/hypr ~/.config/
# Depending on platform, remove one or the other config and rename remaining one
if [[ "$platform" == "d" ]]; then
mv ~/.config/hypr/hyprland_desktop.conf ~/.config/hypr/hyprland.conf
rm ~/.config/hypr/hyprland_*
echo "Running on desktop"
else
mv ~/.config/hypr/hyprland_laptop.conf ~/.config/hypr/hyprland.conf
rm ~/.config/hypr/hyprland_*
fi
cp -r ./config/kitty ~/.config/
cp -r ./config/fastfetch ~/.config/
cp -r ./config/lazygit ~/.config/
cp -r ./config/mpv ~/.config/
cp -r ./config/Thunar ~/.config/
cp -r ./config/wlogout/ ~/.config/
cp -r ./config/yazi ~/.config/
cp -r ./config/zathura ~/.config/
echo "
=> Bundling Astal projects
"
echo "
=> Installing yazi plugins
"
ya pack -i
echo "
=> Installing GTK Theme
"
sudo rm -rf /usr/share/themes/Adaptive-Theme/
sudo mkdir /usr/share/themes/Adaptive-Theme/
sudo cp -r ./gtk-theme/dist/* /usr/share/themes/Adaptive-Theme/
echo "
=> Installing System Configs
"
sudo cp ./system/environment /etc/environment
hyprctl reload
echo "
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▀██░▄▄▄░██░▀██░██░▄▄▄
██░██░██░███░██░█░█░██░▄▄▄
██░▀▀░██░▀▀▀░██░██▄░██░▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
=> All configs installed. Reboot
for them to apply properly
"