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
5270e979
Commit
5270e979
authored
Oct 22, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into img
parents
c804f783
7b281b2a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
69 deletions
+79
-69
Changelog.md
Changelog.md
+9
-0
README.md
README.md
+3
-1
config
config/config
+5
-2
neofetch
neofetch
+57
-64
neofetch.1
neofetch.1
+5
-2
No files found.
Changelog.md
View file @
5270e979
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
-
Added new function called
`checkoldflags`
which informs users about deprecated config options.
-
Added new function called
`checkoldflags`
which informs users about deprecated config options.
-
Change all
`OS X`
references to
`macOS`
.
**[@iandrewt](https://github.com/iandrewt)**
-
Change all
`OS X`
references to
`macOS`
.
**[@iandrewt](https://github.com/iandrewt)**
-
Fix corrupted text when long lines are cut-off.
-
Fix corrupted text when long lines are cut-off.
-
Don't dynamically place prompt in
`image=off`
mode.
## Operating System
## Operating System
...
@@ -67,8 +68,15 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429
...
@@ -67,8 +68,15 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429
**CPU**
<br
\>
**CPU**
<br
\>
-
Expanded
`cpu_cores`
option by adding two new values,
`logical`
and
`physical`
.
-
`logical`
: Show all virtual cores (hyperthreaded).
-
`physical`
: Only show physical cores.
-
[
macOS
]
Print physical cores instead of hyper-threaded cores.
**[@iandrewt](https://github.com/iandrewt)**
-
[
macOS
]
Print physical cores instead of hyper-threaded cores.
**[@iandrewt](https://github.com/iandrewt)**
**Uptime**
<br
\>
-
Rewrote uptime function to use seconds since boot instead of the
`uptime`
command.
**Resolution**
<br
\>
**Resolution**
<br
\>
-
[
macOS
]
Add @2x label for retina resolutions.
**[@iandrewt](https://github.com/iandrewt)**
-
[
macOS
]
Add @2x label for retina resolutions.
**[@iandrewt](https://github.com/iandrewt)**
...
@@ -96,6 +104,7 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429
...
@@ -96,6 +104,7 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429
**Terminal and Terminal Font**
<br
\>
**Terminal and Terminal Font**
<br
\>
-
Uppercase first letter of
`term`
and
`termfont`
outputs.
-
Uppercase first letter of
`term`
and
`termfont`
outputs.
-
Don't print broken output of busybox's
`ps`
.
-
Remove path from output.
-
Remove path from output.
**Song**
<br
\>
**Song**
<br
\>
...
...
README.md
View file @
5270e979
...
@@ -371,7 +371,9 @@ alias neofetch2="neofetch \
...
@@ -371,7 +371,9 @@ alias neofetch2="neofetch \
NOTE: This only support Linux with cpufreq.
NOTE: This only support Linux with cpufreq.
--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 on/off Whether or not to display the number of CPU cores
--cpu_cores type Whether or not to display the number of CPU cores
Takes: logical, physical, off
Note: 'physical' doesn't work on BSD.
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
NOTE: This is only possible on Linux, macOS, and Solaris
NOTE: This is only possible on Linux, macOS, and Solaris
--kernel_shorthand on/off Shorten the output of kernel
--kernel_shorthand on/off Shorten the output of kernel
...
...
config/config
View file @
5270e979
...
@@ -108,8 +108,11 @@ cpu_display="off"
...
@@ -108,8 +108,11 @@ cpu_display="off"
# CPU Cores
# CPU Cores
# Display CPU cores in output
# Display CPU cores in output
# --cpu_cores on/off
# Logical: All virtual cores
cpu_cores
=
"on"
# Physical: All physical cores
# --cpu_cores logical, physical, off
# Note: 'physical' doesn't work on BSD.
cpu_cores
=
"logical"
# GPU
# GPU
...
...
neofetch
View file @
5270e979
...
@@ -268,73 +268,52 @@ getkernel() {
...
@@ -268,73 +268,52 @@ getkernel() {
# Uptime {{{
# Uptime {{{
getuptime() {
getuptime() {
# Get uptime in seconds
case "
$os
" in
case "
$os
" in
"
Linux
" | "
Windows
")
"
Linux
" | "
Windows
")
case "
$distro
" in
seconds="
$(
< /proc/uptime
)
"
*"
Puppy
"* | "
Quirky
Werewolf
"* | "
Alpine
Linux
"* | "
OpenWRT
"* | "
Windows
"*)
seconds="
${
seconds
/.*
}
"
uptime="
$(
uptime
|
awk
-F
':[0-9]{2}+ |(, ){1}+'
'{printf $2}'
)
"
;;
"
openSUSE
"*)
uptime="
$(
uptime
|
awk
-F
':[0-9]{2}+[a-z][a-z] |(, ){1}+'
'{printf $2}'
)
"
;;
*)
uptime="
$(
uptime
-p
)
"
[ "
$uptime
" == "
up
" ] && uptime="
up
$(
awk
-F
'.'
'{print $1}'
/proc/uptime
)
seconds
"
;;
esac
;;
;;
"
Mac
OS X
" | "
iPhone
OS
" | "
BSD
")
"
Mac
OS X
" | "
iPhone
OS
" | "
BSD
")
# Get boot time in seconds
boot="
$(
sysctl
-n
kern.boottime
)
"
boot="
$(
sysctl
-n
kern.boottime
)
"
boot="
${
boot
/
'{ sec = '
}
"
boot="
${
boot
/
'{ sec = '
}
"
boot="
${
boot
/,*
}
"
boot="
${
boot
/,*
}
"
# Get current date in seconds
# Get current date in seconds
now="
$(
date
+%s
)
"
now="
$(
date
+%s
)
"
uptime="
$((
now
-
boot
))
"
seconds="
$((
now
-
boot
))
"
;;
# Convert uptime to days/hours/mins
minutes="
$((
uptime
/
60
%
60
))
"
hours="
$((
uptime
/
3600
%
24
))
"
days="
$((
uptime
/
86400
))
"
case "
$minutes
" in
1) minutes="
1
minute
" ;;
0) unset minutes ;;
*) minutes="
$minutes
minutes
" ;;
esac
case "
$hours
" in
1) hours="
1
hour
" ;;
0) unset hours ;;
*) hours="
$hours
hours
" ;;
esac
case "
$days
" in
"
Solaris
")
1) days="
1
day
" ;;
seconds="
$(
kstat
-p
unix:0:system_misc:snaptime |
awk
'{print $2}'
)
"
0) unset days ;;
seconds="
${
seconds
/.*
}
"
*) days="
$days
days
"
;;
;;
esac
esac
[ "
$hours
" ] &&
\
days="
$((
seconds
/
60
/
60
/
24
))
days
"
[ "
$minutes
" ] &&
\
hours="
$((
seconds
/
60
/
60
%
24
))
hours
"
hours+="
,
"
minutes="
$((
seconds
/
60
%
60
))
minutes
"
[ "
$days
" ] &&
\
case "
$days
" in
[ "
$hours
" ] &&
\
"
0
days
") unset days ;;
days+="
,
"
"
1
days
") days="
${
days
/s
}
" ;;
esac
uptime="
up
$days
$hours
$minutes
"
case "
$hours
" in
;;
"
0
hours
") unset hours ;;
"
1
hours
") hours="
${
hours
/s
}
" ;;
esac
"
Solaris
")
case "
$minutes
" in
uptime="
$(
uptime
| /usr/xpg4/bin/awk
-F
':[0-9]{2}+[a-z][a-z] |(, ){1}+'
'{printf $2}'
)
"
"
0
minutes
") unset minutes ;;
;;
"
1
minutes
") minutes="
${
minutes
/s
}
"
;;
esac
esac
uptime="
${
days
:+
$days
,
}${
hours
:+
$hours
,
}${
minutes
}
"
uptime="
${
uptime
%
', '
}
"
uptime="
up
${
uptime
:-${
seconds
}
seconds
}
"
# Make the output of uptime smaller.
# Make the output of uptime smaller.
case "
$uptime_shorthand
" in
case "
$uptime_shorthand
" in
"
on
")
"
on
")
...
@@ -353,7 +332,7 @@ getuptime() {
...
@@ -353,7 +332,7 @@ getuptime() {
uptime="
${
uptime
/ minutes/m
}
"
uptime="
${
uptime
/ minutes/m
}
"
uptime="
${
uptime
/ minute/m
}
"
uptime="
${
uptime
/ minute/m
}
"
uptime="
${
uptime
/ seconds/s
}
"
uptime="
${
uptime
/ seconds/s
}
"
uptime="
${
uptime
/,
}
"
uptime="
${
uptime
/
/
,
}
"
;;
;;
esac
esac
}
}
...
@@ -724,7 +703,11 @@ getcpu() {
...
@@ -724,7 +703,11 @@ getcpu() {
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
fi
fi
cores=
"
$(
grep
-c
^processor /proc/cpuinfo
)
"
# Show/hide hyperthreaded cores
case
"
$cpu_cores
"
in
"logical"
|
"on"
) cores=
"
$(
grep
-c
^processor /proc/cpuinfo
)
"
;;
"physical"
) cores=
"
$(
grep
"^core id"
/proc/cpuinfo |
sort
-u
|
wc
-l
)
"
;;
esac
# Fix for speeds under 1ghz
# Fix for speeds under 1ghz
if [ -z
"
${
speed
:1
}
"
]; then
if [ -z
"
${
speed
:1
}
"
]; then
...
@@ -738,7 +721,12 @@ getcpu() {
...
@@ -738,7 +721,12 @@ getcpu() {
"Mac OS X"
)
"Mac OS X"
)
cpu=
"
$(
sysctl
-n
machdep.cpu.brand_string
)
"
cpu=
"
$(
sysctl
-n
machdep.cpu.brand_string
)
"
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
# Show/hide hyperthreaded cores
case
"
$cpu_cores
"
in
"logical"
|
"on"
) cores=
"
$(
sysctl
-n
hw.logicalcpu_max
)
"
;;
"physical"
) cores=
"
$(
sysctl
-n
hw.physicalcpu_max
)
"
;;
esac
;;
;;
"iPhone OS"
)
"iPhone OS"
)
...
@@ -884,8 +872,11 @@ getcpu() {
...
@@ -884,8 +872,11 @@ getcpu() {
speed=
"
$(
psrinfo
-v
|
awk
'/operates at/ {print $6}'
)
"
speed=
"
$(
psrinfo
-v
|
awk
'/operates at/ {print $6}'
)
"
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
# Get cpu cores
# Show/hide hyperthreaded cores
cores=
"
$(
kstat
-m
cpu_info |
grep
-c
"chip_id"
)
"
case
"
$cpu_cores
"
in
"logical"
|
"on"
) cores=
"
$(
kstat
-m
cpu_info |
grep
-c
"chip_id"
)
"
;;
"physical"
) cores=
"
$(
psrinfo
-p
)
"
;;
esac
# Fix for speeds under 1ghz
# Fix for speeds under 1ghz
if [ -z
"
${
speed
:1
}
"
]; then
if [ -z
"
${
speed
:1
}
"
]; then
...
@@ -913,7 +904,7 @@ getcpu() {
...
@@ -913,7 +904,7 @@ getcpu() {
cpu=
"
${
cpu
//with Radeon HD Graphics
}
"
cpu=
"
${
cpu
//with Radeon HD Graphics
}
"
# Add cpu cores to output
# Add cpu cores to output
[
"
$cpu_cores
"
==
"on
"
] && [
"
$cores
"
] && \
[
"
$cpu_cores
"
!=
"off
"
] && [
"
$cores
"
] && \
cpu=
"
${
cpu
/@/(
${
cores
}
) @
}
"
cpu=
"
${
cpu
/@/(
${
cores
}
) @
}
"
# Make the output of cpu shorter
# Make the output of cpu shorter
...
@@ -1581,7 +1572,7 @@ getterm() {
...
@@ -1581,7 +1572,7 @@ getterm() {
case "
${
name
//
}
" in
case "
${
name
//
}
" in
"
${
SHELL
/*\/
}
" | *"
sh
" | "
tmux
"* | "
screen
") getterm "
$parent
" ;;
"
${
SHELL
/*\/
}
" | *"
sh
" | "
tmux
"* | "
screen
") getterm "
$parent
" ;;
"
login
"* | *"
Login
"* | "
init
") term="
$(
tty
)
" ;;
"
login
"* | *"
Login
"* | "
init
") term="
$(
tty
)
" ;;
"
ruby
" | "
1
" | "
systemd
" | "
sshd
"* | "
python
"*) unset term ;;
"
ruby
" | "
1
" | "
systemd
" | "
sshd
"* | "
python
"*
| "
USER
"*"
PID
"*
) unset term ;;
"
gnome
-terminal-
") term="
gnome
-terminal
" ;;
"
gnome
-terminal-
") term="
gnome
-terminal
" ;;
*) term="
${
name
##*/
}
" ;;
*) term="
${
name
##*/
}
" ;;
esac
esac
...
@@ -2916,7 +2907,7 @@ kdeconfigdir() {
...
@@ -2916,7 +2907,7 @@ kdeconfigdir() {
dynamicprompt
()
{
dynamicprompt
()
{
# Calculate image height in terminal cells.
# Calculate image height in terminal cells.
# The '+ 4' adds a gap between the prompt and the content.
# The '+ 4' adds a gap between the prompt and the content.
[
"
$image
"
!=
"ascii"
]
&&
[
"
$image
"
!=
"off"
]
&&
\
[
"
$image
"
!=
"ascii"
]
&&
\
lines
=
"
$((${
height
:-
1
}
/
${
font_height
:-
1
}
+
4
))
"
lines
=
"
$((${
height
:-
1
}
/
${
font_height
:-
1
}
+
4
))
"
# If the info is higher than the ascii/image place the prompt
# If the info is higher than the ascii/image place the prompt
...
@@ -2975,7 +2966,9 @@ usage() { cat << EOF
...
@@ -2975,7 +2966,9 @@ usage() { cat << EOF
NOTE: This only support Linux with cpufreq.
NOTE: This only support Linux with cpufreq.
--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 on/off Whether or not to display the number of CPU cores
--cpu_cores type Whether or not to display the number of CPU cores
Takes: logical, physical, off
Note: 'physical' doesn't work on BSD.
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
NOTE: This is only possible on Linux, macOS, and Solaris
NOTE: This is only possible on Linux, macOS, and Solaris
--kernel_shorthand on/off Shorten the output of kernel
--kernel_shorthand on/off Shorten the output of kernel
...
@@ -3312,17 +3305,17 @@ main() {
...
@@ -3312,17 +3305,17 @@ main() {
# Display the image if enabled
# Display the image if enabled
displayimage
displayimage
fi
# Set cursor position next to ascii art
# Set cursor position next to ascii art
printf
"
\0
33[
$((${
lines
:-
4
}
-
${
prompt_loc
:-
4
}))
A"
printf
"
\0
33[
$((${
lines
:-
4
}
-
${
prompt_loc
:-
4
}))
A"
# Reset horizontal cursor position
# Reset horizontal cursor position
printf
"
\0
33[9999999D"
printf
"
\0
33[9999999D"
fi
# Print the info
# Print the info
printinfo
printinfo
dynamicprompt
[
"
$image
"
!=
"off"
]
&&
dynamicprompt
# Re-enable line wrap
# Re-enable line wrap
printf
"%b%s"
"
\0
33[?7h"
printf
"%b%s"
"
\0
33[?7h"
...
...
neofetch.1
View file @
5270e979
...
@@ -35,8 +35,10 @@ Shorten the output of CPU
...
@@ -35,8 +35,10 @@ Shorten the output of CPU
.br
.br
Possible values: name, speed, tiny, on, off
Possible values: name, speed, tiny, on, off
.TP
.TP
.B \--cpu_cores '
on
/off'
.B \--cpu_cores '
logical/physical
/off'
Whether or not to display the number of CPU cores
Whether or not to display the number of CPU cores
.br
Note: 'physical' doesn't work on BSD.
.TP
.TP
.B \--distro_shorthand 'on/off'
.B \--distro_shorthand 'on/off'
Shorten the output of distro (tiny, on, off)
Shorten the output of distro (tiny, on, off)
...
@@ -51,7 +53,8 @@ Shorten the output of uptime (tiny, on, off)
...
@@ -51,7 +53,8 @@ Shorten the output of uptime (tiny, on, off)
.TP
.TP
.B \--refresh_rate 'on/off'
.B \--refresh_rate 'on/off'
Whether to display the refresh rate of each monitor
Whether to display the refresh rate of each monitor
Unsupported on Windows
.br
Note: Unsupported on Windows
.TP
.TP
.B \--gpu_shorthand 'on/off'
.B \--gpu_shorthand 'on/off'
Shorten the output of GPU (tiny, on, off)
Shorten the output of GPU (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