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
03f85176
Commit
03f85176
authored
Jul 14, 2017
by
Muhammad Herdiansyah
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #773 from konimex/cpu
CPU: Various CPU changes
parents
139617e2
a503fb97
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
46 deletions
+37
-46
CHANGELOG.md
CHANGELOG.md
+2
-0
config.conf
config/config.conf
+7
-10
neofetch
neofetch
+26
-33
neofetch.1
neofetch.1
+2
-3
No files found.
CHANGELOG.md
View file @
03f85176
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
**CPU**
**CPU**
-
[
Linux
]
Fixed inaccurate output on ARM SoC devices.
-
[
Linux
]
Fixed inaccurate output on ARM SoC devices.
-
[
Linux
]
Fixed CPU speed not appearing on PowerPC systems.
-
[
NetBSD
]
Added support for CPU temperature. (NOTE: This only supports newer Intel processors)
-
[
NetBSD
]
Added support for CPU temperature. (NOTE: This only supports newer Intel processors)
-
Fixed inaccurate speed output in systems with CPU speed less than 1 GHz.
-
Fixed inaccurate speed output in systems with CPU speed less than 1 GHz.
-
Deprecated
`cpu_shorthand`
in favor of
`cpu_brand`
.
**Uptime**
**Uptime**
...
...
config/config.conf
View file @
03f85176
...
@@ -149,19 +149,16 @@ speed_type="bios_limit"
...
@@ -149,19 +149,16 @@ speed_type="bios_limit"
# off: 'i7-6500U (4) @ 3.100GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthand
=
"off"
speed_shorthand
=
"off"
#
Shorten the output of the CPU function
#
Enable/Disable CPU brand in output.
#
#
# Default: 'o
ff
'
# Default: 'o
n
'
# Values: 'on', 'off'
, 'tiny', 'name', 'speed'
# Values: 'on', 'off'
# Flag: --cpu_
shorth
and
# Flag: --cpu_
br
and
#
#
# Example:
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# on: 'Intel i7-6500U'
# off: 'Intel i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4)'
# tiny: 'i7-6500U (4)'
cpu_brand
=
"on"
# name: 'Intel i7-6500U (4)'
# speed: '3.1GHz'
cpu_shorthand
=
"off"
# CPU Speed
# CPU Speed
# Hide/Show CPU speed.
# Hide/Show CPU speed.
...
...
neofetch
View file @
03f85176
...
@@ -859,7 +859,8 @@ get_cpu() {
...
@@ -859,7 +859,8 @@ get_cpu() {
speed=
"
$((
speed
/
1000
))
"
speed=
"
$((
speed
/
1000
))
"
else
else
speed=
"
$(
awk
-F
': |\\.'
'/cpu MHz/ {printf $2; exit}'
/proc/cpuinfo
)
"
speed=
"
$(
awk
-F
': |\\.'
'/cpu MHz|^clock/ {printf $2; exit}'
/proc/cpuinfo
)
"
speed=
"
${
speed
/MHz
}
"
fi
fi
# Get CPU temp.
# Get CPU temp.
...
@@ -1013,16 +1014,6 @@ get_cpu() {
...
@@ -1013,16 +1014,6 @@ get_cpu() {
;;
;;
esac
esac
if [[
"
$speed
"
]]; then
if (( speed < 1000 )); then
cpu=
"
$cpu
@
${
speed
}
MHz
$temp
"
else
[[
"
$speed_shorthand
"
==
"on"
]] && speed=
"
$((
speed
/
100
))
"
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
cpu=
"
$cpu
@
${
speed
}
GHz
$temp
"
fi
fi
# Remove un-needed patterns from cpu output.
# Remove un-needed patterns from cpu output.
cpu=
"
${
cpu
//(TM)
}
"
cpu=
"
${
cpu
//(TM)
}
"
cpu=
"
${
cpu
//(tm)
}
"
cpu=
"
${
cpu
//(tm)
}
"
...
@@ -1045,28 +1036,28 @@ get_cpu() {
...
@@ -1045,28 +1036,28 @@ get_cpu() {
# Trim spaces from core output
# Trim spaces from core output
cores=
"
${
cores
//[[
:space:]]
}
"
cores=
"
${
cores
//[[
:space:]]
}
"
# Remove CPU brand from the output.
if [[
"
$cpu_brand
"
==
"off"
]]; then
cpu=
"
${
cpu
/AMD
}
"
cpu=
"
${
cpu
/Intel
}
"
cpu=
"
${
cpu
/Core? Duo
}
"
cpu=
"
${
cpu
/Qualcomm
}
"
fi
# Add CPU cores to the output.
# Add CPU cores to the output.
[[
"
$cpu_cores
"
!=
"off"
&&
"
$cores
"
]] && \
[[
"
$cpu_cores
"
!=
"off"
&&
"
$cores
"
]] && \
cpu=
"
${
cpu
/@/(
${
cores
}
) @
}
"
cpu=
"
$cpu
(
$cores
)"
# Remove CPU speed from the output.
[[
"
$cpu_speed
"
==
"off"
]] && \
cpu=
"
${
cpu
/@ *GHz
}
"
# Make the output of CPU shorter.
case
"
$cpu_shorthand
"
in
"name"
) cpu=
"
${
cpu
/@*
}
"
;;
"speed"
) cpu=
"
${
cpu
#*@
}
"
;;
"on"
|
"tiny"
)
# Add CPU speed to the output.
cpu=
"
${
cpu
/AMD
}
"
if [[
"
$cpu_speed
"
!=
"off"
&&
"
$speed
"
]]; then
cpu=
"
${
cpu
/Intel
}
"
if (( speed < 1000 )); then
cpu=
"
${
cpu
/Core? Duo
}
"
cpu=
"
$cpu
@
${
speed
}
MHz
$temp
"
cpu=
"
${
cpu
/Qualcomm
}
"
else
[[
"
$speed_shorthand
"
==
"on"
]] && speed=
"
$((
speed
/
100
))
"
[[
"
$cpu_shorthand
"
==
"tiny"
]] && cpu=
"
${
cpu
/@*
}
"
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
;;
cpu=
"
$cpu
@
${
speed
}
GHz
$temp
"
esac
fi
fi
}
}
get_cpu_usage
()
{
get_cpu_usage
()
{
...
@@ -3801,6 +3792,9 @@ old_options() {
...
@@ -3801,6 +3792,9 @@ old_options() {
# Scrot dir was removed in 3.1.0.
# Scrot dir was removed in 3.1.0.
[[
-n
"
$scrot_dir
"
]]
&&
scrot_dir
=
[[
-n
"
$scrot_dir
"
]]
&&
scrot_dir
=
# cpu_shorthand was deprecated in 3.3.0
[[
-n
"
$cpu_shorthand
"
]]
&&
{
err
"Config:
\$
cpu_shorthand is deprecated, use
\$
cpu_brand,
\$
cpu_cores, and
\$
cpu_speed instead."
;
}
}
}
cache_uname
()
{
cache_uname
()
{
...
@@ -3954,8 +3948,7 @@ INFO:
...
@@ -3954,8 +3948,7 @@ INFO:
NOTE: This flag is not supported in systems with CPU speed less than 1 GHz.
NOTE: This flag is not supported in systems with CPU speed less than 1 GHz.
--cpu_shorthand type Shorten the output of CPU
--cpu_brand on/off Enable/Disable CPU brand in output.
Possible values: name, speed, tiny, on, off
--cpu_cores type Whether or not to display the number of CPU cores
--cpu_cores type Whether or not to display the number of CPU cores
Possible values: logical, physical, off
Possible values: logical, physical, off
...
@@ -4170,7 +4163,7 @@ get_args() {
...
@@ -4170,7 +4163,7 @@ get_args() {
"--distro_shorthand"
)
distro_shorthand
=
"
$2
"
;;
"--distro_shorthand"
)
distro_shorthand
=
"
$2
"
;;
"--kernel_shorthand"
)
kernel_shorthand
=
"
$2
"
;;
"--kernel_shorthand"
)
kernel_shorthand
=
"
$2
"
;;
"--uptime_shorthand"
)
uptime_shorthand
=
"
$2
"
;;
"--uptime_shorthand"
)
uptime_shorthand
=
"
$2
"
;;
"--cpu_
shorthand"
)
cpu_shorth
and
=
"
$2
"
;;
"--cpu_
brand"
)
cpu_br
and
=
"
$2
"
;;
"--gpu_brand"
)
gpu_brand
=
"
$2
"
;;
"--gpu_brand"
)
gpu_brand
=
"
$2
"
;;
"--gpu_type"
)
gpu_type
=
"
$2
"
;;
"--gpu_type"
)
gpu_type
=
"
$2
"
;;
"--refresh_rate"
)
refresh_rate
=
"
$2
"
;;
"--refresh_rate"
)
refresh_rate
=
"
$2
"
;;
...
...
neofetch.1
View file @
03f85176
...
@@ -35,9 +35,8 @@ Whether or not to show decimals in CPU speed.
...
@@ -35,9 +35,8 @@ Whether or not to show decimals in CPU speed.
.IP
.IP
NOTE: This flag is not supported in systems with CPU speed less than 1 GHz.
NOTE: This flag is not supported in systems with CPU speed less than 1 GHz.
.TP
.TP
\fB\-\-cpu_shorthand\fR type
\fB\-\-cpu_brand\fR on/off
Shorten the output of CPU
Enable/Disable CPU brand in output.
Possible values: name, speed, tiny, on, off
.TP
.TP
\fB\-\-cpu_cores\fR type
\fB\-\-cpu_cores\fR type
Whether or not to display the number of CPU cores
Whether or not to display the number of CPU cores
...
...
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