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
03aebe27
Commit
03aebe27
authored
Nov 05, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge #414
parent
e9059f8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
8 deletions
+115
-8
414.patch
414.patch
+106
-0
neofetch
neofetch
+9
-8
No files found.
414.patch
0 → 100644
View file @
03aebe27
From fb46609b5883866ed0f21f02bbfedc7c53de89e6 Mon Sep 17 00:00:00 2001
From: Muhammad Herdiansyah <herdiansyah@openmailbox.org>
Date: Mon, 10 Oct 2016 22:11:29 +0700
Subject: [PATCH] Added initial detection for GNU (Hurd) systems
Since they are quite similar to Linux, some just requires to add "GNU"
within the existing Linux detection commands. But some other commands
that requires the use of kernel (cpuinfo, model, battery) cannot be done
because /proc/cpuinfo and /sys does not exist in GNU Hurd.
---
neofetch | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/neofetch b/neofetch
index 0a79e33..a2c0fda 100755
--- a/neofetch
+++ b/neofetch
@@ -30,6 +30,7 @@ getos() {
*"BSD" | "DragonFly" | "Bitrig") os="BSD" ;;
"CYGWIN"*) os="Windows" ;;
"SunOS") os="Solaris" ;;
+ "GNU"*) os="GNU" ;;
*) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;;
esac
}
@@ -122,7 +123,7 @@ getdistro() {
[ "$distro" ] && return
case "$os" in
- "Linux" )
+ "Linux" | "GNU")
if grep -q 'Microsoft' /proc/version >/dev/null 2>&1 || \
grep -q 'Microsoft' /proc/sys/kernel/osrelease >/dev/null 2>&1; then
case "$distro_shorthand" in
@@ -305,7 +306,7 @@ getkernel() {
getuptime() {
# Get uptime in seconds
case "$os" in
- "Linux" | "Windows")
+ "Linux" | "Windows" | "GNU")
seconds="$(< /proc/uptime)"
seconds="${seconds/.*}"
;;
@@ -376,7 +377,7 @@ getuptime() {
getpackages() {
case "$os" in
- "Linux" | "iPhone OS" | "Solaris")
+ "Linux" | "iPhone OS" | "Solaris" | "GNU")
type -p pacman >/dev/null 2>&1 && \
packages="$(pacman -Qq --color never | wc -l)"
@@ -899,7 +900,7 @@ getcpu_usage() {
cpu_usage="${cpu_usage//[[:space:]]}"
;;
- "Linux" | "Mac OS X" | "iPhone OS" | "BSD" | "Solaris")
+ "Linux" | "Mac OS X" | "iPhone OS" | "BSD" | "Solaris" | "GNU")
# Get cores if unset
if [ -z "$cores" ]; then
case "$os" in
@@ -929,7 +930,7 @@ getcpu_usage() {
getgpu() {
case "$os" in
- "Linux")
+ "Linux" | "GNU")
# Use cache if it exists
if [ -f "/tmp/neofetch/gpu" ]; then
source "/tmp/neofetch/gpu"
@@ -1040,7 +1041,7 @@ getgpu() {
getmemory() {
case "$os" in
- "Linux" | "Windows")
+ "Linux" | "Windows" | "GNU")
# MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
while IFS=":" read -r a b; do
@@ -1220,7 +1221,7 @@ getsong() {
getresolution() {
case "$os" in
- "Linux" | "BSD" | "Solaris")
+ "Linux" | "BSD" | "Solaris" | "GNU")
if type -p xrandr >/dev/null 2>&1; then
case "$refresh_rate" in
"on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;;
@@ -1552,7 +1553,7 @@ gettermfont() {
getdisk() {
# df flags
case "$os" in
- "Linux" | "iPhone OS" | "Windows" | "Solaris")
+ "Linux" | "iPhone OS" | "Windows" | "Solaris" | "GNU")
df_flags="-h -l --total"
df_dir="total"
@@ -1747,7 +1748,7 @@ getusers() {
getbirthday() {
case "$os" in
- "linux" | "iPhone OS")
+ "Linux" | "GNU" | "iPhone OS")
birthday="$(ls -alct --full-time / | awk '/lost\+found|private/ {printf $6 " " $7}')"
date_cmd="$(date -d"$birthday" "$birthday_format")"
;;
neofetch
View file @
03aebe27
...
...
@@ -31,6 +31,7 @@ getos() {
"CYGWIN"
*
)
os
=
"Windows"
;;
"SunOS"
)
os
=
"Solaris"
;;
"Haiku"
)
os
=
"Haiku"
;;
"GNU"
*
)
os
=
"GNU"
;;
*
)
printf
"%s
\n
"
"Unknown OS detected:
$(
uname
)
"
;
exit
1
;;
esac
}
...
...
@@ -123,7 +124,7 @@ getdistro() {
[
"
$distro
"
]
&&
return
case
"
$os
"
in
"Linux"
)
"Linux"
|
"GNU"
)
if
grep
-q
'Microsoft'
/proc/version
>
/dev/null 2>&1
||
\
grep
-q
'Microsoft'
/proc/sys/kernel/osrelease
>
/dev/null 2>&1
;
then
case
"
$distro_shorthand
"
in
...
...
@@ -387,7 +388,7 @@ getuptime() {
getpackages() {
case "
$os
" in
"
Linux
" | "
iPhone
OS
" | "
Solaris
")
"
Linux
" | "
iPhone
OS
" | "
Solaris
"
| "
GNU
"
)
type -p pacman >/dev/null 2>&1 &&
\
packages="
$(
pacman
-Qq
--color
never |
wc
-l
)
"
...
...
@@ -932,7 +933,7 @@ getcpu_usage() {
cpu_usage
=
"
${
cpu_usage
//[[
:space:]]
}
"
;;
"Linux"
|
"Mac OS X"
|
"iPhone OS"
|
"BSD"
|
"Solaris"
)
"Linux"
|
"Mac OS X"
|
"iPhone OS"
|
"BSD"
|
"Solaris"
|
"GNU"
)
# Get cores if unset
if
[
-z
"
$cores
"
]
;
then
case
"
$os
"
in
...
...
@@ -962,7 +963,7 @@ getcpu_usage() {
getgpu
()
{
case
"
$os
"
in
"Linux"
)
"Linux"
|
"GNU"
)
# Use cache if it exists
if
[
-f
"/tmp/neofetch/gpu"
]
;
then
source
"/tmp/neofetch/gpu"
...
...
@@ -1077,7 +1078,7 @@ getgpu() {
getmemory
()
{
case
"
$os
"
in
"Linux"
|
"Windows"
)
"Linux"
|
"Windows"
|
"GNU"
)
# MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
while
IFS
=
":"
read
-r
a b
;
do
...
...
@@ -1263,7 +1264,7 @@ getsong() {
getresolution() {
case "
$os
" in
"
Linux
" | "
BSD
" | "
Solaris
")
"
Linux
" | "
BSD
" | "
Solaris
"
| "
GNU
"
)
if type -p xrandr >/dev/null 2>&1; then
case "
$refresh_rate
" in
"
on
") resolution="
$(
xrandr
--nograb
--current
|
awk
'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}'
)
" ;;
...
...
@@ -1608,7 +1609,7 @@ gettermfont() {
getdisk() {
# df flags
case "
$os
" in
"
Linux
" | "
iPhone
OS
" | "
Windows
" | "
Solaris
")
"
Linux
" | "
iPhone
OS
" | "
Windows
" | "
Solaris
"
| "
GNU
"
)
df_flags="
-h -l --total
"
df_dir="
total
"
...
...
@@ -1814,7 +1815,7 @@ getusers() {
getbirthday() {
case "
$os
" in
"
linux
" | "
iPhone
OS
")
"
Linux
" | "
GNU
" | "
iPhone
OS
")
birthday="
$(
ls
-alct
--full-time
/ |
awk
'/lost\+found|private/ {printf $6 " " $7}'
)
"
date_cmd="
$(
date
-d
"
$birthday
"
"
$birthday_format
"
)
"
;;
...
...
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