From 45ea4784145afd934995b933fdf7ea0b44371633 Mon Sep 17 00:00:00 2001 From: matt Date: Sat, 10 Sep 2022 22:39:56 +0000 Subject: [PATCH 1/5] Added ascii art for OmniOS illumos distribution --- neofetch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/neofetch b/neofetch index 48b96d21..3c087c8a 100755 --- a/neofetch +++ b/neofetch @@ -9077,6 +9077,22 @@ Q@@@@@ggg@@f@ @@@@@@L EOF ;; + "OmniOS"*) + set_colors 15 3 8 + read -rd '' ascii_data <<'EOF' +${c1} + ____ __ __ _ _ _ + / __ \ | \/ || \ | || | + | | | || || \| || | + | |__| || |\/| || , `${c2}_${c1}||${c2}_${c1}| ${c2}____${c1} + \____/ |_| |_||_|\${c2}/ __ \ / ___| + | | | ||(__ + ${c3}community${c2} | |__| | ___)| + ${c3}edition${c2} \____/ |____/ + +EOF + ;; + "openbsd_small") set_colors 3 7 6 1 8 read -rd '' ascii_data <<'EOF' From 624bd97045536460ed976b5ac811fcda337e6c27 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 12 Sep 2022 11:27:03 +0000 Subject: [PATCH 2/5] Fix uptime value in Solaris --- neofetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 3c087c8a..0601a35b 100755 --- a/neofetch +++ b/neofetch @@ -1446,8 +1446,10 @@ get_uptime() { ;; Solaris) - s=$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}') - s=${s/.*} + boot=$(kstat -p unix:0:system_misc:boot_time | awk '{print $2}') + now=$(date +%s) + + s=$((now - boot)) ;; AIX|IRIX) From 4e7724ecf889abaebeaf74dfd73110ff15556fe2 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 12 Sep 2022 19:50:20 +0000 Subject: [PATCH 3/5] Add illumos os support --- neofetch | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/neofetch b/neofetch index 0601a35b..80337336 100755 --- a/neofetch +++ b/neofetch @@ -939,7 +939,10 @@ get_os() { # just the output of "uname -s". case $kernel_name in Darwin) os=$darwin_name ;; - SunOS) os=Solaris ;; + SunOS) case $(uname -o 2>/dev/null) in + illumos) os=illumos ;; + *) os=Solaris ;; + esac ;; Haiku) os=Haiku ;; MINIX) os=MINIX ;; AIX) os=AIX ;; @@ -1187,7 +1190,7 @@ get_distro() { distro=${distro/Microsoft } ;; - Solaris) + Solaris|illumos) case $distro_shorthand in on|tiny) distro=$(awk 'NR==1 {print $1,$3}' /etc/release) ;; *) distro=$(awk 'NR==1 {print $1,$2,$3}' /etc/release) ;; @@ -1218,7 +1221,7 @@ get_distro() { # Get OS architecture. case $os in - Solaris|AIX|Haiku|IRIX|FreeMiNT) + Solaris|illumos|AIX|Haiku|IRIX|FreeMiNT) machine_arch=$(uname -p) ;; @@ -1344,7 +1347,7 @@ get_model() { model=${model/Model} ;; - Solaris) + Solaris|illumos) model=$(prtconf -b | awk -F':' '/banner-name/ {printf $2}') ;; @@ -1445,7 +1448,7 @@ get_uptime() { s=$((now - boot)) ;; - Solaris) + Solaris|illumos) boot=$(kstat -p unix:0:system_misc:boot_time | awk '{print $2}') now=$(date +%s) @@ -1546,7 +1549,7 @@ get_packages() { } case $os in - Linux|BSD|"iPhone OS"|Solaris) + Linux|BSD|"iPhone OS"|Solaris|illumos) # Package Manager Programs. has kiss && tot kiss l has cpt-list && tot cpt-list @@ -2367,7 +2370,7 @@ get_cpu() { esac ;; - "Solaris") + "Solaris" | "illumos") # Get CPU name. cpu="$(psrinfo -pv)" cpu="${cpu//*$'\n'}" @@ -2756,10 +2759,10 @@ get_memory() { esac ;; - "Solaris" | "AIX") + "Solaris" | "illumos" | "AIX") hw_pagesize="$(pagesize)" case $os in - "Solaris") + "Solaris" | "illumos") pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')" pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')" ;; @@ -3851,7 +3854,7 @@ get_battery() { get_local_ip() { case $os in - "Linux" | "BSD" | "Solaris" | "AIX" | "IRIX") + "Linux" | "BSD" | "Solaris" | "illumos" | "AIX" | "IRIX") if [[ "${local_ip_interface[0]}" == "auto" ]]; then local_ip="$(ip route get 1 | awk -F'src' '{print $2; exit}')" local_ip="${local_ip/uid*}" From 078af21630cd33265de7aafea4e006d4cc081945 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 12 Sep 2022 19:50:58 +0000 Subject: [PATCH 4/5] Fix solaris fqdn --- neofetch | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 80337336..a87916d5 100755 --- a/neofetch +++ b/neofetch @@ -1385,8 +1385,13 @@ get_model() { get_title() { user=${USER:-$(id -un || printf %s "${HOME/*\/}")} - case $title_fqdn in - on) hostname=$(hostname -f) ;; + case $os-$title_fqdn in + illumos-on|Solaris-on) + hostname=$(hostname) + domainname=$(domainname) + [[ -n "$domainname" ]] && hostname+=".$domainname" + ;; + *-on) hostname=$(hostname -f) ;; *) hostname=${HOSTNAME:-$(hostname)} ;; esac From c3beb21966bf153dc21a8eacdde8e7ab8224174e Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 12 Sep 2022 19:51:30 +0000 Subject: [PATCH 5/5] Add 'pkg list' package source --- neofetch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neofetch b/neofetch index a87916d5..30dbc731 100755 --- a/neofetch +++ b/neofetch @@ -1639,6 +1639,10 @@ get_packages() { ((packages == 0)) && has pkg && tot pkg list ;; + + illumos-*) + has pkg && tot pkg list + ;; esac # List these last as they accompany regular package managers.