Last active
October 23, 2024 10:53
-
-
Save dimti/318acf5442fe691a8b846f3d43db3000 to your computer and use it in GitHub Desktop.
Install or update YADM for root and non-priveleged single user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command -v direnv || curl -sfLo /usr/local/bin/direnv https://github.com/direnv/direnv/releases/download/v2.35.0/direnv.linux-amd64 && chmod a+x /usr/local/bin/direnv | |
command -v starship || curl -sS https://starship.rs/install.sh | sh -s -- -f > /dev/null | |
command -v yadm && { | |
yadm remote set-url origin https://vcs.wpstudio.ru/gitea/dotfiles.git | |
rm -rf .tmux/plugins/tmux-ip-address | |
yadm pull && yadm checkout . | |
} || { | |
curl -sfLo /usr/local/bin/yadm https://github.com/TheLocehiliosan/yadm/raw/master/yadm && chmod a+x /usr/local/bin/yadm | |
yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git && yadm checkout . | |
} | |
# Do not use if you have greater that one home users | |
HOME_USER=$(ls /home) | |
su --login ${HOME_USER} -c 'yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git && yadm checkout .' | |
# That is change bash prompt line symbol to $ (and stay # for root) | |
su --login ${HOME_USER} -c 'sed -i "s/#/\\\\$/g" ${HOME}/.config/starship.toml' | |
cat /etc/locale.gen | egrep '^#.*en_US.UTF-8' > /dev/null && sed -i 's/^#.*en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && locale-gen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment