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
77bac34c
Unverified
Commit
77bac34c
authored
Oct 04, 2020
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general: drop cpu_usage. Always been unreliable. Never worked well. Closes #1551
parent
d6cd1c13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
43 deletions
+1
-43
neofetch
neofetch
+1
-43
No files found.
neofetch
View file @
77bac34c
...
...
@@ -75,7 +75,6 @@ print_info() {
info "Memory" memory
# info "GPU Driver" gpu_driver # Linux/macOS only
# info "CPU Usage" cpu_usage
# info "Disk" disk
# info "Battery" battery
# info "Font" font
...
...
@@ -2365,47 +2364,6 @@ get_cpu() {
fi
}
get_cpu_usage() {
case $os in
"Windows")
cpu_usage="$(wmic cpu get loadpercentage)"
cpu_usage="${cpu_usage/LoadPercentage}"
cpu_usage="${cpu_usage//[[:space:]]}"
;;
*)
# Get CPU cores if unset.
if [[ "$cpu_cores" != "logical" ]]; then
case $os in
"Linux" | "MINIX") cores="$(grep -c "^processor" /proc/cpuinfo)" ;;
"Mac OS X"|"macOS") cores="$(sysctl -n hw.logicalcpu_max)" ;;
"BSD") cores="$(sysctl -n hw.ncpu)" ;;
"Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
"Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;;
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
"IRIX") cores="$(sysconf NPROC_ONLN)" ;;
"FreeMiNT") cores="$(sysctl -n hw.ncpu)" ;;
"AIX")
cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')"
;;
esac
fi
cpu_usage="$(ps aux | awk 'BEGIN {sum=0} {sum+=$3}; END {print sum}')"
cpu_usage="$((${cpu_usage/\.*} / ${cores:-1}))"
;;
esac
# Print the bar.
case $cpu_display in
"bar") cpu_usage="$(bar "$cpu_usage" 100)" ;;
"infobar") cpu_usage="${cpu_usage}% $(bar "$cpu_usage" 100)" ;;
"barinfo") cpu_usage="$(bar "$cpu_usage" 100)${info_color} ${cpu_usage}%" ;;
*) cpu_usage="${cpu_usage}%" ;;
esac
}
get_gpu() {
case $os in
"Linux")
...
...
@@ -5258,7 +5216,6 @@ get_args() {
info "GPU Driver" gpu_driver
info "Memory" memory
info "CPU Usage" cpu_usage
info "Disk" disk
info "Battery" battery
info "Font" font
...
...
@@ -5311,6 +5268,7 @@ get_simple() {
old_functions() {
# Removed functions for backwards compatibility.
get_line_break() { :; }
get_cpu_usage() { :; }
}
get_distro_ascii() {
...
...
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