From 0f1df0db903ba576fd17b08197d3066af7a61e5f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Nov 2023 23:23:40 +0100 Subject: A lot of changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- base/Makefile | 59 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'base/Makefile') diff --git a/base/Makefile b/base/Makefile index 365bde6..9752ef1 100644 --- a/base/Makefile +++ b/base/Makefile @@ -1,20 +1,26 @@ .POSIX: -include ../common.mk FACE = penguin.png +XINITRC_ORDER = 90 + install: mkdir -p -- ~/.config - test ! -d ~/.profile - test ! -d ~/.config/profile - test ! -d ~/.config/profile-North - test ! -d ~/.config/user-dirs.locale - test ! -d ~/.config/face - test ! -d ~/.face - test ! -d ~/.face.icon + test ! -e ~/.profile || test -L ~/.profile + test ! -e ~/.config/user-profile || test -L ~/.config/profile + test ! -e ~/.config/user-profile-North || test -L ~/.config/profile-North + test ! -e ~/.config/user-profile-Zenith || test -L ~/.config/profile-Zenith + test ! -e ~/.config/user-dirs.locale || test -L ~/.config/user-dirs.locale + test ! -e ~/.config/face || test -L ~/.config/face || \ + sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.config/face | cut -d ' ' -f 1)" > /dev/null + test ! -e ~/.face || test -L ~/.face || \ + sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.face | cut -d ' ' -f 1)" > /dev/null + test ! -e ~/.face.icon || test -L ~/.face.icon || \ + sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.face.icon | cut -d ' ' -f 1)" > /dev/null ln -sf -- .config/profile ~/.profile - ln -sf -- ~/.dotfiles/base/profile ~/.config/profile - ln -sf -- ~/.dotfiles/base/profile-North ~/.config/profile-North + ln -sf -- ~/.dotfiles/base/user-profile ~/.config/profile + ln -sf -- ~/.dotfiles/base/user-profile-North ~/.config/profile-North + ln -sf -- ~/.dotfiles/base/user-profile-Zenith ~/.config/profile-Zenith ln -sf -- ~/.dotfiles/base/user-dirs.locale ~/.config/ ln -sf -- ~/.dotfiles/base/faces/$(FACE) ~/.config/face ln -sf -- .config/face ~/.face @@ -25,28 +31,39 @@ install: test ! -e ~/.config/locations && \ ln -s -- ~/.dotfiles/.secrets/locations ~/.config/locations; \ fi - test ! -d ~/.config/geolocation - test ! -d ~/.config/metar + test ! -e ~/.config/geolocation || test -L ~/.config/geolocation + test ! -e ~/.config/metar || test -L ~/.config/metar test -L ~/.config/locations/current || test ! -e ~/.config/locations/current test -L ~/.config/locations/current || ln -sf default ~/.config/locations/current ln -sf locations/current/geolocation ~/.config/geolocation ln -sf locations/current/metar ~/.config/metar mkdir -p -- ~/.local/bin test ! -d ~/.local/bin/iswork - test -x /bin/false - ln -sf -- /bin/false ~/.local/bin/iswork - ln -sf ~/.dotfiles/base/new-c-proj ~/.local/bin/ - test ! -r ../.secrets/bin/Makefile || make -C ../.secrets/bin install + test -x /bin/false && test -x /bin/true + if test -e "../.secrets/workmachine-$$(hostname)"; then \ + ln -sf -- /bin/true ~/.local/bin/iswork; \ + else \ + ln -sf -- /bin/false ~/.local/bin/iswork; \ + fi + test ! -r ../.secrets/bin/Makefile || (cd ../.secrets/bin && $(MAKE) install) + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -e ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base || \ + test -L ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base + ln -sf -- ~/.dotfiles/base/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base uninstall: - -unlink -- ~/.config/profile + +! ../check-installed base + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + -unlink -- ~/.config/user-profile + -unlink -- ~/.config/user-profile-North + -unlink -- ~/.config/user-profile-Zenith -unlink -- ~/.config/user-dirs.locale -unlink -- ~/.profile -unlink -- ~/.config/locations -unlink -- ~/.config/geolocation -unlink -- ~/.config/metar -unlink -- ~/.local/bin/iswork - -unlink -- ~/.local/bin/new-c-proj - -test ! -r ../.secrets/bin/Makefile || make -C ../.secrets/bin uninstall - -.PHONY: install uninstall + -test ! -r ../.secrets/bin/Makefile || (cd ../.secrets/bin && $(MAKE) uninstall) -- cgit v1.2.3-70-g09d2