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
a02f8577
Commit
a02f8577
authored
Apr 05, 2016
by
Dylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:dylanaraps/neofetch
parents
db33705e
a48186b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
61 deletions
+33
-61
neofetch
neofetch
+33
-61
No files found.
neofetch
View file @
a02f8577
...
@@ -452,10 +452,6 @@ esac
...
@@ -452,10 +452,6 @@ esac
# Distro {{{
# Distro {{{
# Default bit style
x64
=
"x86_64"
x32
=
"x86"
case
"
$os
"
in
case
"
$os
"
in
"Linux"
)
"Linux"
)
if
type
-p
lsb_release
>
/dev/null 2>&1
;
then
if
type
-p
lsb_release
>
/dev/null 2>&1
;
then
...
@@ -510,10 +506,6 @@ case "$os" in
...
@@ -510,10 +506,6 @@ case "$os" in
distro=
${
distro
//[[
:space:]]/
}
distro=
${
distro
//[[
:space:]]/
}
distro=
${
distro
//
}
distro=
${
distro
//
}
distro=
${
distro
/Microsoft
}
distro=
${
distro
/Microsoft
}
# Change bits to xx-bit for Windows
x64="
64
-bit
"
x32="
32
-bit
"
;;
;;
esac
esac
distro=
${
distro
//+( )/
}
distro=
${
distro
//+( )/
}
...
@@ -521,12 +513,8 @@ ascii_distro="$distro"
...
@@ -521,12 +513,8 @@ ascii_distro="$distro"
getdistro () {
getdistro () {
# Get architecture
# Get architecture
if [ "
$os_arch
" == "
on
" ]; then
[ "
$os_arch
" == "
on
" ] &&
\
case "
$(
getconf LONG_BIT
)
" in
distro+="
$(
uname
-m
)
"
64) distro+="
$x64
" ;;
32) distro+="
$x32
" ;;
esac
fi
}
}
...
@@ -781,8 +769,8 @@ getde () {
...
@@ -781,8 +769,8 @@ getde () {
;;
;;
esac
esac
if [ -z "
$de
" ]; then
if [ -
n "
$DISPLAY
" ] && [ -
z "
$de
" ]; then
de="
$(
xprop
-root
|
awk
'/KDE_SESSION_VERSION|^_MARCO|^_MUFFIN|xfce4|xfce5/'
)
"
de="
$(
xprop
-root
|
awk
'/KDE_SESSION_VERSION|^_MARCO|^_MUFFIN|xfce4|xfce5/'
2>/dev/null
)
"
case "
$de
" in
case "
$de
" in
"
KDE_SESSION_VERSION
"*) de="
KDE
${
de
/* =
}
" ;;
"
KDE_SESSION_VERSION
"*) de="
KDE
${
de
/* =
}
" ;;
...
@@ -941,42 +929,12 @@ getwmtheme () {
...
@@ -941,42 +929,12 @@ getwmtheme () {
getcpu () {
getcpu () {
case "$os" in
case "$os" in
"Linux")
# Get cpu name
cpu="$(awk -F '
:
| @
' '
/model name/ {printf
$2
; exit
}
' /proc/cpuinfo)"
# Get cpu speed
if [ -d "/sys/devices/system/cpu/cpu0/cpufreq" ]; then
case "$speed_type" in
current) speed_type="scaling_cur_freq" ;;
min) speed_type="scaling_min_freq" ;;
max) speed_type="scaling_max_freq" ;;
bios) speed_type="bios_limit" ;;
scaling_current) speed_type="scaling_cur_freq" ;;
scaling_min) speed_type="scaling_min_freq" ;;
scaling_max) speed_type="scaling_max_freq" ;;
esac
read -r speed < \
/sys/devices/system/cpu/cpu0/cpufreq/${speed_type}
speed=$((speed / 100000))
else
speed=$(awk -F '
:
|\\.
' '
/cpu MHz/ {printf
$2
; exit
}
' /proc/cpuinfo)
speed=
$((
speed
/
100
))
fi
speed=
${
speed
:0:1
}
.
${
speed
:1
}
cpu="
$cpu
@
${
speed
}
GHz
"
cores=
$(
awk
-F
': '
'/siblings/ {printf $2; exit}'
/proc/cpuinfo
)
;;
"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)
cores=$(sysctl -n hw.ncpu)
;;
;;
*
"
BSD
" | "
Windows
"
)
*)
case "$distro" in
case "$distro" in
"OpenBSD"* | "FreeBSD"*)
"OpenBSD"* | "FreeBSD"*)
# Get cpu name
# Get cpu name
...
@@ -993,28 +951,42 @@ getcpu () {
...
@@ -993,28 +951,42 @@ getcpu () {
cores=$(sysctl -n hw.ncpu)
cores=$(sysctl -n hw.ncpu)
;;
;;
"
NetBSD
"* | "
Windows
"
*)
*)
# Get cpu name
# Get cpu name
cpu="
$(
grep
-F
'model name'
/proc/cpuinfo
)
"
cpu="$(awk -F '
:
| @
' '
/model name/ {printf
$2
; exit
}
' /proc/cpuinfo)"
cpu=
${
cpu
/model name*
:
}
cpu=
${
cpu
/ @*
}
cpu=
${
cpu
//
}
cpu=
${
cpu
%
}
# Get cpu speed
# Get cpu speed
speed="
$(
grep
-F
'cpu MHz'
/proc/cpuinfo
)
"
if [ -d "/sys/devices/system/cpu/cpu0/cpufreq" ]; then
speed=
${
speed
/cpu MHz*
:
}
case "$speed_type" in
speed=
${
speed
/\.
}
current) speed_type="scaling_cur_freq" ;;
min) speed_type="scaling_min_freq" ;;
max) speed_type="scaling_max_freq" ;;
bios) speed_type="bios_limit" ;;
scaling_current) speed_type="scaling_cur_freq" ;;
scaling_min) speed_type="scaling_min_freq" ;;
scaling_max) speed_type="scaling_max_freq" ;;
esac
read -r speed < \
/sys/devices/system/cpu/cpu0/cpufreq/${speed_type}
speed=$((speed / 100000))
else
speed=$(awk -F '
:
|\\.
' '
/cpu MHz/ {printf
$2
; exit
}
' /proc/cpuinfo)
speed=
$((
speed
/
100
))
fi
case "
$distro
" in
"
NetBSD
"*) speed=
$((
speed
/
10000
))
;;
"
Windows
"*) speed=
$((
speed
/
100000
))
;;
esac
cores=
$(
awk
-F
': '
'/siblings/ {printf $2; exit}'
/proc/cpuinfo
)
cores=
$(
awk
-F
': '
'/siblings/ {printf $2; exit}'
/proc/cpuinfo
)
;;
;;
esac
esac
speed=
${
speed
:0:1
}
.
${
speed
:1
}
# 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
"
cpu="
$cpu
@
${
speed
}
GHz
"
;;
;;
esac
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