From 233e04966295ca54bb8d318edff83aa813331687 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 13 Nov 2023 04:42:51 +0100 Subject: [PATCH] Allow for system-wide installations --- README.md | 16 ++++++++++++---- init.source | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 18f214c..674ddb6 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,19 @@ This is a premade and fully-fletched bashrc, fully configurable to your liking. - ytfzf ## Usage -### Installing +### Installing (user-wide) ```bash -git clone https://git.staropensource.de/JeremyStarTM/jstmbash.git ${HOME}/.jstmbash # clone repository +git clone https://git.staropensource.de/JeremyStarTM/jstmbash.git "${HOME}/.jstmbash" # clone repository echo "source \${HOME}/.jstmbash/init.source" >> "${HOME}/.bashrc" # add init script to bashrc -cp ${HOME}/.jstmbash/config.env.example ${HOME}/.jstmbash/config.env # copy example config -${EDITOR} ${HOME}/.jstmbash/config.env # configure jstmbash +cp "${HOME}/.jstmbash/config.env.example" "${HOME}/.jstmbash/config.env" # copy example config +"${EDITOR}" "${HOME}/.jstmbash/config.env" # configure jstmbash +exec bash # restart bash +``` +### Installing (system-wide) +```bash +git clone https://git.staropensource.de/JeremyStarTM/jstmbash.git /etc/jstmbash # clone repository +echo "source /etc/jstmbash/init.source" >> "/etc/bash.bashrc" # add init script to bashrc +cp "/etc/jstmbash/config.env.example" "/etc/jstmbash/config.env" # copy example config +"${EDITOR}" "/etc/jstmbash/config.env" # configure jstmbash exec bash # restart bash ``` \ No newline at end of file diff --git a/init.source b/init.source index 0d8c80a..385f759 100644 --- a/init.source +++ b/init.source @@ -13,6 +13,8 @@ fi # source configuration file if [ -f "${HOME}/.jstmbash/config.env" ] && [ "${JSTMBASH_LOCAL_CONFIG}" != "true" ]; then source "${HOME}/.jstmbash/config.env" +elif [ -f "/etc/jstmbash/config.env" ] && [ "${JSTMBASH_LOCAL_CONFIG}" != "true" ]; then + source "/etc/jstmbash/config.env" elif [ -f "$(pwd)/config.env" ]; then source "$(pwd)/config.env" else