PortValhalla/scripts/PopOS/software/oh-my-posh.sh

23 lines
564 B
Bash
Raw Normal View History

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