pfetch: Added PF_SOURCE. Closes #34

This commit is contained in:
Dylan Araps 2020-01-26 22:08:57 +02:00
parent 0dcc4d6a82
commit a7b0439aeb
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
2 changed files with 10 additions and 0 deletions

View File

@ -57,6 +57,11 @@ PF_INFO="ascii"
# Example: Only Information. # Example: Only Information.
PF_INFO="title os host kernel uptime pkgs memory" PF_INFO="title os host kernel uptime pkgs memory"
# A file to source before running pfetch.
# Default: unset
# Valid: A shell script
PF_SOURCE=""
# Separator between info name and info data. # Separator between info name and info data.
# Default: unset # Default: unset
# Valid: string # Valid: string

5
pfetch
View File

@ -1296,6 +1296,11 @@ main() {
# This gives full control over what it displayed on the screen. # This gives full control over what it displayed on the screen.
exec 6>&1 >/dev/null exec 6>&1 >/dev/null
# Allow the user to execute their own script and modify or
# extend pfetch's behavior.
# shellcheck source=/dev/null
. "${PF_SOURCE:-/dev/null}" ||:
# Ensure that the 'TMPDIR' is writable as heredocs use it and # Ensure that the 'TMPDIR' is writable as heredocs use it and
# fail without the write permission. This was found to be the # fail without the write permission. This was found to be the
# case on Android where the temporary directory requires root. # case on Android where the temporary directory requires root.