]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
autostart: let xprofile manage application startup
[dotfiles.git] / Makefile
index 8f85fd5d2e2a1b6cf9fa8b4ffe7f2742624e26a4..e0b39123e06590aad3c98a4508d844a4c0a1fc4a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,67 @@
-.PHONY: install
+APATH := $(realpath .)
 
-install:
-       cp -f vimrc ~/.vimrc
-       cp -f flexget/config.yml ~/.flexget/config.yml
+FILES := bin
+DOTFILES := conky* goobookrc msmtp* mutt profile tmux.conf weechat Xresources xprofile
+CONFIGFILES := aliases compton.conf git gnupg mpv offlineimap ranger retroarch systemd vim xbindkeys xkb
 
-update:
-       cp -f ~/.vimrc vimrc
-       cp -f ~/.flexget/config.yml flexget/config.yml 
+.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
+
+mpd:
+       ln -sfT $(APATH)/mpd ~/.config/mpd
+       mkdir -p ~/.local/share/mpd/playlists
+.PHONY: mpd
+
+ncmpcpp:
+       ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
+       mkdir -p ~/.local/share/mpd/lyrics
+.PHONY: ncmpcpp
+
+zsh:
+       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
+
+xprofile:
+       ln -sfT $(APATH)/xprofile ~/.xprofile
+.PHONY: xprofile
+
+dircolors:
+       ln -sfT $(APATH)/dircolors ~/.config/dircolors
+.PHONY: dircolors
+
+$(FILES): 
+       @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
+           if [[ -d $@ ]]; then \
+             cp -r ~/$@/* $@; \
+           else \
+             cp -r ~/$@ $@; \
+           fi; \
+           rm -r ~/$@; \
+       fi; 
+       ln -sfT $(APATH)/$@ ~/$@
+
+$(DOTFILES): 
+       @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
+           if [[ -d .$@ ]]; then \
+             cp -r ~/.$@/* $@; \
+           else \
+             cp -r ~/.$@ $@; \
+           fi; \
+           rm -r ~/.$@; \
+       fi; 
+       ln -sfT $(APATH)/$@ ~/.$@
+
+$(CONFIGFILES): 
+       @if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \
+           if [[ -d .config/$@ ]]; then \
+             cp -r ~/.config/$@/* $@; \
+           else \
+             cp -r ~/.config/$@ $@; \
+           fi; \
+           rm -r ~/.config/$@; \
+       fi; 
+       ln -sfT $(APATH)/$@ ~/.config/$@