pfetch: dynamic info printing
This commit is contained in:
parent
b3dda95507
commit
4a0e7df041
20
pfetch
20
pfetch
|
@ -279,14 +279,18 @@ main() {
|
||||||
$(uname -sr)
|
$(uname -sr)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
get_ascii
|
# Allow the user to specify the order and inclusion of information
|
||||||
get_title
|
# functions through the 'PF_INFO' environment variable.
|
||||||
get_distro
|
# shellcheck disable=2086
|
||||||
get_host
|
{
|
||||||
get_kernel
|
# Disable globbing and set the positional parameters to the
|
||||||
get_uptime
|
# contents of 'PF_INFO'.
|
||||||
get_packages
|
set -f
|
||||||
get_memory
|
set +f ${PF_INFO-ascii title distro host kernel uptime packages memory}
|
||||||
|
|
||||||
|
# Iterate over the above list and run any existing "get_" functions.
|
||||||
|
for info; do "get_$info"; done
|
||||||
|
}
|
||||||
|
|
||||||
# Position the cursor below both the ascii art and information lines
|
# Position the cursor below both the ascii art and information lines
|
||||||
# according to the height of both. If the information exceeds the ascii
|
# according to the height of both. If the information exceeds the ascii
|
||||||
|
|
Loading…
Reference in New Issue
Block a user