X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/172cfbb4b15794f9dd12a4531e6ba6b8f0edbb2a..fe0b3f4cc70ff890b67fca36c6d4ada71b916aec:/Makefile?ds=sidebyside diff --git a/Makefile b/Makefile index 8af2d32..0671e47 100644 --- a/Makefile +++ b/Makefile @@ -1,57 +1,79 @@ APATH := $(realpath .) +XDG_CONFIG_HOME ?= ~/.config +XDG_DATA_HOME ?= ~/.local/share + FILES := bin -DOTFILES := conky* goobookrc msmtp* mutt profile tmux.conf weechat Xresources -CONFIGFILES := aliases compton.conf git mpv offlineimap ranger retroarch xbindkeys xkb +DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources +CONFIGFILES := compton.conf mpv offlineimap ranger retroarch xbindkeys xkb .PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES) install: $(FILES) $(DOTFILES) $(CONFIGFILES) -~/.config: - mkdir -p ~/.config +$(XDG_DATA_HOME) $(XDG_CONFIG_HOME): + mkdir -p $@ + +task: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/taskrc $(XDG_CONFIG_HOME)/taskrc + +git: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/git $(XDG_CONFIG_HOME)/git + ln -sfT $(APATH)/tig $(XDG_CONFIG_HOME)/tig +.PHONY: git -vim: - ln -sfT $(APATH)/vim ~/.config/vim - mkdir -p ~/.local/share/vim - git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle +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 -awesome: ~/.config - ln -sfT $(APATH)/awesome ~/.config/awesome +mutt: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/mutt $(XDG_CONFIG_HOME)/mutt +.PHONY: mutt + +gdb: + mkdir $(XDG_DATA_HOME)/gdb + ln -sfT $(APATH)/gdbinit ~/.gdbinit + ln -sfT $(APATH)/cgdb ~/.cgdb +.PHONY: gdb + +awesome: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/awesome $(XDG_CONFIG_HOME)/awesome .PHONY: awesome -qutebrowser: ~/.config - ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser +qutebrowser: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/qutebrowser $(XDG_CONFIG_HOME)/qutebrowser mkdir -p ~/downloads .PHONY: qutebrowser 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: - ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp - mkdir -p ~/.local/share/mpd/lyrics +ncmpcpp: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/ncmpcpp $(XDG_CONFIG_HOME)/ncmpcpp + mkdir -p $(XDG_DATA_HOME)/mpd/lyrics .PHONY: ncmpcpp -systemd: - ln -sfT $(APATH)/$@ ~/.config/$@ +systemd: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@ .PHONY: systemd gnupg: systemd - ln -sfT $(APATH)/$@ ~/.config/$@ + 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 -zsh: +zsh: $(XDG_CONFIG_HOME) ln -sfT $(APATH)/zshrc ~/.zshrc ln -sfT $(APATH)/zprofile ~/.zprofile ln -sfT $(APATH)/zshenv ~/.zshenv - ln -sfT $(APATH)/zsh ~/.config/zsh + ln -sfT $(APATH)/zsh $(XDG_CONFIG_HOME)/zsh + ln -sfT $(APATH)/aliases $(XDG_CONFIG_HOME)/aliases mkdir -p ~/.cache/zsh .PHONY: zsh @@ -59,15 +81,15 @@ xprofile: ln -sfT $(APATH)/xprofile ~/.xprofile .PHONY: xprofile -dircolors: - ln -sfT $(APATH)/dircolors ~/.config/dircolors +dircolors: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/dircolors $(XDG_CONFIG_HOME)/dircolors .PHONY: dircolors -urxvt: - ln -sfT $(APATH)/urxvt ~/.config/urxvt +urxvt: $(XDG_CONFIG_HOME) + ln -sfT $(APATH)/urxvt $(XDG_CONFIG_HOME)/urxvt .PHONY: urxvt -$(FILES): +$(FILES): @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \ if [[ -d $@ ]]; then \ cp -r ~/$@/* $@; \ @@ -75,10 +97,10 @@ $(FILES): cp -r ~/$@ $@; \ fi; \ rm -r ~/$@; \ - fi; + fi; ln -sfT $(APATH)/$@ ~/$@ -$(DOTFILES): +$(DOTFILES): @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \ if [[ -d .$@ ]]; then \ cp -r ~/.$@/* $@; \ @@ -86,16 +108,16 @@ $(DOTFILES): cp -r ~/.$@ $@; \ fi; \ rm -r ~/.$@; \ - fi; + 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/$@; \ - fi; - ln -sfT $(APATH)/$@ ~/.config/$@ + rm -r $(XDG_CONFIG_HOME)/$@; \ + fi; + ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@