improve hm-session-vars.sh sourcing and also source bash completion on macOS
This commit is contained in:
parent
e01ffdad60
commit
9928cb402b
14
.bashrc
14
.bashrc
|
@ -38,10 +38,10 @@ if [[ "$(uname -s)" == 'Linux' ]]; then
|
|||
alias pbcopy='wl-copy'
|
||||
fi
|
||||
|
||||
|
||||
# source the vars only if we are not on NixOS
|
||||
if ! grep 'ID=nixos' /etc/os-release > /dev/null; then
|
||||
[[ -f "${HOME}/.nix-profile/etc/profile.d/hm-session-vars.sh" ]] && \
|
||||
source "${HOME}/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
SOURCE_HM_VARS=1
|
||||
elif grep 'debian' /etc/os-release > /dev/null; then
|
||||
export NEEDRESTART_MODE='a'
|
||||
export DEBIAN_FRONTEND='noninteractive'
|
||||
|
@ -51,6 +51,7 @@ if [[ "$(uname -s)" == 'Linux' ]]; then
|
|||
elif [[ "$(uname -s)" == 'Darwin' ]]; then
|
||||
GNU_LS="$(command -v gls)"
|
||||
GNU_GREP="$(command -v ggrep)"
|
||||
SOURCE_HM_VARS=1
|
||||
|
||||
alias ktb='sudo pkill TouchBarServer; sudo killall ControlStrip'
|
||||
alias mpv='mpv --vo=libmpv'
|
||||
|
@ -84,6 +85,15 @@ function tty_serial() {
|
|||
fi
|
||||
}
|
||||
|
||||
if [ "$SOURCE_HM_VARS" -eq 1 ]; then
|
||||
[ -f "${HOME}/.nix-profile/etc/profile.d/hm-session-vars.sh" ] && \
|
||||
source "${HOME}/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
[ -f "${HOME}/.local/share/nix-bash/bash_completion.sh" ] && \
|
||||
source "${HOME}/.local/share/nix-bash/bash_completion.sh"
|
||||
|
||||
# alias wrappers to call scripts
|
||||
SCRIPTS_DIR="${HOME}/.local/scripts/other-common-scripts"
|
||||
alias debextract="${SCRIPTS_DIR}/extract-deb-pkg.sh"
|
||||
|
|
Loading…
Reference in New Issue