PortValhalla/scripts/PopOS/software/logo-ls.sh

20 lines
461 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
package=$(mktemp)
wget https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_amd64.deb -O $package
dpkg -i $package
rm -f $package
2022-11-13 00:11:32 +00:00
homeDir=$(sudo -u $1 bash -c 'realpath ~')
2022-11-13 00:11:32 +00:00
{
echo "alias ls='logo-ls -D'"
echo "alias ll='ls -al'"
echo "alias l='ls'"
2022-11-13 00:16:22 +00:00
} | sudo -u $1 tee -a $homeDir/.bashrc
2022-11-13 00:11:32 +00:00
fi