Move ~/.dotfiles to $XDG_DATA_HOME/dotfiles
This commit is contained in:
parent
13b8724696
commit
71baf34d58
4 changed files with 11 additions and 11 deletions
|
@ -39,7 +39,7 @@ alias help='man'
|
|||
# Various one-line utilities
|
||||
alias datetime='date +"%Y-%m-%d %H:%M:%S %z (%Z)"'
|
||||
alias datetime-iso='date --iso-8601=seconds'
|
||||
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
||||
alias dotfiles='git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME'
|
||||
alias external-ip="curl https://icanhazip.com"
|
||||
alias external-ip-alt="curl https://ipinfo.io/ip\?token=cfd78a97e15ebf && echo"
|
||||
alias external-ip-extended-infos="curl https://ipinfo.io/json\?token=cfd78a97e15ebf && echo"
|
||||
|
|
|
@ -13,9 +13,9 @@ _command_exists() {
|
|||
cd $HOME
|
||||
|
||||
|
||||
# Get the latest ~/.dotfiles, possibly replacing the old ones
|
||||
rm -rf "$HOME/.dotfiles" >/dev/null
|
||||
git clone --bare https://code.webartifex.biz/alexander/dotfiles.git "$HOME/.dotfiles"
|
||||
# Get the latest $XDG_DATA_HOME/dotfiles, possibly replacing the old ones
|
||||
rm -rf "$XDG_DATA_HOME/dotfiles" >/dev/null
|
||||
git clone --bare https://code.webartifex.biz/alexander/dotfiles.git "$XDG_DATA_HOME/dotfiles"
|
||||
|
||||
# Distribute the dotfiles in $HOME
|
||||
git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME checkout --force
|
||||
|
|
|
@ -63,15 +63,15 @@ _update_repositories() {
|
|||
cd $cwd
|
||||
}
|
||||
|
||||
# Update the ~/.dotfiles repository
|
||||
# Update the $XDG_DATA_HOME/dotfiles repository
|
||||
_update_dotfiles() {
|
||||
echo "Fetching $HOME/.dotfiles"
|
||||
echo "Fetching $XDG_DATA_HOME/dotfiles"
|
||||
# The `dotfiles` alias is defined in ~/.bashrc at the end of the
|
||||
# "Shell Utilities & Aliases" section and can NOT be used here
|
||||
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME stash --quiet
|
||||
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME fetch --all --prune
|
||||
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME pull --rebase --quiet
|
||||
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME stash pop # --quiet is ignored
|
||||
git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME stash --quiet
|
||||
git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME fetch --all --prune
|
||||
git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME pull --rebase --quiet
|
||||
git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME stash pop # --quiet is ignored
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ curl https://code.webartifex.biz/alexander/dotfiles/-/raw/main/.config/shell/ini
|
|||
```
|
||||
|
||||
This gives you a local copy of the latest version of this repository
|
||||
(located in `~/.dotfiles`)
|
||||
(located in `$XDG_DATA_HOME/dotfiles`)
|
||||
and initializes all the dotfiles provided here on the system.
|
||||
Further, `zsh` is set up
|
||||
with [`oh-my-zsh`](https://ohmyz.sh/) and [`zplug`](https://github.com/zplug/zplug)
|
||||
|
|
Loading…
Reference in a new issue