From 28aae89f70958d583ea5409ca75597d8d4e4e369 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Tue, 23 Jul 2024 05:09:30 +0300 Subject: [PATCH] chore: cleanup and fixes --- base/zshenv | 2 -- base/zshrc | 6 ++++-- config/exports | 10 +++++----- config/shared.sh | 6 +++--- local/bin/x-have | 1 - local/bin/x-load-configs | 1 - 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/base/zshenv b/base/zshenv index 395a99b..67bf6ee 100644 --- a/base/zshenv +++ b/base/zshenv @@ -4,5 +4,3 @@ export DOTFILES="$HOME/.dotfiles" export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH" export SHARED_SCRIPTS_SOURCED=0 - -source "$DOTFILES/config/shared.sh" diff --git a/base/zshrc b/base/zshrc index fbf9e94..2b5379e 100755 --- a/base/zshrc +++ b/base/zshrc @@ -4,6 +4,10 @@ # export VERBOSE=1 # export DEBUG=1 +export DOTFILES="$HOME/.dotfiles" + +source "$DOTFILES/config/shared.sh" + x-path-prepend "/usr/local/bin" x-path-prepend "/opt/homebrew/bin" x-path-prepend "$HOME/.local/share/cargo/bin" @@ -11,8 +15,6 @@ x-path-prepend "$HOME/.local/share/bob/nvim-bin" x-path-prepend "$HOME/.local/bin" x-path-prepend "$DOTFILES/local/bin" -x-load-configs - eval "$(oh-my-posh init zsh --config "$DOTFILES/config/omp/own.toml")" # Load asdf diff --git a/config/exports b/config/exports index d194d65..e4adb84 100755 --- a/config/exports +++ b/config/exports @@ -4,11 +4,11 @@ # Set XDG directories if not already set # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -[ -z "$XDG_CONFIG_HOME" ] && export $XDG_CONFIG_HOME="$HOME/.config" -[ -z "$XDG_DATA_HOME" ] && export $XDG_DATA_HOME="$HOME/.local/share" -[ -z "$XDG_CACHE_HOME" ] && export $XDG_CACHE_HOME="$HOME/.cache" -[ -z "$XDG_STATE_HOME" ] && export $XDG_STATE_HOME="$HOME/.local/state" -[ -z "$XDG_BIN_HOME" ] && export $XDG_BIN_HOME="$HOME/.local/bin" +[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config" +[ -z "$XDG_DATA_HOME" ] && export XDG_DATA_HOME="$HOME/.local/share" +[ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME="$HOME/.cache" +[ -z "$XDG_STATE_HOME" ] && export XDG_STATE_HOME="$HOME/.local/state" +[ -z "$XDG_BIN_HOME" ] && export XDG_BIN_HOME="$HOME/.local/bin" # if DOTFILES is not set, set it to the default location [ -z "$DOTFILES" ] && export DOTFILES="$HOME/.dotfiles" diff --git a/config/shared.sh b/config/shared.sh index fb055d9..bfeb200 100755 --- a/config/shared.sh +++ b/config/shared.sh @@ -19,10 +19,10 @@ DEBUG="${DEBUG:-0}" # Explicitly set XDG folders, if not already set # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html [ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config" -[ -z "$XDG_DATA_HOME" ] && export $XDG_DATA_HOME="$HOME/.local/share" -[ -z "$XDG_STATE_HOME" ] && export $XDG_STATE_HOME="$HOME/.local/state" -[ -z "$XDG_BIN_HOME" ] && export XDG_BIN_HOME="$HOME/.local/bin" +[ -z "$XDG_DATA_HOME" ] && export XDG_DATA_HOME="$HOME/.local/share" [ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME="$HOME/.cache" +[ -z "$XDG_STATE_HOME" ] && export XDG_STATE_HOME="$HOME/.local/state" +[ -z "$XDG_BIN_HOME" ] && export XDG_BIN_HOME="$HOME/.local/bin" # Paths x-path-prepend "/usr/local/bin" diff --git a/local/bin/x-have b/local/bin/x-have index 7e07f67..bd37ec0 100755 --- a/local/bin/x-have +++ b/local/bin/x-have @@ -42,7 +42,6 @@ main() fi check_command "$1" - return 0 } main "$@" diff --git a/local/bin/x-load-configs b/local/bin/x-load-configs index 8017818..9f7577e 100755 --- a/local/bin/x-load-configs +++ b/local/bin/x-load-configs @@ -93,6 +93,5 @@ config_msg "VERBOSE=1" "Verbose mode enabled" config_msg "HOST" "$CONFIG_HOST" load_config_files "$(config_file_path "exports")" -load_config_files "$(config_file_path "functions")" load_config_files "$(config_file_path "alias")" exit 0