Updated install script
This commit is contained in:
88
install.sh
88
install.sh
@@ -2,6 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
files=".config/fish \
|
||||
.config/git \
|
||||
.config/omf \
|
||||
@@ -16,18 +17,89 @@ function this_script_root_dir() {
|
||||
}
|
||||
|
||||
function run() {
|
||||
echo "$@"
|
||||
# echo "$@"
|
||||
$@
|
||||
}
|
||||
|
||||
function load_gnome_terminal_profiles() {
|
||||
if which dconf
|
||||
if which dconf 1>/dev/null
|
||||
then
|
||||
run dconf load /org/gnome/terminal/legacy/profiles:/ < $(this_script_root_dir)/gnome-terminal-profiles.dconf
|
||||
fi
|
||||
}
|
||||
|
||||
function use_fish() {
|
||||
if ! which fish 1>/dev/null
|
||||
then
|
||||
echo "Installing fish"
|
||||
run sudo apt-get install -y fish
|
||||
else
|
||||
echo "Fish is installed"
|
||||
fi
|
||||
|
||||
fish=$(which fish)
|
||||
current_shell=$(grep $USER /etc/passwd | cut -d ":" -f 7)
|
||||
if [ $current_shell != $fish ]
|
||||
then
|
||||
echo "Changing shell to $fish (you will be prompted for passwd)"
|
||||
run chsh -s $fish
|
||||
else
|
||||
echo "Default shell is $fish"
|
||||
fi
|
||||
}
|
||||
|
||||
function use_direnv() {
|
||||
if ! which direnv 1>/dev/null
|
||||
then
|
||||
echo "Installing direnv"
|
||||
run sudo apt-get install -y direnv
|
||||
else
|
||||
echo "direnv is installed"
|
||||
fi
|
||||
}
|
||||
|
||||
function use_starship() {
|
||||
if ! which starship 1>/dev/null
|
||||
then
|
||||
echo "Installing starship"
|
||||
run curl -sS https://starship.rs/install.sh | sh
|
||||
else
|
||||
echo "Starship is installed"
|
||||
fi
|
||||
}
|
||||
|
||||
function install_ubuntu_mono_nerd() {
|
||||
if ! fc-list | grep "UbuntuMono Nerd" 1>/dev/null
|
||||
then
|
||||
pushd /tmp
|
||||
run wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/UbuntuMono.zip
|
||||
run unzip UbuntuMono.zip
|
||||
run mkdir -p ~/.local/share/fonts
|
||||
run cp *.ttf ~/.local/share/fonts/
|
||||
run fc-cache -f
|
||||
popd
|
||||
else
|
||||
echo "UbuntuMono Nerd font is installed"
|
||||
fi
|
||||
|
||||
if [ ! -e /usr/share/terminfo/x/xterm-direct ]
|
||||
then
|
||||
run sudo apt-get install -y ncurses-term
|
||||
else
|
||||
echo "xterm-direct is in terminfo database"
|
||||
fi
|
||||
}
|
||||
|
||||
function install_deps() {
|
||||
use_fish
|
||||
use_direnv
|
||||
use_starship
|
||||
install_ubuntu_mono_nerd
|
||||
}
|
||||
|
||||
|
||||
function install_home() {
|
||||
install_deps
|
||||
for f in $files
|
||||
do
|
||||
run rm -Rf $HOME/$f
|
||||
@@ -43,9 +115,11 @@ function install_home() {
|
||||
}
|
||||
|
||||
|
||||
pushd $(this_script_root_dir)
|
||||
git pull
|
||||
git submodule init
|
||||
git submodule update
|
||||
popd
|
||||
pushd $(this_script_root_dir) 1>/dev/null
|
||||
echo "Updating git.tuleu.science:atuleu/home.git"
|
||||
git pull 1>/dev/null
|
||||
git submodule init 1>/dev/null
|
||||
git submodule update 1>/dev/null
|
||||
popd 1>/dev/null
|
||||
install_home
|
||||
echo "git.tuleu.science:atuleu/home.git updated and set"
|
||||
|
||||
Reference in New Issue
Block a user