Move ~/.dotfiles to $XDG_DATA_HOME/dotfiles

This commit is contained in:
Alexander Hess 2023-04-10 17:46:20 +02:00
parent 13b8724696
commit 71baf34d58
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
4 changed files with 11 additions and 11 deletions

View file

@ -39,7 +39,7 @@ alias help='man'
# Various one-line utilities # Various one-line utilities
alias datetime='date +"%Y-%m-%d %H:%M:%S %z (%Z)"' alias datetime='date +"%Y-%m-%d %H:%M:%S %z (%Z)"'
alias datetime-iso='date --iso-8601=seconds' 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="curl https://icanhazip.com"
alias external-ip-alt="curl https://ipinfo.io/ip\?token=cfd78a97e15ebf && echo" 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" alias external-ip-extended-infos="curl https://ipinfo.io/json\?token=cfd78a97e15ebf && echo"

View file

@ -13,9 +13,9 @@ _command_exists() {
cd $HOME cd $HOME
# Get the latest ~/.dotfiles, possibly replacing the old ones # Get the latest $XDG_DATA_HOME/dotfiles, possibly replacing the old ones
rm -rf "$HOME/.dotfiles" >/dev/null rm -rf "$XDG_DATA_HOME/dotfiles" >/dev/null
git clone --bare https://code.webartifex.biz/alexander/dotfiles.git "$HOME/.dotfiles" git clone --bare https://code.webartifex.biz/alexander/dotfiles.git "$XDG_DATA_HOME/dotfiles"
# Distribute the dotfiles in $HOME # Distribute the dotfiles in $HOME
git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME checkout --force git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME checkout --force

View file

@ -63,15 +63,15 @@ _update_repositories() {
cd $cwd cd $cwd
} }
# Update the ~/.dotfiles repository # Update the $XDG_DATA_HOME/dotfiles repository
_update_dotfiles() { _update_dotfiles() {
echo "Fetching $HOME/.dotfiles" echo "Fetching $XDG_DATA_HOME/dotfiles"
# The `dotfiles` alias is defined in ~/.bashrc at the end of the # The `dotfiles` alias is defined in ~/.bashrc at the end of the
# "Shell Utilities & Aliases" section and can NOT be used here # "Shell Utilities & Aliases" section and can NOT be used here
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME stash --quiet git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME stash --quiet
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME fetch --all --prune git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME fetch --all --prune
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME pull --rebase --quiet git --git-dir=$XDG_DATA_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 pop # --quiet is ignored
} }

View file

@ -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 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. and initializes all the dotfiles provided here on the system.
Further, `zsh` is set up Further, `zsh` is set up
with [`oh-my-zsh`](https://ohmyz.sh/) and [`zplug`](https://github.com/zplug/zplug) with [`oh-my-zsh`](https://ohmyz.sh/) and [`zplug`](https://github.com/zplug/zplug)