Skip to content

Instantly share code, notes, and snippets.

@dimti
Last active October 23, 2024 10:53
Show Gist options
  • Save dimti/318acf5442fe691a8b846f3d43db3000 to your computer and use it in GitHub Desktop.
Save dimti/318acf5442fe691a8b846f3d43db3000 to your computer and use it in GitHub Desktop.
Install or update YADM for root and non-priveleged single user
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