From 4008fa4f12d6688c580a78980e4722899a84498c Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Fri, 12 Apr 2024 16:06:30 -0500 Subject: Update Makefile to manage fedora/sway-de config --- Makefile | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bbdaf73..6f6fc48 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,66 @@ REPO_CHANGES := $(shell git status --porcelain | wc -l) +DEV_MODE := 0 +IS_FEDORA := $(shell command -v dnf > /dev/null && test -f /etc/fedora-release; echo $$?) .PHONY: .initialize .initialize: ifneq ($(REPO_CHANGES),0) - $(error cannot run with a dirty repo. stash or commit changes.) +ifeq ($(DEV_MODE),0) + $(error will not run with a dirty repo. stash or commit changes, or re-run with DEV_MODE=1.) +endif endif git submodule update --init --recursive - -.PHONY: .local -.local: - mkdir -p stow/duplicity/.config/duplicity - cp --update=none local/duplicity-config stow/duplicity/.config/duplicity/config - cp --update=none local/duplicity-excludes stow/duplicity/.config/duplicity/excludes + 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 .PHONY: console -console: .initialize .local - 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 - stow --adopt --dir=stow --target=${HOME} duplicity +console: .initialize + 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 +endif + +.PHONY: fedora +fedora: console +ifneq ($(IS_FEDORA),0) + $(warning not fedora workstation, skipping.) +else + stow --adopt --dir=sway-de --target=$(HOME) foot + stow --adopt --dir=sway-de --target=$(HOME) mako + stow --adopt --dir=sway-de --target=$(HOME) rofi + stow --adopt --dir=sway-de --target=$(HOME) sway + stow --adopt --dir=sway-de --target=$(HOME) swaylock + stow --adopt --dir=sway-de --target=$(HOME) udiskie + stow --adopt --dir=sway-de --target=$(HOME) waybar + stow --adopt --dir=sway-de --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 . + git restore stow sway-de -- cgit v1.2.3