aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-25 19:08:22 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-25 19:08:22 +0300
commit621855148bf9261c62480828af3195a278c49f73 (patch)
tree838e4b6ce363862fa609da20ebf80d4a8b642c73
parent977afd6e9d78f3842cb640c3fab58cdb5e118342 (diff)
downloadpfetch-621855148bf9261c62480828af3195a278c49f73.tar.gz
host: fallback to uname -m
-rwxr-xr-xpfetch7
1 files changed, 4 insertions, 3 deletions
diff --git a/pfetch b/pfetch
index 2599350..ab14557 100755
--- a/pfetch
+++ b/pfetch
@@ -242,7 +242,8 @@ get_host() {
;;
esac
- log host "$host" >&6
+ # '$arch' is the cached output from 'uname -m'.
+ log host "${host:-$arch}" >&6
}
get_uptime() {
@@ -924,8 +925,8 @@ main() {
# Store the output of 'uname' to avoid calling it multiple times
# throughout the script. 'read <<EOF' is the simplest way of reading
# a command into a list of variables.
- read -r os kernel <<-EOF
- $(uname -sr)
+ read -r os kernel arch <<-EOF
+ $(uname -srm)
EOF
# Always run 'get_os' for the purposes of detecting which ascii