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
e2af2772
Commit
e2af2772
authored
Aug 31, 2016
by
Muhammad Herdiansyah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expanded distro_shorthand to support non-LSB solutions
parent
14ed583d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
18 deletions
+37
-18
README.md
README.md
+2
-2
config
config/config
+2
-2
neofetch
neofetch
+31
-12
neofetch.1
neofetch.1
+2
-2
No files found.
README.md
View file @
e2af2772
...
@@ -369,8 +369,8 @@ alias neofetch2="neofetch \
...
@@ -369,8 +369,8 @@ alias neofetch2="neofetch \
--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 on/off Whether or not to display the number of CPU cores
--distro_shorthand on/off Shorten the output of distro
--distro_shorthand on/off Shorten the output of distro
(tiny, on, off)
NOTE: This is only possible on Linux
with lsb_release
NOTE: This is only possible on Linux
--kernel_shorthand on/off Shorten the output of kernel
--kernel_shorthand on/off Shorten the output of kernel
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--refresh_rate on/off Whether to display the refresh rate of each monitor
--refresh_rate on/off Whether to display the refresh rate of each monitor
...
...
config/config
View file @
e2af2772
...
@@ -61,8 +61,8 @@ kernel_shorthand="on"
...
@@ -61,8 +61,8 @@ kernel_shorthand="on"
# Distro
# Distro
# Shorten the output of distro
# Shorten the output of distro
(tiny, on, off)
# NOTE: This is only possible on Linux
with lsb_release
# NOTE: This is only possible on Linux
distro_shorthand
=
"off"
distro_shorthand
=
"off"
# Mac OS X hide/show build version
# Mac OS X hide/show build version
...
...
neofetch
View file @
e2af2772
...
@@ -120,9 +120,9 @@ getdistro() {
...
@@ -120,9 +120,9 @@ getdistro() {
"Linux"
)
"Linux"
)
if
type
-p
lsb_release
>
/dev/null 2>&1
;
then
if
type
-p
lsb_release
>
/dev/null 2>&1
;
then
case
"
$distro_shorthand
"
in
case
"
$distro_shorthand
"
in
"on"
)
distro
=
"
$(
lsb_release
-sir
2>/dev/null
)
"
;;
"on"
)
distro
=
"
$(
lsb_release
-sir
2>/dev/null
)
"
;;
"
off"
)
distro
=
"
$(
lsb_release
-sd
2>/dev/null
)
"
"
tiny"
)
distro
=
"
$(
lsb_release
-si
2>/dev/null
)
"
;;
distro
=
"
${
distro
//\
"}
"
;;
*
)
distro
=
"
$(
lsb_release
-sd
2>/dev/null
)
"
;;
esac
esac
elif
type
-p
guix
>
/dev/null 2>&1
;
then
elif
type
-p
guix
>
/dev/null 2>&1
;
then
...
@@ -130,16 +130,35 @@ getdistro() {
...
@@ -130,16 +130,35 @@ getdistro() {
elif
type
-p
crux
>
/dev/null 2>&1
;
then
elif
type
-p
crux
>
/dev/null 2>&1
;
then
distro
=
"
$(
crux
)
"
distro
=
"
$(
crux
)
"
case
"
$distro_shorthand
"
in
"on"
)
distro
=
"
${
distro
//version
}
"
;;
"tiny"
)
distro
=
"
${
distro
//version*
}
"
;;
esac
else
else
distro=
"
$(
awk
-F
'NAME='
'/^NAME=/ {printf $2}'
/etc/
*
ease
)
"
# Workarounds are included in every shorthand option
distro=
"
${
distro
//\
"}"
case
"
$distro_shorthand
"
in
"on"
)
# Workaround for distros that store the value differently.
distro
=
"
$(
awk
-F
'='
'/^NAME|VERSION_ID=/ {print $2}'
/etc/
*
ease
)
"
[ -z
"
$distro
"
] && distro=
"
$(
awk
-F
'TAILS_PRODUCT_NAME="|"'
'/^TAILS_PRODUCT_NAME=/ {printf $2}'
/etc/
*
ease
)
"
[
-z
"
$distro
"
]
&&
distro
=
"
$(
awk
-F
'='
'/^DISTRIB_ID|DISTRIB_RELEASE=/ {print $2}'
/etc/openwrt_release
)
"
[ -z
"
$distro
"
] && distro=
"
$(
awk
'/BLAG/ {print $1; exit}'
/etc/
*
ease
)
"
;;
[ -z
"
$distro
"
] && distro=
"
$(
awk
-F
"'"
'/^DISTRIB_DESCRIPTION/ {print $2}'
/etc/openwrt_release
)
"
"tiny"
)
distro
=
"
$(
awk
-F
'='
'/^NAME=/ {print $2}'
/etc/
*
ease
)
"
[
-z
"
$distro
"
]
&&
distro
=
"
$(
awk
-F
'='
'/^TAILS_PRODUCT_NAME=/ {print $2}'
/etc/
*
ease
)
"
[
-z
"
$distro
"
]
&&
distro
=
"
$(
awk
-F
'='
'/^DISTRIB_ID=/ {print $2}'
/etc/openwrt_release
)
"
;;
*
)
distro
=
"
$(
awk
-F
'='
'/^PRETTY_NAME=/ {print $2}'
/etc/
*
ease
)
"
[
-z
"
$distro
"
]
&&
distro
=
"
$(
awk
-F
'='
'{print $2}'
/etc/
*
ease
)
"
[
-z
"
$distro
"
]
&&
distro
=
"
$(
awk
'/BLAG/ {print $1; exit}'
/etc/
*
ease
)
"
[
-z
"
$distro
"
]
&&
distro
=
"
$(
awk
-F
'='
'/^DISTRIB_DESCRIPTION=/ {print $2}'
/etc/openwrt_release
)
"
;;
esac
fi
fi
distro
=
"
${
distro
//\
"}"
distro=
"
${
distro
//\
'}"
;;
;;
"Mac OS X")
"Mac OS X")
...
@@ -2771,8 +2790,8 @@ usage() { cat << EOF
...
@@ -2771,8 +2790,8 @@ usage() { cat << EOF
--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 on/off Whether or not to display the number of CPU cores
--distro_shorthand on/off Shorten the output of distro
--distro_shorthand on/off Shorten the output of distro
(tiny, on, off)
NOTE: This is only possible on Linux
with lsb_release
NOTE: This is only possible on Linux
--kernel_shorthand on/off Shorten the output of kernel
--kernel_shorthand on/off Shorten the output of kernel
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--refresh_rate on/off Whether to display the refresh rate of each monitor
--refresh_rate on/off Whether to display the refresh rate of each monitor
...
...
neofetch.1
View file @
e2af2772
...
@@ -45,9 +45,9 @@ Possible values: name, speed, tiny, on, off
...
@@ -45,9 +45,9 @@ Possible values: name, speed, tiny, on, off
Whether or not to display the number of CPU cores
Whether or not to display the number of CPU cores
.TP
.TP
.B \--distro_shorthand 'on/off'
.B \--distro_shorthand 'on/off'
Shorten the output of distro
Shorten the output of distro
(tiny, on, off)
.br
.br
NOTE: This is only possible on Linux
with lsb_release
NOTE: This is only possible on Linux
.TP
.TP
.B \--kernel_shorthand 'on/off'
.B \--kernel_shorthand 'on/off'
Shorten the output of kernel
Shorten the output of kernel
...
...
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