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
b00928ae
Commit
b00928ae
authored
Nov 06, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Plain Diff
Merge master
parents
4b16e289
df2ecf9f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
77 deletions
+42
-77
neofetch
neofetch
+42
-77
No files found.
neofetch
View file @
b00928ae
...
@@ -229,10 +229,8 @@ getdistro() {
...
@@ -229,10 +229,8 @@ getdistro() {
distro=
"
${
distro
/DragonFly/DragonFlyBSD
}
"
distro=
"
${
distro
/DragonFly/DragonFlyBSD
}
"
# Workaround
for PCBSD as uname still displays FreeBSD
.
# Workaround
s for FreeBSD based distros
.
[ -f
"/etc/pcbsd-lang"
] && distro=
"PCBSD"
[ -f
"/etc/pcbsd-lang"
] && distro=
"PCBSD"
# Workaround for PacBSD as uname displays FreeBSD.
[ -f
"/etc/pacbsd-release"
] && distro=
"PacBSD"
[ -f
"/etc/pacbsd-release"
] && distro=
"PacBSD"
;;
;;
...
@@ -284,20 +282,14 @@ getkernel() {
...
@@ -284,20 +282,14 @@ getkernel() {
esac
esac
# Hardcode kernel settings in BSDs
# Hardcode kernel settings in BSDs
case "
$os
" in
if [ "
$os
" == "
BSD
" ] && [[ ! "
$distro
" =~ (PacBSD|PCBSD) ]]; then
"
BSD
")
case "
$distro
" in
"
PacBSD
"* | "
PCBSD
"*) kernel="
$(
uname
$kernel_flags
)
" ;;
*)
case "
$distro_shorthand
" in
case "
$distro_shorthand
" in
"
on
" | "
tiny
") kernel=
$(
uname
-r
)
;;
"
on
" | "
tiny
") kernel=
$(
uname
-r
)
;;
*) unset kernel ;;
*) unset kernel ;;
esac
esac
;;
else
esac
kernel="
$(
uname
$kernel_flags
)
"
;;
fi
*) kernel="
$(
uname
$kernel_flags
)
" ;;
esac
}
}
# }}}
# }}}
...
@@ -305,7 +297,6 @@ getkernel() {
...
@@ -305,7 +297,6 @@ getkernel() {
# Uptime {{{
# Uptime {{{
getuptime() {
getuptime() {
# Since Haiku's uptime cannot be fetched in seconds, a case outside
# Since Haiku's uptime cannot be fetched in seconds, a case outside
# the usual case is needed
# the usual case is needed
case "
$os
" in
case "
$os
" in
...
@@ -496,30 +487,31 @@ getshell() {
...
@@ -496,30 +487,31 @@ getshell() {
if [ "
$shell_version
" == "
on
" ]; then
if [ "
$shell_version
" == "
on
" ]; then
shell+="
"
shell+="
"
case "
$
shell
" in
case "
$
{
SHELL
##*/
}
" in
*"
bash
"*
)
"
bash
"
)
shell+="
$(
bash
--version
|
head
-n
1
)
"
shell+="
$(
bash
--version
)
"
shell="
${
shell
/ *, version
}
"
shell="
${
shell
/ *, version
}
"
shell="
${
shell
/
$'
\n
'
*
}
"
;;
;;
*"
zsh
"*
)
"
zsh
"
)
shell+="
$(
zsh
--version
)
"
shell+="
$(
zsh
--version
)
"
shell="
${
shell
/ zsh
}
"
shell="
${
shell
/ zsh
}
"
;;
;;
*"
mksh
"* | *
"
ksh
")
"
mksh
" |
"
ksh
")
shell+="
$(
"
$SHELL
"
-c
'printf "%s" "$KSH_VERSION"'
)
"
shell+="
$(
"
$SHELL
"
-c
'printf "%s" "$KSH_VERSION"'
)
"
shell="
${
shell
/ * KSH
}
"
shell="
${
shell
/ * KSH
}
"
;;
;;
*"
tcsh
"* | *"
csh
"*
)
"
tcsh
" | "
csh
"
)
shell+="
$(
"
$SHELL
"
--version
)
"
shell+="
$(
"
$SHELL
"
--version
)
"
shell="
${
shell
/tcsh
}
"
shell="
${
shell
/tcsh
}
"
shell="
${
shell
/\(*
}
"
shell="
${
shell
/\(*
}
"
;;
;;
*"
fish
"*
)
"
fish
"
)
shell+="
$(
"
$SHELL
"
-c
'printf "%s" "$FISH_VERSION"'
)
"
shell+="
$(
fish
-c
'printf "%s" "$FISH_VERSION"'
)
"
;;
;;
esac
esac
shell="
${
shell
/\(*\)
}
"
shell="
${
shell
/\(*\)
}
"
...
@@ -767,15 +759,6 @@ getcpu() {
...
@@ -767,15 +759,6 @@ getcpu() {
"logical"
|
"on"
) cores=
"
$(
grep
-c
^processor /proc/cpuinfo
)
"
;;
"logical"
|
"on"
) cores=
"
$(
grep
-c
^processor /proc/cpuinfo
)
"
;;
"physical"
) cores=
"
$(
grep
"^core id"
/proc/cpuinfo |
sort
-u
|
wc
-l
)
"
;;
"physical"
) cores=
"
$(
grep
"^core id"
/proc/cpuinfo |
sort
-u
|
wc
-l
)
"
;;
esac
esac
# Fix for speeds under 1ghz
if [ -z
"
${
speed
:1
}
"
]; then
speed=
"0.
${
speed
}
"
else
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
fi
cpu=
"
$cpu
@
${
speed
}
GHz
$temp
"
;;
;;
"Mac OS X"
)
"Mac OS X"
)
...
@@ -828,15 +811,6 @@ getcpu() {
...
@@ -828,15 +811,6 @@ getcpu() {
# Get cpu cores
# Get cpu cores
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
cores=
"
$(
sysctl
-n
hw.ncpu
)
"
# Fix for speeds under 1ghz
if [ -z
"
${
speed
:1
}
"
]; then
speed=
"0.
${
speed
}
"
else
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
fi
cpu=
"
$cpu
@
${
speed
}
GHz"
;;
;;
"Solaris"
)
"Solaris"
)
...
@@ -854,15 +828,6 @@ getcpu() {
...
@@ -854,15 +828,6 @@ getcpu() {
"logical"
|
"on"
) cores=
"
$(
kstat
-m
cpu_info |
grep
-c
-F
"chip_id"
)
"
;;
"logical"
|
"on"
) cores=
"
$(
kstat
-m
cpu_info |
grep
-c
-F
"chip_id"
)
"
;;
"physical"
) cores=
"
$(
psrinfo
-p
)
"
;;
"physical"
) cores=
"
$(
psrinfo
-p
)
"
;;
esac
esac
# Fix for speeds under 1ghz
if [ -z
"
${
speed
:1
}
"
]; then
speed=
"0.
${
speed
}
"
else
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
fi
cpu=
"
$cpu
@
${
speed
}
GHz"
;;
;;
"Haiku"
)
"Haiku"
)
...
@@ -872,15 +837,22 @@ getcpu() {
...
@@ -872,15 +837,22 @@ getcpu() {
speed=
"
${
speed
/MHz
}
"
speed=
"
${
speed
/MHz
}
"
speed=
"
$((
speed
/
100
))
"
speed=
"
$((
speed
/
100
))
"
cores=
"
$(
sysinfo
-cpu
|
grep
-c
-F
'CPU #'
)
"
cores=
"
$(
sysinfo
-cpu
|
grep
-c
-F
'CPU #'
)
"
;;
esac
>>>>>>> df2ecf9f4fd077872037c3d3a7e558fa0871b5fa
# Fix for speed under 1ghz
# Format the output
if [ -z ]
"
${
speed
:1
}
"
; then
case
"
$os
"
in
"Mac OS X"
|
"iPhone OS"
) ;;
*)
# Fix for speeds under 1ghz
if [ -z
"
${
speed
:1
}
"
]; then
speed=
"0.
${
speed
}
"
speed=
"0.
${
speed
}
"
else
else
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
speed=
"
${
speed
:0:1
}
.
${
speed
:1
}
"
fi
fi
cpu=
"
$cpu
@
${
speed
}
GHz"
cpu=
"
$cpu
@
${
speed
}
GHz
$temp
"
;;
;;
esac
esac
...
@@ -892,10 +864,11 @@ getcpu() {
...
@@ -892,10 +864,11 @@ getcpu() {
cpu=
"
${
cpu
//(R)
}
"
cpu=
"
${
cpu
//(R)
}
"
cpu=
"
${
cpu
//CPU
}
"
cpu=
"
${
cpu
//CPU
}
"
cpu=
"
${
cpu
//Processor
}
"
cpu=
"
${
cpu
//Processor
}
"
cpu=
"
${
cpu
//Six-Core
}
"
cpu=
"
${
cpu
//Core
}
"
cpu=
"
${
cpu
//Eight-Core
}
"
cpu=
"
${
cpu
//Dual-Core
}
"
cpu=
"
${
cpu
//Dual-Core
}
"
cpu=
"
${
cpu
//Quad-Core
}
"
cpu=
"
${
cpu
//Quad-Core
}
"
cpu=
"
${
cpu
//Six-Core
}
"
cpu=
"
${
cpu
//Eight-Core
}
"
cpu=
"
${
cpu
//with Radeon HD Graphics
}
"
cpu=
"
${
cpu
//with Radeon HD Graphics
}
"
# Add cpu cores to output
# Add cpu cores to output
...
@@ -1116,13 +1089,15 @@ getmemory() {
...
@@ -1116,13 +1089,15 @@ getmemory() {
"BSD"
)
"BSD"
)
case
"
$distro
"
in
case
"
$distro
"
in
"NetBSD"
*
)
memfree
=
"
$(($(
awk
-F
':|kB'
'/MemFree:/ {printf $2}'
/proc/meminfo
)
/
1024
))
"
;;
"NetBSD"
*
)
*
)
memfree
=
"
$(($(
vmstat |
awk
'END{printf $5}'
)
/
1024
))
"
;;
memfree
=
"
$(($(
awk
-F
':|kB'
'/MemFree:/ {printf $2}'
/proc/meminfo
)
/
1024
))
"
esac
memtotal
=
"
$(($(
sysctl
-n
hw.physmem64
)
/
1024
/
1024
))
"
;;
case
"
$distro
"
in
*
)
"NetBSD"
*
)
memtotal
=
"
$(($(
sysctl
-n
hw.physmem64
)
/
1024
/
1024
))
"
;;
memfree
=
"
$(($(
vmstat |
awk
'END{printf $5}'
)
/
1024
))
"
*
)
memtotal
=
"
$(($(
sysctl
-n
hw.physmem
)
/
1024
/
1024
))
"
;;
memtotal
=
"
$(($(
sysctl
-n
hw.physmem
)
/
1024
/
1024
))
"
;;
esac
esac
case
"
$distro
"
in
case
"
$distro
"
in
...
@@ -1298,8 +1273,7 @@ getresolution() {
...
@@ -1298,8 +1273,7 @@ getresolution() {
resolution="
${
resolution
//x??@/ @
}
"
resolution="
${
resolution
//x??@/ @
}
"
else
else
resolution="
$(
system_profiler SPDisplaysDataType |
\
resolution="
$(
system_profiler SPDisplaysDataType |
awk
'/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}'
)
"
awk
'/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}'
)
"
fi
fi
scale_factor="
$(
/usr/libexec/PlistBuddy
-c
"Print DisplayAnyUserSets:0:0:Resolution"
/Library/Preferences/com.apple.windowserver.plist
)
"
scale_factor="
$(
/usr/libexec/PlistBuddy
-c
"Print DisplayAnyUserSets:0:0:Resolution"
/Library/Preferences/com.apple.windowserver.plist
)
"
...
@@ -1323,16 +1297,13 @@ getresolution() {
...
@@ -1323,16 +1297,13 @@ getresolution() {
height="
$(
wmic path Win32_VideoController get CurrentVerticalResolution /value
)
"
height="
$(
wmic path Win32_VideoController get CurrentVerticalResolution /value
)
"
height="
${
height
/CurrentVerticalResolution
'='
/
}
"
height="
${
height
/CurrentVerticalResolution
'='
/
}
"
[ "
$width
" ] &&
\
[ "
$width
" ] && resolution="
${
width
}
x
${
height
}
"
resolution="
${
width
}
x
${
height
}
"
;;
;;
"
Haiku
")
"
Haiku
")
resolution="
$(
screenmode |
awk
-F
' |, '
'{printf $2 "x" $3 " @ " $6 $7}'
)
"
resolution="
$(
screenmode |
awk
-F
' |, '
'{printf $2 "x" $3 " @ " $6 $7}'
)
"
case "
$refresh_rate
" in
[ "
$refresh_rate
" == "
off
" ] && resolution="
${
resolution
/ @*
}
"
"
off
") resolution="
${
resolution
/ @*
}
" ;;
esac
;;
;;
esac
esac
...
@@ -1748,8 +1719,7 @@ getbattery() {
...
@@ -1748,8 +1719,7 @@ getbattery() {
"
Windows
")
"
Windows
")
battery="
$(
wmic Path Win32_Battery get EstimatedChargeRemaining /value
)
"
battery="
$(
wmic Path Win32_Battery get EstimatedChargeRemaining /value
)
"
battery="
${
battery
/EstimatedChargeRemaining
'='
}
"
battery="
${
battery
/EstimatedChargeRemaining
'='
}
"
[ "
$battery
" ] &&
\
[ "
$battery
" ] && battery+="
%
"
battery+="
%
"
;;
;;
"
Haiku
")
"
Haiku
")
...
@@ -1759,9 +1729,7 @@ getbattery() {
...
@@ -1759,9 +1729,7 @@ getbattery() {
;;
;;
esac
esac
case "
$battery_state
" in
[ "
$battery_state
" ] && battery+="
Charging
"
"
charging
"*) battery+="
Charging
" ;;
esac
case "
$battery_display
" in
case "
$battery_display
" in
"
bar
") battery="
$(
bar
"
${
battery
/
'%'
*
}
"
100
)
" ;;
"
bar
") battery="
$(
bar
"
${
battery
/
'%'
*
}
"
100
)
" ;;
...
@@ -2474,13 +2442,10 @@ prin() {
...
@@ -2474,13 +2442,10 @@ prin() {
# Underline {{{
# Underline {{{
getunderline
()
{
getunderline
()
{
case
"
$underline_enabled
"
in
if
[
"
$underline_enabled
"
==
"on"
]
;
then
"on"
)
underline
=
"
$(
printf
%
"
$length
"
s
)
"
underline
=
"
$(
printf
%
"
$length
"
s
)
"
underline
=
"
${
underline
// /
$underline_char
}
"
underline
=
"
${
underline
// /
$underline_char
}
"
;;
fi
"off"
)
underline
=
""
;;
esac
}
}
# }}}
# }}}
...
...
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