diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-09-24 14:04:43 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-09-24 14:04:43 +0300 |
| commit | 4a0e7df04137aa6f73eb1266f55170ad3d5d310d (patch) | |
| tree | 116d041a072debd23ae77ce35f90aec9d7593def | |
| parent | b3dda955070e6ceffe2898f731dfe13d4de126f4 (diff) | |
| download | pfetch-4a0e7df04137aa6f73eb1266f55170ad3d5d310d.tar.gz | |
pfetch: dynamic info printing
| -rwxr-xr-x | pfetch | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -279,14 +279,18 @@ main() { $(uname -sr) EOF - get_ascii - get_title - get_distro - get_host - get_kernel - get_uptime - get_packages - get_memory + # Allow the user to specify the order and inclusion of information + # functions through the 'PF_INFO' environment variable. + # shellcheck disable=2086 + { + # Disable globbing and set the positional parameters to the + # contents of 'PF_INFO'. + set -f + 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 # according to the height of both. If the information exceeds the ascii |
