REPO_CHANGES := $(shell git status --porcelain | wc -l) IS_FEDORA := $(shell command -v dnf > /dev/null && test -f /etc/fedora-release; echo $$?) .PHONY: console console: ifneq ($(REPO_CHANGES),0) $(error will not run with a dirty repo. stash or commit changes, or re-run forcing REPO_CHANGES=0.) endif git submodule update --init --recursive cp --update=none local/vimrc-local stow/vim/.vimrc-local cp --update=none local/gitconfig-local stow/git/.config/git/config-local cp --update=none local/local.zsh stow/zsh/.config/zsh/00-local.zsh mkdir -p ${HOME}/.local/share/zsh stow --adopt --dir=stow --target=$(HOME) console-utils stow --adopt --dir=stow --target=$(HOME) dircolors stow --adopt --dir=stow --target=$(HOME) git stow --adopt --dir=stow --target=$(HOME) vim stow --adopt --dir=stow --target=$(HOME) zsh .PHONY: fedora-packages fedora-packages: ifneq ($(IS_FEDORA),0) $(warning not fedora workstation, skipping.) else sudo dnf install \ "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(shell rpm -E %fedora).noarch.rpm" \ "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(shell rpm -E %fedora).noarch.rpm" sudo dnf install \ sway waybar rofi-wayland foot mako intel-one-mono-fonts \ udiskie libappindicator-gtk3 python3-b2sdk pass passmenu \ vlc unzip vim wget git zsh stow dnf-automatic \ grimshot pulseaudio-utils thunar pavucontrol-qt \ network-manager-applet sway-config-fedora blueman endif .PHONY: fedora fedora: console ifneq ($(IS_FEDORA),0) $(warning not fedora workstation, skipping.) else stow --adopt --dir=stow --target=$(HOME) foot stow --adopt --dir=stow --target=$(HOME) mako stow --adopt --dir=stow --target=$(HOME) rofi stow --adopt --dir=stow --target=$(HOME) sway stow --adopt --dir=stow --target=$(HOME) swaylock stow --adopt --dir=stow --target=$(HOME) udiskie stow --adopt --dir=stow --target=$(HOME) waybar stow --adopt --dir=stow --target=$(HOME) xdg-names ifeq ($(shell systemctl --user is-active sway-session.target),active) systemctl --user enable --now udiskie.service systemctl --user enable --now xdg-names.service else systemctl --user enable udiskie.service systemctl --user enable xdg-names.service endif sudo systemctl enable --now dnf-automatic-install.timer endif .PHONY: restore restore: git restore stow