Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
f7686ee8
Commit
f7686ee8
authored
Dec 14, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Update comments
parent
5a6a3d7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
neofetch
neofetch
+18
-15
No files found.
neofetch
View file @
f7686ee8
...
@@ -727,7 +727,7 @@ get_cpu() {
...
@@ -727,7 +727,7 @@ get_cpu() {
case
"
$os
"
in
case
"
$os
"
in
"Linux"
|
"Windows"
)
"Linux"
|
"Windows"
)
# Get
cpu
name
# Get
CPU
name
case
"
$distro
"
in
case
"
$distro
"
in
"Android"
*) cpu=
"
$(
getprop ro.product.board
)
"
;;
"Android"
*) cpu=
"
$(
getprop ro.product.board
)
"
;;
*) cpu=
"
$(
awk
-F
': | @'
'/model name|Processor/ {printf $2; exit}'
/proc/cpuinfo
)
"
;;
*) cpu=
"
$(
awk
-F
': | @'
'/model name|Processor/ {printf $2; exit}'
/proc/cpuinfo
)
"
;;
...
@@ -736,7 +736,7 @@ get_cpu() {
...
@@ -736,7 +736,7 @@ get_cpu() {
speed_dir=
"/sys/devices/system/cpu/cpu0/cpufreq"
speed_dir=
"/sys/devices/system/cpu/cpu0/cpufreq"
temp_dir=
"/sys/class/hwmon/hwmon0/temp1_input"
temp_dir=
"/sys/class/hwmon/hwmon0/temp1_input"
# Get
cpu
speed
# Get
CPU
speed
if [[ -d
"
$speed_dir
"
]]; then
if [[ -d
"
$speed_dir
"
]]; then
# Fallback to bios_limit if
$speed_type
fails.
# Fallback to bios_limit if
$speed_type
fails.
speed=
"
$(
<
"
${
speed_dir
}
/
${
speed_type
}
"
)
"
|| \
speed=
"
$(
<
"
${
speed_dir
}
/
${
speed_type
}
"
)
"
|| \
...
@@ -749,14 +749,14 @@ get_cpu() {
...
@@ -749,14 +749,14 @@ get_cpu() {
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
fi
fi
# Get
cpu
temp
# Get
CPU
temp
if [[
"
$cpu_temp
"
==
"on"
&& -f
"
$temp_dir
"
]]; then
if [[
"
$cpu_temp
"
==
"on"
&& -f
"
$temp_dir
"
]]; then
temp=
"
$(
<
"
$temp_dir
"
)
"
temp=
"
$(
<
"
$temp_dir
"
)
"
temp=
"
$((
temp
*
100
/
10000
))
"
temp=
"
$((
temp
*
100
/
10000
))
"
temp=
"[
${
temp
/
${
temp
:
-1
}}
.
${
temp
:
-1
}
°C]"
temp=
"[
${
temp
/
${
temp
:
-1
}}
.
${
temp
:
-1
}
°C]"
fi
fi
#
Show/hide hyperthreaded
cores
#
Get CPU
cores
case
"
$cpu_cores
"
in
case
"
$cpu_cores
"
in
"logical"
|
"on"
) cores=
"
$(
grep
-c
"^processor"
/proc/cpuinfo
)
"
;;
"logical"
|
"on"
) cores=
"
$(
grep
-c
"^processor"
/proc/cpuinfo
)
"
;;
"physical"
) cores=
"
$(
grep
"^core id"
/proc/cpuinfo |
sort
-u
|
wc
-l
)
"
;;
"physical"
) cores=
"
$(
grep
"^core id"
/proc/cpuinfo |
sort
-u
|
wc
-l
)
"
;;
...
@@ -766,7 +766,7 @@ get_cpu() {
...
@@ -766,7 +766,7 @@ get_cpu() {
"Mac OS X"
)
"Mac OS X"
)
cpu=
"
$(
sysctl
-n
machdep.cpu.brand_string
)
"
cpu=
"
$(
sysctl
-n
machdep.cpu.brand_string
)
"
#
Show/hide hyperthreaded
cores
#
Get CPU
cores
case
"
$cpu_cores
"
in
case
"
$cpu_cores
"
in
"logical"
|
"on"
) cores=
"
$(
sysctl
-n
hw.logicalcpu_max
)
"
;;
"logical"
|
"on"
) cores=
"
$(
sysctl
-n
hw.logicalcpu_max
)
"
;;
"physical"
) cores=
"
$(
sysctl
-n
hw.physicalcpu_max
)
"
;;
"physical"
) cores=
"
$(
sysctl
-n
hw.physicalcpu_max
)
"
;;
...
@@ -801,20 +801,20 @@ get_cpu() {
...
@@ -801,20 +801,20 @@ get_cpu() {
;;
;;
"BSD"
)
"BSD"
)
# Get
cpu
name
# Get
CPU
name
cpu=
"
$(
sysctl
-n
hw.model
)
"
cpu=
"
$(
sysctl
-n
hw.model
)
"
cpu=
"
${
cpu
/[0-9]\.*
}
"
cpu=
"
${
cpu
/[0-9]\.*
}
"
cpu=
"
${
cpu
/ @*
}
"
cpu=
"
${
cpu
/ @*
}
"
# Get
cpu
speed
# Get
CPU
speed
speed=
"
$(
sysctl
-n
hw.cpuspeed
)
"
speed=
"
$(
sysctl
-n
hw.cpuspeed
)
"
[[ -z
"
$speed
"
]] && speed=
"
$(
sysctl
-n
hw.clockrate
)
"
[[ -z
"
$speed
"
]] && speed=
"
$(
sysctl
-n
hw.clockrate
)
"
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
# Get
cpu
cores
# Get
CPU
cores
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
# Get
cpu
temp
# Get
CPU
temp
if [[
"
$cpu_temp
"
==
"on"
]]; then
if [[
"
$cpu_temp
"
==
"on"
]]; then
case
"
$kernel_name
"
in
case
"
$kernel_name
"
in
"FreeBSD"
* |
"DragonFly"
*)
"FreeBSD"
* |
"DragonFly"
*)
...
@@ -830,17 +830,17 @@ get_cpu() {
...
@@ -830,17 +830,17 @@ get_cpu() {
;;
;;
"Solaris"
)
"Solaris"
)
# Get
cpu
name
# Get
CPU
name
cpu=
"
$(
psrinfo
-pv
)
"
cpu=
"
$(
psrinfo
-pv
)
"
cpu=
"
${
cpu
//*
$'
\n
'
}
"
cpu=
"
${
cpu
//*
$'
\n
'
}
"
cpu=
"
${
cpu
/[0-9]\.*
}
"
cpu=
"
${
cpu
/[0-9]\.*
}
"
cpu=
"
${
cpu
/ @*
}
"
cpu=
"
${
cpu
/ @*
}
"
# Get
cpu
speed
# Get
CPU
speed
speed=
"
$(
psrinfo
-v
|
awk
'/operates at/ {print $6; exit}'
)
"
speed=
"
$(
psrinfo
-v
|
awk
'/operates at/ {print $6; exit}'
)
"
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
#
Show/hide hyperthreaded
cores
#
Get CPU
cores
case
"
$cpu_cores
"
in
case
"
$cpu_cores
"
in
"logical"
|
"on"
) cores=
"
$(
kstat
-m
cpu_info |
grep
-c
-F
"chip_id"
)
"
;;
"logical"
|
"on"
) cores=
"
$(
kstat
-m
cpu_info |
grep
-c
-F
"chip_id"
)
"
;;
"physical"
) cores=
"
$(
psrinfo
-p
)
"
;;
"physical"
) cores=
"
$(
psrinfo
-p
)
"
;;
...
@@ -848,11 +848,16 @@ get_cpu() {
...
@@ -848,11 +848,16 @@ get_cpu() {
;;
;;
"Haiku"
)
"Haiku"
)
# Get CPU name
cpu=
"
$(
sysinfo
-cpu
|
awk
-F
'\\"'
'/CPU #0/ {print $2}'
)
"
cpu=
"
$(
sysinfo
-cpu
|
awk
-F
'\\"'
'/CPU #0/ {print $2}'
)
"
cpu=
"
${
cpu
/@*
}
"
cpu=
"
${
cpu
/@*
}
"
# Get CPU speed
speed=
"
$(
sysinfo
-cpu
|
awk
'/running at/ {print $NF; exit}'
)
"
speed=
"
$(
sysinfo
-cpu
|
awk
'/running at/ {print $NF; exit}'
)
"
speed=
"
${
speed
/MHz
}
"
speed=
"
${
speed
/MHz
}
"
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
# Get CPU cores
cores=
"
$(
sysinfo
-cpu
|
grep
-c
-F
'CPU #'
)
"
cores=
"
$(
sysinfo
-cpu
|
grep
-c
-F
'CPU #'
)
"
;;
;;
esac
esac
...
@@ -906,9 +911,7 @@ get_cpu() {
...
@@ -906,9 +911,7 @@ get_cpu() {
cpu=
"
${
cpu
/Core? Duo
}
"
cpu=
"
${
cpu
/Core? Duo
}
"
cpu=
"
${
cpu
/AMD
}
"
cpu=
"
${
cpu
/AMD
}
"
case
"
$cpu_shorthand
"
in
[[
"
$cpu_shorthand
"
==
"tiny"
]] && cpu=
"
${
cpu
/@*
}
"
"tiny"
) cpu=
"
${
cpu
/@*
}
"
;;
esac
;;
;;
esac
esac
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment