23 lines
507 B
Bash
23 lines
507 B
Bash
|
#!/bin/bash
|
||
|
# Elevate script
|
||
|
if [ ! "$UID" -eq 0 ]
|
||
|
then
|
||
|
exec sudo bash "$0" "$USER"
|
||
|
fi
|
||
|
|
||
|
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 $homeDir/.bashrc
|