2023-01-27 11:29:28 +00:00
|
|
|
CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config)
|
|
|
|
FONT_DIR := $(HOME)/.local/share/fonts
|
|
|
|
ZSH_DIR := $(if $(ZSH), $(ZSH), $(HOME)/.oh-my-zsh)
|
2023-02-09 08:59:12 +00:00
|
|
|
SSH_DIR := $(HOME)/.ssh
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-09 15:47:44 +00:00
|
|
|
ZSH_CUSTOM_DIR := $(if $(ZSH_CUSTOM), $(ZSH_CUSTOM), $(ZSH_DIR)/custom)
|
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
HOME_ITEMS := $(wildcard home/*)
|
|
|
|
HOME_TARGETS := $(HOME_ITEMS:home/%=$(HOME)/.%)
|
2023-01-27 11:29:28 +00:00
|
|
|
CONFIG_ITEMS := $(wildcard config/*)
|
|
|
|
CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%)
|
2023-02-01 09:39:52 +00:00
|
|
|
ZSH_ITEMS := $(wildcard ohmyzsh/*.zsh)
|
|
|
|
ZSH_TARGETS := $(ZSH_ITEMS:ohmyzsh/%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh)
|
2023-02-09 08:59:12 +00:00
|
|
|
SSH_ITEMS := $(wildcard ssh/*)
|
|
|
|
SSH_TARGETS := $(SSH_ITEMS:ssh/%=$(SSH_DIR)/%)
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-17 09:00:12 +00:00
|
|
|
LAZY_REPO := https://github.com/folke/lazy.nvim.git
|
|
|
|
LAZY_DIR := /home/tux/.local/share/nvim/lazy/lazy.nvim
|
2023-01-27 11:29:28 +00:00
|
|
|
POWERLEVEL_REPO := https://github.com/romkatv/powerlevel10k.git
|
|
|
|
POWERLEVEL_DIR := $(ZSH_CUSTOM_DIR)/themes/powerlevel10k
|
2023-02-14 22:38:38 +00:00
|
|
|
ZSH_SYNTAX_REPO := https://github.com/zsh-users/zsh-syntax-highlighting.git
|
|
|
|
ZSH_SYNTAX_DIR := $(ZSH_CUSTOM_DIR)/plugins/zsh-syntax-highlighting
|
2023-02-09 15:47:44 +00:00
|
|
|
TPM_REPO := https://github.com/tmux-plugins/tpm
|
|
|
|
TPM_DIR := $(HOME)/.tmux/plugins/tpm
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-11 10:02:36 +00:00
|
|
|
.PHONY: all clean link unlink install uninstall pacman
|
2023-02-08 23:54:40 +00:00
|
|
|
|
2023-02-10 08:13:48 +00:00
|
|
|
all: link install
|
2023-02-08 23:54:40 +00:00
|
|
|
|
2023-02-10 08:13:48 +00:00
|
|
|
clean: unlink uninstall
|
2023-02-09 16:05:24 +00:00
|
|
|
|
2023-02-10 08:14:10 +00:00
|
|
|
link: $(HOME_TARGETS) $(CONFIG_TARGETS) $(SSH_TARGETS) $(HOME)/.ssh/sockets
|
2023-02-10 08:13:48 +00:00
|
|
|
|
|
|
|
unlink:
|
2023-02-09 08:53:40 +00:00
|
|
|
for link in $(HOME_TARGETS); do rm "$$link"; done
|
2023-01-30 22:30:02 +00:00
|
|
|
for link in $(CONFIG_TARGETS); do rm "$$link"; done
|
2023-02-10 08:13:48 +00:00
|
|
|
for link in $(SSH_TARGETS); do rm "$$link"; done
|
|
|
|
rmdir $(HOME)/.ssh/sockets
|
2023-02-09 08:53:40 +00:00
|
|
|
|
2023-02-17 09:00:12 +00:00
|
|
|
install: $(ZSH_DIR) $(POWERLEVEL_DIR) $(ZSH_SYNTAX_DIR) $(ZSH_TARGETS) $(LAZY_DIR) $(TPM_DIR)
|
2023-02-10 08:13:48 +00:00
|
|
|
python3 -m pip list | grep -E "libtmux.*0\.16\.1" > /dev/null ||\
|
|
|
|
python3 -m pip install --user libtmux==0.16.1
|
2023-02-09 08:53:40 +00:00
|
|
|
|
2023-02-10 08:13:48 +00:00
|
|
|
uninstall:
|
|
|
|
rm -rf $(ZSH_DIR)
|
2023-02-17 09:00:12 +00:00
|
|
|
rm -rf $(LAZY_DIR)
|
2023-02-09 22:09:51 +00:00
|
|
|
|
2023-02-11 10:02:36 +00:00
|
|
|
pacman:
|
2023-02-09 22:09:51 +00:00
|
|
|
sort -h pkglist.txt -o pkglist.txt
|
2023-02-10 08:13:48 +00:00
|
|
|
pacman -T - < pkglist.txt ||\
|
|
|
|
sudo pacman --needed -S - < pkglist.txt
|
2023-02-09 22:09:51 +00:00
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
$(HOME_TARGETS): $(HOME)/.%: home/%
|
2023-01-27 11:29:28 +00:00
|
|
|
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
2023-02-01 09:39:52 +00:00
|
|
|
$(ZSH_TARGETS): $(ZSH_CUSTOM_DIR)/%.zsh: ohmyzsh/%.zsh
|
2023-02-09 08:59:12 +00:00
|
|
|
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
|
|
|
|
$(HOME_TARGETS) $(CONFIG_TARGETS) $(ZSH_TARGETS) $(SSH_TARGETS):
|
2023-02-09 15:52:52 +00:00
|
|
|
ln -s $(PWD)/$? $@
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-17 09:00:12 +00:00
|
|
|
$(LAZY_DIR):
|
|
|
|
git clone --depth 1 $(LAZY_REPO) $@
|
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
$(POWERLEVEL_DIR): $(ZSH_DIR)
|
2023-01-27 11:29:28 +00:00
|
|
|
git clone --depth 1 $(POWERLEVEL_REPO) $@
|
|
|
|
|
2023-02-14 22:38:38 +00:00
|
|
|
$(ZSH_SYNTAX_DIR): $(ZSH_DIR)
|
|
|
|
git clone --depth 1 $(ZSH_SYNTAX_REPO) $@
|
|
|
|
|
2023-02-09 15:47:44 +00:00
|
|
|
$(TPM_DIR):
|
|
|
|
git clone --depth 1 $(TPM_REPO) $@
|
|
|
|
|
|
|
|
$(ZSH_DIR):
|
|
|
|
sh -c "$$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
|
|
|
|
2023-02-10 08:13:48 +00:00
|
|
|
$(CONFIG_DIR) $(SSH_DIR) $(HOME)/.ssh/sockets:
|
2023-01-27 11:29:28 +00:00
|
|
|
mkdir -p $@
|