mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
aliases: fix 'dotfiles' and 'aliases' alias
After moving dotfiles around, these aliases became out of sync. Dynamically detect the path of the 'aliases' file, and set 'dotfiles' to use the XDG config directory. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
parent
521f462141
commit
9316d74027
10
aliases
10
aliases
@ -1,3 +1,9 @@
|
|||||||
|
case "$(basename "$(readlink -f /proc/$$/exe)")" in
|
||||||
|
zsh) thisfile="$(readlink -f "${(%):-%N}")";;
|
||||||
|
bash) thisfile="$(readlink -f "${BASH_SOURCE[0]}")";;
|
||||||
|
*) thisfile="$(find /proc/$$/fd/ | xargs -n1 -r readlink -f | grep aliases | head -n1)";;
|
||||||
|
esac
|
||||||
|
|
||||||
# Global aliases for ZSH
|
# Global aliases for ZSH
|
||||||
if alias -g 2>/dev/null; then
|
if alias -g 2>/dev/null; then
|
||||||
alias -g ...=../..
|
alias -g ...=../..
|
||||||
@ -287,14 +293,14 @@ _zl() { _zfs "list $@"; }
|
|||||||
|
|
||||||
# General Aliases
|
# General Aliases
|
||||||
alias ssha='eval `ssh-agent` ; ssh-add'
|
alias ssha='eval `ssh-agent` ; ssh-add'
|
||||||
alias aliases="$EDITOR $DOTFILES/aliases ; exec zsh"
|
alias aliases="$EDITOR $thisfile ; exec zsh"
|
||||||
alias vimrc="$EDITOR $VIMRC"
|
alias vimrc="$EDITOR $VIMRC"
|
||||||
alias zshrc="$EDITOR ${ZDOTDIR:-$HOME}/.zshrc ; exec zsh"
|
alias zshrc="$EDITOR ${ZDOTDIR:-$HOME}/.zshrc ; exec zsh"
|
||||||
alias gitrc="$EDITOR $XDG_CONFIG_HOME/git/config"
|
alias gitrc="$EDITOR $XDG_CONFIG_HOME/git/config"
|
||||||
alias xinitrc="$EDITOR $XDG_CONFIG_HOME/X11/xinitrc"
|
alias xinitrc="$EDITOR $XDG_CONFIG_HOME/X11/xinitrc"
|
||||||
alias xresources="$EDITOR $XDG_CONFIG_HOME/X11/xresources ; xrdb merge $XDG_CONFIG_HOME/X11/xresources"
|
alias xresources="$EDITOR $XDG_CONFIG_HOME/X11/xresources ; xrdb merge $XDG_CONFIG_HOME/X11/xresources"
|
||||||
alias sshc="$EDITOR ~/.ssh/config"
|
alias sshc="$EDITOR ~/.ssh/config"
|
||||||
alias dotfiles="cd $DOTFILES"
|
alias dotfiles="cd $XDG_CONFIG_HOME"
|
||||||
alias i3c="$EDITOR $XDG_CONFIG_HOME/i3/config; systemctl --user reload i3"
|
alias i3c="$EDITOR $XDG_CONFIG_HOME/i3/config; systemctl --user reload i3"
|
||||||
alias polybarc="$EDITOR $XDG_CONFIG_HOME/polybar/config; systemctl --user reload polybar@i3bar"
|
alias polybarc="$EDITOR $XDG_CONFIG_HOME/polybar/config; systemctl --user reload polybar@i3bar"
|
||||||
|
|
||||||
|
@ -151,13 +151,6 @@ ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan,bold'
|
|||||||
|
|
||||||
source "$XDG_CONFIG_HOME/aliases"
|
source "$XDG_CONFIG_HOME/aliases"
|
||||||
|
|
||||||
# Source secret keys and values into environment
|
|
||||||
if [ -f "$XDG_CONFIG_HOME/secrets" ]; then
|
|
||||||
set -o allexport
|
|
||||||
source $XDG_CONFIG_HOME/secrets
|
|
||||||
set +o allexport
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load some manual plugins
|
# Load some manual plugins
|
||||||
source "$ZSH_DIR/plugins/sudo.zsh"
|
source "$ZSH_DIR/plugins/sudo.zsh"
|
||||||
source "$ZSH_DIR/plugins/fish-theme.zsh"
|
source "$ZSH_DIR/plugins/fish-theme.zsh"
|
||||||
|
Loading…
Reference in New Issue
Block a user