mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-24 17:52:54 +00:00
fix(shell): change how shell detection works
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
export DOTFILES_SHARED_LOADED=""
|
export DOTFILES_SHARED_LOADED=""
|
||||||
export DOTFILES_CURRENT_SHELL="bash"
|
|
||||||
# shellcheck source=scripts/shared.sh
|
# shellcheck source=scripts/shared.sh
|
||||||
source "$DOTFILES/scripts/shared.sh"
|
source "$DOTFILES/scripts/shared.sh"
|
||||||
path_prepend "$DOTFILES/local/bin"
|
path_prepend "$DOTFILES/local/bin"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
export DOTFILES_CURRENT_SHELL="zsh"
|
|
||||||
# shellcheck source=scripts/shared.sh
|
# shellcheck source=scripts/shared.sh
|
||||||
source "$DOTFILES/scripts/shared.sh"
|
source "$DOTFILES/scripts/shared.sh"
|
||||||
path_prepend "$DOTFILES/local/bin"
|
path_prepend "$DOTFILES/local/bin"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# shellcheck disable=1091,2139
|
# shellcheck disable=1091,2139
|
||||||
# vim: filetype=bash
|
# vim: filetype=bash
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||||
source "$DOTFILES/scripts/shared.sh"
|
source "$DOTFILES/scripts/shared.sh"
|
||||||
|
|
||||||
# Antigen configuration
|
# Antigen configuration
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# shellcheck disable=1091,2046
|
# shellcheck disable=1091,2046
|
||||||
# vim: filetype=zsh
|
# vim: filetype=bash
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
source "$DOTFILES/scripts/shared.sh"
|
source "$DOTFILES/scripts/shared.sh"
|
||||||
@@ -48,25 +48,27 @@ hash shopt 2> /dev/null && shopt -s checkwinsize
|
|||||||
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
|
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
|
||||||
|
|
||||||
# If we are using zsh, color our dir lists and such
|
# If we are using zsh, color our dir lists and such
|
||||||
if [ "$DOTFILES_CURRENT_SHELL" = "zsh" ]; then
|
if [ "$DOTFILES_CURRENT_SHELL" = "-zsh" ]; then
|
||||||
autoload -U colors zsh/terminfo compinit
|
[[ $ZSH_VERSION != "" ]] && {
|
||||||
colors
|
autoload -U colors zsh/terminfo compinit
|
||||||
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
colors
|
||||||
|
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
||||||
|
|
||||||
x-dc "$XDG_CACHE_HOME/zsh"
|
x-dc "$XDG_CACHE_HOME/zsh"
|
||||||
x-dc "$XDG_STATE_HOME/zsh"
|
x-dc "$XDG_STATE_HOME/zsh"
|
||||||
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||||||
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
||||||
zstyle ':completion:*' list-colors "$LS_COLORS"
|
zstyle ':completion:*' list-colors "$LS_COLORS"
|
||||||
|
|
||||||
# fzf
|
# fzf
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
|
||||||
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
|
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
|
||||||
|
|
||||||
# Load iterm2 shell integration
|
# Load iterm2 shell integration
|
||||||
# https://iterm2.com/documentation-shell-integration.html
|
# https://iterm2.com/documentation-shell-integration.html
|
||||||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
|
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
|
||||||
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If we are using bash
|
# If we are using bash
|
||||||
|
|||||||
@@ -3,20 +3,21 @@
|
|||||||
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
||||||
|
|
||||||
: "${DOTFILES:=$HOME/.dotfiles}"
|
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||||
|
source "$DOTFILES/scripts/shared.sh"
|
||||||
|
|
||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
for FILENAME in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
HOST="$(hostname -s)"
|
HOST="$(hostname -s)"
|
||||||
# global (exports|alias|functions) file for all hosts
|
# global (exports|alias|functions) FILENAME for all hosts
|
||||||
# shellcheck source=../config/exports
|
# shellcheck source=../config/exports
|
||||||
[ -r "$file" ] && source "$file"
|
[ -r "$FILENAME" ] && source "$FILENAME"
|
||||||
# global secret file, git ignored
|
# global secret FILENAME, git ignored
|
||||||
# shellcheck source=../config/exports-secret
|
# shellcheck source=../config/exports-secret
|
||||||
[ -r "$file-secret" ] && source "$file-secret"
|
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
|
||||||
# host specific (exports|alias|functions) file
|
# host specific (exports|alias|functions) FILENAME
|
||||||
# shellcheck source=../config/exports
|
# shellcheck source=../config/exports
|
||||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
|
||||||
# host specific (exports|alias|functions) file, git ignored
|
# host specific (exports|alias|functions) FILENAME, git ignored
|
||||||
# shellcheck source=../config/exports
|
# shellcheck source=../config/exports
|
||||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
|
|
||||||
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
|
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
|
||||||
: "${VERBOSE:=0}"
|
: "${VERBOSE:=0}"
|
||||||
|
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||||
|
|
||||||
|
DOTFILES_CURRENT_SHELL=$(ps -p $$ -oargs=)
|
||||||
|
export DOTFILES_CURRENT_SHELL
|
||||||
|
|
||||||
source "$DOTFILES/local/bin/msgr"
|
source "$DOTFILES/local/bin/msgr"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user