diff --git a/.yamlfmt b/.yamlfmt index 04bcd62..efd6725 100644 --- a/.yamlfmt +++ b/.yamlfmt @@ -19,4 +19,3 @@ include: exclude: - ./tools/** - - ./config/nvim/** diff --git a/base/bashrc b/base/bashrc old mode 100644 new mode 100755 index dfa220d..710510c --- a/base/bashrc +++ b/base/bashrc @@ -7,19 +7,27 @@ export DOTFILES="$HOME/.dotfiles" # Run x-load-configs in your terminal to reload the files. function x-load-configs() { + # Load the shell dotfiles, and then some: + for file in $DOTFILES/config/{exports,alias,functions}; do HOST="$(hostname -s)" - # Load the shell dotfiles, and then some: - for file in $DOTFILES/config/{exports,alias,functions}; do - [ -r "$file" ] && source "$file" - [ -r "$file-secret" ] && source "$file-secret" - [ -r "$file-$HOST" ] && source "$file-$HOST" - [ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret" - done + # global (exports|alias|functions) file for all hosts + # shellcheck source=../config/exports + [ -r "$file" ] && source "$file" + # global secret file, git ignored + # shellcheck source=../config/exports-secret + [ -r "$file-secret" ] && source "$file-secret" + # host specific (exports|alias|functions) file + # shellcheck source=../config/exports + [ -r "$file-$HOST" ] && source "$file-$HOST" + # host specific (exports|alias|functions) file, git ignored + # shellcheck source=../config/exports + [ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret" + done } x-load-configs # Import ssh keys in keychain -ssh-add -A 2>/dev/null; +ssh-add -A 2> /dev/null # shellcheck source=../config/fzf/fzf.bash [ -f "${DOTFILES}/config/fzf/fzf.bash" ] \ diff --git a/base/zshrc b/base/zshrc old mode 100644 new mode 100755 index 1feec04..11fbf61 --- a/base/zshrc +++ b/base/zshrc @@ -42,8 +42,7 @@ x-dc "$ZSH_CUSTOM_COMPLETION_PATH" FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH" autoload -Uz compinit -if type brew &>/dev/null -then +if type brew &> /dev/null; then FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" fi @@ -70,4 +69,3 @@ have antigen && { # Start starship eval "$(starship init zsh)" - diff --git a/config/alacritty/alacritty.yml b/config/alacritty/alacritty.yml index fd5590f..9e79b59 100644 --- a/config/alacritty/alacritty.yml +++ b/config/alacritty/alacritty.yml @@ -1,3 +1,4 @@ +--- # Configuration for Alacritty, the GPU enhanced terminal emulator # Any items in the `env` entry below will be added as diff --git a/install b/install index 387af40..7ef91cc 100755 --- a/install +++ b/install @@ -27,9 +27,9 @@ git submodule update --init --recursive "${DOTBOT_DIR}" if [ "${DOTBOT_HOST}" != "" ]; then DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}" echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}" - [ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] && - echo "(!) Found $DOTBOT_HOST_CONFIG" && - "$DOTBOT_BIN_PATH" \ + [ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \ + && echo "(!) Found $DOTBOT_HOST_CONFIG" \ + && "$DOTBOT_BIN_PATH" \ -d "$BASEDIR" \ --plugin-dir=tools/dotbot-brew \ --plugin-dir=tools/dotbot-include \ diff --git a/local/bin/dfm b/local/bin/dfm index b80288c..68e8cc2 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -250,10 +250,8 @@ function section_dotfiles ~/.local/share/nvim \ ~/.local/state/nvim \ ~/.cache/nvim \ - ~/.config/astronvim \ ~/.config/nvim - msg_ok "Deleted old nvim files" - ln -s "$DOTFILES/config/astronvim" ~/.config/astronvim + msg_ok "Deleted old nvim files (share, state and cache + config)" ln -s "$DOTFILES/config/nvim" ~/.config/nvim msg_ok "Linked nvim and astronvim" have npm && $0 install npm diff --git a/local/bin/x-welcome-banner b/local/bin/x-welcome-banner index b0073bd..ae032f4 100755 --- a/local/bin/x-welcome-banner +++ b/local/bin/x-welcome-banner @@ -16,21 +16,22 @@ COLOR_S='\033[0;36m' RESET='\033[0m' # Print time-based personalized message, using figlet & lolcat if availible -function welcome_greeting () { +function welcome_greeting() +{ h=$(date +%H) - if [ "$h" -lt 04 ] || [ "$h" -gt 22 ]; - then greeting="Good Night" - elif [ "$h" -lt 12 ]; - then greeting="Good morning" - elif [ "$h" -lt 18 ]; - then greeting="Good afternoon" - elif [ "$h" -lt 22 ]; - then greeting="Good evening" + if [ "$h" -lt 04 ] || [ "$h" -gt 22 ]; then + greeting="Good Night" + elif [ "$h" -lt 12 ]; then + greeting="Good morning" + elif [ "$h" -lt 18 ]; then + greeting="Good afternoon" + elif [ "$h" -lt 22 ]; then + greeting="Good evening" else greeting="Hello" fi WELCOME_MSG="$greeting $USER!" - if hash lolcat 2>/dev/null && hash figlet 2>/dev/null; then + if hash lolcat 2> /dev/null && hash figlet 2> /dev/null; then echo "${WELCOME_MSG}" | figlet | lolcat else echo -e "$COLOR_P${WELCOME_MSG}${RESET}\n" @@ -38,8 +39,9 @@ function welcome_greeting () { } # Print system information with neofetch, if it's installed -function welcome_sysinfo () { - if hash neofetch 2>/dev/null; then +function welcome_sysinfo() +{ + if hash neofetch 2> /dev/null; then neofetch --shell_version off \ --disable kernel distro shell resolution cpu gpu de wm wm_theme theme icons terminal \ --backend off \ @@ -50,7 +52,8 @@ function welcome_sysinfo () { } # Print todays info: Date, IP, weather, etc -function welcome_today () { +function welcome_today() +{ timeout=1 echo -e "\033[1;34mToday\n------" @@ -62,7 +65,7 @@ function welcome_today () { echo -e "${RESET}" # Print IP address - if hash ip 2>/dev/null; then + if hash ip 2> /dev/null; then ip_address=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}') ip_interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1{split($2,a," ");print a[1]}') echo -e "${COLOR_S}🌐 IP: $(curl -s -m $timeout 'https://ipinfo.io/ip') (${ip_address} on ${ip_interface})" @@ -71,23 +74,11 @@ function welcome_today () { } # Putting it all together -function welcome() { +function welcome() +{ welcome_greeting welcome_sysinfo welcome_today } -# Determine if file is being run directly or sourced -([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \ - || [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \ - && printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \ - || [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null) -) && sourced=1 || sourced=0 - -# If script being called directly run immediately -if [ "$sourced" -eq 0 ]; then - welcome "$@" -fi - -# EOF - +welcome "$@" diff --git a/scripts/install-cargo-packages.sh b/scripts/install-cargo-packages.sh index 1b9897c..cff49a9 100755 --- a/scripts/install-cargo-packages.sh +++ b/scripts/install-cargo-packages.sh @@ -29,7 +29,7 @@ for pkg in "${packages[@]}"; do # Skip comments if [[ ${pkg:0:1} == "#" ]]; then continue; fi - msg "Installing cargo package $pkg" + msg_run "Installing cargo package $pkg" cargo install "$pkg" echo "" diff --git a/scripts/install-pip-packages.sh b/scripts/install-pip-packages.sh index b7e95e7..4f9e1fe 100755 --- a/scripts/install-pip-packages.sh +++ b/scripts/install-pip-packages.sh @@ -9,6 +9,7 @@ source "$HOME/.dotfiles/scripts/shared.sh" } packages=( + "pipx" "libtmux" )