diff --git a/profile.d/compress.sh b/profile.d/compress.sh index d7aba19..4300966 100644 --- a/profile.d/compress.sh +++ b/profile.d/compress.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "compress" + # ------------------------------------------------------------------------------ # Smartly uncompress archives # Usage: utaz [option] [directorie(s)|file(s)] @@ -839,6 +841,4 @@ export -f taz # ------------------------------------------------------------------------------ -load_conf "compress" - # EOF diff --git a/profile.d/disp.sh b/profile.d/disp.sh index 371c81d..349c58f 100644 --- a/profile.d/disp.sh +++ b/profile.d/disp.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf disp + # ------------------------------------------------------------------------------ # Color definitions set_colors() @@ -715,8 +717,7 @@ export -f mdcat # ------------------------------------------------------------------------------ -# Load disp section variables -load_conf disp +# Load color codes set_colors # EOF diff --git a/profile.d/filefct.sh b/profile.d/filefct.sh index e5519d9..7358e84 100644 --- a/profile.d/filefct.sh +++ b/profile.d/filefct.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "filefct" + # ------------------------------------------------------------------------------ # Expand wildcards in a file/directory list and quote the results # Usage: expandlist [options] @@ -866,6 +868,4 @@ export -f finddead # ------------------------------------------------------------------------------ -load_conf "filefct" - # EOF diff --git a/profile.d/fun.sh b/profile.d/fun.sh index 41f5d87..b4f3daa 100644 --- a/profile.d/fun.sh +++ b/profile.d/fun.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "fun" + # ------------------------------------------------------------------------------ # Make non-IT peoples think you're busy doing something hard # Usage: busy [options] [pattern] @@ -485,6 +487,4 @@ export -f hack # ------------------------------------------------------------------------------ -load_conf "fun" - # EOF diff --git a/profile.d/git.sh b/profile.d/git.sh index a7c7031..90752a5 100644 --- a/profile.d/git.sh +++ b/profile.d/git.sh @@ -34,8 +34,9 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ -# ------------------------------------------------------------------------------ +load_conf git +# ------------------------------------------------------------------------------ # Built-in defaults (can be overridden from [git] section in profile.conf) : "${GIT_MAIN_BRANCH:=main}" : "${GIT_DEFAULT_REMOTE:=origin}" @@ -651,6 +652,4 @@ export -f groot # ------------------------------------------------------------------------------ -load_conf git - # EOF diff --git a/profile.d/info.sh b/profile.d/info.sh index b2d65a0..960ed48 100644 --- a/profile.d/info.sh +++ b/profile.d/info.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf info + # ------------------------------------------------------------------------------ # Show profile version # Usage: ver @@ -408,5 +410,4 @@ export -f showinfo # ------------------------------------------------------------------------------ -load_conf info # EOF diff --git a/profile.d/lang.sh b/profile.d/lang.sh index 4319854..49cc23d 100644 --- a/profile.d/lang.sh +++ b/profile.d/lang.sh @@ -34,6 +34,10 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf lang + +# ------------------------------------------------------------------------------ +# check if a given locale is installed on the system locale_check() { locale -a | grep -qx "$1" || { @@ -42,6 +46,7 @@ locale_check() } return 0 } +export -f locale_check # ------------------------------------------------------------------------------ @@ -172,11 +177,10 @@ build_locale_shortcuts() unset cfg item alias loc fname locale_items } -export -f build_locale_shortcuts # ------------------------------------------------------------------------------ - -load_conf lang +# Dynamically build locale functions based on SET_LOCALE configuration build_locale_shortcuts + # ------------------------------------------------------------------------------ # EOF diff --git a/profile.d/net.sh b/profile.d/net.sh index efd8b00..3c23ffa 100644 --- a/profile.d/net.sh +++ b/profile.d/net.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "net" + # ------------------------------------------------------------------------------ # Download a resource using curl, wget, or fetch. # Usage: dwl [-t ] [-r|--resume] [output_file] @@ -370,9 +372,4 @@ export -f myextip # ------------------------------------------------------------------------------ -# ------------------------------------------------------------------------------ -# EOF - -load_conf "net" - # EOF diff --git a/profile.d/packages.sh b/profile.d/packages.sh index 1dfbc4d..97ff94c 100644 --- a/profile.d/packages.sh +++ b/profile.d/packages.sh @@ -34,6 +34,9 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "packages" + + # ------------------------------------------------------------------------------ # Detect the active package manager of the current distribution. # Detection is based on /etc/os-release (ID / ID_LIKE), then falls back to @@ -272,6 +275,4 @@ export -f pkgf # ------------------------------------------------------------------------------ -load_conf "packages" - # EOF diff --git a/profile.d/processes.sh b/profile.d/processes.sh index c74b47d..6b50389 100644 --- a/profile.d/processes.sh +++ b/profile.d/processes.sh @@ -34,6 +34,9 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "processes" + + # ------------------------------------------------------------------------------ # Search processes matching the given string # Usage: ppg @@ -515,7 +518,5 @@ export -f kt # ------------------------------------------------------------------------------ -load_conf "processes" - # EOF diff --git a/profile.d/prompt.sh b/profile.d/prompt.sh index 2ec7b7a..a71e256 100644 --- a/profile.d/prompt.sh +++ b/profile.d/prompt.sh @@ -34,6 +34,7 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "prompt" # ------------------------------------------------------------------------------ # Parse a prompt theme file safely — it is NEVER sourced or executed. @@ -599,8 +600,6 @@ _pt_theme="${CONF_prompt[PROMPT_THEME]:-}" _pt_dir="${CONF_prompt[PROMPT_THEME_DIR]:-}" [[ -n "$_pt_theme" ]] && load_theme "$_pt_theme" ${_pt_dir:+"$_pt_dir"} unset _pt_theme _pt_dir - -load_conf "prompt" # ------------------------------------------------------------------------------ diff --git a/profile.d/pwd.sh b/profile.d/pwd.sh index e4e55ea..51e0a01 100644 --- a/profile.d/pwd.sh +++ b/profile.d/pwd.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "pwd" + # ------------------------------------------------------------------------------ # genpwd : generate a password with different criteria # Usage: genpwd [options] [--extracars=] [--length=] [nb_passwd] @@ -478,6 +480,4 @@ export -f pwdscore # ------------------------------------------------------------------------------ -load_conf "pwd" - # EOF diff --git a/profile.d/rain.sh b/profile.d/rain.sh index 3133be1..14fe8fa 100644 --- a/profile.d/rain.sh +++ b/profile.d/rain.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "rain" + # ------------------------------------------------------------------------------ # Generic rain-like engine and presets @@ -703,6 +705,4 @@ rainbow() export -f rainbow # ------------------------------------------------------------------------------ -load_conf "rain" - # EOF diff --git a/profile.d/ssh.sh b/profile.d/ssh.sh index 064f688..6c911c9 100644 --- a/profile.d/ssh.sh +++ b/profile.d/ssh.sh @@ -34,6 +34,8 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ +load_conf "ssh" + # ------------------------------------------------------------------------------ # Remove host entries (name and IP) from ~/.ssh/known_hosts for the active user # Usage: rmhost [hostname2|ip2 [...]] @@ -249,6 +251,4 @@ export -f ssr # ------------------------------------------------------------------------------ -load_conf "ssh" - # EOF