From 30b0cc68aed155f84741cd33e5f3747e58f143b2 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 27 Apr 2019 18:21:33 -0400 Subject: [PATCH] Adding makefile for all current configurations. --- lib/makefile | 18 ++++++++++++++++++ ssh/makefile | 23 +++++++++++++++++++++++ sway/makefile | 22 ++++++++++++++++++++++ tmux/makefile | 21 +++++++++++++++++++++ tridactyl/makefile | 19 +++++++++++++++++++ waybar/makefile | 24 ++++++++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 lib/makefile create mode 100644 ssh/makefile create mode 100644 sway/makefile create mode 100644 tmux/makefile create mode 100644 tridactyl/makefile create mode 100644 waybar/makefile diff --git a/lib/makefile b/lib/makefile new file mode 100644 index 0000000..7658c87 --- /dev/null +++ b/lib/makefile @@ -0,0 +1,18 @@ + +SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +GIT_HOOK_SRC = $(SRC_DIR)/post-merge +GIT_HOOK_TARGET = $(abspath $(SRC_DIR)/..)/.git/hooks/post-merge + +include ../lib/shared.mk + +install: | init update + +init: + $(info => Setting up githook) + $(report) info "Symlinked `ln -svf $(GIT_HOOK_SRC) $(GIT_HOOK_TARGET)`" + +update: + +remove: + $(info => Removing Githook) + $(rm_link) $(GIT_HOOK_TARGET) diff --git a/ssh/makefile b/ssh/makefile new file mode 100644 index 0000000..df90474 --- /dev/null +++ b/ssh/makefile @@ -0,0 +1,23 @@ +SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +SOURCE := $(SRC_DIR)/config +TARGET := ~/.ssh/config + +include ../lib/shared.mk + +install: | init update + +init: + $(info => Setting up ssh) + $(mk_link) $(SOURCE) $(TARGET) + [ ! -e ~/.ssh/git.jpatrick.io ] \ + && echo "No key for git.jpatrick.io. Generating" \ + && ( ssh-keygen -t ed25519 -C "`hostname`: `date`" -f ~/.ssh/git.jpatrick.io -N "" \ + ; $(report) "Key generation" ) \ + ; true + +update: + +remove: + $(info => Remvoing ssh) + $(rm_link) $(TARGET) + $(report) warn "NOTE: All prior keys still remain." diff --git a/sway/makefile b/sway/makefile new file mode 100644 index 0000000..d3cf0e5 --- /dev/null +++ b/sway/makefile @@ -0,0 +1,22 @@ +SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + +include ../lib/shared.mk +TARGET := $(XDG_DIR)/sway + +install: | init update + +init: +ifeq ($(call cmd_exist,sway), true) + $(info => Setting up sway) + $(mk_link) $(SRC) $(TARGET) +endif + +update: +ifeq ($(call cmd_exist,swaymsg), true) + $(info => Reloading sway) + swaymsg reload ; $(report) "sway reload" +endif + +remove: + $(info => Remvoing sway) + $(rm_link) $(TARGET) diff --git a/tmux/makefile b/tmux/makefile new file mode 100644 index 0000000..c176759 --- /dev/null +++ b/tmux/makefile @@ -0,0 +1,21 @@ +SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +SOURCE := $(SRC_DIR)/tmux.conf +TARGET := ~/.tmux.conf + +include ../lib/shared.mk + +install: | init update + +init: +ifeq ($(call cmd_exist,tmux), true) + $(info => Setting up tmux) + $(mk_link) $(SOURCE) $(TARGET) +else + $(report) warn "tmux not installed" +endif + +update: + +remove: + $(info => Remvoing tmux config) + @ $(rm_link) $(TARGET) diff --git a/tridactyl/makefile b/tridactyl/makefile new file mode 100644 index 0000000..bd98090 --- /dev/null +++ b/tridactyl/makefile @@ -0,0 +1,19 @@ +SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + +include ../lib/shared.mk +TARGET := $(XDG_DIR)/tridactyl + + +install: | init update + +init: +ifeq ($(shell $(call cmd_exist,firefox) || $(IS_MAC) ; echo $$? ), 0) + $(info => Setting up Tridacyl) + $(mk_link) $(SRC) $(TARGET) +endif + +update: + +remove: + $(info => Remvoing tridactyl ) + $(rm_link) $(TARGET) diff --git a/waybar/makefile b/waybar/makefile new file mode 100644 index 0000000..c108e00 --- /dev/null +++ b/waybar/makefile @@ -0,0 +1,24 @@ +SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + +include ../lib/shared.mk +TARGET := $(XDG_DIR)/waybar + +install: | init update + +init: +ifeq ($(call cmd_exist,waybar), true) + $(info => Setting up waybar) + $(mk_link) $(SRC) $(TARGET) +endif + +update: +ifeq ($(call cmd_exist,swaymsg), true) + $(info => Reloading sway) + swaymsg reload ; $(report) "sway reload" +endif + +remove: + $(info => Removing waybar) + @ $(rm_link) $(TARGET) + +.PHONY: install update init remove