Compare commits

...

8 Commits

8 changed files with 73 additions and 135 deletions

5
.luarc.json Normal file
View File

@@ -0,0 +1,5 @@
{
"diagnostics.globals": [
"vim"
]
}

View File

@@ -1,10 +1,10 @@
1password-cli 2.29.0
age 1.2.0
asdf-plugin-manager 1.3.1
bottom 0.9.6
bottom 0.9.7
dotenv-linter 3.3.0
editorconfig-checker 2.8.0
eza 0.18.22
eza 0.18.23
fd 10.1.0
github-cli 2.53.0
golang 1.22.5
@@ -12,9 +12,9 @@ hadolint 2.12.0
kubectl 1.30.3
lazygit 0.43.1
neovim system
nodejs 22.4.1
nodejs 22.5.1
pipx 1.6.0
pre-commit 3.7.1
pre-commit 3.8.0
ripgrep 14.1.0
rust 1.79.0
semgrep system
@@ -22,7 +22,7 @@ shellcheck 0.10.0
shfmt 3.8.0
terraform-ls 0.33.3
terraform-lsp 0.0.12
terragrunt 0.63.3
terragrunt 0.64.2
tf-summarize 0.3.10
vault 1.17.2+ent
yamllint 1.35.1

View File

@@ -13,6 +13,8 @@
# if DOTFILES is not set, set it to the default location
[ -z "$DOTFILES" ] && export DOTFILES="$HOME/.dotfiles"
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
if ! command -v msg &> /dev/null; then
# Function to print messages if VERBOSE is enabled
# $1 - message (string)
@@ -73,6 +75,7 @@ darknotify_alacritty()
-c "$HOME/.dotfiles/local/bin/x-change-alacritty-theme" &
) &> /dev/null
}
return 0
}
darknotify_alacritty
@@ -98,14 +101,14 @@ have_brew()
# Alacritty preexec hook to update dynamic title
preexec()
{
print -Pn "\e]0;$1%~\a"
print -n -P "\e]0;$1%~\a"
}
# Update dotfiles
dfu()
{
(
cd "$DOTFILES" && git pull --ff-only && ./install -q
cd "$DOTFILES" && git pull --ff-only && ./install
)
}
@@ -364,17 +367,6 @@ msg "Setting up Go configuration"
export GOPATH="$XDG_DATA_HOME/go"
export GOBIN="$XDG_BIN_HOME"
# Herd, herd.laravel.com
# Herd injected PHP binary.
msg "Setting up Herd configuration"
export PATH="$HOME/Library/Application\ Support/Herd/bin/":$PATH
x-have herd && {
# Herd injected PHP 8.3 configuration.
export HERD_PHP_83_INI_SCAN_DIR="$HOME/Library/Application\ Support/Herd/config/php/83/"
# Herd injected PHP 7.4 configuration.
export HERD_PHP_74_INI_SCAN_DIR="$HOME/Library/Application\ Support/Herd/config/php/74/"
}
# nb, https://xwmx.github.io/nb/
msg "Setting up nb configuration"
export NBRC_PATH="$XDG_CONFIG_HOME/nbrc"
@@ -461,3 +453,4 @@ x-dc "$WAKATIME_HOME"
msg "Setting up miscellaneous configuration"
export CHEAT_USE_FZF=true
export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history"

View File

@@ -14,7 +14,7 @@ A_DIR="$HOME/.config/alacritty"
usage()
{
echo "Usage: $0 <theme>"
echo "Available themes: dark, night, day"
echo "Available themes: (dark|night) to turn dark mode on, (day|light) to turn off"
exit 1
}
@@ -23,6 +23,7 @@ usage()
msg()
{
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
return 0
}
# Function to set the alacritty theme
@@ -30,8 +31,10 @@ msg()
set_alacritty_theme()
{
local theme=$1
msg "Setting alacritty theme to $theme"
cp -f "$A_DIR/theme-$theme.toml" "$A_DIR/theme-active.toml"
local theme_file="$A_DIR/theme-$theme.toml"
msg "Setting alacritty theme to $theme ($theme_file)"
cp -f "$theme_file" "$A_DIR/theme-active.toml"
return 0
}
# Function to notify alacritty about the changes
@@ -39,6 +42,7 @@ notify_alacritty()
{
msg "Notifying alacritty about the changes"
touch "$A_DIR/alacritty.toml"
return 0
}
# Main function
@@ -51,7 +55,7 @@ main()
local alacritty_theme=$1
case "$alacritty_theme" in
day)
day | light)
set_alacritty_theme "day"
;;
*)
@@ -61,6 +65,7 @@ main()
notify_alacritty
msg "Theme set successfully!"
exit 0
}
main "$@"

View File

@@ -6,13 +6,6 @@
# Set verbosity with VERBOSE=1
VERBOSE="${VERBOSE:-0}"
# Function to print usage information
usage()
{
echo "Usage: $0 <dir>"
exit 1
}
# Function to print messages if VERBOSE is enabled
# $1 - message (string)
msg()
@@ -20,48 +13,28 @@ msg()
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
}
# Function to remove a directory from PATH
# $1 - directory to remove (string)
remove_from_path()
{
local dir=$1
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <dir>"
exit 1
fi
if echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
export PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$dir\"" | sed 's/:$//')
msg "Directory $dir has been removed from PATH"
else
msg "Directory $dir is not in PATH"
fi
}
dir="$1"
# Function to append a directory to PATH
# $1 - directory to append (string)
append_to_path()
{
local dir=$1
if echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
export PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$dir\"" | sed 's/:$//')
msg "Directory $dir has been removed from PATH"
else
msg "Directory $dir is not in PATH"
fi
if [ ! -d "$dir" ]; then
msg "(?) Directory $dir does not exist"
exit 0
fi
if [ ! -d "$dir" ]; then
msg "(?) Directory $dir does not exist"
exit 0
fi
if echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
msg "(!) Directory $dir is already in PATH"
else
export PATH="${PATH:+"$PATH:"}$dir"
msg "(!) Directory $dir has been added to the end of PATH"
fi
}
# Main function
main()
{
if [ "$#" -ne 1 ]; then
usage
fi
remove_from_path "$1"
append_to_path "$1"
}
main "$@"
if echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
msg "(!) Directory $dir is already in PATH"
else
export PATH="${PATH:+"$PATH:"}$dir"
msg "(!) Directory $dir has been added to the end of PATH"
fi

View File

@@ -6,13 +6,6 @@
# Set verbosity with VERBOSE=1
VERBOSE="${VERBOSE:-0}"
# Function to print usage information
usage()
{
echo "Usage: $0 <dir>"
exit 1
}
# Function to print messages if VERBOSE is enabled
# $1 - message (string)
msg()
@@ -20,33 +13,21 @@ msg()
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
}
# Function to add a directory to the front of PATH
# $1 - directory to add (string)
prepend_to_path()
{
local dir=$1
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <dir>"
exit 1
fi
if [ ! -d "$dir" ]; then
msg "(?) Directory $dir does not exist"
exit 0
fi
dir="$1"
if echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
msg "(!) Directory $dir is already in PATH"
else
export PATH="$dir${PATH:+":$PATH"}"
msg "(!) Directory $dir has been added to the front of PATH"
fi
}
if [ ! -d "$dir" ]; then
msg "(?) Directory $dir does not exist"
exit 0
fi
# Main function
main()
{
if [ "$#" -ne 1 ]; then
usage
fi
prepend_to_path "$1"
}
main "$@"
if echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
msg "(!) Directory $dir is already in PATH"
else
export PATH="$dir${PATH:+":$PATH"}"
msg "(!) Directory $dir has been added to the front of PATH"
fi

View File

@@ -6,13 +6,6 @@
# Set verbosity with VERBOSE=1
VERBOSE="${VERBOSE:-0}"
# Function to print usage information
usage()
{
echo "Usage: $0 <dir>"
exit 1
}
# Function to print messages if VERBOSE is enabled
# $1 - message (string)
msg()
@@ -20,29 +13,17 @@ msg()
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
}
# Function to remove a directory from PATH
# $1 - directory to remove (string)
remove_from_path()
{
local dir=$1
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <dir>"
exit 1
fi
if ! echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
msg "(?) Directory $dir is not in PATH"
exit 0
fi
dir="$1"
export PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$dir\"" | sed 's/:$//')
msg "(!) Directory $dir has been removed from PATH"
}
if ! echo "$PATH" | grep -qE "(^|:)$dir($|:)"; then
msg "(?) Directory $dir is not in PATH"
exit 0
fi
# Main function
main()
{
if [ "$#" -ne 1 ]; then
usage
fi
remove_from_path "$1"
}
main "$@"
export PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$dir\"" | sed 's/:$//')
msg "(!) Directory $dir has been removed from PATH"