#!/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