2025-09-18 19:54:02 -04:00
|
|
|
# Define list of directories you want to stow
|
2026-05-14 18:15:30 -04:00
|
|
|
CONFIG_DIRS := btop doom hypr kitty local nvim rclone starship tmux wallpapers waybar wireplumber wofi yazi zsh
|
2025-09-18 19:54:02 -04:00
|
|
|
|
2026-05-20 14:31:04 -04:00
|
|
|
# Local stow package directory (installed to ~/.local)
|
|
|
|
|
STOW_LOCAL_DIR := local
|
|
|
|
|
|
2025-09-18 19:54:02 -04:00
|
|
|
all: stow_all
|
|
|
|
|
wal -i ~/.config/wallpapers/green_yellow_forest.jpg -o ~/.config/waybar/launch.sh
|
|
|
|
|
neofetch
|
|
|
|
|
|
2026-05-20 14:31:04 -04:00
|
|
|
.PHONY: all stow_all stow_local stow_rclone post_install_rclone clean
|
|
|
|
|
|
2025-09-18 19:54:02 -04:00
|
|
|
# Main target to handle stowing for all directories except rclone
|
|
|
|
|
stow_all: $(filter-out rclone, $(CONFIG_DIRS))
|
|
|
|
|
@echo "Cleaning broken symlinks in ~/.config..."
|
|
|
|
|
find ~/.config -xtype l -delete -print
|
|
|
|
|
@echo "Removing symlink ~/.zshrc if it exists..."
|
|
|
|
|
@if [ -L $$HOME/.zshrc ]; then rm $$HOME/.zshrc; fi
|
|
|
|
|
@echo "Removing symlink ~/.tmux.conf if it exists..."
|
|
|
|
|
@if [ -L $$HOME/.tmux.conf ]; then rm $$HOME/.tmux.conf; fi
|
|
|
|
|
@echo "Stowing all configurations except rclone..."
|
|
|
|
|
@$(foreach dir,$(filter-out rclone, $(CONFIG_DIRS)), $(MAKE) stow_$(dir);)
|
|
|
|
|
|
|
|
|
|
# Generic stow command for user-scoped directories
|
|
|
|
|
stow_%:
|
|
|
|
|
@echo "Stowing $*"
|
|
|
|
|
stow -v -t $(HOME) $*
|
|
|
|
|
|
2026-05-20 14:31:04 -04:00
|
|
|
# Special target for the local stow package
|
|
|
|
|
stow_local:
|
|
|
|
|
@echo "Cleaning broken symlinks in ~/.local/share/applications..."
|
|
|
|
|
find ~/.local/share/applications -xtype l -delete -print
|
|
|
|
|
@echo "Stowing local package"
|
|
|
|
|
stow -v -t $(HOME) $(STOW_LOCAL_DIR)
|
|
|
|
|
|
2025-09-18 19:54:02 -04:00
|
|
|
# Post-installation script for rclone (executed after stowing)
|
|
|
|
|
post_install_rclone:
|
|
|
|
|
@echo "Running post-installation script for rclone"
|
|
|
|
|
@bash $(CURDIR)/scripts/rclone_post_install.sh
|
|
|
|
|
|
|
|
|
|
# Special target for rclone to run post-install after stowing
|
|
|
|
|
stow_rclone:
|
|
|
|
|
@echo "Cleaning broken symlinks in ~/.config/rclone/..."
|
|
|
|
|
find ~/.config/rclone/ -xtype l -delete -print
|
|
|
|
|
@echo "Removing symlink ~/.local/bin/rclone_mount_check.sh if it exists..."
|
|
|
|
|
@if [ -L $$HOME/.local/bin/rclone_mount_check.sh ]; then rm $$HOME/.local/bin/rclone_mount_check.sh; fi
|
|
|
|
|
@echo "Stowing rclone"
|
|
|
|
|
stow -v -t $(HOME) rclone
|
|
|
|
|
@$(MAKE) post_install_rclone
|
2026-05-20 14:31:04 -04:00
|
|
|
|
|
|
|
|
# Unstow all packages
|
|
|
|
|
clean:
|
|
|
|
|
@echo "Unstowing all packages..."
|
|
|
|
|
@for dir in $(CONFIG_DIRS); do \
|
|
|
|
|
echo "Unstowing $$dir..."; \
|
|
|
|
|
stow -v -D -t $(HOME) $$dir 2>/dev/null || true; \
|
|
|
|
|
done
|