dev: automated commit - 2025-09-06 17:51:28

This commit is contained in:
Mariano Z. 2025-09-06 17:51:28 -03:00
parent c84dfa059e
commit b18f0b1edf
13 changed files with 560 additions and 116 deletions

View file

@ -1,4 +1,11 @@
source ~/.config/env
# === Zsh Profile Configuration ===
# This file is sourced for login shells
# Set ZDOTDIR if not already set
export ZDOTDIR=${ZDOTDIR:-~/.config/zsh}
# Auto-start Sway on first virtual terminal
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec sway
fi
# If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec dbus-run-session sway

View file

@ -98,4 +98,15 @@ alias la='ll -a'
alias tree='ll --tree --level=2'
alias valheim="cd ~/.config/r2modmanPlus-local/Valheim/profiles/Default/ && ./start_server_bepinex.sh"
# Font management
alias fm='font-manager'
alias fml='font-manager list'
alias fms='font-manager status'
alias fmc='font-manager clean'
alias fma='font-manager all'
# Maintenance shortcuts
alias maint='sudo ~/.local/bin/maintenance.sh'
alias maint-disable='touch ~/.local/share/arch_maintenance_disabled && echo "Maintenance reminders disabled"'
alias maint-enable='rm -f ~/.local/share/arch_maintenance_disabled && echo "Maintenance reminders enabled"'
alias maint-status='if [ -f ~/.local/share/arch_maintenance_disabled ]; then echo "Maintenance reminders: DISABLED"; else echo "Maintenance reminders: ENABLED"; fi'

View file

@ -3,7 +3,7 @@
# This file handles all completion registrations
# Load custom completion files
for completion_file in ~/.local/share/zsh/*-autocomplete.zsh; do
for completion_file in ~/.local/share/zsh/*-autocomplete.zsh(N); do
if [ -f "$completion_file" ]; then
source "$completion_file"
fi
@ -13,7 +13,7 @@ done
_lazy_load_completion() {
local cmd="$1"
local completion_cmd="$2"
eval "${cmd}() {
unfunction $cmd
eval \"\$($completion_cmd)\"
@ -38,7 +38,7 @@ _kf_completion() {
local -a contexts
# Get all contexts and extract unique cluster names (remove -read and -security suffixes)
contexts=($(kubectx 2>/dev/null | sed 's/-read$//; s/-security$//' | sort -u))
if [[ ${#contexts[@]} -gt 0 ]]; then
_values 'cluster' "${contexts[@]}"
fi

View file

@ -507,16 +507,26 @@ function cb {
return 1
fi
export GTK_THEME=HighContrast
export GDK_THEME=HighContrast
export QT_STYLE_OVERRIDE=HighContrast
export XDG_CURRENT_DESKTOP=GNOME
# Reset GTK configuration
unset GTK2_RC_FILES
unset GTK_RC_FILES
exec /usr/bin/codeblocks "$@"
# Store original values
local original_gtk_theme="$GTK_THEME"
local original_gdk_theme="$GDK_THEME"
local original_qt_style="$QT_STYLE_OVERRIDE"
local original_xdg_desktop="$XDG_CURRENT_DESKTOP"
# Set high contrast theme temporarily
GTK_THEME=HighContrast \
GDK_THEME=HighContrast \
QT_STYLE_OVERRIDE=HighContrast \
XDG_CURRENT_DESKTOP=GNOME \
GTK2_RC_FILES="" \
GTK_RC_FILES="" \
/usr/bin/codeblocks "$@"
# Restore original values
export GTK_THEME="$original_gtk_theme"
export GDK_THEME="$original_gdk_theme"
export QT_STYLE_OVERRIDE="$original_qt_style"
export XDG_CURRENT_DESKTOP="$original_xdg_desktop"
}
@ -627,5 +637,79 @@ alias pport='ppid'
# Node.js cleanup alias
alias unChonk="echo 'Starting the great node_modules purge...' && find . -name 'node_modules' -type d -prune -exec sh -c 'echo \"Deleting {}\" && rm -rf \"{}\"' \;"
# Font management
alias fm='font-manager'
alias fml='font-manager list'
alias fms='font-manager status'
alias fmc='font-manager clean'
alias fma='font-manager all'
# Advanced font management function
function font-switch() {
# Show help if requested
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: font-switch [font-name]"
echo "Quickly switch between font sets"
echo "Example: font-switch jetbrains-mono"
return 0
fi
if [[ -z "$1" ]]; then
echo "Available fonts:"
font-manager list
return 0
fi
local font_name="$1"
# Check if font exists
if ! font-manager list | grep -q "$font_name"; then
echo "Error: Font '$font_name' not found" >&2
echo "Available fonts:" >&2
font-manager list >&2
return 1
fi
echo "Switching to $font_name fonts..."
font-manager clean
font-manager extract "$font_name"
# Reload terminal if in kitty
if [[ "$TERM" == "xterm-kitty" ]] && command -v kitty >/dev/null 2>&1; then
echo "Reloading kitty configuration..."
kitty @ set-colors --all ~/.config/kitty/kitty.conf
fi
echo "Font switch complete!"
}
# Font preview function
function font-preview() {
# Show help if requested
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: font-preview [font-name]"
echo "Preview fonts in terminal"
echo "Example: font-preview jetbrains-mono"
return 0
fi
if [[ -z "$1" ]]; then
echo "Error: Font name required" >&2
echo "Usage: font-preview [font-name]" >&2
return 1
fi
local font_name="$1"
local preview_text="The quick brown fox jumps over the lazy dog
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
!@#$%^&*()_+-=[]{}|;':\",./<>?"
echo "Previewing font: $font_name"
echo "----------------------------------------"
echo "$preview_text" | font-manager extract "$font_name" && echo "$preview_text"
}

View file

@ -2,13 +2,25 @@
# Configuration
MAINTENANCE_SCRIPT="$HOME/.local/bin/maintenance.sh"
TIMESTAMP_FILE="$HOME/.local/share/arch_maintenance_timestamp"
INTERVAL=7
DISABLED_FILE="$HOME/.local/share/arch_maintenance_disabled"
INTERVAL=14 # Increased from 7 to 14 days
QUIET_MODE=${MAINTENANCE_QUIET:-false} # Set MAINTENANCE_QUIET=true to disable
if [ ! -f "$MAINTENANCE_SCRIPT" ]; then
echo "Maintenance script not found at $MAINTENANCE_SCRIPT"
return 0
fi
# Check if maintenance is disabled
if [ -f "$DISABLED_FILE" ] || [ "$QUIET_MODE" = "true" ]; then
return 0
fi
# Only run in interactive shells (not scripts)
if [[ ! -o interactive ]]; then
return 0
fi
if [ -f "$TIMESTAMP_FILE" ]; then
LAST_RUN=$(cat $TIMESTAMP_FILE)
CURRENT_TIME=$(date +%s)
@ -59,13 +71,21 @@ snooze_maintenance() {
print_styled "⏰ Maintenance reminder snoozed for 7 more days."
}
# Function to disable maintenance permanently
disable_maintenance() {
touch "$DISABLED_FILE"
print_styled "🔕 Maintenance reminders disabled permanently."
print_styled "To re-enable: rm $DISABLED_FILE"
print_styled "To run manually: sudo $MAINTENANCE_SCRIPT"
}
# Display maintenance notification
echo ""
print_styled "⚠️ It's been $DAYS_DIFF days since your last system maintenance"
# Enhanced confirmation with three options
# Enhanced confirmation with four options
if command -v gum &> /dev/null; then
CHOICE=$(gum choose "Run maintenance now" "Skip this time" "Don't ask for 7 more days")
CHOICE=$(gum choose "Run maintenance now" "Skip this time" "Don't ask for 7 more days" "Disable permanently")
case "$CHOICE" in
"Run maintenance now")
run_maintenance
@ -77,6 +97,9 @@ if command -v gum &> /dev/null; then
"Don't ask for 7 more days")
snooze_maintenance
;;
"Disable permanently")
disable_maintenance
;;
esac
else
# Fallback for systems without gum
@ -84,7 +107,8 @@ else
echo "1) Run maintenance now"
echo "2) Skip this time"
echo "3) Don't ask for 7 more days"
echo -n "Enter your choice (1-3): "
echo "4) Disable permanently"
echo -n "Enter your choice (1-4): "
read -k 1 CHOICE
echo ""
@ -99,6 +123,9 @@ else
3)
snooze_maintenance
;;
4)
disable_maintenance
;;
*)
print_styled "Invalid choice. Maintenance skipped."
print_styled "To run manually: sudo $MAINTENANCE_SCRIPT"

View file

@ -36,17 +36,8 @@ if [[ -f "$HISTFILE" && -w "$HISTFILE" ]]; then
fi
fi
# Minimal prompt configuration
MNML_INFOLN=()
MNML_PROMPT=(mnml_ssh mnml_status 'mnml_cwd 2 0' mnml_git mnml_keymap )
MNML_RPROMPT=()
MNML_NORMAL_CHAR="◉"
# Environment variables
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
export FZF_DEFAULT_COMMAND='fd --type f'
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export COREPACK_ENABLE_NETWORK_RESOLUTION=1
export COREPACK_ENABLE_STRICT_VERIFICATION=0
export MANPAGER="nvim +Man!"
export _ZO_ECHO=1

Binary file not shown.