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
30a6d864
Commit
30a6d864
authored
Mar 09, 2017
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Added speed_shorthand to toggle showing decimals in the output
parent
d8561cce
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
config
config/config
+11
-0
neofetch
neofetch
+8
-7
neofetch.1
neofetch.1
+5
-2
No files found.
config/config
View file @
30a6d864
...
@@ -138,6 +138,17 @@ shell_version="on"
...
@@ -138,6 +138,17 @@ shell_version="on"
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
speed_type
=
"bios_limit"
speed_type
=
"bios_limit"
# CPU speed shorthand
#
# Default: 'off'
# Values: 'on', 'off'.
# Flag: --speed_shorthand.
#
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthand
=
"off"
# Shorten the output of the CPU function
# Shorten the output of the CPU function
#
#
# Default: 'off'
# Default: 'off'
...
...
neofetch
View file @
30a6d864
...
@@ -810,11 +810,10 @@ get_cpu() {
...
@@ -810,11 +810,10 @@ get_cpu() {
speed=
"
$(
<
"
${
speed_dir
}
/bios_limit"
)
"
|| \
speed=
"
$(
<
"
${
speed_dir
}
/bios_limit"
)
"
|| \
speed=
"
$(
<
"
${
speed_dir
}
/scaling_max_freq"
)
"
|| \
speed=
"
$(
<
"
${
speed_dir
}
/scaling_max_freq"
)
"
|| \
speed=
"
$(
<
"
${
speed_dir
}
/cpuinfo_max_freq"
)
"
speed=
"
$(
<
"
${
speed_dir
}
/cpuinfo_max_freq"
)
"
speed=
"
$((
speed
/
1000
0
))
"
speed=
"
$((
speed
/
1000
))
"
else
else
speed=
"
$(
awk
-F
': |\\.'
'/cpu MHz/ {printf $2; exit}'
/proc/cpuinfo
)
"
speed=
"
$(
awk
-F
': |\\.'
'/cpu MHz/ {printf $2; exit}'
/proc/cpuinfo
)
"
speed=
"
$((
speed
/
10
))
"
fi
fi
# Get CPU temp.
# Get CPU temp.
...
@@ -882,7 +881,6 @@ get_cpu() {
...
@@ -882,7 +881,6 @@ get_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
/
10
))
"
# Get CPU cores.
# Get CPU cores.
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
...
@@ -920,7 +918,6 @@ get_cpu() {
...
@@ -920,7 +918,6 @@ get_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
/
10
))
"
# Get CPU cores.
# Get CPU cores.
case
"
$cpu_cores
"
in
case
"
$cpu_cores
"
in
...
@@ -937,7 +934,6 @@ get_cpu() {
...
@@ -937,7 +934,6 @@ get_cpu() {
# Get CPU speed.
# 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
/
10
))
"
# Get CPU cores.
# Get CPU cores.
cores=
"
$(
sysinfo
-cpu
|
grep
-c
-F
'CPU #'
)
"
cores=
"
$(
sysinfo
-cpu
|
grep
-c
-F
'CPU #'
)
"
...
@@ -950,7 +946,6 @@ get_cpu() {
...
@@ -950,7 +946,6 @@ get_cpu() {
# Get CPU speed.
# Get CPU speed.
speed=
"
$(
prtconf |
awk
-F
':'
'/Processor Clock Speed/ {printf $2}'
)
"
speed=
"
$(
prtconf |
awk
-F
':'
'/Processor Clock Speed/ {printf $2}'
)
"
speed=
"
${
speed
/MHz
}
"
speed=
"
${
speed
/MHz
}
"
speed=
"
$((
speed
/
10
))
"
# Get CPU cores.
# Get CPU cores.
case
"
$cpu_cores
"
in
case
"
$cpu_cores
"
in
...
@@ -960,8 +955,12 @@ get_cpu() {
...
@@ -960,8 +955,12 @@ get_cpu() {
;;
;;
esac
esac
# Fix for speeds under 1ghz.
if [[
"
$speed
"
]]; then
if [[
"
$speed
"
]]; then
# Hide decimals if on.
[[
"
$speed_shorthand
"
==
"on"
]] && \
speed=
"
$((
speed
/
100
))
"
# Fix for speeds under 1ghz.
if [[ -z
"
${
speed
:1
}
"
]]; then
if [[ -z
"
${
speed
:1
}
"
]]; then
speed=
"0.
${
speed
}
"
speed=
"0.
${
speed
}
"
else
else
...
@@ -3739,6 +3738,7 @@ INFO:
...
@@ -3739,6 +3738,7 @@ INFO:
NOTE: This only supports Linux with cpufreq.
NOTE: This only supports Linux with cpufreq.
--speed_shorthand on/off Whether or not to show decimals in CPU speed.
--cpu_shorthand type Shorten the output of CPU
--cpu_shorthand type Shorten the output of CPU
Possible values: name, speed, tiny, on, off
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
...
@@ -3944,6 +3944,7 @@ get_args() {
...
@@ -3944,6 +3944,7 @@ get_args() {
"--cpu_cores"
)
cpu_cores
=
"
$2
"
;;
"--cpu_cores"
)
cpu_cores
=
"
$2
"
;;
"--cpu_speed"
)
cpu_speed
=
"
$2
"
;;
"--cpu_speed"
)
cpu_speed
=
"
$2
"
;;
"--speed_type"
)
speed_type
=
"
$2
"
;;
"--speed_type"
)
speed_type
=
"
$2
"
;;
"--speed_shorthand"
)
speed_shorthand
=
"
$2
"
;;
"--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
"
;;
...
...
neofetch.1
View file @
30a6d864
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.
3
.
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.
1
.
.TH NEOFETCH "1" "
February
2017" "Neofetch 3.0.2" "User Commands"
.TH NEOFETCH "1" "
March
2017" "Neofetch 3.0.2" "User Commands"
.SH NAME
.SH NAME
Neofetch \- A fast, highly customizable system info script
Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS
.SH SYNOPSIS
...
@@ -30,6 +30,9 @@ scaling_current, scaling_min, scaling_max
...
@@ -30,6 +30,9 @@ scaling_current, scaling_min, scaling_max
.IP
.IP
NOTE: This only supports Linux with cpufreq.
NOTE: This only supports Linux with cpufreq.
.TP
.TP
\fB\-\-speed_shorthand\fR on/off
Whether or not to show decimals in CPU speed.
.TP
\fB\-\-cpu_shorthand\fR type
\fB\-\-cpu_shorthand\fR type
Shorten the output of CPU
Shorten the output of CPU
Possible values: name, speed, tiny, on, off
Possible values: name, speed, tiny, on, off
...
...
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