feat: improved setup script

This commit is contained in:
2026-08-21 17:57:34 +02:00
parent 3ca3f2eece
commit ffdf09d173
+37 -3
View File
@@ -13,6 +13,9 @@ echo "
-> WARNING: This will remove the old configurations from the system -> WARNING: This will remove the old configurations from the system
" "
# ┌ ┐
# │ Platform setup │
# └ ┘
if ! [[ -f ~/.config/janishutz/platform ]]; then if ! [[ -f ~/.config/janishutz/platform ]]; then
platform="" platform=""
read -p "Choose on the platform (l/D): " platform read -p "Choose on the platform (l/D): " platform
@@ -24,16 +27,23 @@ if ! [[ -f ~/.config/janishutz/platform ]]; then
echo "n" >~/.config/janishutz/docked echo "n" >~/.config/janishutz/docked
fi fi
# ┌ ┐
# │ System config file │
# └ ┘
# (currently only env)
confirmation="" confirmation=""
read -p "Also install the system-wide environment file? (y/N) " confirmation read -p "Also install the system-wide environment file? (y/N) " confirmation
if [[ "$confirmation" == "y" ]]; then if [[ "$confirmation" == "y" ]]; then
sudo cp ./system/environment /etc/environment sudo cp ./system/environment /etc/environment
fi fi
# ┌ ┐
# │ Install configs │
# └ ┘
rm -rf ~/.config/hypr/*.conf rm -rf ~/.config/hypr/*.conf
rm ~/.config/platform || true rm ~/.config/platform &> /dev/null || true
rm -rf ~/.config/ags || true rm -rf ~/.config/ags &> /dev/null || true
rm -rf ~/.config/astal || true rm -rf ~/.config/astal &> /dev/null || true
cp -r ./config/* ~/.config cp -r ./config/* ~/.config
@@ -42,4 +52,28 @@ cp ./config/zsh/.zshrc ~/.zshrc
rm ~/.config/kitty/current-theme.conf rm ~/.config/kitty/current-theme.conf
cp ./linters/indentconfig_import.yaml ~/.indentconfig.yaml 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 hyprctl reload