X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/767c6733dfa1928e55d12ae6c53ff070579e6e65..refs/heads/uh-backup:/Makefile diff --git a/Makefile b/Makefile index 8427708..87fa04d 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,110 @@ APATH := $(realpath .) +XDG_CONFIG_HOME ?= ~/.config +XDG_CACHE_HOME ?= ~/.cache +XDG_DATA_HOME ?= ~/.local/share + FILES := bin -DOTFILES := aliases bash* conky* flexget git* vim* xbindkeysrc Xmodmap zsh* -CONFIGFILES := retroarch +DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources +CONFIGFILES := compton.conf mpv offlineimap ranger retroarch xbindkeys xkb + +.PHONY: core_files +core_files: dircolors git ssh systemd vim zsh .PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES) install: $(FILES) $(DOTFILES) $(CONFIGFILES) -$(FILES): +$(XDG_DATA_HOME) $(XDG_CONFIG_HOME): + mkdir -p $@ + +awesome: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/awesome $(XDG_CONFIG_HOME)/awesome +.PHONY: awesome + +dircolors: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/dircolors $(XDG_CONFIG_HOME)/dircolors +.PHONY: dircolors + +gdb: + mkdir $(XDG_DATA_HOME)/gdb + ln -sfT $(APATH)/gdb $(XDG_CONFIG_HOME)/gdb + ln -sfT $(APATH)/gdbinit ~/.gdbinit + ln -sfT $(APATH)/cgdb ~/.cgdb +.PHONY: gdb + +git: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/git $(XDG_CONFIG_HOME)/git + ln -sfT $(APATH)/tig $(XDG_CONFIG_HOME)/tig +.PHONY: git + +gnupg: systemd + ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@ + systemctl --user enable gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket + systemctl --user start gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket +.PHONY: gnupg + +mpd: systemd + ln -sfT $(APATH)/mpd $(XDG_CONFIG_HOME)/mpd + mkdir -p $(XDG_DATA_HOME)/mpd/playlists + systemctl --user enable mpd + systemctl --user start mpd +.PHONY: mpd + +mutt: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/mutt $(XDG_CONFIG_HOME)/mutt +.PHONY: mutt + +ncmpcpp: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/ncmpcpp $(XDG_CONFIG_HOME)/ncmpcpp + mkdir -p $(XDG_DATA_HOME)/mpd/lyrics +.PHONY: ncmpcpp + +qutebrowser: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/qutebrowser $(XDG_CONFIG_HOME)/qutebrowser + mkdir -p ~/downloads +.PHONY: qutebrowser + +ssh: + ln -sfT $(APATH)/ssh/config ~/.ssh/config +.PHONY: ssh + +systemd: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@ +.PHONY: systemd + +task: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/taskrc $(XDG_CONFIG_HOME)/taskrc +.PHONY: task + +urxvt: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/urxvt $(XDG_CONFIG_HOME)/urxvt +.PHONY: urxvt + +vim: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/vim $(XDG_CONFIG_HOME)/vim + mkdir -p $(XDG_DATA_HOME)/vim + -git clone https://github.com/gmarik/vundle $(XDG_DATA_HOME)/vim/vundle +.PHONY: vim + +yay: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/yay $(XDG_CONFIG_HOME)/yay + mkdir -p $(XDG_CACHE_HOME)/yay + +xprofile: + ln -sfT $(APATH)/xprofile ~/.xprofile +.PHONY: xprofile + +zsh: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/zshrc ~/.zshrc + ln -sfT $(APATH)/zprofile ~/.zprofile + ln -sfT $(APATH)/zshenv ~/.zshenv + ln -sfT $(APATH)/zsh $(XDG_CONFIG_HOME)/zsh + ln -sfT $(APATH)/aliases $(XDG_CONFIG_HOME)/aliases + mkdir -p $(XDG_CACHE_HOME)/zsh + mkdir -p $(XDG_DATA_HOME)/zsh +.PHONY: zsh + +$(FILES): @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \ if [[ -d $@ ]]; then \ cp -r ~/$@/* $@; \ @@ -15,10 +112,10 @@ $(FILES): cp -r ~/$@ $@; \ fi; \ rm -r ~/$@; \ - fi; + fi; ln -sfT $(APATH)/$@ ~/$@ -$(DOTFILES): +$(DOTFILES): @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \ if [[ -d .$@ ]]; then \ cp -r ~/.$@/* $@; \ @@ -26,16 +123,16 @@ $(DOTFILES): cp -r ~/.$@ $@; \ fi; \ rm -r ~/.$@; \ - fi; + fi; ln -sfT $(APATH)/$@ ~/.$@ -$(CONFIGFILES): - @if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \ +$(CONFIGFILES): $(XDG_CONFIG_HOME) + @if [[ -e $(XDG_CONFIG_HOME)/$@ && ! -L $(XDG_CONFIG_HOME)/$@ ]]; then \ if [[ -d .config/$@ ]]; then \ - cp -r ~/.config/$@/* $@; \ + cp -r $(XDG_CONFIG_HOME)/$@/* $@; \ else \ - cp -r ~/.config/$@ $@; \ + cp -r $(XDG_CONFIG_HOME)/$@ $@; \ fi; \ - rm -r ~/.config/$@; \ - fi; - ln -sfT $(APATH)/$@ ~/.config/$@ + rm -r $(XDG_CONFIG_HOME)/$@; \ + fi; + ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@