From c66f5c6175a002bf2b9e58fadd2dc5296200c65d Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 2 Apr 2023 04:00:32 +0200 Subject: [PATCH] Split `oh-my-posh` installation commands --- scripts/Common/Config/Oh My Posh/install.sh | 5 +++++ scripts/Common/Config/UserProfile/personal.sh | 3 ++- scripts/Common/Config/bash/oh-my-posh.sh | 3 +++ scripts/Common/Software/Oh My Posh/install.sh | 8 -------- scripts/PopOS/Collections/personal.sh | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100755 scripts/Common/Config/Oh My Posh/install.sh create mode 100755 scripts/Common/Config/bash/oh-my-posh.sh diff --git a/scripts/Common/Config/Oh My Posh/install.sh b/scripts/Common/Config/Oh My Posh/install.sh new file mode 100755 index 000000000..e79064d1d --- /dev/null +++ b/scripts/Common/Config/Oh My Posh/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash +NEXTCLOUD_DIR="${NEXTCLOUD_DIR}"; + +mkdir -p ~/.omp; +cp ~/$NEXTCLOUD_DIR/.omp/manuel.omp.json ~/.omp/manuel.omp.json; diff --git a/scripts/Common/Config/UserProfile/personal.sh b/scripts/Common/Config/UserProfile/personal.sh index b2671053a..3199b2a28 100755 --- a/scripts/Common/Config/UserProfile/personal.sh +++ b/scripts/Common/Config/UserProfile/personal.sh @@ -19,7 +19,8 @@ cloudRoot="$configRoot/rclone"; source "../Fonts/NerdFont/install.sh"; fi; - source "../../Software/Oh My Posh/install.sh"; + source "../bash/oh-my-posh.sh"; + source "../Oh My Posh/install.sh"; popd > /dev/null; } & diff --git a/scripts/Common/Config/bash/oh-my-posh.sh b/scripts/Common/Config/bash/oh-my-posh.sh new file mode 100755 index 000000000..db32f5131 --- /dev/null +++ b/scripts/Common/Config/bash/oh-my-posh.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"' \ + | tee -a ~/.bashrc; diff --git a/scripts/Common/Software/Oh My Posh/install.sh b/scripts/Common/Software/Oh My Posh/install.sh index 5c505a59a..b66b23a56 100755 --- a/scripts/Common/Software/Oh My Posh/install.sh +++ b/scripts/Common/Software/Oh My Posh/install.sh @@ -15,12 +15,4 @@ else popd > /dev/null; rm -rf "$contextRoot"; - - homeDir="$(sudo -u "$1" bash -c 'realpath ~')"; - - sudo -u "$1" mkdir -p "$homeDir/.omp"; - sudo -u "$1" cp "$homeDir/$NEXTCLOUD_DIR/.omp/manuel.omp.json" "$homeDir/.omp/manuel.omp.json"; - - echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"' \ - | sudo -u "$1" tee -a "$homeDir/.bashrc"; fi diff --git a/scripts/PopOS/Collections/personal.sh b/scripts/PopOS/Collections/personal.sh index 1386c3979..251a98eb4 100755 --- a/scripts/PopOS/Collections/personal.sh +++ b/scripts/PopOS/Collections/personal.sh @@ -15,6 +15,7 @@ EXTENSION_POLICY_DIR=/opt/brave.com/brave/extensions \ source "../../Debian/Software/Google Chrome/install.sh"; # Install further software +source "../../Common/Software/Oh My Posh/install.sh"; source "../../Debian/Software/git/install.sh"; source "../../Debian/Software/logo-ls/install.sh"; source "../../Debian/Software/VSCodium/install.sh";