Centralize Oh My Posh! installation

This commit is contained in:
Manuel Thalmann 2024-03-20 21:24:10 +01:00
parent 6997511486
commit 3617798a0e
4 changed files with 15 additions and 18 deletions

View file

@ -1,5 +1,20 @@
#!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../bash/profile.sh";
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}";
themeDir="/usr/local/share/oh-my-posh/themes";
install -d644 "$themeDir";
cat ~/.mnt/$NEXTCLOUD_DIR/.omp/manuel.omp.json | sudo tee "$themeDir/manuel.omp.json" > /dev/null;
{
echo 'eval "$(oh-my-posh init bash)"';
echo 'eval "$(oh-my-posh completion bash)"';
} | addBashProfile "oh-my-posh" "Oh My Posh!";
{
echo "# Oh My Posh!";
echo "oh-my-posh init fish | source";
echo "oh-my-posh completion fish | source";
} | sudo tee /etc/fish/conf.d/oh-my-posh.fish;
popd > /dev/null;

View file

@ -47,8 +47,6 @@ else
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Fonts/NerdFont/install.sh";
fi;
source "../bash/oh-my-posh.sh";
source "../fish/oh-my-posh.sh";
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Oh My Posh/install.sh";
echo "You are done! Please log out!";
read;

View file

@ -1,10 +0,0 @@
#!/bin/bash
if ! grep "\boh-my-posh\b" ~/.bashrc > /dev/null
then
{
echo "";
echo "# Oh My Posh!";
echo 'eval "$(oh-my-posh init bash --config /usr/share/oh-my-posh/themes/manuel.omp.json)"'
echo 'eval "$(oh-my-posh completion bash)"';
} | tee -a ~/.bashrc > /dev/null;
fi;

View file

@ -1,6 +0,0 @@
#!/bin/bash
{
echo "# Oh My Posh!";
echo "oh-my-posh init fish --config /usr/share/oh-my-posh/themes/manuel.omp.json | source";
echo "oh-my-posh completion fish | source";
} | sudo tee /etc/fish/conf.d/oh-my-posh.fish;