From b15758ca8291a856b66f969f9e3efbb418d9f077 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 15 Mar 2023 07:47:37 +0000 Subject: [PATCH] Add default profile to source bashrc on login shell, rewrite Makefile layout to be more logical --- .profile | 9 +++++++++ Makefile | 37 ++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 .profile diff --git a/.profile b/.profile new file mode 100644 index 00000000..c4c7402d --- /dev/null +++ b/.profile @@ -0,0 +1,9 @@ +# ~/.profile: executed by Bourne-compatible login shells. + +if [ "$BASH" ]; then + if [ -f ~/.bashrc ]; then + . ~/.bashrc + fi +fi + +mesg n 2> /dev/null || true diff --git a/Makefile b/Makefile index a89805d9..162bf0ac 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%) LAZY_REPO := https://github.com/folke/lazy.nvim.git PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv) -.PHONY: default all clean check install +.PHONY: default all clean check directories link configure install -default: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(LAZY_DIR) $(HOME)/.bashrc $(HOME)/.zshrc $(HOME)/.ssh/sockets config/nvim/.venv config/git/user_email +default: directories link configure all: default install @@ -23,6 +23,7 @@ clean: for link in $(SSH_TARGETS); do rm "$$link"; done for link in $(THEMES_TARGETS); do rm "$$link"; done rm -rf $(LAZY_DIR) + rm $(HOME)/.profile rm $(HOME)/.bashrc rm $(HOME)/.zshrc rmdir $(HOME)/.ssh/sockets @@ -31,32 +32,38 @@ clean: check: echo "Placeholder" -install: - command -v direnv > /dev/null || bin_path=$(HOME)/.local/bin bash packages/direnv.sh - command -v pipx > /dev/null || bash packages/pipx.sh - command -v poetry > /dev/null || python3 packages/poetry.py - command -v pyenv > /dev/null || bash packages/pyenv.sh - command -v starship > /dev/null || bash packages/starship.sh +directories: $(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin -config/git/user_email: - echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email" +$(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin: + mkdir -p $@ + +link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.bashrc $(HOME)/.zshrc $(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/% $(SSH_TARGETS): $(SSH_DIR)/%: ssh/% $(THEMES_TARGETS): $(THEMES_DIR)/%: themes/% +$(HOME)/.profile: $(HOME)/%: % $(HOME)/.bashrc: $(HOME)/%: % $(HOME)/.zshrc: $(HOME)/%: % -$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.zshrc: +$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.bashrc $(HOME)/.zshrc: ln -s $(PWD)/$? $@ -$(LAZY_DIR): - git clone --depth 1 $(LAZY_REPO) $@ +configure: config/git/user_email config/nvim/.venv + +config/git/user_email: + echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email" config/nvim/.venv: python3 -m venv $@ $@/bin/python3 -m pip install -U pip wheel $@/bin/python3 -m pip install --use-pep517 pynvim +install: $(LAZY_DIR) + command -v direnv > /dev/null || bin_path=$(HOME)/.local/bin bash packages/direnv.sh + command -v pipx > /dev/null || bash packages/pipx.sh + command -v poetry > /dev/null || python3 packages/poetry.py + command -v pyenv > /dev/null || bash packages/pyenv.sh + command -v starship > /dev/null || bash packages/starship.sh -$(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin: - mkdir -p $@ +$(LAZY_DIR): + git clone --depth 1 $(LAZY_REPO) $@