bugfix, esthetic cleanup, better comments, version bump

This commit is contained in:
Geoffray Levasseur-Brandin
2024-06-21 16:19:44 +02:00
parent 9e49e3e4d7
commit bef205ae84
18 changed files with 634 additions and 571 deletions

View File

@@ -1,3 +1,4 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# Copyright (c) 2013-2022 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# Protected by the BSD3 license. Please read bellow for details.
@@ -36,17 +37,16 @@
# ------------------------------------------------------------------------------
# Show profile version
# ------------------------------------------------------------------------------
ver ()
ver()
{
disp "Profile version $PROFVERSION."
}
export -f ver
# ------------------------------------------------------------------------------
# Display weather of the given city (or default one)
# ------------------------------------------------------------------------------
meteo ()
meteo()
{
cities=$@
[[ $# -eq 0 ]] && local cities=$DEFAULT_CITY
@@ -57,34 +57,36 @@ meteo ()
}
export -f meteo
# ------------------------------------------------------------------------------
# Display system general information
# ------------------------------------------------------------------------------
showinfo()
{
echo -e "\n"
if command -v figlet >/dev/null 2>&1; then
if [[ -s /usr/share/figlet/ansi_shadow.flf ]]; then
local figopt="-f ansi_shadow"
fi
figlet -k $(hostname) $figopt
if command -v figlet >/dev/null 2>&1; then
if [[ -s /usr/share/figlet/ansi_shadow.flf ]]; then
local figopt="-f ansi_shadow"
fi
figlet -k $(hostname) $figopt
else
echo "$(hostname -f)"
echo "$(hostname -f)"
fi
echo ""
if command -v neofetch >/dev/null 2>&1; then
neofetch
neofetch
else
(
if [[ -s /etc/os-release ]]; then
. /etc/os-release
echo "$NAME $VERSION"
else
cat /proc/version
fi
echo "Uptime: $(uptime)"
)
(
if [[ -s /etc/os-release ]]; then
. /etc/os-release
echo "$NAME $VERSION"
else
cat /proc/version
fi
echo "Uptime: $(uptime)"
)
fi
}
export -f showinfo
# ------------------------------------------------------------------------------
# EOF