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
c89bf856
Commit
c89bf856
authored
Jul 23, 2017
by
Muhammad Herdiansyah
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'pr/784' into master
parents
906e7cc4
fe9a379d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
30 deletions
+25
-30
neofetch
neofetch
+25
-30
No files found.
neofetch
View file @
c89bf856
...
@@ -871,15 +871,9 @@ get_cpu() {
...
@@ -871,15 +871,9 @@ get_cpu() {
fi
fi
# Get CPU temp.
# Get CPU temp.
if [[
"
$cpu_temp
"
!=
"off"
&&
-f
"
$temp_dir
"
]]; then
if [[ -f
"
$temp_dir
"
]]; then
temp=
"
$(
<
"
$temp_dir
"
)
"
temp=
"
$(
<
"
$temp_dir
"
)
"
temp=
"
$((
temp
*
100
/
10000
))
"
temp=
"
$((
temp
*
100
/
10000
))
"
# Convert to fahrenheit if enabled.
[[
"
$cpu_temp
"
==
"F"
]] && temp=
"
$((
temp
*
90
/
50
+
320
))
"
# Format the output.
temp=
"[
${
temp
/
${
temp
:
-1
}}
.
${
temp
:
-1
}
°
${
cpu_temp
:-
C
}
]"
fi
fi
# Get CPU cores.
# Get CPU cores.
...
@@ -940,27 +934,16 @@ get_cpu() {
...
@@ -940,27 +934,16 @@ get_cpu() {
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
# Get CPU temp.
# Get CPU temp.
if [[
"
$cpu_temp
"
!=
"off"
]]; then
case
"
$kernel_name
"
in
case
"
$kernel_name
"
in
"FreeBSD"
* |
"DragonFly"
* |
"NetBSD"
*)
"FreeBSD"
* |
"DragonFly"
* |
"NetBSD"
*)
temp=
"
$(
sysctl
-n
dev.cpu.0.temperature
)
"
temp=
"
$(
sysctl
-n
dev.cpu.0.temperature
)
"
temp=
"
${
temp
/C
}
"
temp=
"
${
temp
/C
}
"
;;
;;
"OpenBSD"
* |
"Bitrig"
*)
"OpenBSD"
* |
"Bitrig"
*)
temp=
"
$(
sysctl
-n
hw.sensors.lm0.temp0
)
"
temp=
"
$(
sysctl
-n
hw.sensors.lm0.temp0
)
"
temp=
"
${
temp
/ degC
}
"
temp=
"
${
temp
/ degC
}
"
;;
;;
esac
esac
# Convert to fahrenheit if enabled.
if [[
"
$cpu_temp
"
==
"F"
]]; then
temp=
"
${
temp
//.
}
"
temp=
"
$((
temp
*
90
/
50
+
320
))
"
temp=
"[
${
temp
/
${
temp
:
-1
}}
.
${
temp
:
-1
}
°F]"
else
temp=
"[
${
temp
}
°C]"
fi
fi
;;
;;
"Solaris"
)
"Solaris"
)
...
@@ -1063,13 +1046,25 @@ get_cpu() {
...
@@ -1063,13 +1046,25 @@ get_cpu() {
# Add CPU speed to the output.
# Add CPU speed to the output.
if [[
"
$cpu_speed
"
!=
"off"
&&
"
$speed
"
]]; then
if [[
"
$cpu_speed
"
!=
"off"
&&
"
$speed
"
]]; then
if (( speed < 1000 )); then
if (( speed < 1000 )); then
cpu=
"
$cpu
@
${
speed
}
MHz
$temp
"
cpu=
"
$cpu
@
${
speed
}
MHz"
else
else
[[
"
$speed_shorthand
"
==
"on"
]] && speed=
"
$((
speed
/
100
))
"
[[
"
$speed_shorthand
"
==
"on"
]] && speed=
"
$((
speed
/
100
))
"
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
cpu=
"
$cpu
@
${
speed
}
GHz
$temp
"
cpu=
"
$cpu
@
${
speed
}
GHz"
fi
fi
fi
fi
# Add CPU temp to the output.
if [[
"
$cpu_temp
"
!=
"off"
&&
"
$temp
"
]]; then
temp=
"
${
temp
//.
}
"
# Convert to Fahrenheit if enabled
[[
"
$cpu_temp
"
==
"F"
]] && temp=
"
$((
temp
*
90
/
50
+
320
))
"
# Format the output
temp=
"[
${
temp
/
${
temp
:
-1
}}
.
${
temp
:
-1
}
°
${
cpu_temp
:-
C
}
]"
cpu=
"
$cpu
$temp
"
fi
}
}
get_cpu_usage() {
get_cpu_usage() {
...
...
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