commit
fd2ab61e2e
1 changed files with 53 additions and 5 deletions
58
neofetch
58
neofetch
|
@ -437,6 +437,7 @@ case "$(uname)" in
|
||||||
"Darwin") os="$(sw_vers -productName)" ;;
|
"Darwin") os="$(sw_vers -productName)" ;;
|
||||||
*"BSD" | "DragonFly") os="BSD" ;;
|
*"BSD" | "DragonFly") os="BSD" ;;
|
||||||
"CYGWIN"*) os="Windows" ;;
|
"CYGWIN"*) os="Windows" ;;
|
||||||
|
"SunOS") os="Solaris" ;;
|
||||||
*) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;;
|
*) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -506,6 +507,10 @@ getdistro () {
|
||||||
distro="${distro/Caption'='}"
|
distro="${distro/Caption'='}"
|
||||||
distro="${distro/Microsoft }"
|
distro="${distro/Microsoft }"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Solaris")
|
||||||
|
distro="$(nawk 'NR==1{gsub(/^ \t]+|[ \t]+$/,""); printf $1 " " $2;}' /etc/release)"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Get architecture
|
# Get architecture
|
||||||
|
@ -605,6 +610,10 @@ getuptime () {
|
||||||
|
|
||||||
uptime="up $days $hours $minutes"
|
uptime="up $days $hours $minutes"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Solaris")
|
||||||
|
uptime="$(uptime | /usr/xpg4/bin/awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Make the output of uptime smaller.
|
# Make the output of uptime smaller.
|
||||||
|
@ -707,6 +716,10 @@ getpackages () {
|
||||||
[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ] && \
|
[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ] && \
|
||||||
packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))"
|
packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Solaris")
|
||||||
|
packages="$(pkg list | wc -l)"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1105,6 +1118,29 @@ getcpu () {
|
||||||
|
|
||||||
cpu="$cpu @ ${speed}GHz"
|
cpu="$cpu @ ${speed}GHz"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Solaris")
|
||||||
|
# Get cpuname
|
||||||
|
cpu="$(psrinfo -pv | tail -1)"
|
||||||
|
cpu="${cpu/[0-9]\.*}"
|
||||||
|
cpu="${cpu/ @*}"
|
||||||
|
|
||||||
|
# Get cpu speed
|
||||||
|
speed="$(psrinfo -v | tail -2 | head -1 | awk '{print $6}')"
|
||||||
|
speed="$((speed / 100))"
|
||||||
|
|
||||||
|
# Get cpu cores
|
||||||
|
cores="$(kstat -m cpu_info | grep "chip_id" | wc -l | tr -d ' ')"
|
||||||
|
|
||||||
|
# Fix for speeds under 1ghz
|
||||||
|
if [ -z "${speed:1}" ]; then
|
||||||
|
speed="0.${speed}"
|
||||||
|
else
|
||||||
|
speed="${speed:0:1}.${speed:1}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cpu="$cpu @ ${speed}GHz"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
@ -1160,12 +1196,13 @@ getcpu_usage () {
|
||||||
cpu_usage="${cpu_usage//[[:space:]]}"
|
cpu_usage="${cpu_usage//[[:space:]]}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Linux" | "Mac OS X" | "iPhone OS" | "BSD")
|
"Linux" | "Mac OS X" | "iPhone OS" | "BSD" | "Solaris")
|
||||||
# Get cores if unset
|
# Get cores if unset
|
||||||
if [ -z "$cores" ]; then
|
if [ -z "$cores" ]; then
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux") cores="$(awk -F ': ' '/siblings/ {printf $2; exit}' /proc/cpuinfo)" ;;
|
"Linux") cores="$(awk -F ': ' '/siblings/ {printf $2; exit}' /proc/cpuinfo)" ;;
|
||||||
"Mac OS X" | "BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
"Mac OS X" | "BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
||||||
|
"Solaris") cores="$(kstat -m cpu_info | grep "chip_id" | wc -l | tr -d ' ')"
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1330,7 +1367,7 @@ getgpu () {
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"BSD")
|
"BSD" | "Solaris")
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
"FreeBSD"*)
|
"FreeBSD"*)
|
||||||
gpu="$(pciconf -lv 2>/dev/null | grep -B 4 "VGA" | grep "device")"
|
gpu="$(pciconf -lv 2>/dev/null | grep -B 4 "VGA" | grep "device")"
|
||||||
|
@ -1413,6 +1450,12 @@ getmemory () {
|
||||||
memtotal="$(($(sysctl -n hw.physmem) / 1024 / 1024))"
|
memtotal="$(($(sysctl -n hw.physmem) / 1024 / 1024))"
|
||||||
memused="$((memtotal - memfree))"
|
memused="$((memtotal - memfree))"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Solaris")
|
||||||
|
memtotal="$(prtconf | grep Memory | head -1 | awk 'BEGIN {FS=" "} {print $3}')"
|
||||||
|
memfree="$(($(sar -r 1 1 | tail -1 | awk 'BEGIN {FS=" "} {print $2}') / 1024))"
|
||||||
|
memused="$((memtotal - memfree))"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
memory="${memused}MB / ${memtotal}MB"
|
memory="${memused}MB / ${memtotal}MB"
|
||||||
|
|
||||||
|
@ -1510,7 +1553,7 @@ getsong () {
|
||||||
|
|
||||||
getresolution () {
|
getresolution () {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "BSD")
|
"Linux" | "BSD" | "Solaris")
|
||||||
if type -p xrandr >/dev/null 2>&1; then
|
if type -p xrandr >/dev/null 2>&1; then
|
||||||
case "$refresh_rate" in
|
case "$refresh_rate" in
|
||||||
"on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;;
|
"on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;;
|
||||||
|
@ -1826,7 +1869,7 @@ gettermfont () {
|
||||||
getdisk () {
|
getdisk () {
|
||||||
# df flags
|
# df flags
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "iPhone OS" | "Windows") df_flags="-h -l --total" ;;
|
"Linux" | "iPhone OS" | "Windows" | "Solaris") df_flags="-h -l --total" ;;
|
||||||
"Mac OS X" | "BSD")
|
"Mac OS X" | "BSD")
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
"FreeBSD"* | *"OS X"* ) df_flags="-H / -l" ;;
|
"FreeBSD"* | *"OS X"* ) df_flags="-H / -l" ;;
|
||||||
|
@ -1982,7 +2025,7 @@ getlocalip () {
|
||||||
[ -z "$localip" ] && localip="$(ipconfig getifaddr en1)"
|
[ -z "$localip" ] && localip="$(ipconfig getifaddr en1)"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"BSD")
|
"BSD" | "Solaris")
|
||||||
localip="$(ifconfig | awk '/broadcast/ {print $2}')"
|
localip="$(ifconfig | awk '/broadcast/ {print $2}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -2064,6 +2107,11 @@ getbirthday () {
|
||||||
birthday="$(ls -alct --full-time /cygdrive/c/Windows/explorer.exe | awk '{printf $8 " " $9}')"
|
birthday="$(ls -alct --full-time /cygdrive/c/Windows/explorer.exe | awk '{printf $8 " " $9}')"
|
||||||
date_cmd="$(date -d"$birthday" "$birthday_format")"
|
date_cmd="$(date -d"$birthday" "$birthday_format")"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Solaris")
|
||||||
|
birthday="$(ls -alct --full-time /var/sadm/system/logs/install_log | awk '{printf $6 " " $7}')"
|
||||||
|
date_cmd="$(date -d"$birthday" "$birthday_format")"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Strip seconds from time output
|
# Strip seconds from time output
|
||||||
|
|
Loading…
Reference in a new issue