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
ff3dbd9c
Commit
ff3dbd9c
authored
Nov 05, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge #414
parent
03aebe27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
106 deletions
+0
-106
414.patch
414.patch
+0
-106
No files found.
414.patch
deleted
100644 → 0
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")"
;;
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