From 6185230dfdc4514d189c9376b8a306a76dc0cb36 Mon Sep 17 00:00:00 2001 From: Astound Date: Mon, 3 Nov 2025 15:14:19 -0500 Subject: optimized _custom.sh --- hyperterm/_custom.sh | 71 ++++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/hyperterm/_custom.sh b/hyperterm/_custom.sh index 07aff33..34b1da3 100644 --- a/hyperterm/_custom.sh +++ b/hyperterm/_custom.sh @@ -7,42 +7,47 @@ #--------------- alias ac='clean && clear' -#--------------- -# Theme's prompt -#--------------- -if [[ -f $HOME/.hyperterm/themes/joy.sh ]]; then source "$HOME/.hyperterm/themes/joy.sh"; else true; fi -if [[ -f $HOME/.hyperterm/themes/light_theme.sh ]]; then source "$HOME/.hyperterm/themes/light_theme.sh"; else true; fi -if [[ -f $HOME/.hyperterm/themes/minterm.sh ]]; then source "$HOME/.hyperterm/themes/minterm.sh"; else true; fi -if [[ -f $HOME/.hyperterm/themes/pure.sh ]]; then source "$HOME/.hyperterm/themes/pure.sh"; else true; fi -if [[ -f $HOME/.hyperterm/themes/simple.sh ]]; then source "$HOME/.hyperterm/themes/simple.sh"; else true; fi -if [[ -f $HOME/.hyperterm/themes/special.sh ]]; then source "$HOME/.hyperterm/themes/special.sh"; else true; fi +#----------------- +# Theme Selection +#----------------- +HYPERTERM_THEME="default" -#--------------- -# Set Theme -#--------------- -unset prompt -prompt="${default}" -#prompt="${joy}" -#prompt="${light_theme}" -#prompt="${minterm}" -#prompt="${pure}" -#prompt="${simple}" -#prompt="${special}" +# Load only selected theme - optimized for speed +if [[ -f "$HOME/.hyperterm/themes/${HYPERTERM_THEME}.sh" ]]; then + source "$HOME/.hyperterm/themes/${HYPERTERM_THEME}.sh" + case "$HYPERTERM_THEME" in + "default") prompt="${default}" ;; + "joy") prompt="${joy}" ;; + "light_theme") prompt="${light_theme}" ;; + "minterm") prompt="${minterm}" ;; + "pure") prompt="${pure}" ;; + "simple") prompt="${simple}" ;; + "special") prompt="${special}" ;; + esac +fi -#--------------- +#------- # Tools -#--------------- -if [[ -f $HOME/.hyperterm/tools/compress.sh ]]; then source "$HOME/.hyperterm/tools/compress.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/export.sh ]]; then source "$HOME/.hyperterm/tools/export.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/listuser.sh ]]; then source "$HOME/.hyperterm/tools/listuser.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/network.sh ]]; then source "$HOME/.hyperterm/tools/network.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/proxy.sh ]]; then source "$HOME/.hyperterm/tools/proxy.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/rar2zip.sh ]]; then source "$HOME/.hyperterm/tools/rar2zip.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/ruby.sh ]]; then source "$HOME/.hyperterm/tools/ruby.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/ssh-agent.sh ]]; then source "$HOME/.hyperterm/tools/ssh-agent.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/sysinfo.sh ]]; then source "$HOME/.hyperterm/tools/sysinfo.sh"; else true; fi -if [[ -f $HOME/.hyperterm/tools/virtualenv.sh ]]; then source "$HOME/.hyperterm/tools/virtualenv.sh"; else true; fi -# if [[ -f $HOME/.hyperterm/tools/vconverter.sh ]]; then source "$HOME/.hyperterm/tools/vconverter.sh"; else true; fi +#------- +# Uncomment only the tools you actually use for faster loading +HYPERTERM_TOOLS=( + "compress" # Archive extractor (ex function for .tar, .zip, .rar, etc) + # "export" # Export functions and environment variables + # "listuser" # User listing and management utilities + "network" # IP detection and network info functions + # "proxy" # Proxy configuration helpers + # "rar2zip" # RAR to ZIP conversion utilities + # "ruby" # Ruby development environment setup + "ssh-agent" # SSH key and agent management + # "sysinfo" # System information display functions + # "virtualenv" # Python virtual environment tools + # "vconverter" # Video conversion utilities +) + +# Load only selected tools +for tool in "${HYPERTERM_TOOLS[@]}"; do + [[ -f "$HOME/.hyperterm/tools/${tool}.sh" ]] && source "$HOME/.hyperterm/tools/${tool}.sh" +done #--------------- # Screenfetch -- cgit v1.2.3