release 4.2.0

This commit is contained in:
2026-10-13 16:35:14 +02:00
parent 9911f6d01d
commit 8221ac5325
18 changed files with 116 additions and 5 deletions
@@ -1,5 +1,38 @@
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Copyright (c) 2013-2026 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# Protected by the BSD3 license. Please read bellow for details.
#
# * Redistribution and use in source and binary forms,
# * with or without modification, are permitted provided
# * that the following conditions are met:
# *
# * Redistributions of source code must retain the above
# * copyright notice, this list of conditions and the
# * following disclaimer.
# *
# * Redistributions in binary form must reproduce the above
# * copyright notice, this list of conditions and the following
# * disclaimer in the documentation and/or other materials
# * provided with the distribution.
# *
# * Neither the name of the copyright holder nor the names
# * of any other contributors may be used to endorse or
# * promote products derived from this software without
# * specific prior written permission.
# *
# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# * OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Git helper completions for profile.d/git.sh shortcuts.
# ------------------------------------------------------------------------------
+33
View File
@@ -1,5 +1,38 @@
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Copyright (c) 2013-2026 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# Protected by the BSD3 license. Please read bellow for details.
#
# * Redistribution and use in source and binary forms,
# * with or without modification, are permitted provided
# * that the following conditions are met:
# *
# * Redistributions of source code must retain the above
# * copyright notice, this list of conditions and the
# * following disclaimer.
# *
# * Redistributions in binary form must reproduce the above
# * copyright notice, this list of conditions and the following
# * disclaimer in the documentation and/or other materials
# * provided with the distribution.
# *
# * Neither the name of the copyright holder nor the names
# * of any other contributors may be used to endorse or
# * promote products derived from this software without
# * specific prior written permission.
# *
# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# * OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Prompt helper completions for profile.d/prompt.sh shortcuts.
# ------------------------------------------------------------------------------
+6
View File
@@ -43,8 +43,14 @@ load_conf "debug"
# Display a backtrace of the current call stack (innermost frame first), one
# line per frame: function, file where it is defined, line of the call site.
# Usage: backtrace
# shellcheck disable=SC2120 # only --help is a possible argument
backtrace()
{
if [[ "${1:-}" == -h || "${1:-}" == --help ]]; then
printf "backtrace: print the current call stack, innermost frame first.\n"
printf "Usage: backtrace\n"
return 0
fi
printf "========= Call stack =========\n"
local i=1 # We begin at 1 to ignore backtrace itself
while [[ $i -lt ${#FUNCNAME[@]} ]]; do
+9
View File
@@ -34,6 +34,12 @@
# * OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
load_conf "help"
# Common helpers, then the ones private to this module (helpers/help.sh)
declare -F _profile_load_helpers >/dev/null || . "$(dirname -- "${BASH_SOURCE[0]}")/../helpers/common.sh"
_profile_load_helpers "${BASH_SOURCE[0]}"
# ------------------------------------------------------------------------------
# Display list of commands and general informations
# Usage: help [command]
@@ -66,6 +72,7 @@ help()
printf "%b%s%b\n\n" "$BIWhite" \
"Welcome to your profile! Here is a list of available commands:" "$DEFAULTCOL"
fi
printf "backtrace\tPrint the current call stack\n"
printf "busy\t\tMonitor /dev/urandom for a hex pattern — look busy\n"
printf "check_updates\tCheck for new versions of profile\n"
printf "clean\t\tErase backup files in given directories, optionally recursive\n"
@@ -81,6 +88,7 @@ help()
printf "findzero\tFind empty files in the given or current directory\n"
printf "gacp\t\tAdd, commit and push changes (auto-pull if needed)\n"
printf "genpwd\t\tGenerate one or more random secure passwords with configurable constraints\n"
printf "get_pkgmgr\tDetect the package manager of the running distribution\n"
printf "ggraph\t\tDisplay decorated git history graph\n"
printf "gpid\t\tGive the list of PIDs matching the given process name(s)\n"
printf "gprune\t\tDelete local branches already merged, or after remote deletion (MR / PR)\n"
@@ -95,6 +103,7 @@ help()
printf "isipv6\t\tTell if the given parameter is a valid IPv6 address\n"
printf "kt\t\tKill a process and all its children (kill tree)\n"
printf "ku\t\tKill all processes owned by the given user name or ID\n"
printf "locale_check\tTell whether a locale is installed (canonical name on stdout)\n"
printf "matrix\t\tConsole screensaver with Matrix-style digital rain (binary, kana, ascii charset)\n"
printf "mcd\t\tCreate a directory and immediately move into it\n"
printf "mdcat\t\tRender Markdown files in terminal with colors, tables and code frames\n"
+7 -1
View File
@@ -48,7 +48,13 @@ load_conf lang
# Usage: canonical=$(locale_check <locale>) || handle-missing
locale_check()
{
local requested="$1"
if [[ "${1:-}" == -h || "${1:-}" == --help ]]; then
printf "locale_check: tell whether a locale is installed.\n"
printf "Usage: locale_check <locale>\n"
printf "Prints the name of the locale as the system spells it; status 1 if it is not installed.\n"
return 0
fi
local requested="${1:-}"
[[ -z $requested ]] && { disp W "No locale given to check."; return 1; }
# Split "lang_TERRITORY[.codeset][@modifier]" into base, codeset, modifier.
+1 -1
View File
@@ -36,7 +36,7 @@
load_conf "net"
# Common helpers, then the ones private to this module (helpers/packages.sh)
# Common helpers, then the ones private to this module (helpers/net.sh)
declare -F _profile_load_helpers >/dev/null || . "$(dirname -- "${BASH_SOURCE[0]}")/../helpers/common.sh"
_profile_load_helpers "${BASH_SOURCE[0]}"
+7
View File
@@ -46,8 +46,15 @@ _profile_load_helpers "${BASH_SOURCE[0]}"
# checking available binaries in a fixed priority order.
# Echoes one of: apt dnf yum zypper pacman apk portage xbps nix
# Returns 1 if no known package manager could be identified.
# shellcheck disable=SC2120 # only --help is a possible argument
get_pkgmgr()
{
if [[ "${1:-}" == -h || "${1:-}" == --help ]]; then
printf "get_pkgmgr: print the package manager of the running distribution.\n"
printf "Usage: get_pkgmgr\n"
printf "Prints one of: apt dnf yum zypper pacman apk portage xbps nix (status 1 if unknown).\n"
return 0
fi
local distro_id="" distro_like=""
if [[ -r /etc/os-release ]]; then
# shellcheck disable=SC1091
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Copyright (c) 2013-2022 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# Copyright (c) 2013-2026 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# Protected by the BSD3 license. Please read bellow for details.
#
# * Redistribution and use in source and binary forms,