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
2e1c9424
Commit
2e1c9424
authored
Jul 14, 2017
by
Muhammad Herdiansyah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU [Speed]: Use the cpu_cores approach instead of deleting it manually.
This way, we don't have to replace the "@" with "($cores) @" and remove the CPU speed from the output.
parent
1378d3b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
neofetch
neofetch
+11
-14
No files found.
neofetch
View file @
2e1c9424
...
@@ -1013,16 +1013,6 @@ get_cpu() {
...
@@ -1013,16 +1013,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)
}
"
...
@@ -1047,11 +1037,18 @@ get_cpu() {
...
@@ -1047,11 +1037,18 @@ get_cpu() {
# 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.
# Add CPU speed to the output.
[[
"
$cpu_speed
"
==
"off"
]] && \
if [[
"
$cpu_speed
"
!=
"off"
&&
"
$speed
"
]]; then
cpu=
"
${
cpu
/@ *GHz
}
"
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
# Make the output of CPU shorter.
# Make the output of CPU shorter.
case
"
$cpu_shorthand
"
in
case
"
$cpu_shorthand
"
in
...
...
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