X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/e252820a3fe76eb728d9a5e9796e1c971094e08b..refs/heads/uh-backup:/Makefile diff --git a/Makefile b/Makefile index eb5f29b..87fa04d 100644 --- a/Makefile +++ b/Makefile @@ -1,80 +1,108 @@ APATH := $(realpath .) +XDG_CONFIG_HOME ?= ~/.config +XDG_CACHE_HOME ?= ~/.cache +XDG_DATA_HOME ?= ~/.local/share + FILES := bin DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources -CONFIGFILES := aliases compton.conf git mpv offlineimap ranger retroarch xbindkeys xkb +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) -~/.config: - mkdir -p ~/.config +$(XDG_DATA_HOME) $(XDG_CONFIG_HOME): + mkdir -p $@ -vim: ~/.config - ln -sfT $(APATH)/vim ~/.config/vim - mkdir -p ~/.local/share/vim - git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle -.PHONY: vim +awesome: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/awesome $(XDG_CONFIG_HOME)/awesome +.PHONY: awesome -mutt: ~/.config - ln -sfT $(APATH)/mutt ~/.config/mutt -.PHONY: mutt +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 -awesome: ~/.config - ln -sfT $(APATH)/awesome ~/.config/awesome -.PHONY: awesome +git: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/git $(XDG_CONFIG_HOME)/git + ln -sfT $(APATH)/tig $(XDG_CONFIG_HOME)/tig +.PHONY: git -qutebrowser: ~/.config - ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser - mkdir -p ~/downloads -.PHONY: qutebrowser +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 ~/.config/mpd - mkdir -p ~/.local/share/mpd/playlists + 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 -ncmpcpp: ~/.config - ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp - mkdir -p ~/.local/share/mpd/lyrics +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 -systemd: ~/.config - ln -sfT $(APATH)/$@ ~/.config/$@ +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 -gnupg: systemd - ln -sfT $(APATH)/$@ ~/.config/$@ - 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 +task: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/taskrc $(XDG_CONFIG_HOME)/taskrc +.PHONY: task -zsh: ~/.config - ln -sfT $(APATH)/zshrc ~/.zshrc - ln -sfT $(APATH)/zprofile ~/.zprofile - ln -sfT $(APATH)/zshenv ~/.zshenv - ln -sfT $(APATH)/zsh ~/.config/zsh - mkdir -p ~/.cache/zsh -.PHONY: zsh +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 -dircolors: ~/.config - ln -sfT $(APATH)/dircolors ~/.config/dircolors -.PHONY: dircolors - -urxvt: ~/.config - ln -sfT $(APATH)/urxvt ~/.config/urxvt -.PHONY: urxvt +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 \ @@ -98,13 +126,13 @@ $(DOTFILES): fi; ln -sfT $(APATH)/$@ ~/.$@ -$(CONFIGFILES): ~/.config - @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/$@; \ + rm -r $(XDG_CONFIG_HOME)/$@; \ fi; - ln -sfT $(APATH)/$@ ~/.config/$@ + ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@