This is the very first repo to clone after switch to a new machine. The purposes of this repo are listed below.
-
Automation
Shell script makes it easy to automating installing softwares and setting up your development environment.
-
Repeating operations
For example, backup files.
-
Saving Time
Spend time writing a script and save time at some time in the future.
-
Config files
Config files can be shared between machines or operating systems. Don't waste time to google it and configure it again and again.
nerd font download link
-
Other Intents
IOT stuff.
curl -Lks https://github.com/eynol/dotfiles/raw/master/scripts/install-dotfiles.sh | /bin/bashThe install script does the following things.
- Clone this repo to
$HOME/.cfg - Make dir
.config-backupfor backuping existing config files - Try checkout files
- if checkout error, rerun again to use
egrep "\s+"to select files and mv these files to.config-backup
- if checkout error, rerun again to use
- In the end,
git config status.showUntrackedFiles no
When install is done, reload your shell or source your rc file.
You can use config as git command to manage your dotfiles.
Check out this article: https://www.atlassian.com/git/tutorials/dotfiles and github.com/durdn/cfg.
It shows a simple way to backup your dotfiles.
Basicly, it use .zshrc or .bashrc to source other config files.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# read common shared config
[ -s "$HOME/.shell.rc.sh" ] && source $HOME/.shell.rc.shIn the $HOME/.shell.rc.sh, it does the following things.
-
Add
$HOME/binto$PATH, so that we can use local binaries -
Add device private scripts to
$PATHin$HOME/device-scripts -
Set environment variables:
RUSTUP_DIST_SERVER -
Source
$HOME/.shell.secret.shif it exists -
Source
$HOME/.shell.device.shif it exists -
Define editor:
export EDITOR=nvim -
Define aliases:
lg: lazygitt:v:$EDITORconfig:git --git-dir=$HOME/.cfg/ --work-tree=$HOMElazyconfig:lazygit --git-dir=$HOME/.cfg/ --work-tree=$HOME
-
Os related configs
git can use includeIf to include different config files based on the remote url.
[includeIf "hasconfig:remote.*.url:git@gitlab.com:*/**"]
path = ~/.gitconfig.github