chore(config): tweaks to configs and scripts

This commit is contained in:
2024-11-22 17:54:37 +02:00
parent 746646ae55
commit d585d61537
4 changed files with 15 additions and 10 deletions

View File

@@ -27,7 +27,7 @@ if ! command -v msg &> /dev/null; then
# $1 - message (string) # $1 - message (string)
msg() msg()
{ {
[[ "$VERBOSE" -eq 1 ]] && echo "-> $1" [[ "$VERBOSE" -eq 1 ]] && msgr msg "-> $1"
return 0 return 0
} }
fi fi
@@ -224,11 +224,11 @@ replacable()
FILE2="$2" FILE2="$2"
[[ ! -r "$FILE1" ]] && { [[ ! -r "$FILE1" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "File 1 ($FILE1) does not exist" [[ $VERBOSE -eq 1 ]] && msgr err "File 1 ($FILE1) does not exist"
return 0 return 0
} }
[[ ! -r "$FILE2" ]] && { [[ ! -r "$FILE2" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replaceable" [[ $VERBOSE -eq 1 ]] && msgr err "File 2 ($FILE2) does not exist, replaceable"
return 1 return 1
} }
@@ -236,20 +236,20 @@ replacable()
FILE2_HASH=$(get_sha256sum "$FILE2") FILE2_HASH=$(get_sha256sum "$FILE2")
[[ $FILE1_HASH = "" ]] && { [[ $FILE1_HASH = "" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 1 ($FILE1)" [[ $VERBOSE -eq 1 ]] && msgr err "Could not get hash for file 1 ($FILE1)"
return 0 return 0
} }
[[ $FILE2_HASH = "" ]] && { [[ $FILE2_HASH = "" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replaceable" [[ $VERBOSE -eq 1 ]] && msgr err "Could not get hash for file 2 ($FILE2), replaceable"
return 1 return 1
} }
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && { [[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replaceable: $FILE1" [[ $VERBOSE -eq 1 ]] && msgr ok "Files match, not replaceable: $FILE1"
return 0 return 0
} }
[[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replaceable" [[ $VERBOSE -eq 1 ]] && msgr warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replaceable"
return 1 return 1
} }
@@ -328,6 +328,7 @@ fi
# https://getantidote.github.io/ # https://getantidote.github.io/
msg "Setting up Antidote configuration" msg "Setting up Antidote configuration"
export ANTIDOTE_DIR="$DOTFILES/tools/antidote" export ANTIDOTE_DIR="$DOTFILES/tools/antidote"
export ANTIDOTE_HOME="$XDG_CACHE_HOME/antidote"
export ANTIDOTE_PLUGINS="$XDG_CONFIG_HOME/zsh/antidote_plugins" export ANTIDOTE_PLUGINS="$XDG_CONFIG_HOME/zsh/antidote_plugins"
# Antigen configuration # Antigen configuration
@@ -417,6 +418,9 @@ msg "Setting up Go configuration"
export GOPATH="$XDG_DATA_HOME/go" export GOPATH="$XDG_DATA_HOME/go"
export GOBIN="$XDG_BIN_HOME" export GOBIN="$XDG_BIN_HOME"
# Lando
export PATH="$HOME/.lando/bin${PATH+:$PATH}" #landopath
# NPM: Add npm packages to path # NPM: Add npm packages to path
msg "Setting up NPM configuration" msg "Setting up NPM configuration"
x-have node && { x-have node && {

View File

@@ -97,7 +97,8 @@ final_space = true
[blocks.segments.properties] [blocks.segments.properties]
display_mode = 'context' display_mode = 'context'
fetch_virtual_env = false fetch_version = true
fetch_virtual_env = true
[[blocks]] [[blocks]]
type = 'prompt' type = 'prompt'

View File

@@ -131,7 +131,7 @@ systemsetup -settimezone "Europe/Helsinki" > /dev/null
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Stop iTunes from responding to the keyboard media keys # Stop iTunes from responding to the keyboard media keys
#launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null
############################################################################### ###############################################################################
# Screen # # Screen #

View File

@@ -11,7 +11,7 @@
[ -z "$SHARED_SCRIPTS_SOURCED" ] && { [ -z "$SHARED_SCRIPTS_SOURCED" ] && {
source "${DOTFILES}/config/shared.sh" source "${DOTFILES}/config/shared.sh"
msgr done "(!) shared.sh not sourced" msgr warn "(!) shared.sh not sourced"
# Set variable that checks if the shared.sh script has been sourced only once # Set variable that checks if the shared.sh script has been sourced only once
# shellcheck disable=SC2034 # shellcheck disable=SC2034