Backup (1801B)
1 # Dotfiles - Mahdi's system configuration 2 # See LICENSE file for copyright and license details. 3 4 include config.mk 5 6 help: 7 @grep '^[a-zA-Z_-]*:.*## .*$$' Backup \ 8 | awk -F ':.*##' '{printf "\033[34m%-20s\033[0m %s\n", $$1, $$2}' 9 10 backup-arch: ## Backup packages from my arch setup 11 pacman -Q | awk '{print $1}' > pkgs-arch.mk 12 sed 's/^/ARCH_PKGS\t+= /' pkgs-arch.mk > pkgs-arch.mk.tmp 13 mv pkgs-arch.mk.tmp pkgs-arch.mk 14 mv pkgs-arch.mk inc/pkgs-arch.mk 15 16 backup-alpine: ## Backup packages from my alpine setup 17 cat /etc/apk/world > pkgs-alpine.mk 18 sed 's/^/ALPINE_PKGS\t+= /' pkgs-alpine.mk > pkgs-alpine.mk.tmp 19 mv pkgs-alpine.mk.tmp pkgs-alpine.mk 20 mv pkgs-alpine.mk inc/pkgs-alpine.mk 21 22 backup-freebsd: ## Backup packages from my freebsd setup 23 pkg prime-list > pkgs-freebsd.mk 24 sed 's/^/FREEBSD_PKGS\t+= /' pkgs-freebsd.mk > pkgs-freebsd.mk.tmp 25 mv pkgs-freebsd.mk.tmp pkgs-freebsd.mk 26 mv pkgs-freebsd.mk inc/pkgs-freebsd.mk 27 28 backup-scheme: ## Generate inc/{configs-dirs.mk,configs-files.mk} 29 find . -type d > configs-dirs.mk 30 sort configs-dirs.mk > configs-dirs.mk.tmp 31 sed 's/^\.\///g;/^\.$$/d;/^\.git/d;/^\./!d;/^\.local\/src\//d;s/^/CONFIGS_MKDIR\t+= /' configs-dirs.mk.tmp > configs-dirs.mk 32 mv configs-dirs.mk inc/configs-dirs.mk 33 find . -type f > configs-files.mk 34 sort configs-files.mk > configs-files.mk.tmp 35 sed 's/^\.\///g;/^\.$$/d;/^\.git/d;/^\./!d;/^\.local\/src\//d;s/^/CONFIGS_FILES\t+= /' configs-files.mk.tmp > configs-files.mk 36 mv configs-files.mk inc/configs-files.mk 37 rm configs-dirs.mk.tmp configs-files.mk.tmp 38 39 backup-files: ## Force copy files from ~/ to ./ (inc/configs-files.mk) 40 @for CONFIG_FILE in $(CONFIGS_FILES); do $(CP) $${HOME}/$$CONFIG_FILE $${PWD}/$$CONFIG_FILE; done 41 $(RUN_PERM) $(CP) /etc/X11/xorg.conf.d/40-libinput.conf etc/X11/xorg.conf.d/40-libinput.conf