docs: update

This commit is contained in:
Dylan Araps 2019-09-24 16:15:35 +03:00
parent 1bcb2f5427
commit 8b8b88f053
2 changed files with 19 additions and 9 deletions

View File

@ -20,6 +20,7 @@ _/\ __)/_) pkgs 130
```sh ```sh
# Which information to display. # Which information to display.
# NOTE: If 'ascii' will be used, it must come first. # NOTE: If 'ascii' will be used, it must come first.
# Default: first example below
# Valid: space separated string # Valid: space separated string
PF_INFO="ascii title distro host kernel uptime pkgs memory" PF_INFO="ascii title distro host kernel uptime pkgs memory"
@ -30,20 +31,29 @@ PF_INFO="ascii"
PF_INFO="title distro host kernel uptime pkgs memory" PF_INFO="title distro host kernel uptime pkgs memory"
# Separator between info name and info data. # Separator between info name and info data.
# Default: unset
# Valid: string # Valid: string
PF_SEP=":" PF_SEP=":"
# Color of info names: # Color of info names:
# Default: unset (auto)
# Valid: 0-9 # Valid: 0-9
PF_COL1=4 PF_COL1=4
# Color of info data: # Color of info data:
# Default: unset (auto)
# Valid: 0-9 # Valid: 0-9
PF_COL2=7 PF_COL2=7
# Alignment padding. # Alignment padding.
# Default: unset (auto)
# Valid: int # Valid: int
PF_ALIGN="" PF_ALIGN=""
# Which ascii art to use.
# Default: unset (auto)
# Valid: string
PF_ASCII="openbsd"
``` ```
## Make `pfetch` update on an interval ## Make `pfetch` update on an interval

18
pfetch
View File

@ -87,7 +87,7 @@ log() {
get_title() { get_title() {
case $os in case $os in
Linux*|GNU*) Linux*)
read -r hostname < /proc/sys/kernel/hostname read -r hostname < /proc/sys/kernel/hostname
;; ;;
esac esac
@ -107,7 +107,7 @@ get_title() {
get_distro() { get_distro() {
case $os in case $os in
Linux*|GNU*) Linux*)
# Disable warning about shellcheck not being able # Disable warning about shellcheck not being able
# to read '/etc/os-release'. This is fine. # to read '/etc/os-release'. This is fine.
# shellcheck source=/dev/null # shellcheck source=/dev/null
@ -124,7 +124,7 @@ get_kernel() {
get_host() { get_host() {
case $os in case $os in
Linux*|GNU*) Linux*)
# Despite what these files are called, version doesn't # Despite what these files are called, version doesn't
# always contain the version nor does name always contain # always contain the version nor does name always contain
# the name. # the name.
@ -144,7 +144,7 @@ get_uptime() {
# converting that data into days, hours and minutes using simple # converting that data into days, hours and minutes using simple
# math. # math.
case $os in case $os in
Linux*|GNU*) Linux*)
IFS=. read -r s _ < /proc/uptime IFS=. read -r s _ < /proc/uptime
;; ;;
esac esac
@ -176,7 +176,7 @@ get_pkgs() {
# managers are installed. # managers are installed.
packages=$( packages=$(
case $os in case $os in
Linux*|GNU*) Linux*)
# Commands which print packages one per line. # Commands which print packages one per line.
has kiss && kiss l has kiss && kiss l
has bonsai && bonsai list has bonsai && bonsai list
@ -201,7 +201,7 @@ get_memory() {
# Used memory is calculated using the following "formula" (Linux): # Used memory is calculated using the following "formula" (Linux):
# MemUsed = MemTotal + Shmem - MemFree - Buffers - Cached - SReclaimable # MemUsed = MemTotal + Shmem - MemFree - Buffers - Cached - SReclaimable
# Source: https://github.com/KittyKatt/screenFetch/issues/386 # Source: https://github.com/KittyKatt/screenFetch/issues/386
Linux*|GNU*) Linux*)
# Parse the '/proc/meminfo' file splitting on ':' and 'k'. # Parse the '/proc/meminfo' file splitting on ':' and 'k'.
# The format of the file is 'key: 000kB' and an additional # The format of the file is 'key: 000kB' and an additional
# split is used on 'k' to filter out 'kB'. # split is used on 'k' to filter out 'kB'.
@ -231,8 +231,8 @@ get_memory() {
} }
get_ascii() { get_ascii() {
case $os in case ${PF_ASCII:-$os} in
Linux*|GNU*) [lL]inux*)
ascii="\ ascii="\
${c4} ___ ${c4} ___
(${c7}.· ${c4}| (${c7}.· ${c4}|
@ -244,7 +244,7 @@ ${c5}\/${c4}-____${c5}\/
" "
;; ;;
OpenBSD*) [Oo]pen[Bb][Ss][Dd]*)
ascii="\ ascii="\
${c3} _____ ${c3} _____
\\- -/ \\- -/