Files
dotfiles/setup.sh
T

79 lines
2.6 KiB
Bash
Executable File

#!/bin/sh
echo "
_ _ ( ) ( )_
(_) _ _ ___ (_) ___| |__ _ _| _)____
| |/ _ ) _ \ | __) _ \ ) ( ) | (_ )
| | (_| | ( ) | |__ \ | | | (_) | |_ / /_
_ | |\__ _)_) (_)_)____/_) (_)\___/ \__)____)
( )_| |
\___/
=> Setup + Theming script <=
"
# ┌ ┐
# │ Platform setup │
# └ ┘
if ! [[ -f ~/.config/janishutz/platform ]]; then
platform=""
read -p "Choose on the platform (l/D): " platform
mkdir ~/.config/janishutz
if [ $platform != "l" ]; then
platform="d"
fi
echo "$platform" >~/.config/janishutz/platform
echo "n" >~/.config/janishutz/docked
fi
# ┌ ┐
# │ System config file │
# └ ┘
# (currently only env)
confirmation=""
read -p "Also install the system-wide environment file? (y/N) " confirmation
if [[ "$confirmation" == "y" ]]; then
sudo cp ./system/environment /etc/environment
fi
# ┌ ┐
# │ Install configs │
# └ ┘
rm -rf ~/.config/hypr/*.conf
rm ~/.config/platform &> /dev/null || true
rm -rf ~/.config/ags &> /dev/null || true
rm -rf ~/.config/astal &> /dev/null || true
cp -r ./config/* ~/.config
cp ./config/zsh/.zshrc ~/.zshrc
# Makes kitty use the matugen theme config
rm ~/.config/kitty/current-theme.conf
cp ./linters/indentconfig_import.yaml ~/.indentconfig.yaml
# ┌ ┐
# │ Theming │
# └ ┘
# Picker works via argument and open bind in Yazi (set image via Ctrl + W)
# If no image is specified, then the previous one is used
# If no image was used previously and none is specified, an error is raised
if [[ -n $1 ]]; then
matugen image --prefer value $1
mkdir ~/.local/state/janishutz &> /dev/null || true
echo "$1" >~/.local/state/janishutz/imgcache
else
if ! [[ -f ~/.local/state/janishutz/imgcache ]]; then
echo "No image to use for theme generation specified, aborting"
exit 1
else
echo "Falling back to previous image"
matugen image --prefer value $(cat ~/.local/state/janishutz/imgcache)
fi
fi
killall hyprpaper &>/dev/null
hyprpaper &>/dev/null &
disown
hyprctl reload