PortValhalla/scripts/PopOS/software/oh-my-posh.sh
2022-11-14 22:23:08 +01:00

22 lines
564 B
Bash
Executable file

#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE" "$USER"
else
bin=oh-my-posh
workingDirectory=$(pwd)
contextRoot=$(mktemp -d)
cd $contextRoot
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O $bin
install $bin /usr/local/bin
cd $workingDirectory
rm -rf $contextRoot
homeDir=$(sudo -u $1 bash -c 'realpath ~')
echo 'eval "$(oh-my-posh init bash --config ~/Nextcloud/.omp/manuel.omp.json)"' \
| sudo -u $1 tee -a $homeDir/.bashrc
fi