Skip to content

Instantly share code, notes, and snippets.

@su8
Last active March 29, 2025 12:38
Show Gist options
  • Save su8/171b98dd8300aa32285321d8b1a9fa66 to your computer and use it in GitHub Desktop.
Save su8/171b98dd8300aa32285321d8b1a9fa66 to your computer and use it in GitHub Desktop.
char *idx = buf + strlen(var);
get/setAttribute
referemce_wrapper
text edit0r
hellxcb border rgb
extraction functions
peripherial functions
-static-libc++ compile flag
wget https://github.com/USER/REPOSITORY/pull/1.diff
memcpy snprintf allptr+=
diff --git a/README.md b/README.md
index e828bef..67674d8 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
screenfetch-c
=============
-## Current Version: 1.3 (release)
+## Current Version: 1.4 (release)
screenfetch-c is an attempt to rewrite screenFetch, a popular shell
script that displays system information and an ASCII logo, in the C
@@ -17,6 +17,8 @@ screenfetch-c only relies on libraries that come on virtually every system.
* On Linux and Solaris, libX11 is required. In most package managers, this is listed as `libX11-dev`.
+* screenfetch-c has it's own screenshot creation and saving code based on jpeglib.h, in order to utilize it you are advised to install `libjpeg-turbo`, notice the **turbo**. The program will fallback to **scrot** and **screencapture** if jpeglib.h is not present while compiling the program.
+
Installing screenfetch-c is very simple:
```bash
diff --git a/bootstrap b/bootstrap
new file mode 100644
index 0000000..d52a94d
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,348 @@
+#!/usr/bin/env bash
+# Author: Aaron Caffrey
+# Like the rest of screenfetch-c, this file is licensed under the MIT license.
+
+# ./bootstrap && ./configure --prefix=/usr && make
+# sudo make install
+
+prog_name='screenfetch2'
+prog_ver='1.4.0'
+
+
+# configure.ac
+configure_ac=("# This file is processed by autoconf to create a configure script
+AC_INIT(["${prog_name}"], ["${prog_ver}"])
+AC_CONFIG_AUX_DIR([temp_dir])
+AM_CONFIG_HEADER(src/config.h)
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([1.11 -Wall no-define foreign subdir-objects dist-xz no-dist-gzip std-options])
+
+AM_SILENT_RULES([yes])
+AC_PROG_CC_STDC
+AC_EXEEXT
+AC_C_CONST
+AC_HEADER_STDC
+AM_PROG_CC_C_O
+
+IT_PROG_INTLTOOL([0.40.0])
+AM_GLIB_GNU_GETTEXT
+
+GETTEXT_PACKAGE="${prog_name}"
+AC_SUBST(GETTEXT_PACKAGE)
+
+AC_CHECK_HEADERS(stdio.h stdlib.h stdbool.h \\
+string.h unistd.h time.h ctype.h regex.h argp.h \\
+sys/utsname.h inttypes.h malloc.h)
+
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "\"${prog_name}\"", [Gettext package.])
+AC_DEFINE_UNQUOTED(PROG_VERSION, "\"${prog_ver}\"", [The current version])
+
+# The linker flags tests in m4 dir
+TEST_X11
+TEST_OPENGL
+TEST_JPEG
+
+rm -f po/LINGUAS
+for po_file in \`ls --color=never po/*.po | sort\`; do
+ echo \$po_file | awk -F '.' '{gsub(\"po/\",\"\");print \$1}' >> po/LINGUAS
+done
+
+AC_CONFIG_FILES([
+Makefile
+src/Makefile
+src/scripts/Makefile
+po/Makefile.in
+])
+
+AC_OUTPUT
+
+echo
+echo 'Now type \"make\" and \"sudo make install\" afterwards'
+echo")
+
+
+# Makefile.am
+main_makefile=('
+SUBDIRS = \
+ src \
+ po \
+ src/scripts
+
+man_MANS = \
+ screenfetch-c.1
+')
+
+
+mac_win_cppflagz=''
+mac_ldflagz=''
+if type -p uname > /dev/null 2>&1; then
+ uname_test=`uname -s`
+ if test "$uname_test" = "Linux"; then
+ plat_module='plat/linux/detect.c'
+
+ elif test "$uname_test" = "Darwin"; then
+ plat_module='plat/darwin/detect.c'
+ mac_win_cppflagz='-D_DARWIN_C_SOURCE -D_DARWIN_USE_64_BIT_INODE'
+ mac_ldflagz='-framework CoreServices'
+
+ elif test "$uname_test" = "SunOS"; then
+ plat_module='plat/sun/detect.c'
+ fi
+fi
+
+# I guarantee that `machine' exists in OpenBSD
+# We don't want to rely on `uname' only
+if type -p machine > /dev/null 2>&1; then
+ plat_module='plat/bsd/detect.c'
+fi
+# src/Makefile.am
+src_files=(`ls --color=never src/*.{c,h} | awk '{gsub("src/","");print}'`)
+src_makefile=('AM_CPPFLAGS = \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
+ -D_POSIX_C_SOURCE=200112L '${mac_win_cppflagz}'
+
+bin_PROGRAMS = \
+ '${prog_name}'
+
+'${prog_name}'_CFLAGS = \
+ -O3 -std=c99 -Wall \
+ -Wformat -Wunused-variable \
+ -pedantic
+
+'${prog_name}'_LDADD = $(X_LIBS) $(GL_LIBS) $(JPEG_LIBS) '${mac_ldflagz}'
+
+'${prog_name}'_SOURCES = '${src_files[@]}
+ ${plat_module}' plat/common.c
+')
+
+
+# src/scripts/Makefile.am
+src_scripts_makefile=('
+bin_SCRIPTS = \
+'`ls --color=never src/scripts`'
+')
+
+
+cat <<EOF > configure.ac
+${configure_ac[@]}
+EOF
+
+cat <<EOF > Makefile.am
+${main_makefile[@]}
+EOF
+
+cat <<EOF > src/Makefile.am
+${src_makefile[@]}
+EOF
+
+cat <<EOF > src/scripts/Makefile.am
+${src_scripts_makefile[@]}
+EOF
+
+
+# Add all modules that will be translated
+# \nsrc/module_name.c
+printf '%b' 'src/main.c\nsrc/parser.c\nsrc/disp.c\nsrc/plat/common.c' > 'po/POTFILES.in'
+
+
+#screenfetch-c.1
+man_page=(".\\\" Manpage for screenfetch-c
+.\\\" Contact woodruffw on GitHub or at william @ tuffbizz.com to report any bugs or errors
+.TH screenfetch-c 1 \"04 August 2013\" \""${prog_ver}"r\" \"User Commands\"
+.SH NAME
+.BR screenfetch-c \" - Display computer information and an ASCII logo\"
+.SH SYNOPSIS
+.B screenfetch-c
+.RI [ OPTIONS ]
+.SH DESCRIPTION
+.B screenfetch-c
+is a C rewrite of the original screenFetch, which was written in bash by Brett Bohnenkamper.
+Like the original, it displays both an ASCII logo determined by the computer's OS and a variety of statistics, including kernel type, ram, uptime, and so forth.
+.SH COMPATIBILITY
+Supported OSes:
+Microsoft Windows, Mac OS X, FreeBSD, OpenBSD, NetBSD, DragonFlyBSD, Solaris and its derivatives,
+and most Linux-kernel based distributions.
+.PP
+.I Note:
+If you are using manual mode to provide
+.B screenfetch-c
+with system information, you will need to enter the distribution name EXACTLY as written below:
+Arch Linux, ParabolaGNU/Linux-libre, Chakra, Manjaro, Frugalware, Ubuntu, LinuxMint, SolusOS, Debian, LMDE, CrunchBang, Peppermint, LinuxDeepin, Trisquel, elementary OS, Backtrack Linux, Slackware, Gentoo, Sabayon, Funtoo, Fuduntu, Fedora, OpenSUSE, Red Hat Linux, Mandriva, Mandrake, Mageia, Viperr, Andoid, Linux, Solaris, Angstrom.
+.PP
+Supported shells:
+GNU bash, csh, zsh, ksh, fish, dash, ash.
+.SH OPTIONS
+.PP
+.BR \-v ,
+.B \-\-verbose
+.PP
+Enable verbose mode, which prints out detection information.
+.PP
+.BR \-s ,
+.B \-\-screenshot
+.PP
+Take a screenshot after completing the output.
+On non\-Windows systems, this will save a file titled
+.RI ' screenfetch_screenshot.png '
+in
+.BR $HOME .
+On Windows, this will save the screenshot in the system clipboard.
+.PP
+.BR \-n ,
+.B \-\-no-logo
+.PP
+Strip output of ASCII logo - print information only.
+.PP
+.BR \-D ,
+.BI \-\-distro \" DISTRO\"
+.PP
+Set the distro outputted by
+.BR screenfetch-c .
+.PP
+.BR \-E ,
+.B \-\-suppress-errors
+.PP
+Suppress (most) error messages as they arise.
+.PP
+.BR \-p ,
+.B \-\-portrait
+.PP
+Print output in portrait mode.
+.PP
+.BR \-V ,
+.B \-\-version
+.PP
+Display the version of
+.B screenfetch-c
+currently being used.
+.PP
+.BR \-h ,
+.B \-\-help
+.PP
+Displays help and compatibility information.
+.PP
+.BR \-L ,
+.BI \-\-logo-only \" DISTRO\"
+.PP
+Output only the ASCII logo associated with that distro. Follows the general naming conventions of the
+.B \-D
+flag, but with \"OS X\", \"Windows\", and \"Solaris\" as possibilities as well.
+.SH CONFIGURATION
+When
+.B screenfetch-c
+is invoked with the
+.B \-m
+flag for the first time, it enters manual mode.
+Manual mode prompts the user to enter specific information about the computer, storing that information in
+.RI ~/ .screenfetchc
+for the next invocation with the
+.B \-m
+flag.
+.PP
+By default, you must enter all fields asked for in manual mode. However, if you want
+.B screenfetch-c
+to skip a particular field while reading from the file, enter an asterisk (\"*\") for that section.
+This will force
+.B screenfetch-c
+to attempt to detect that section, which may come in handy if you want to use manual mode for some sections but not for others.
+.PP
+To remove your existing manual configuration, simply delete the
+.I .screenfetchc
+file located in your
+.BR $HOME .
+.PP
+Note:
+.IR .screenfetchc 's
+format isn't exactly human-friendly, so editing it manually is
+.B NOT
+recommended.
+.SH ENVIRONMENT
+.B screenfetch-c
+uses the following environment variables:
+.PP
+.BR USER \" - Used on BSD to determine the current user.\"
+.PP
+.BR HOME \" - Used to determine the user's home directory.\"
+.PP
+.BR SHELL \" - Used to determine the active shell.\"
+.PP
+Each of these variables must be defined properly in order for
+.B screenfetch-c
+to function as intended.
+.SH RELEASE HISTORY
+.IR 0.1 \" - ALPHA - INCOMPLETE, UNCOMPILED\"
+.PP
+.IR 0.5 \" - ALPHA - INCOMPLETE, TEST COMPILED\"
+.PP
+.IR 1.0 \" - BETA - LACKING MINOR PARTS, STABLE, WORKING ON MOST SYSTEMS\"
+.PP
+.IR 1.1 \" - BETA - NEARLY COMPLETE, MINOR BUGS AND GPU DETECTION NOT FINISHED\"
+.PP
+.IR 1.2 \" - RELEASE - WORKS ON THE MAJORITY OF SYSTEMS\"
+.PP
+.IR 1.3 \" - RELEASE - SIGNIFICANT REFACTORING AND PERFORMANCE IMPROVEMENTS\"
+.PP
+.IR 1.4 \" - RELEASE - CODE REDUCTION, PERFORMANCE IMPROVEMENTS AND NATIVIZATION ON LINUX\"
+.SH BUGS AND ERRATIC BEHAVIOR
+Shell version detection relies of very specific naming schemes and may appear incorrectly if any shell changes its versioning scheme.
+.PP
+DragonFly BSD systems with more than 4GiB of RAM may have their RAM stats displayed incorrectly, as 32-bit integers are used in sysctl.
+.PP
+Manual mode on Windows seems the result in a variety of weird bugs concerning uptime, packages, disk stats, and memory stats. For the time being, I recommend NOT using it on Windows.
+.PP
+Memory detection on Linux systems includes swap/buffer RAM in used RAM, not free RAM. While this is not a bug per se, it may contradict figures from other utilities (which factor out swap/buffer RAM).
+.PP
+Found a bug or issue? Please tell me about it:
+.I http://github.com/woodruffw/screenfetch-c
+.SH DIAGNOSTICS
+.B screenfetch-c
+has two built-in output modes: verbose (disabled by default) and error (enabled by default).
+If a serious or fatal error occurs, the user will be notified via error (stderr).
+Otherwise, the user may choose to enable the verbose mode, which display real-time detection.
+.SH EXIT STATUS
+.B screenfetch-c
+returns
+.B EXIT_SUCCESS
+in all circumstances except for malformed argument strings.
+For example,
+.B screenfetch-c
+will return
+.B EXIT_FAILURE
+if flagged with
+.B \-D
+but not given an additional argument.
+.SH AUTHOR
+.B screenfetch-c
+was written and is maintained by William Woodruff
+.RI ( \"william @ tuffbizz.com\" )
+.PP
+The original screenFetch was written by Brett Bohnenkamper
+.RI ( \"kittykatt @ archlinux.us\" )
+.PP
+For a list of contributors to
+.BR screenfetch-c ,
+please refer to the CONTRIBUTORS file.
+.SH SEE ALSO
+.BR screenFetch (1)")
+
+cat <<EOF > screenfetch-c.1
+${man_page[@]}
+EOF
+
+
+# convert the man page to human readable text
+# so we can gzip it later (if needed)
+#if type -p groff > /dev/null 2>&1 && \
+# type -p col > /dev/null 2>&1 && \
+# type -p uniq > /dev/null 2>&1 && \
+# type -p mv > /dev/null 2>&1; then
+
+# groff -man -Tascii screenfetch-c.1 | col -b | uniq > scr.1
+# mv scr.1 screenfetch-c.1
+
+#fi
+
+
+
+# do not remove nor edit
+autoreconf --install --force
\ No newline at end of file
diff --git a/CONTRIBUTORS b/doc/CONTRIBUTORS
similarity index 89%
rename from CONTRIBUTORS
rename to doc/CONTRIBUTORS
index 0748193..1bc5191 100644
--- a/CONTRIBUTORS
+++ b/doc/CONTRIBUTORS
@@ -10,4 +10,4 @@ Hu6
diantahoc
NachoSimo
nyanpasu
-
+Aaron Caffrey (wifiextender)
diff --git a/LICENSE b/doc/LICENSE
similarity index 100%
rename from LICENSE
rename to doc/LICENSE
diff --git a/m4/jpeg.m4 b/m4/jpeg.m4
new file mode 100644
index 0000000..1dfeb2f
--- /dev/null
+++ b/m4/jpeg.m4
@@ -0,0 +1,17 @@
+# Author: Aaron Caffrey
+# TEST_JPEG() function in configure.ac
+#
+# Check for the presence of jpeglib headers and
+# substitute the linker flags -ljpeg to the
+# the variable 'JPEG_LIBS' if they are available
+# Like the rest of screenfetch-c, this file is licensed under the MIT license.
+AC_DEFUN([TEST_JPEG],
+[
+ JPEG_LIBS=""
+
+ AC_CHECK_HEADERS([jpeglib.h], [
+ JPEG_LIBS="-ljpeg"
+ AC_SUBST(JPEG_LIBS)
+ ])
+
+])
\ No newline at end of file
diff --git a/m4/opengl.m4 b/m4/opengl.m4
new file mode 100644
index 0000000..e7b5fdc
--- /dev/null
+++ b/m4/opengl.m4
@@ -0,0 +1,17 @@
+# Author: Aaron Caffrey
+# TEST_OPENGL() function in configure.ac
+#
+# Check for the presence of OpenGL headers and
+# substitute the linker flags -lGL to the
+# the variable 'GL_LIBS' if they are available
+# Like the rest of screenfetch-c, this file is licensed under the MIT license.
+AC_DEFUN([TEST_OPENGL],
+[
+ GL_LIBS=""
+
+ AC_CHECK_HEADERS([GL/glx.h], [
+ GL_LIBS="-lGL"
+ AC_SUBST(GL_LIBS)
+ ])
+
+])
\ No newline at end of file
diff --git a/m4/x11.m4 b/m4/x11.m4
new file mode 100644
index 0000000..f2cd3bf
--- /dev/null
+++ b/m4/x11.m4
@@ -0,0 +1,37 @@
+# Author: Aaron Caffrey
+# TEST_X11() function in configure.ac
+#
+# Check for the presence of X11 headers and
+# substitute the linker flags -lX11 to the
+# the variable 'X_LIBS' if they are available.
+# Otherwise test whether the user is running
+# Linux or Solaris, and if so, fallback to 3rd party
+# programs such as `lspci' and `xdpyinfo'
+# Like the rest of screenfetch-c, this file is licensed under the MIT license.
+AC_DEFUN([TEST_X11],
+[
+ X_LIBS=""
+ xorg_here="no"
+
+ AC_CHECK_HEADERS([X11/Xlib.h], [
+ X_LIBS="-lX11"
+ xorg_here="yes"
+ AC_SUBST(X_LIBS)
+ ])
+
+
+if test "$xorg_here" = "no"; then
+ AC_CHECK_PROG(UNAME, [uname], [yes], [no])
+ if test "$UNAME" = "yes"; then
+ uname_s=`uname -s`
+ if test "$uname_s" = "Linux" || test "$uname_s" = "SunOS"; then
+ AC_CHECK_PROG(LSPCI, [lspci], [yes], [no])
+ AC_CHECK_PROG(XDPYINFO, [xdpyinfo], [yes], [no])
+ if test "$LSPCI" = "no"; then
+ AC_MSG_ERROR([Unable to find the lspci program. Install X headers and/or lspci in order to compile the program. Currently you have neither X headers nor lspci.])
+ fi
+ fi
+ fi
+fi
+
+])
\ No newline at end of file
diff --git a/makefile b/makefile
deleted file mode 100644
index 5e0c353..0000000
--- a/makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-CC = gcc
-CFLAGS = -O3 -std=c99 -Wall -Wformat -Wunused-variable -pedantic
-CPPFLAGS = -D_POSIX_C_SOURCE=200112L
-LDFLAGS =
-INSTALL = install -c
-
-PREFIX = /usr/local
-BIN = $(PREFIX)/bin
-MAN = $(PREFIX)/share/man/man1
-
-SOURCES = $(wildcard ./src/*.c)
-OBJS = $(SOURCES:.c=.o)
-
-SCRIPTS =
-TESTS =
-
-OLDTARGETS = linux win bsd osx sun
-
-ifeq ($(OS),Windows_NT)
- SOURCES += $(wildcard ./src/plat/win32/*.c)
- CPPFLAGS += -DWIN32_LEAN_AND_MEAN
-else
- UNAME_S := $(shell uname -s)
-
- ifeq ($(UNAME_S),Linux)
- SOURCES += $(wildcard ./src/plat/linux/*.c)
- CFLAGS += -Wno-unused-result
- LDFLAGS += -lX11 -lGL
- SCRIPTS += ./src/scripts/detectwmtheme ./src/scripts/detectgtk
- TESTS += x11test gltest
- endif
-
- ifeq ($(UNAME_S),Darwin)
- SOURCES += $(wildcard ./src/plat/darwin/*.c)
- LDFLAGS += -framework CoreServices
- CPPFLAGS += -D_DARWIN_C_SOURCE -D_DARWIN_USE_64_BIT_INODE
- endif
-
- ifeq ($(UNAME_S),SunOS)
- SOURCES += $(wildcard ./src/plat/sun/*.c)
- LDFLAGS += -lX11
- SCRIPTS += ./src/scripts/detectwm ./src/scripts/detectwmtheme
- TESTS += x11test
- endif
-
- ifneq (,$(filter $(UNAME_S),FreeBSD NetBSD OpenBSD DragonFly))
- SOURCES += $(wildcard ./src/plat/bsd/*.c)
- LDFLAGS +=
- SCRIPTS += ./src/scripts/detectwm ./src/scripts/detectwmtheme \
- ./src/scripts/detectgtk
- endif
-endif
-
-all: $(TESTS) $(OBJS)
- $(CC) $(CFLAGS) $(CPPFLAGS) $(OBJS) -o ./screenfetch-c $(LDFLAGS)
-
-.c.o:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-
-install: all
- $(INSTALL) ./screenfetch-c $(BIN)/screenfetch-c
- if [ -n "$(SCRIPTS)" ] ; then \
- $(INSTALL) $(SCRIPTS) $(BIN) ; \
- fi
- mkdir -p $(MAN)
- $(INSTALL) ./man/screenfetch-c.1 $(MAN)/screenfetch-c.1
-
-uninstall:
- rm -rf $(BIN)/screenfetch-c
- rm -rf $(BIN)/detectde
- rm -rf $(BIN)/detectgtk
- rm -rf $(BIN)/detectwm
- rm -rf $(BIN)/detectwmtheme
- rm -rf $(BIN)/detectgpu
- rm -rf $(MAN)/screenfetch-c.1
-
-x11test:
- @echo "Testing for X11..."
- $(CC) $(CFLAGS) ./tests/x11test.c -o ./x11test -lX11
- @echo "Looks good."
-
-gltest:
- @echo "Testing for OpenGL..."
- $(CC) $(CFLAGS) ./tests/gltest.c -o ./gltest -lGL
- @echo "Looks good."
-
-clean:
- rm -f ./src/*.o ./src/plat/*/*.o
- rm -f threadtest
- rm -f x11test
- rm -f gltest
- rm -f screenfetch-c
-
-$(OLDTARGETS): all
-
-.PHONY: all install uninstall clean $(OLDTARGETS)
-
diff --git a/man/screenfetch-c.1 b/man/screenfetch-c.1
deleted file mode 100755
index b1e0342..0000000
--- a/man/screenfetch-c.1
+++ /dev/null
@@ -1,180 +0,0 @@
-.\" Manpage for screenfetch-c
-.\" Contact woodruffw on GitHub or at william @ tuffbizz.com to report any bugs or errors
-.TH screenfetch-c 1 "04 August 2013" "1.3r" "User Commands"
-.SH NAME
-.BR screenfetch-c " - Display computer information and an ASCII logo"
-.SH SYNOPSIS
-.B screenfetch-c
-.RI [ OPTIONS ]
-.SH DESCRIPTION
-.B screenfetch-c
-is a C rewrite of the original screenFetch, which was written in bash by Brett Bohnenkamper.
-Like the original, it displays both an ASCII logo determined by the computer's OS and a variety of statistics, including kernel type, ram, uptime, and so forth.
-.SH COMPATIBILITY
-Supported OSes:
-Microsoft Windows, Mac OS X, FreeBSD, OpenBSD, NetBSD, DragonFlyBSD, Solaris and its derivatives,
-and most Linux-kernel based distributions.
-.PP
-.I Note:
-If you are using manual mode to provide
-.B screenfetch-c
-with system information, you will need to enter the distribution name EXACTLY as written below:
-Arch Linux, ParabolaGNU/Linux-libre, Chakra, Manjaro, Frugalware, Ubuntu, LinuxMint, SolusOS, Debian, LMDE, CrunchBang, Peppermint, LinuxDeepin, Trisquel, elementary OS, Backtrack Linux, Slackware, Gentoo, Sabayon, Funtoo, Fuduntu, Fedora, OpenSUSE, Red Hat Linux, Mandriva, Mandrake, Mageia, Viperr, Andoid, Linux, Solaris, Angstrom.
-.PP
-Supported shells:
-GNU bash, csh, zsh, ksh, fish, dash, ash.
-.SH OPTIONS
-.BR \-m ,
-.B \-\-manual
-.PP
-Begin manual mode, which allows the user to enter specific values for devices/statistics. See 'Configuration' below for formatting options.
-.PP
-.BR \-v ,
-.B\-\-verbose
-.PP
-Enable verbose mode, which prints out detection information.
-.PP
-.BR \-s ,
-.B \-\-screenshot
-.PP
-Take a screenshot after completing the output.
-On non\-Windows systems, this will save a file titled
-.RI ' screenfetch_screenshot.png '
-in
-.BR $HOME .
-On Windows, this will save the screenshot in the system clipboard.
-.PP
-.BR \-n ,
-.B \-\-no-logo
-.PP
-Strip output of ASCII logo - print information only.
-.PP
-.BR \-D ,
-.BI \-\-distro " DISTRO"
-.PP
-Set the distro outputted by
-.BR screenfetch-c .
-.PP
-.BR \-E ,
-.B \-\-suppress-errors
-.PP
-Suppress (most) error messages as they arise.
-.PP
-.BR \-p ,
-.B \-\-portrait
-.PP
-Print output in portrait mode.
-.PP
-.BR \-V ,
-.B \-\-version
-.PP
-Display the version of
-.B screenfetch-c
-currently being used.
-.PP
-.BR \-h ,
-.B \-\-help
-.PP
-Displays help and compatibility information.
-.PP
-.BR \-L ,
-.BI \-\-logo-only " DISTRO"
-.PP
-Output only the ASCII logo associated with that distro. Follows the general naming conventions of the
-.B \-D
-flag, but with "OS X", "Windows", and "Solaris" as possibilities as well.
-.SH CONFIGURATION
-When
-.B screenfetch-c
-is invoked with the
-.B \-m
-flag for the first time, it enters manual mode.
-Manual mode prompts the user to enter specific information about the computer, storing that information in
-.RI ~/ .screenfetchc
-for the next invocation with the
-.B \-m
-flag.
-.PP
-By default, you must enter all fields asked for in manual mode. However, if you want
-.B screenfetch-c
-to skip a particular field while reading from the file, enter an asterisk ("*") for that section.
-This will force
-.B screenfetch-c
-to attempt to detect that section, which may come in handy if you want to use manual mode for some sections but not for others.
-.PP
-To remove your existing manual configuration, simply delete the
-.I .screenfetchc
-file located in your
-.BR $HOME .
-.PP
-Note:
-.IR .screenfetchc 's
-format isn't exactly human-friendly, so editing it manually is
-.B NOT
-recommended.
-.SH ENVIRONMENT
-.B screenfetch-c
-uses the following environment variables:
-.PP
-.BR USER " - Used on BSD to determine the current user."
-.PP
-.BR HOME " - Used to determine the user's home directory."
-.PP
-.BR SHELL " - Used to determine the active shell."
-.PP
-Each of these variables must be defined properly in order for
-.B screenfetch-c
-to function as intended.
-.SH RELEASE HISTORY
-.IR 0.1 " - ALPHA - INCOMPLETE, UNCOMPILED"
-.PP
-.IR 0.5 " - ALPHA - INCOMPLETE, TEST COMPILED"
-.PP
-.IR 1.0 " - BETA - LACKING MINOR PARTS, STABLE, WORKING ON MOST SYSTEMS"
-.PP
-.IR 1.1 " - BETA - NEARLY COMPLETE, MINOR BUGS AND GPU DETECTION NOT FINISHED"
-.PP
-.IR 1.2 " - RELEASE - WORKS ON THE MAJORITY OF SYSTEMS"
-.PP
-.IR 1.3 " - RELEASE - SIGNIFICANT REFACTORING AND PERFORMANCE IMPROVEMENTS"
-.SH BUGS AND ERRATIC BEHAVIOR
-Shell version detection relies of very specific naming schemes and may appear incorrectly if any shell changes its versioning scheme.
-.PP
-DragonFly BSD systems with more than 4GiB of RAM may have their RAM stats displayed incorrectly, as 32-bit integers are used in sysctl.
-.PP
-Manual mode on Windows seems the result in a variety of weird bugs concerning uptime, packages, disk stats, and memory stats. For the time being, I recommend NOT using it on Windows.
-.PP
-Memory detection on Linux systems includes swap/buffer RAM in used RAM, not free RAM. While this is not a bug per se, it may contradict figures from other utilities (which factor out swap/buffer RAM).
-.PP
-Found a bug or issue? Please tell me about it:
-.I http://github.com/woodruffw/screenfetch-c
-.SH DIAGNOSTICS
-.B screenfetch-c
-has two built-in output modes: verbose (disabled by default) and error (enabled by default).
-If a serious or fatal error occurs, the user will be notified via error (stderr).
-Otherwise, the user may choose to enable the verbose mode, which display real-time detection.
-.SH EXIT STATUS
-.B screenfetch-c
-returns
-.B EXIT_SUCCESS
-in all circumstances except for malformed argument strings.
-For example,
-.B screenfetch-c
-will return
-.B EXIT_FAILURE
-if flagged with
-.B \-D
-but not given an additional argument.
-.SH AUTHOR
-.B screenfetch-c
-was written and is maintained by William Woodruff
-.RI ( "william @ tuffbizz.com" )
-.PP
-The original screenFetch was written by Brett Bohnenkamper
-.RI ( "kittykatt @ archlinux.us" )
-.PP
-For a list of contributors to
-.BR screenfetch-c ,
-please refer to the CONTRIBUTORS file.
-.SH SEE ALSO
-.BR screenFetch (1)
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..1d52790
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,220 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <[email protected]>
+# Copyright (C) 2004-2008 Rodney Dawes <[email protected]>
+#
+# This file may be copied and used freely without restrictions. It may
+# be used in projects which are not available under a GNU Public License,
+# but which still want to provide support for the GNU gettext functionality.
+#
+# - Modified by Owen Taylor <[email protected]> to use GETTEXT_PACKAGE
+# instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <[email protected]> to install
+# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <[email protected]> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p@.
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V))
+INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY))
+INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@;
+
+.po.pox:
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $<
+
+.po.gmo:
+ $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && gencat $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+ $(GENPOT)
+
+install: install-data
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $$dir; \
+ if test -r $$lang.gmo; then \
+ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $(srcdir)/$$lang.gmo as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo"; \
+ fi; \
+ if test -r $$lang.gmo.m; then \
+ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ if test -r $(srcdir)/$$lang.gmo.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+ $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $(srcdir)/$$lang.gmo.m as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info ctags tags CTAGS TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+ done
+
+check: all $(GETTEXT_PACKAGE).pot
+ rm -f missing notexist
+ srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+ if [ -r missing -o -r notexist ]; then \
+ exit 1; \
+ fi
+
+mostlyclean:
+ rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+ rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES stamp-it
+ rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ for file in $$extra_dists; do \
+ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+ done; \
+ for file in $$dists; do \
+ test -f $$file || file="$(srcdir)/$$file"; \
+ ln $$file $(distdir) 2> /dev/null \
+ || cp -p $$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ tmpdir=`pwd`; \
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ echo "$$lang:"; \
+ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+ if $$result; then \
+ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.gmo failed!"; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi; \
+ done
+
+Makefile POTFILES: stamp-it
+ @if test ! -f $@; then \
+ rm -f stamp-it; \
+ $(MAKE) stamp-it; \
+ fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/en_GB.po b/po/en_GB.po
new file mode 100644
index 0000000..3e01008
--- /dev/null
+++ b/po/en_GB.po
@@ -0,0 +1,334 @@
+# src/arrays.c:60
+msgid "OS: "
+msgstr "OS: "
+
+
+# src/arrays.c:61
+msgid "Kernel: "
+msgstr "Kernel: "
+
+
+# src/arrays.c:62
+msgid "CPU: "
+msgstr "CPU: "
+
+
+# src/arrays.c:63
+msgid "GPU: "
+msgstr "GPU: "
+
+
+# src/arrays.c:64
+msgid "SHELL: "
+msgstr "SHELL: "
+
+
+# src/arrays.c:65
+msgid "Packages: "
+msgstr "Packages: "
+
+
+# src/arrays.c:66
+msgid "Disk: "
+msgstr "Disk: "
+
+
+# src/arrays.c:67
+msgid "Memory: "
+msgstr "Memory: "
+
+
+# src/arrays.c:68
+msgid "Uptime: "
+msgstr "Uptime: "
+
+
+# src/arrays.c:69
+msgid "Resolution: "
+msgstr "Resolution: "
+
+
+# src/arrays.c:70
+msgid "DE: "
+msgstr "DE: "
+
+
+# src/arrays.c:71
+msgid "WM: "
+msgstr "WM: "
+
+
+# src/arrays.c:72
+msgid "WM Theme: "
+msgstr "WM Theme: "
+
+
+# src/arrays.c:73
+msgid "GTK: "
+msgstr "GTK: "
+
+
+# src/arrays.c:74
+msgid "Icon Theme: "
+msgstr "Icon Theme: "
+
+
+# src/arrays.c:75
+msgid "Font: "
+msgstr "Font: "
+
+
+# src/parser.c:23
+msgid "Display computer information and an ASCII logo"
+msgstr "Display computer information and an ASCII logo"
+
+
+# src/parser.c:31
+msgid "Enable verbosity during output."
+msgstr "Enable verbosity during output."
+
+
+# src/parser.c:33
+msgid "Take a screenshot."
+msgstr "Take a screenshot."
+
+
+# src/parser.c:35
+msgid "Print output without a logo."
+msgstr "Print output without a logo."
+
+
+# src/parser.c:37
+msgid "Suppress error output."
+msgstr "Suppress error output."
+
+
+# src/parser.c:39
+msgid "Print output in portrait mode."
+msgstr "Print output in portrait mode."
+
+
+# src/parser.c:41
+msgid "Output only DISTRO's logo."
+msgstr "Output only DISTRO's logo."
+
+
+# src/parser.c:43
+msgid "Print output with DISTRO's logo."
+msgstr "Print output with DISTRO's logo."
+
+
+# src/parser.c:29
+msgid "Main operation mode:"
+msgstr "Main operation mode:"
+
+
+# src/disp.c:115
+msgid "Could not find a logo for the distro."
+msgstr "Could not find a logo for the distro."
+
+
+# src/util.c:181
+msgid "Screenshot has been saved to the clipboard."
+msgstr "Screenshot has been saved to the clipboard."
+
+
+# src/util.c:212
+msgid "Screenshot successfully saved."
+msgstr "Screenshot successfully saved."
+
+
+# src/util.c:215
+msgid "Problem saving screenshot."
+msgstr "Problem saving screenshot."
+
+
+# src/util.c
+msgid "No X server, aborting the creation of screenshot."
+msgstr "No X server, aborting the creation of screenshot."
+
+
+# src/misc.h:101
+msgid "Error"
+msgstr "Error"
+
+
+# src/plat/*/detect.c:127
+msgid "Failed to detect a Linux distro (1)."
+msgstr "Failed to detect a Linux distro (1)."
+
+
+# src/plat/*/detect.c:135
+msgid "Failed to detect a Linux distro (2)."
+msgstr "Failed to detect a Linux distro (2)."
+
+
+# src/plat/*/detect.c:157
+msgid "Could not detect username."
+msgstr "Could not detect username."
+
+
+# src/plat/*/detect.c:163
+msgid "Could not detect hostname."
+msgstr "Could not detect hostname."
+
+
+# src/plat/*/detect.c
+msgid "No X Server"
+msgstr "No X Server"
+
+
+# src/plat/*/detect.c
+msgid "Not Found"
+msgstr "Not Found"
+
+
+# src/plat/*/detect.c:184
+msgid "Could not detect kernel information."
+msgstr "Could not detect kernel information."
+
+
+# src/plat/*/detect.c:212
+msgid "Could not detect system uptime."
+msgstr "Could not detect system uptime."
+
+
+# src/plat/*/detect.c:228
+msgid "Failure while globbing packages."
+msgstr "Failure while globbing packages."
+
+
+# src/plat/*/detect.c:296
+msgid "Packages cannot be detected on an unknown Linux distro."
+msgstr "Packages cannot be detected on an unknown Linux distro."
+
+
+# src/plat/*/detect.c:323
+msgid "Fatal error while reading /proc/cpuinfo"
+msgstr "Fatal error while reading /proc/cpuinfo"
+
+
+# src/plat/bsd/detect.c
+msgid "Could not find packages on current OS."
+msgstr "Could not find packages on current OS."
+
+
+# src/plat/*/detect.c:331
+msgid "Fatal error matching in /proc/cpuinfo"
+msgstr "Fatal error matching in /proc/cpuinfo"
+
+
+# src/plat/*/detect.c:350
+msgid "Failed to open /proc/cpuinfo. Ancient Linux kernel?"
+msgstr "Failed to open /proc/cpuinfo. Ancient Linux kernel?"
+
+
+# src/plat/*/detect.c:382
+msgid "Failed to create OpenGL context."
+msgstr "Failed to create OpenGL context."
+
+
+# src/plat/*/detect.c:387
+msgid "Failed to select a proper X visual."
+msgstr "Failed to select a proper X visual."
+
+
+# src/plat/*/detect.c:394
+msgid "Could not open an X display (detect_gpu)."
+msgstr "Could not open an X display (detect_gpu)."
+
+
+# src/plat/*/detect.c:418
+msgid "Could not stat $HOME for filesystem statistics."
+msgstr "Could not stat $HOME for filesystem statistics."
+
+
+# src/plat/*/detect.c:459
+msgid "Could not detect a shell - $SHELL not defined."
+msgstr "Could not detect a shell - $SHELL not defined."
+
+
+# src/plat/*/detect.c:512
+msgid "Could not open an X display (detect_res)"
+msgstr "Could not open an X display (detect_res)"
+
+
+# src/plat/*/detect.c:544
+msgid "No desktop environment found."
+msgstr "No desktop environment found."
+
+
+# src/plat/*/detect.c:579
+msgid "No _NET_WM_NAME property found."
+msgstr "No _NET_WM_NAME property found."
+
+
+# src/plat/*/detect.c:582
+msgid "Missing script. (detect_wm_theme)"
+msgstr "Missing script. (detect_wm_theme)"
+
+
+# src/plat/*/detect.c:584
+msgid "No WM detected (non-EWMH compliant?)"
+msgstr "No WM detected (non-EWMH compliant?)"
+
+
+# src/plat/*/detect.c:589
+msgid "Could not open an X display. (detect_wm)"
+msgstr "Could not open an X display. (detect_wm)"
+
+
+# src/plat/*/detect.c:627
+msgid "Missing script. (detect_gtk)"
+msgstr "Missing script. (detect_gtk)"
+
+
+# src/plat/*/detect.c:580,625,632,635
+msgid "Missing script"
+msgstr "Missing script"
+
+
+# src/plat/*/detect.c:639,642,645
+msgid "GTK"
+msgstr "GTK"
+
+
+# src/plat/*/detect.c:642,645
+msgid "Icons"
+msgstr "Icons"
+
+
+msgid "Print program version"
+msgstr "Print program version"
+
+
+msgid "Give a short usage message"
+msgstr "Give a short usage message"
+
+
+msgid "Give this help list"
+msgstr "Give this help list"
+
+
+msgid "Usage:"
+msgstr "Usage:"
+
+
+msgid " [OPTION...]"
+msgstr " [OPTION...]"
+
+
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+
+
+msgid "Report bugs to %s.\n"
+msgstr "Report bugs to %s.\n"
+
+
+msgid "Unknown"
+msgstr "Unknown"
\ No newline at end of file
diff --git a/src/arrays.c b/src/arrays.c
new file mode 100644
index 0000000..0793ec5
--- /dev/null
+++ b/src/arrays.c
@@ -0,0 +1,1020 @@
+/* arrays.c
+ * Author: William Woodruff
+ * Edited by: Aaron Caffrey
+ * -------------
+ *
+ * Most of the character arrays are declared and initialized in this file,
+ * so we don't have to pass them as function arguments to some of the screenfetch-c modules.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+
+#include "misc.h"
+
+char host_str[MAX_STRLEN] = "Unknown";
+char distro_str[MAX_STRLEN] = "Unknown";
+char kernel_str[MAX_STRLEN] = "Unknown";
+char uptime_str[MAX_STRLEN] = "Unknown";
+char pkgs_str[MAX_STRLEN] = "Unknown";
+char cpu_str[MAX_STRLEN] = "Unknown";
+char gpu_str[MAX_STRLEN] = "Unknown";
+char disk_str[MAX_STRLEN] = "Unknown";
+char mem_str[MAX_STRLEN] = "Unknown";
+char shell_str[MAX_STRLEN] = "Unknown";
+char res_str[MAX_STRLEN] = "Unknown";
+char de_str[MAX_STRLEN] = "Unknown";
+char wm_str[MAX_STRLEN] = "Unknown";
+char wm_theme_str[MAX_STRLEN] = "Unknown";
+char gtk_str[MAX_STRLEN] = "Unknown";
+char icon_str[MAX_STRLEN] = "Unknown";
+char font_str[MAX_STRLEN] = "Unknown";
+
+char UseR[MAX_STRLEN], HosT[MAX_STRLEN];
+char given_distro_str[MAX_STRLEN] = "Unknown";
+
+char *detected_arr[] =
+{
+ host_str,
+ distro_str,
+ kernel_str,
+ cpu_str,
+ gpu_str,
+ shell_str,
+ pkgs_str,
+ disk_str,
+ mem_str,
+ uptime_str,
+ res_str,
+ de_str,
+ wm_str,
+ wm_theme_str,
+ gtk_str,
+ icon_str,
+ font_str
+};
+
+const char *detected_arr_names[] =
+{
+ "",
+ "OS: ",
+ "Kernel: ",
+ "CPU: ",
+ "GPU: ",
+ "Shell: ",
+ "Packages: ",
+ "Disk: ",
+ "Memory: ",
+ "Uptime: ",
+ "Resolution: ",
+ "DE: ",
+ "WM: ",
+ "WM Theme: ",
+ "GTK: ",
+ "Icon Theme: ",
+ "Font: "
+};
+
+
+/* 18 */
+const char *oldarch_logo[] =
+{
+ ""TWHT" __ " TNRM,
+ ""TWHT" _=(SDGJT=_ " TNRM,
+ ""TWHT" _GTDJHGGFCVS) " TNRM,
+ ""TWHT" ,GTDJGGDTDFBGX0 " TNRM,
+ ""TWHT" JDJDIJHRORVFSBSVL"TLBL"-=+=,_ " TNRM,
+ ""TWHT" IJFDUFHJNXIXCDXDSV,"TLBL" \"DEBL " TNRM,
+ ""TWHT" [LKDSDJTDU=OUSCSBFLD."TLBL" '?ZWX, " TNRM,
+ ""TWHT" ,LMDSDSWH' `DCBOSI"TLBL" DRDS], " TNRM,
+ ""TWHT" SDDFDFH' !YEWD,"TLBL" )HDROD " TNRM,
+ ""TWHT" !KMDOCG &GSU|"TLBL"_GFHRGO' " TNRM,
+ ""TWHT" HKLSGP'"TLBL" __"TWHT"TKM0"TLBL"GHRBV)' " TNRM,
+ ""TWHT" JSNRVW'"TLBL" __+MNAEC"TWHT"IOI,"TLBL"BN' " TNRM,
+ ""TWHT" HELK['"TLBL" __,=OFFXCBGHC"TWHT"FD) " TNRM,
+ ""TWHT" ?KGHE "TLBL"_-#DASDFLSV='"TWHT" 'EF " TNRM,
+ ""TWHT" 'EHTI !H " TNRM,
+ ""TWHT" `0F' '! " TNRM,
+ " " TNRM,
+ " " TNRM
+};
+
+/* 19 */
+const char *arch_logo[] =
+{
+ ""TLCY" -` " TNRM,
+ ""TLCY" .o+` " TNRM,
+ ""TLCY" `ooo/ " TNRM,
+ ""TLCY" `+oooo: " TNRM,
+ ""TLCY" `+oooooo: " TNRM,
+ ""TLCY" -+oooooo+: " TNRM,
+ ""TLCY" `/:-:++oooo+: " TNRM,
+ ""TLCY" `/++++/+++++++: " TNRM,
+ ""TLCY" `/++++++++++++++: " TNRM,
+ ""TLCY" `/+++o"TCYN"oooooooo"TLCY"oooo/` " TNRM,
+ ""TCYN" "TLCY"./"TCYN"ooosssso++osssssso"TLCY"+` " TNRM,
+ ""TCYN" .oossssso-````/ossssss+` " TNRM,
+ ""TCYN" -osssssso. :ssssssso. " TNRM,
+ ""TCYN" :osssssss/ osssso+++. " TNRM,
+ ""TCYN" /ossssssss/ +ssssooo/- " TNRM,
+ ""TCYN" `/ossssso+/:- -:/+osssso+- " TNRM,
+ ""TCYN" `+sso+:-` `.-/+oso: " TNRM,
+ ""TCYN" `++:. `-/+/" TNRM,
+ ""TCYN" .` `/" TNRM
+};
+
+/* 18 */
+const char *mint_logo[] =
+{
+ " " TNRM,
+ ""TLGN" MMMMMMMMMMMMMMMMMMMMMMMMMmds+. " TNRM,
+ ""TLGN" MMm----::-://////////////oymNMd+` " TNRM,
+ ""TLGN" MMd "TWHT"/++ "TLGN"-sNMd: " TNRM,
+ ""TLGN" MMNso/` "TWHT"dMM `.::-. .-::.` "TLGN".hMN: " TNRM,
+ ""TLGN" ddddMMh "TWHT"dMM :hNMNMNhNMNMNh: "TLGN"`NMm " TNRM,
+ ""TLGN" NMm "TWHT"dMM .NMN/-+MMM+-/NMN` "TLGN"dMM " TNRM,
+ ""TLGN" NMm "TWHT"dMM -MMm `MMM dMM. "TLGN"dMM " TNRM,
+ ""TLGN" NMm "TWHT"dMM -MMm `MMM dMM. "TLGN"dMM " TNRM,
+ ""TLGN" NMm "TWHT"dMM .mmd `mmm yMM. "TLGN"dMM " TNRM,
+ ""TLGN" NMm "TWHT"dMM` ..` ... ydm. "TLGN"dMM " TNRM,
+ ""TLGN" hMM- "TWHT"+MMd/-------...-:sdds "TLGN"dMM " TNRM,
+ ""TLGN" -NMm- "TWHT":hNMNNNmdddddddddy/` "TLGN"dMM " TNRM,
+ ""TLGN" -dMNs-"TWHT"``-::::-------.`` "TLGN"dMM " TNRM,
+ ""TLGN" `/dMNmy+/:-------------:/yMMM " TNRM,
+ ""TLGN" ./ydNMMMMMMMMMMMMMMMMMMMMM " TNRM,
+ ""TLGN" .MMMMMMMMMMMMMMMMMMM " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *lmde_logo[] =
+{
+ " "TWHT"`.-::---.. " TNRM,
+ ""TLGN" .:++++ooooosssoo:. " TNRM,
+ ""TLGN" .+o++::. `.:oos+. " TNRM,
+ ""TLGN" :oo:.` -+oo"TWHT": " TNRM,
+ ""TLGN" "TWHT"`"TLGN"+o/` ."TWHT"::::::"TLGN"-. .++-"TWHT"` " TNRM,
+ ""TLGN" "TWHT"`"TLGN"/s/ .yyyyyyyyyyo: +o-"TWHT"` " TNRM,
+ ""TLGN" "TWHT"`"TLGN"so .ss ohyo` :s-"TWHT": " TNRM,
+ ""TLGN" "TWHT"`"TLGN"s/ .ss h m myy/ /s`"TWHT"` " TNRM,
+ ""TLGN" `s: `oo s m Myy+-o:` " TNRM,
+ ""TLGN" `oo :+sdoohyoydyso/. " TNRM,
+ ""TLGN" :o. .:////////++: " TNRM,
+ ""TLGN" `/++ "TWHT"-:::::- " TNRM,
+ ""TLGN" "TWHT"`"TLGN"++- " TNRM,
+ ""TLGN" "TWHT"`"TLGN"/+- " TNRM,
+ ""TLGN" "TWHT"."TLGN"+/. " TNRM,
+ ""TLGN" "TWHT"."TLGN":+-. " TNRM,
+ ""TLGN" `--.`` " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *ubuntu_logo[] =
+{
+ ""TLRD" ./+o+- " TNRM,
+ ""TWHT" yyyyy- "TLRD"-yyyyyy+ " TNRM,
+ ""TWHT" "TWHT"://+//////"TLRD"-yyyyyyo " TNRM,
+ ""TYLW" .++ "TWHT".:/++++++/-"TLRD".+sss/` " TNRM,
+ ""TYLW" .:++o: "TWHT"/++++++++/:--:/- " TNRM,
+ ""TYLW" o:+o+:++."TWHT"`..```.-/oo+++++/ " TNRM,
+ ""TYLW" .:+o:+o/."TWHT" `+sssoo+/ " TNRM,
+ ""TWHT" .++/+:"TYLW"+oo+o:`"TWHT" /sssooo. " TNRM,
+ ""TWHT" /+++//+:"TYLW"`oo+o"TWHT" /::--:. " TNRM,
+ ""TWHT" +/+o+++"TYLW"`o++o"TLRD" ++////. " TNRM,
+ ""TWHT" .++.o+"TYLW"++oo+:`"TLRD" /dddhhh. " TNRM,
+ ""TYLW" .+.o+oo:."TLRD" `oddhhhh+ " TNRM,
+ ""TYLW" +.++o+o``-``"TLRD"``.:ohdhhhhh+ " TNRM,
+ ""TYLW" `:o+++ "TLRD"`ohhhhhhhhyo++os: " TNRM,
+ ""TYLW" .o:"TLRD"`.syhhhhhhh/"TYLW".oo++o` " TNRM,
+ ""TLRD" /osyyyyyyo"TYLW"++ooo+++/ " TNRM,
+ ""TLRD" ````` "TYLW"+oo+++o: " TNRM,
+ ""TYLW" `oo++. " TNRM
+};
+
+/* 18 */
+const char *debian_logo[] =
+{
+ " "TWHT" _,met$$$$$gg. " TNRM,
+ " "TWHT" ,g$$$$$$$$$$$$$$$P. " TNRM,
+ " "TWHT" ,g$$P\"\" \"\"\"Y$$.\". " TNRM,
+ " "TWHT" ,$$P' `$$$. " TNRM,
+ " "TWHT"',$$P ,ggs. `$$b: " TNRM,
+ " "TWHT"`d$$' ,$P\"\' "TLRD"."TWHT" $$$ " TNRM,
+ " "TWHT" $$P d$\' "TLRD","TWHT" $$P " TNRM,
+ " "TWHT" $$: $$. "TLRD"-"TWHT" ,d$$' " TNRM,
+ " "TWHT" $$; Y$b._ _,d$P' " TNRM,
+ " "TWHT" Y$$. "TLRD"`."TWHT"`\"Y$$$$P\"' " TNRM,
+ " "TWHT" `$$b "TLRD"\"-.__ " TNRM,
+ " "TWHT" `Y$$ " TNRM,
+ " "TWHT" `Y$$. " TNRM,
+ " "TWHT" `$$b. " TNRM,
+ " "TWHT" `Y$$b. " TNRM,
+ " "TWHT" `\"Y$b._ " TNRM,
+ " "TWHT" `\"\"\"\" " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *crunchbang_logo[] =
+{
+ " "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
+ " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
+ " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
+ " "TNRM""
+};
+
+/* 18 */
+const char *gentoo_logo[] =
+{
+ ""TLPR" -/oyddmdhs+:. " TNRM,
+ ""TLPR" -o"TWHT"dNMMMMMMMMNNmhy+"TLPR"-` " TNRM,
+ ""TLPR" -y"TWHT"NMMMMMMMMMMMNNNmmdhy"TLPR"+- " TNRM,
+ ""TLPR" `o"TWHT"mMMMMMMMMMMMMNmdmmmmddhhy"TLPR"/` " TNRM,
+ ""TLPR" om"TWHT"MMMMMMMMMMMN"TLPR"hhyyyo"TWHT"hmdddhhhd"TLPR"o` " TNRM,
+ ""TLPR".y"TWHT"dMMMMMMMMMMd"TLPR"hs++so/s"TWHT"mdddhhhhdm"TLPR"+` " TNRM,
+ ""TLPR" oy"TWHT"hdmNMMMMMMMN"TLPR"dyooy"TWHT"dmddddhhhhyhN"TLPR"d. " TNRM,
+ ""TLPR" :o"TWHT"yhhdNNMMMMMMMNNNmmdddhhhhhyym"TLPR"Mh " TNRM,
+ ""TLPR" .:"TWHT"+sydNMMMMMNNNmmmdddhhhhhhmM"TLPR"my " TNRM,
+ ""TLPR" /m"TWHT"MMMMMMNNNmmmdddhhhhhmMNh"TLPR"s: " TNRM,
+ ""TLPR" `o"TWHT"NMMMMMMMNNNmmmddddhhdmMNhs"TLPR"+` " TNRM,
+ ""TLPR" `s"TWHT"NMMMMMMMMNNNmmmdddddmNMmhs"TLPR"/. " TNRM,
+ ""TLPR" /N"TWHT"MMMMMMMMNNNNmmmdddmNMNdso"TLPR":` " TNRM,
+ ""TLPR"+M"TWHT"MMMMMMNNNNNmmmmdmNMNdso"TLPR"/- " TNRM,
+ ""TLPR"yM"TWHT"MNNNNNNNmmmmmNNMmhs+/"TLPR"-` " TNRM,
+ ""TLPR"/h"TWHT"MMNNNNNNNNMNdhs++/"TLPR"-` " TNRM,
+ ""TLPR"`/"TWHT"ohdmmddhys+++/:"TLPR".` " TNRM,
+ ""TLPR" `-//////:--. " TNRM
+};
+
+/* 18 */
+const char *funtoo_logo[] =
+{
+ " " TNRM,
+ " " TNRM,
+ " " TNRM,
+ " " TNRM,
+ TWHT " _______ ____ " TNRM,
+ TWHT " /MMMMMMM/ /MMMM| _____ _____ " TNRM,
+ TWHT " __/M"TLPR".MMM."TWHT"M/_____________|M"TLPR".M"TWHT"MM|/MMMMM\\/MMMMM\\ " TNRM,
+ TWHT "|MMMM"TLPR"MM'"TWHT"MMMMMMMMMMMMMMMMMMM"TLPR"MM"TWHT"MMMM"TLPR".MMMM..MMMM."TWHT"MM\\ " TNRM,
+ TWHT "|MM"TLPR"MMMMMMM"TWHT"/m"TLPR"MMMMMMMMMMMMMMMMMMMMMM"TWHT"MMMM"TLPR"MM"TWHT"MMMM"TLPR"MM"TWHT"MM| " TNRM,
+ TWHT "|MMMM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MMMMM"TLPR"\\MMM"TWHT"MMM"TLPR"MM"TWHT"MMMM"TLPR"MM"TWHT"MMMM"TLPR"MM"TWHT"MM| " TNRM,
+ TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MMM"TWHT"MMMM"TLPR"'MMMM''MMMM'"TWHT"MM/ " TNRM,
+ TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MMM"TWHT"MMM\\MMMMM/\\MMMMM/ " TNRM,
+ TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MMMMMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MMMMM'"TWHT"M| " TNRM,
+ TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MMMMMMMMMMMMMMMMM MM'"TWHT"M/ " TNRM,
+ TWHT " |MMMMMMMMMMMMMMMMMMMMMMMMMMMM/ " TNRM,
+ " " TNRM,
+ " " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *fedora_logo[] =
+{
+ ""TLBL" :/------------:// " TNRM,
+ ""TLBL" :------------------:// " TNRM,
+ ""TLBL" :-----------"TWHT"/shhdhyo/"TLBL"-:// " TNRM,
+ ""TLBL" /-----------"TWHT"omMMMNNNMMMd/"TLBL"-:/ " TNRM,
+ ""TLBL" :-----------"TWHT"sMMMdo:/"TLBL" -:/ " TNRM,
+ ""TLBL" :-----------"TWHT":MMMd"TLBL"------- --:/ " TNRM,
+ ""TLBL" /-----------"TWHT":MMMy"TLBL"------- ---/ " TNRM,
+ ""TLBL" :------ --"TWHT"/+MMMh/"TLBL"-- ---: " TNRM,
+ ""TLBL" :--- "TWHT"oNMMMMMMMMMNho"TLBL" -----: " TNRM,
+ ""TLBL" :-- "TWHT"+shhhMMMmhhy++"TLBL" ------: " TNRM,
+ ""TLBL" :- -----"TWHT":MMMy"TLBL"--------------/ " TNRM,
+ ""TLBL" :- ------"TWHT"/MMMy"TLBL"-------------: " TNRM,
+ ""TLBL" :- ----"TWHT"/hMMM+"TLBL"------------: " TNRM,
+ ""TLBL" :--"TWHT":dMMNdhhdNMMNo"TLBL"-----------: " TNRM,
+ ""TLBL" :---"TWHT":sdNMMMMNds:"TLBL"----------: " TNRM,
+ ""TLBL" :------"TWHT":://:"TLBL"-----------:// " TNRM,
+ ""TLBL" :--------------------:// " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *freebsd_logo[] =
+{
+ " " TNRM,
+ " "TWHT"``` "TLRD"` " TNRM,
+ " "TWHT"` `.....---..."TLRD"....--.``` -/ " TNRM,
+ " "TWHT"+o .--` "TLRD"/y:` +. " TNRM,
+ " "TWHT" yo`:. "TLRD":o `+- " TNRM,
+ " "TWHT"y/ "TLRD"-/` -o/ " TNRM,
+ " "TWHT".- "TLRD"::/sy+:. " TNRM,
+ " "TWHT"/ "TLRD"`-- / " TNRM,
+ " "TWHT"`: "TLRD":` " TNRM,
+ " "TWHT"`: "TLRD":` " TNRM,
+ " "TWHT"/ "TLRD"/ " TNRM,
+ " "TWHT".- "TLRD"-. " TNRM,
+ " "TWHT"-- "TLRD"-. " TNRM,
+ " "TWHT"`:` "TLRD"`:` " TNRM,
+ " "TLRD".-- `--. " TNRM,
+ " "TLRD" .---.....----. " TNRM,
+ " " TNRM,
+ " " TNRM
+};
+
+/* 23 */
+const char *openbsd_logo[] =
+{
+ " "TLCY" _ "TNRM"",
+ " "TLCY"(_) "TNRM"",
+ ""TYLW" | . "TNRM"",
+ ""TYLW" . |L /| . "TLCY" _ " TNRM,
+ ""TYLW" _ . |\\ _| \\--+._/| . "TLCY"(_) " TNRM,
+ ""TYLW" / ||\\| Y J ) / |/| ./ " TNRM,
+ ""TYLW" J |)'( | \\` F\\`.'/ "TLCY" _ " TNRM,
+ ""TYLW" -<| F __ .-< "TLCY"(_) " TNRM,
+ ""TYLW" | / .-'"TLCY". "TYLW"\\`. /"TLCY"-. "TYLW"L___ " TNRM,
+ ""TYLW" J \\ < "TLCY"\\ "TYLW" | | "TDGY"O"TLCY"\\\\"TYLW"|.-' "TLCY" _ " TNRM,
+ ""TYLW" _J \\ .- \\\\"TLCY"/ "TDGY"O "TLCY"| "TYLW"| \\ |"TYLW"F "TLCY"(_) " TNRM,
+ ""TYLW" '-F -<_. \\ .-' \\`-' L__ " TNRM,
+ ""TYLW"__J _ _. >-' "TBRN")"TLRD"._. "TYLW"|-' "TNRM,
+ ""TYLW" \\`-|.' /_. "TLRD"\\_| "TYLW" F "TNRM,
+ ""TYLW" /.- . _.< " TNRM,
+ ""TYLW" /' /.' .' \\`\\ " TNRM,
+ ""TYLW" /L /' |/ _.-'-\\ "TNRM,
+ ""TYLW" /'J ___.---'\\| " TNRM,
+ ""TYLW" |\\ .--' V | \\`. \\` "TNRM,
+ ""TYLW" |/\\`. \\`-. \\`._) " TNRM,
+ ""TYLW" / .-.\\ " TNRM,
+ ""TYLW" \\ ( \\`\\ "TNRM"",
+ ""TYLW" \\`.\\ "TNRM""
+};
+
+/* 18 */
+const char *dragonflybsd_logo[] =
+{
+ " "TLRD" | " TNRM,
+ " "TLRD" .-. " TNRM,
+ " "TYLW" ()"TLRD"I"TYLW"() " TNRM,
+ " "TLRD" \"==.__:-:__.==\" " TNRM,
+ " "TLRD"\"==.__/~|~\\__.==\" " TNRM,
+ " "TLRD"\"==._( Y )_.==\" " TNRM,
+ " "TWHT".-'~~\"\"~=--...,__"TLRD"\\/|\\/"TWHT"__,...--=~\"\"~~'-. " TNRM,
+ " "TWHT"( ..="TLRD"\\\\="TLRD"/"TWHT"=.. )" TNRM,
+ " "TWHT"\\`'-. ,.-\"\\`;"TLRD"/=\\\\"TWHT" ;\"-.,_ .-'\\`" TNRM,
+ " "TWHT" \\`~\"-=-~\\` .-~\\` "TLRD"|=|"TWHT" \\`~-. \\`~-=-\"~\\` " TNRM,
+ " "TWHT" .-~\\` /"TLRD"|=|"TWHT"\\ \\`~-. " TNRM,
+ " "TWHT" .~\\` / "TLRD"|=|"TWHT" \\ \\`~. " TNRM,
+ " "TWHT" .-~\\` .' "TLRD"|=|"TWHT" \\\\\\`. \\`~-. " TNRM,
+ " "TWHT" (\\` _,.-=\"\\` "TLRD" |=|"TWHT" \\`\"=-.,_ \\`) " TNRM,
+ " "TWHT" \\`~\"~\"\\` "TLRD" |=|"TWHT" \\`\"~\"~\\` " TNRM,
+ " "TLRD" /=\\ " TNRM,
+ " "TLRD" \\=/ " TNRM,
+ " "TLRD" ^ " TNRM
+};
+
+/* 19 */
+const char *netbsd_logo[] =
+{
+ " "TLRD"__,gnnnOCCCCCOObaau,_ " TNRM,
+ " "TWHT"_._ "TLRD"__,gnnCCCCCCCCOPF\"'' " TNRM,
+ " "TWHT"(N\\\\\\\\"TLRD"XCbngg,._____.,gnnndCCCCCCCCCCCCF\"___,,,,___ " TNRM,
+ " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOPYvv. " TNRM,
+ " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPF\"'' " TNRM,
+ " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCCCCCCOF\"' " TNRM,
+ " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCOF\"' " TNRM,
+ " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCPF\"' " TNRM,
+ " "TWHT"\\\\N\\\\\\\\"TLRD"\"PCOCCCOCCFP\"\" " TNRM,
+ " "TWHT"\\\\N\\ " TNRM,
+ " "TWHT"\\\\N\\ " TNRM,
+ " "TWHT"\\\\N\\ " TNRM,
+ " "TWHT"\\\\NN\\ " TNRM,
+ " "TWHT"\\\\NN\\ " TNRM,
+ " "TWHT"\\\\NNA. " TNRM,
+ " "TWHT"\\\\NNA, " TNRM,
+ " "TWHT"\\\\NNN, " TNRM,
+ " "TWHT"\\\\NNN\\ " TNRM,
+ " "TWHT"\\\\NNN\\ " TNRM,
+ " "TWHT"\\\\NNNA" TNRM
+};
+
+/* 18 */
+const char *mandriva_mandrake_logo[] =
+{
+ " " TNRM,
+ ""TYLW" `` " TNRM,
+ ""TYLW" `-. " TNRM,
+ ""TLBL" ` "TYLW".--- " TNRM,
+ ""TLBL" -/ "TYLW"-::--` " TNRM,
+ ""TLBL" `++ "TYLW"`----...```-:::::. " TNRM,
+ ""TLBL" `os. "TYLW".::::::::::::::-``` ` ` " TNRM,
+ ""TLBL" +s+ "TYLW".::::::::::::::::---...--` " TNRM,
+ ""TLBL" -ss: "TYLW"`-::::::::::::::::-.``.`` " TNRM,
+ ""TLBL" /ss- "TYLW".::::::::::::-.`` ` " TNRM,
+ ""TLBL" +ss: "TYLW".::::::::::::- " TNRM,
+ ""TLBL" /sso "TYLW".::::::-::::::- " TNRM,
+ ""TLBL" .sss/ "TYLW"-:::-.` .::::: " TNRM,
+ ""TLBL" /sss+. "TYLW"..`"TLBL" `--` "TYLW".::: " TNRM,
+ ""TLBL" -ossso+/:://+/-` "TYLW".:` " TNRM,
+ ""TLBL" -/+ooo+/-. "TYLW"` " TNRM,
+ " " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *opensuse_logo[] =
+{
+ ""TWHT" .;ldkO0000Okdl;. " TNRM,
+ ""TWHT" .;d00xl:,'....';:ok00d;. " TNRM,
+ ""TWHT" .d00l' ,o00d. " TNRM,
+ ""TWHT" .d0Kd."TLGN" :Okxol:;'. "TWHT":O0d. " TNRM,
+ ""TWHT" 'OK"TLGN"KKK0kOKKKKKKKKKKOxo:' "TWHT"lKO' " TNRM,
+ ""TWHT" ,0K"TLGN"KKKKKKKKKKKKKKK0d:"TWHT",,,"TLGN":dx:"TWHT" ;00, " TNRM,
+ ""TWHT" .OK"TLGN"KKKKKKKKKKKKKKKk."TWHT".oOkdl."TLGN"'0k."TWHT" cKO. " TNRM,
+ ""TWHT" :KK"TLGN"KKKKKKKKKKKKKKK: "TWHT"kKx..od "TLGN"lKd"TWHT" .OK: " TNRM,
+ ""TWHT" dKK"TLGN"KKKKKKKKKOx0KKKd "TWHT";0KKKO, "TLGN"kKKc"TWHT" dKd " TNRM,
+ ""TWHT" dKK"TLGN"KKKKKKKKKK;.;oOKx,.."TWHT"'"TLGN"..;kKKK0."TWHT" dKd " TNRM,
+ ""TWHT" :KK"TLGN"KKKKKKKKKK0o;...;cdxxOK0Oxc,. "TWHT".0K: " TNRM,
+ ""TWHT" kKK"TLGN"KKKKKKKKKKKKK0xl;'......,cdo "TWHT"lKk " TNRM,
+ ""TWHT" '0K"TLGN"KKKKKKKKKKKKKKKKKKKK00KKOo; "TWHT"c00' " TNRM,
+ ""TWHT" .kK"TLGN"KKOxddxkOO00000Okxoc;'. "TWHT".dKk. " TNRM,
+ ""TWHT" l0Ko. .c00l. " TNRM,
+ ""TWHT" .l0Kk:. .;xK0l. " TNRM,
+ ""TWHT" ,lkK0xl:;,,,,;:ldO0kl, " TNRM,
+ ""TWHT" .':ldxkkkkxdl:'. " TNRM
+};
+
+/* 21 */
+const char *slackware_logo[] =
+{
+ ""TLBL" ::::::: " TNRM,
+ ""TLBL" ::::::::::::::::::: " TNRM,
+ ""TLBL" ::::::::::::::::::::::::: " TNRM,
+ ""TLBL" ::::::::"TWHT"cllcccccllllllll"TLBL":::::: " TNRM,
+ ""TLBL" :::::::::"TWHT"lc dc"TLBL"::::::: " TNRM,
+ ""TLBL" ::::::::"TWHT"cl clllccllll oc"TLBL"::::::::: " TNRM,
+ ""TLBL" :::::::::"TWHT"o lc"TLBL"::::::::"TWHT"co oc"TLBL":::::::::: " TNRM,
+ ""TLBL" ::::::::::"TWHT"o cccclc"TLBL":::::"TWHT"clcc"TLBL":::::::::::: " TNRM,
+ ""TLBL" :::::::::::"TWHT"lc cclccclc"TLBL"::::::::::::: " TNRM,
+ ""TLBL" ::::::::::::::"TWHT"lcclcc lc"TLBL":::::::::::: " TNRM,
+ ""TLBL" ::::::::::"TWHT"cclcc"TLBL":::::"TWHT"lccclc oc"TLBL"::::::::::: " TNRM,
+ ""TLBL" ::::::::::"TWHT"o l"TLBL"::::::::::"TWHT"l lc"TLBL"::::::::::: " TNRM,
+ ""TLBL" :::::"TWHT"cll"TLBL":"TWHT"o clcllcccll o"TLBL"::::::::::: " TNRM,
+ ""TLBL" :::::"TWHT"occ"TLBL":"TWHT"o clc"TLBL"::::::::::: " TNRM,
+ ""TLBL" ::::"TWHT"ocl"TLBL":"TWHT"ccslclccclclccclclc"TLBL"::::::::::::: " TNRM,
+ ""TLBL" :::"TWHT"oclcccccccccccccllllllllllllll"TLBL"::::: " TNRM,
+ ""TLBL" ::"TWHT"lcc1lcccccccccccccccccccccccco"TLBL":::: " TNRM,
+ ""TLBL" :::::::::::::::::::::::::::::::: " TNRM,
+ ""TLBL" :::::::::::::::::::::::::::: " TNRM,
+ ""TLBL" ::::::::::::::::::::::" TNRM,
+ ""TLBL" ::::::::::::" TNRM
+};
+
+/* 18 */
+const char *redhat_logo[] =
+{
+ " " TNRM,
+ ""TLRD" `.-..........` " TNRM,
+ ""TLRD" `////////::.`-/. " TNRM,
+ ""TLRD" -: ....-////////. " TNRM,
+ ""TLRD" //:-::///////////` " TNRM,
+ ""TLRD" `--::: `-://////////////: " TNRM,
+ ""TLRD" //////- ``.-:///////// .` " TNRM,
+ ""TLRD" `://////:-.` :///////::///:` " TNRM,
+ ""TLRD" .-/////////:---/////////////: " TNRM,
+ ""TLRD" .-://////////////////////. " TNRM,
+ ""TWHT" yMN+`.-"TLRD"::///////////////-` " TNRM,
+ ""TWHT" .-`:NMMNMs` `..-------..` " TNRM,
+ ""TWHT" MN+/mMMMMMhoooyysshsss " TNRM,
+ ""TWHT" MMM MMMMMMMMMMMMMMyyddMMM+ " TNRM,
+ ""TWHT" MMMM MMMMMMMMMMMMMNdyNMMh` hyhMMM " TNRM,
+ ""TWHT" MMMMMMMMMMMMMMMMyoNNNMMM+. MMMMMMMM " TNRM,
+ ""TWHT" MMNMMMNNMMMMMNM+ mhsMNyyyyMNMMMMsMM " TNRM,
+ " " TNRM
+};
+
+/* 23 */
+const char *frugalware_logo[] =
+{
+ ""TLBL" `++/::-.` " TNRM,
+ ""TLBL" /o+++++++++/::-.` " TNRM,
+ ""TLBL" `o+++++++++++++++o++/::-.` " TNRM,
+ ""TLBL" /+++++++++++++++++++++++oo++/:-.`` " TNRM,
+ ""TLBL" .o+ooooooooooooooooooosssssssso++oo++/:-` " TNRM,
+ ""TLBL" ++osoooooooooooosssssssssssssyyo+++++++o: " TNRM,
+ ""TLBL" -o+ssoooooooooooosssssssssssssyyo+++++++s` " TNRM,
+ ""TLBL" o++ssoooooo++++++++++++++sssyyyyo++++++o: " TNRM,
+ ""TLBL" :o++ssoooooo"TWHT"/-------------"TLBL"+syyyyyo+++++oo " TNRM,
+ ""TLBL" `o+++ssoooooo"TWHT"/-----"TLBL"+++++ooosyyyyyyo++++os: " TNRM,
+ ""TLBL" /o+++ssoooooo"TWHT"/-----"TLBL"ooooooosyyyyyyyo+oooss " TNRM,
+ ""TLBL" .o++++ssooooos"TWHT"/------------"TLBL"syyyyyyhsosssy- " TNRM,
+ ""TLBL" ++++++ssooooss"TWHT"/-----"TLBL"+++++ooyyhhhhhdssssso " TNRM,
+ ""TLBL" -s+++++syssssss"TWHT"/-----"TLBL"yyhhhhhhhhhhhddssssy. " TNRM,
+ ""TLBL" sooooooyhyyyyyh"TWHT"/-----"TLBL"hhhhhhhhhhhddddyssy+ " TNRM,
+ ""TLBL" :yooooooyhyyyhhhyyyyyyhhhhhhhhhhdddddyssy` " TNRM,
+ ""TLBL" yoooooooyhyyhhhhhhhhhhhhhhhhhhhddddddysy/ " TNRM,
+ ""TLBL"-ysooooooydhhhhhhhhhhhddddddddddddddddssy " TNRM,
+ ""TLBL" .-:/+osssyyyysyyyyyyyyyyyyyyyyyyyyyyssy: " TNRM,
+ ""TLBL" ``.-/+oosysssssssssssssssssssssss " TNRM,
+ ""TLBL" ``.:/+osyysssssssssssssh. " TNRM,
+ ""TLBL" `-:/+osyyssssyo",
+ ""TLBL" .-:+++`" TNRM
+};
+
+/* 19 */
+const char *peppermint_logo[] =
+{
+ ""TLRD" 8ZZZZZZ"TWHT"MMMMM " TNRM,
+ ""TLRD" .ZZZZZZZZZ"TWHT"MMMMMMM. " TNRM,
+ ""TWHT" MM"TLRD"ZZZZZZZZZ"TWHT"MMMMMMM"TLRD"ZZZZ " TNRM,
+ ""TWHT" MMMMM"TLRD"ZZZZZZZZ"TWHT"MMMMM"TLRD"ZZZZZZZM " TNRM,
+ ""TWHT" MMMMMMM"TLRD"ZZZZZZZ"TWHT"MMMM"TLRD"ZZZZZZZZZ. " TNRM,
+ ""TWHT" MMMMMMMMM"TLRD"ZZZZZZ"TWHT"MMM"TLRD"ZZZZZZZZZZZI " TNRM,
+ ""TWHT" MMMMMMMMMMM"TLRD"ZZZZZZ"TWHT"MM"TLRD"ZZZZZZZZZZ"TWHT"MMM " TNRM,
+ ""TLRD" .ZZZ"TWHT"MMMMMMMMMM"TLRD"IZZ"TWHT"MM"TLRD"ZZZZZ"TWHT"MMMMMMMMM " TNRM,
+ ""TLRD" ZZZZZZZ"TWHT"MMMMMMMM"TLRD"ZZ"TWHT"M"TLRD"ZZZZ"TWHT"MMMMMMMMMMM " TNRM,
+ ""TLRD" ZZZZZZZZZZZZZZZZ"TWHT"M"TLRD"Z"TWHT"MMMMMMMMMMMMMMM " TNRM,
+ ""TLRD" .ZZZZZZZZZZZZZ"TWHT"MMM"TLRD"Z"TWHT"M"TLRD"ZZZZZZZZZZ"TWHT"MMMM " TNRM,
+ ""TLRD" .ZZZZZZZZZZZ"TWHT"MMM"TLRD"7ZZ"TWHT"MM"TLRD"ZZZZZZZZZZ7"TWHT"M " TNRM,
+ ""TLRD" ZZZZZZZZZ"TWHT"MMMM"TLRD"ZZZZ"TWHT"MMMM"TLRD"ZZZZZZZ77 " TNRM,
+ ""TWHT" MMMMMMMMMMMM"TLRD"ZZZZZ"TWHT"MMMM"TLRD"ZZZZZ77 " TNRM,
+ ""TWHT" MMMMMMMMMM"TLRD"7ZZZZZZ"TWHT"MMMMM"TLRD"ZZ77 " TNRM,
+ ""TWHT" .MMMMMMM"TLRD"ZZZZZZZZ"TWHT"MMMMM"TLRD"Z7Z " TNRM,
+ ""TWHT" MMMMM"TLRD"ZZZZZZZZZ"TWHT"MMMMMMM " TNRM,
+ ""TLRD" NZZZZZZZZZZZ"TWHT"MMMMM " TNRM,
+ ""TLRD" ZZZZZZZZZ"TWHT"MM" TNRM
+};
+
+/* 18 */
+const char *solusos_logo[] =
+{
+ ""TWHT" e e " TNRM,
+ ""TWHT" eee ee " TNRM,
+ ""TWHT" eeee eee " TNRM,
+ ""TDGY" wwwwwwwww"TWHT"eeeeee " TNRM,
+ ""TDGY" wwwwwwwwwwwwwww"TWHT"eee " TNRM,
+ ""TDGY" wwwwwwwwwwwwwwwwwww"TWHT"eeeeeeee " TNRM,
+ ""TDGY" wwwww "TWHT"eeeee"TDGY"wwwwww"TWHT"eeee " TNRM,
+ ""TDGY" www "TWHT"eeee"TDGY"wwwwww"TWHT"e " TNRM,
+ ""TDGY" ww "TWHT"ee"TDGY"wwwwww " TNRM,
+ ""TDGY" w wwwww " TNRM,
+ ""TDGY" wwwww " TNRM,
+ ""TDGY" wwwww " TNRM,
+ ""TDGY" wwwww " TNRM,
+ ""TDGY" wwww " TNRM,
+ ""TDGY" wwww " TNRM,
+ ""TDGY" wwww " TNRM,
+ ""TDGY" www " TNRM,
+ ""TDGY" ww " TNRM
+};
+
+/* 18 */
+const char *mageia_logo[] =
+{
+ ""TLCY" .°°. " TNRM,
+ ""TLCY" °° .°°. " TNRM,
+ ""TLCY" .°°°. °° " TNRM,
+ ""TLCY" . . " TNRM,
+ ""TLCY" °°° .°°°. " TNRM,
+ ""TLCY" .°°°. '___' " TNRM,
+ ""TWHT" ."TLCY"'___' "TWHT" . " TNRM,
+ ""TWHT" :dkxc;'. ..,cxkd; " TNRM,
+ ""TWHT" .dkk. kkkkkkkkkk .kkd. " TNRM,
+ ""TWHT" .dkk. ';cloolc;. .kkd " TNRM,
+ ""TWHT" ckk. .kk; " TNRM,
+ ""TWHT" xO: cOd " TNRM,
+ ""TWHT" xO: lOd " TNRM,
+ ""TWHT" lOO. .OO: " TNRM,
+ ""TWHT" .k00. .00x " TNRM,
+ ""TWHT" .k00; ;00O. " TNRM,
+ ""TWHT" .lO0Kc;,,,,,,;c0KOc. " TNRM,
+ ""TWHT" ;d00KKKKKK00d; " TNRM,
+ ""TWHT" .,KKKK,. " TNRM
+};
+
+/* 18 */
+const char *parabolagnu_linuxlibre_logo[] =
+{
+ " " TNRM,
+ ""TLPR" eeeeeeeee " TNRM,
+ ""TLPR" eeeeeeeeeeeeeee " TNRM,
+ ""TLPR" eeeeee"TWHT"//////////"TLPR"eeeee " TNRM,
+ ""TLPR" eeeee"TWHT"///////////////"TLPR"eeeee " TNRM,
+ ""TLPR" eeeee"TWHT"/// ////"TLPR"eeee " TNRM,
+ ""TLPR" eeee"TWHT"// ///"TLPR"eeeee " TNRM,
+ ""TLPR" eee "TWHT"///"TLPR"eeeee " TNRM,
+ ""TLPR"ee "TWHT"//"TLPR"eeeeee " TNRM,
+ ""TLPR"e "TWHT"/"TLPR"eeeeeee " TNRM,
+ ""TLPR" eeeeeee " TNRM,
+ ""TLPR" eeeeee " TNRM,
+ ""TLPR" eeeeee " TNRM,
+ ""TLPR" eeeee " TNRM,
+ ""TLPR" eeee " TNRM,
+ ""TLPR" eee " TNRM,
+ ""TLPR" ee " TNRM,
+ ""TLPR" e " TNRM
+};
+
+/* 18 */
+const char *viperr_logo[] =
+{
+ ""TWHT" wwzapd dlzazw " TNRM,
+ ""TWHT" an"TDGY"#"TWHT"zncmqzepweeirzpas"TDGY"#"TWHT"xz " TNRM,
+ ""TWHT" apez"TDGY"##"TWHT"qzdkawweemvmzdm"TDGY"##"TWHT"dcmv " TNRM,
+ ""TWHT"zwepd"TDGY"####"TWHT"qzdweewksza"TDGY"####"TWHT"ezqpa " TNRM,
+ ""TWHT"ezqpdkapeifjeeazezqpdkazdkwqz " TNRM,
+ ""TWHT" ezqpdksz"TDGY"##"TWHT"wepuizp"TDGY"##"TWHT"wzeiapdk " TNRM,
+ ""TWHT" zqpakdpa"TDGY"#"TWHT"azwewep"TDGY"#"TWHT"zqpdkqze " TNRM,
+ ""TWHT" apqxalqpewenwazqmzazq " TNRM,
+ ""TWHT" mn"TDGY"##"TWHT"=="TDGY"#######"TWHT"=="TDGY"##"TWHT"qp " TNRM,
+ ""TWHT" qw"TDGY"##"TWHT"="TDGY"#######"TWHT"="TDGY"##"TWHT"zl " TNRM,
+ ""TWHT" z0"TDGY"######"TWHT"="TDGY"######"TWHT"0a " TNRM,
+ ""TWHT" qp"TDGY"#####"TWHT"="TDGY"#####"TWHT"mq " TNRM,
+ ""TWHT" az"TDGY"####"TWHT"==="TDGY"####"TWHT"mn " TNRM,
+ ""TWHT" ap"TDGY"#########"TWHT"qz " TNRM,
+ ""TWHT" 9qlzskwdewz " TNRM,
+ ""TWHT" zqwpakaiw " TNRM,
+ ""TWHT" qoqpe " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *linuxdeepin_logo[] =
+{
+ ""TLGN" eeeeeeeeeeeeeeeeeeeeeeeeeeee " TNRM,
+ ""TLGN" eee eeeeeee eeeeeeee " TNRM,
+ ""TLGN"ee eeeeeeeee eeeeeeeee ee " TNRM,
+ ""TLGN"e eeeeeeeee eeeeeeeee e " TNRM,
+ ""TLGN"e eeeeeee eeeeeeeeee e " TNRM,
+ ""TLGN"e eeeeee eeeee e " TNRM,
+ ""TLGN"e eeeee eee eee e " TNRM,
+ ""TLGN"e eeeee ee eeeeee e " TNRM,
+ ""TLGN"e eeeee eee eee e " TNRM,
+ ""TLGN"e eeeeeeeeee eeee e " TNRM,
+ ""TLGN"e eeeee eeee e " TNRM,
+ ""TLGN"e eeeeee e " TNRM,
+ ""TLGN"e eeeeeee e " TNRM,
+ ""TLGN"e eee eeeeeeee e " TNRM,
+ ""TLGN"eeeeeeeeeeeeeeee e " TNRM,
+ ""TLGN"eeeeeeeeeeeee ee " TNRM,
+ ""TLGN" eeeeeeeeeee eee " TNRM,
+ ""TLGN" eeeeeeeeeeeeeeeeeeeeeeeeeeee " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *chakra_logo[] =
+{
+ ""TLBL" _ _ _ \"kkkkkkkk. " TNRM,
+ ""TLBL" ,kkkkkkkk., \'kkkkkkkkk, " TNRM,
+ ""TLBL" ,kkkkkkkkkkkk., \'kkkkkkkkk. " TNRM,
+ ""TLBL" ,kkkkkkkkkkkkkkkk,\'kkkkkkkk, " TNRM,
+ ""TLBL" ,kkkkkkkkkkkkkkkkkkk\'kkkkkkk. " TNRM,
+ ""TLBL" \"\'\'\"\'\'\',;::,,\"\'\'kkk\'\'kkkkk; __ " TNRM,
+ ""TLBL" ,kkkkkkkkkk, \"k\'\'kkkkk\' ,kkkk " TNRM,
+ ""TLBL" ,kkkkkkk\' ., \' .: \'kkkk\',kkkkkk " TNRM,
+ ""TLBL" ,kkkkkkkk\'.k\' , ,kkkk;kkkkkkkkk " TNRM,
+ ""TLBL" ,kkkkkkkk\';kk \'k \"\'k\',kkkkkkkkkkkk " TNRM,
+ ""TLBL" .kkkkkkkkk.kkkk.\'kkkkkkkkkkkkkkkkkk\' " TNRM,
+ ""TLBL" ;kkkkkkkk\'\'kkkkkk;\'kkkkkkkkkkkkk\'\' " TNRM,
+ ""TLBL" \'kkkkkkk; \'kkkkkkkk.,\"\"\'\'\"\'\'\"\" " TNRM,
+ ""TLBL" \'\'kkkk; \'kkkkkkkkkk., " TNRM,
+ ""TLBL" \';\' \'kkkkkkkkkkkk., " TNRM,
+ ""TLBL" ';kkkkkkkkkk\' " TNRM,
+ ""TLBL" ';kkkkkk\' " TNRM,
+ ""TLBL" \"\'\'\" " TNRM
+};
+
+/* 21 */
+const char *fuduntu_logo[] =
+{
+ ""TDGY" `dwoapfjsod`"TYLW" `dwoapfjsod` " TNRM,
+ ""TDGY" `xdwdsfasdfjaapz`"TYLW" `dwdsfasdfjaapzx` " TNRM,
+ ""TDGY" `wadladfladlafsozmm`"TYLW" `wadladfladlafsozmm` " TNRM,
+ ""TDGY" `aodowpwafjwodisosoaas`"TYLW" `odowpwafjwodisosoaaso` " TNRM,
+ ""TDGY" `adowofaowiefawodpmmxs`"TYLW" `dowofaowiefawodpmmxso` " TNRM,
+ ""TDGY" `asdjafoweiafdoafojffw`"TYLW" `sdjafoweiafdoafojffwq` " TNRM,
+ ""TDGY" `dasdfjalsdfjasdlfjdd`"TYLW" `asdfjalsdfjasdlfjdda` " TNRM,
+ ""TDGY" `dddwdsfasdfjaapzxaw`"TYLW" `ddwdsfasdfjaapzxawo` " TNRM,
+ ""TDGY" `dddwoapfjsowzocmw`"TYLW" `ddwoapfjsowzocmwp` " TNRM,
+ ""TDGY" `ddasowjfowiejao`"TYLW" `dasowjfowiejaow` " TNRM,
+ " " TNRM,
+ ""TLRD" `ddasowjfowiejao`"TWHT" `dasowjfowiejaow` " TNRM,
+ ""TLRD" `dddwoapfjsowzocmw`"TWHT" `ddwoapfjsowzocmwp` " TNRM,
+ ""TLRD" `dddwdsfasdfjaapzxaw`"TWHT" `ddwdsfasdfjaapzxawo` " TNRM,
+ ""TLRD" `dasdfjalsdfjasdlfjdd`"TWHT" `asdfjalsdfjasdlfjdda` " TNRM,
+ ""TLRD" `asdjafoweiafdoafojffw`"TWHT" `sdjafoweiafdoafojffwq` " TNRM,
+ ""TLRD" `adowofaowiefawodpmmxs`"TWHT" `dowofaowiefawodpmmxso` " TNRM,
+ ""TLRD" `aodowpwafjwodisosoaas`"TWHT" `odowpwafjwodisosoaaso` " TNRM,
+ ""TLRD" `wadladfladlafsozmm`"TWHT" `wadladfladlafsozmm` " TNRM,
+ ""TLRD" `dwdsfasdfjaapzx`"TWHT" `dwdsfasdfjaapzx`" TNRM,
+ ""TLRD" `woapfjsod`"TWHT" `woapfjsod`" TNRM
+};
+
+/* 17 */
+const char *macosx_logo[] =
+{
+ "\n"TGRN" -/+:. " TNRM,
+ ""TGRN" :++++. " TNRM,
+ ""TGRN" /+++/. " TNRM,
+ ""TGRN" .:-::- .+/:-``.::- " TNRM,
+ ""TGRN" .:/++++++/::::/++++++/:` " TNRM,
+ ""TBRN" .:///////////////////////:` " TNRM,
+ ""TBRN" ////////////////////////` " TNRM,
+ ""TLRD" -+++++++++++++++++++++++` " TNRM,
+ ""TLRD" /++++++++++++++++++++++/ " TNRM,
+ ""TRED" /sssssssssssssssssssssss. " TNRM,
+ ""TRED" :ssssssssssssssssssssssss- " TNRM,
+ ""TPUR" osssssssssssssssssssssssso/` " TNRM,
+ ""TPUR" `syyyyyyyyyyyyyyyyyyyyyyyy+` " TNRM,
+ ""TBLU" `ossssssssssssssssssssss/ " TNRM,
+ ""TBLU" :ooooooooooooooooooo+. " TNRM,
+ ""TBLU" `:+oo+/:-..-:/+o+/- "TNRM"",
+ " "
+};
+
+/* 17 */
+const char *windows_logo[] =
+{
+ ""TLRD" ,.=:!!t3Z3z., " TNRM,
+ ""TLRD" :tt:::tt333EE3 " TNRM,
+ ""TLRD" Et:::ztt33EEEL"TLGN" @Ee., .., " TNRM,
+ ""TLRD" ;tt:::tt333EE7"TLGN" ;EEEEEEttttt33# " TNRM,
+ ""TLRD" :Et:::zt333EEQ."TLGN" $EEEEEttttt33QL " TNRM,
+ ""TLRD" it::::tt333EEF"TLGN" @EEEEEEttttt33F " TNRM,
+ ""TLRD" ;3=*^```\"*4EEV"TLGN" :EEEEEEttttt33@. " TNRM,
+ ""TLBL" ,.=::::!t=., "TLRD"`"TLGN" @EEEEEEtttz33QF " TNRM,
+ ""TLBL" ;::::::::zt33)"TLGN" \"4EEEtttji3P* " TNRM,
+ ""TLBL" :t::::::::tt33."TYLW":Z3z.."TLGN" ``"TYLW" ,..g. " TNRM,
+ ""TLBL" i::::::::zt33F"TYLW" AEEEtttt::::ztF " TNRM,
+ ""TLBL" ;:::::::::t33V"TYLW" ;EEEttttt::::t3 " TNRM,
+ ""TLBL" E::::::::zt33L"TYLW" @EEEtttt::::z3F " TNRM,
+ ""TLBL"{3=*^```\"*4E3)"TYLW" ;EEEtttt:::::tZ` " TNRM,
+ ""TLBL" `"TYLW" :EEEEtttt::::z7 " TNRM,
+ ""TYLW" \"VEzjt:;;z>*` " TNRM,
+ " "
+};
+
+/* 18 */
+const char *trisquel_logo[] =
+{
+ ""TLBL" ▄▄▄▄▄▄ " TNRM,
+ ""TLBL" ▄█████████▄ " TNRM,
+ ""TLBL" ▄▄▄▄▄▄ ████▀ ▀████ " TNRM,
+ ""TLBL" ▄██████████▄ ████▀ ▄▄ ▀███ " TNRM,
+ ""TLBL" ▄███▀▀ ▀▀████ ███▄ ▄█ ███ " TNRM,
+ ""TLBL" ▄███ ▄▄▄ ████▄ ▀██████ ▄███ " TNRM,
+ ""TLBL" ███ █▀▀██▄ █████▄ ▀▀ ▄████ " TNRM,
+ ""TLBL" ▀███ ███ ███████▄▄ ▄▄██████ " TNRM,
+ ""TLBL" ▀███▄ ▄███ █████████████"TLCY"████▀ " TNRM,
+ ""TLBL" ▀█████████ ███████"TLCY"███▀▀▀ " TNRM,
+ ""TLBL" ▀▀███▀▀ ██"TLCY"████▀▀ " TNRM,
+ ""TLCY" ██████▀ ▄▄▄▄ " TNRM,
+ ""TLCY" █████▀ ████████ " TNRM,
+ ""TLCY" █████ ███▀ ▀███ " TNRM,
+ ""TLCY" ████▄ ██▄▄▄ ███ " TNRM,
+ ""TLCY" █████▄ ▀▀ ▄██ " TNRM,
+ ""TLCY" ██████▄▄▄████ " TNRM,
+ ""TLCY" ▀▀█████▀▀ " TNRM
+};
+
+/* 18 */
+const char *manjaro_logo[] =
+{
+ ""TLGN" ██████████████████ ████████ " TNRM,
+ ""TLGN" ██████████████████ ████████ " TNRM,
+ ""TLGN" ██████████████████ ████████ " TNRM,
+ ""TLGN" ██████████████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ ""TLGN" ████████ ████████ ████████ " TNRM,
+ " " TNRM
+};
+
+/* 18 */
+const char *elementaryos_logo[] =
+{
+ " ",
+ ""TWHT" $?77777$$$IO " TNRM,
+ ""TWHT" $III777ZZZZ$$$ZZ$8 " TNRM,
+ ""TWHT" ZI777 OZZZ$ " TNRM,
+ ""TWHT" Z777 O7ZZO8 " TNRM,
+ ""TWHT" Z777 O$ZZZ8 " TNRM,
+ ""TWHT" I$$ O$ZZZD " TNRM,
+ ""TWHT" 0$$O O$$ZZ " TNRM,
+ ""TWHT" 0$$O 8$$$$ " TNRM,
+ ""TWHT" 0$$O 8$$$$ " TNRM,
+ ""TWHT" $ZZ O$$ZZ D " TNRM,
+ ""TWHT" ZZZ8ZZZZ O88 " TNRM,
+ ""TWHT" DZZZZ8 D888 " TNRM,
+ ""TWHT" ZZZZDMMMMMMMMMMDO888 " TNRM,
+ ""TWHT" ZOOOOOOOOOOOO888 " TNRM,
+ ""TWHT" N8OOOOOOO8D " TNRM,
+ " " TNRM,
+ " " TNRM
+};
+
+/* 20 */
+const char *scientificlinux_logo[] =
+{
+ ""TLBL" =/;;/- " TNRM,
+ ""TLBL" +: // " TNRM,
+ ""TLBL" /; /; " TNRM,
+ ""TLBL" -X H. " TNRM,
+ ""TLBL" .//;;;:;;-, X= :+ .-;:=;:;#;. " TNRM,
+ ""TLBL" M- ,=;;;#:, ,:#;;:=, ,@ " TNRM,
+ ""TLBL" :# :#.=/++++/=.$= #= " TNRM,
+ ""TLBL" ,#; #/:+/;,,/++:+/ ;+. " TNRM,
+ ""TLBL" ,+/. ,;@+, ,#H;, ,/+, " TNRM,
+ ""TLBL" ;+;;/= @. "TLRD".H"TWHT"#"TLRD"#X "TLBL"-X :///+; " TNRM,
+ ""TLBL" ;+=;;;.@, "TWHT".X"TLRD"M"TWHT"@$. "TLBL"=X.//;=#/. " TNRM,
+ ""TLBL" ,;: :@#= =$H: .+#- " TNRM,
+ ""TLBL" ,#= #;-///==///-// =#, " TNRM,
+ ""TLBL" ;+ :#-;;;:;;;;-X- +: " TNRM,
+ ""TLBL" @- .-;;;;M- =M/;;;-. -X " TNRM,
+ ""TLBL" :;;::;;-. #- :+ ,-;;-;:== " TNRM,
+ ""TLBL" ,X H. " TNRM,
+ ""TLBL" ;/ #= " TNRM,
+ ""TLBL" // +; " TNRM,
+ ""TLBL" '////'" TNRM
+};
+
+/* 21 */
+const char *backtracklinux_logo[] =
+{
+ ""TWHT".............. " TNRM,
+ ""TWHT" ..,;:ccc,. " TNRM,
+ ""TWHT" ......''';lxO. " TNRM,
+ ""TWHT".....''''..........,:ld; " TNRM,
+ ""TWHT" .';;;:::;,,.x, " TNRM,
+ ""TWHT" ..'''. 0Xxoc:,. ... " TNRM,
+ ""TWHT" .... ,ONkc;,;cokOdc',. " TNRM,
+ ""TWHT" . OMo ':"TLRD"dd"TWHT"o. " TNRM,
+ ""TWHT" dMc :OO; " TNRM,
+ ""TWHT" 0M. .:o. " TNRM,
+ ""TWHT" ;Wd " TNRM,
+ ""TWHT" ;XO, " TNRM,
+ ""TWHT" ,d0Odlc;,.. " TNRM,
+ ""TWHT" ..',;:cdOOd::,. " TNRM,
+ ""TWHT" .:d;.':;. " TNRM,
+ ""TWHT" 'd, .' " TNRM,
+ ""TWHT" ;l .." TNRM,
+ ""TWHT" .o " TNRM,
+ ""TWHT" c " TNRM,
+ ""TWHT" .' " TNRM,
+ ""TWHT" . " TNRM
+};
+
+/* 21 */
+const char *kalilinux_logo[] =
+{
+ ""TLBL".............. " TNRM,
+ ""TLBL" ..,;:ccc,. " TNRM,
+ ""TLBL" ......''';lxO. " TNRM,
+ ""TLBL".....''''..........,:ld; " TNRM,
+ ""TLBL" .';;;:::;,,.x, " TNRM,
+ ""TLBL" ..'''. 0Xxoc:,. ... " TNRM,
+ ""TLBL" .... ,ONkc;,;cokOdc',. " TNRM,
+ ""TLBL" . OMo ':"TBLK"dd"TLBL"o. " TNRM,
+ ""TLBL" dMc :OO; " TNRM,
+ ""TLBL" 0M. .:o. " TNRM,
+ ""TLBL" ;Wd " TNRM,
+ ""TLBL" ;XO, " TNRM,
+ ""TLBL" ,d0Odlc;,.. " TNRM,
+ ""TLBL" ..',;:cdOOd::,. " TNRM,
+ ""TLBL" .:d;.':;. " TNRM,
+ ""TLBL" 'd, .' " TNRM,
+ ""TLBL" ;l .." TNRM,
+ ""TLBL" .o " TNRM,
+ ""TLBL" c " TNRM,
+ ""TLBL" .' " TNRM,
+ ""TLBL" . " TNRM
+};
+
+/* 18 */
+const char *sabayon_logo[] =
+{
+ ""TLBL" ........... " TNRM,
+ ""TLBL" .. .. " TNRM,
+ ""TLBL" .. .. " TNRM,
+ ""TLBL" .. "TWHT"o "TLBL".. " TNRM,
+ ""TLBL" .. "TWHT":W' "TLBL".. " TNRM,
+ ""TLBL" .. "TWHT".d. "TLBL".. " TNRM,
+ ""TLBL":. "TWHT".KNO "TLBL".: " TNRM,
+ ""TLBL":. "TWHT"cNNN. "TLBL".: " TNRM,
+ ""TLBL": "TWHT"dXXX, "TLBL": " TNRM,
+ ""TLBL": "TWHT". dXXX, .cd, "TLBL": " TNRM,
+ ""TLBL": "TWHT"'kc .. dKKK. ,ll;:' "TLBL": " TNRM,
+ ""TLBL": "TWHT".xkkxc;..dkkkc',cxkkl "TLBL": " TNRM,
+ ""TLBL":. "TWHT".,cdddddddddddddo:. "TLBL".: " TNRM,
+ ""TLBL" .. "TWHT":lllllll: "TLBL".. " TNRM,
+ ""TLBL" .. "TWHT"',,,,, "TLBL".. " TNRM,
+ ""TLBL" .. .. " TNRM,
+ ""TLBL" .. .. " TNRM,
+ ""TLBL" ............... " TNRM
+};
+
+/* 17 */
+const char *android_logo[] =
+{
+ ""TLGN" ▀▄ ▂▂▂▂▂ ▄▀ " TNRM,
+ ""TLGN " ▗▟█████████▙▖ " TNRM,
+ ""TLGN" ▟██▀▀█████▀▀██▙ " TNRM,
+ ""TLGN" ███▄▄█████▄▄███▌ " TNRM,
+ ""TLGN" █████████████████ " TNRM,
+ ""TLGN"▟█▙ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▟█▙" TNRM,
+ ""TLGN"███ █████████████████ ███" TNRM,
+ ""TLGN"███ █████████████████ ███" TNRM,
+ ""TLGN"███ █████████████████ ███" TNRM,
+ ""TLGN"███ █████████████████ ███" TNRM,
+ ""TLGN"███ █████████████████ ███" TNRM,
+ ""TLGN"▜█▛ █████████████████ ▜█▛" TNRM,
+ ""TLGN" ▀███████████████▀ " TNRM,
+ ""TLGN" ████ ████ " TNRM,
+ ""TLGN" ████ ████ " TNRM,
+ ""TLGN" ▜██▛ ▜██▛ " TNRM,
+ " "
+};
+
+/* 18 */
+const char *linux_logo[] =
+{
+ " " TNRM,
+ " " TNRM,
+ " " TNRM,
+ ""TDGY" ##### " TNRM,
+ ""TDGY" ####### " TNRM,
+ ""TDGY" ##"TWHT"O"TDGY"#"TWHT"O"TDGY"## " TNRM,
+ ""TDGY" #"TYLW"#####"TDGY"# " TNRM,
+ ""TDGY" ##"TWHT"##"TYLW"###"TWHT"##"TDGY"## " TNRM,
+ ""TDGY" #"TWHT"##########"TDGY"## " TNRM,
+ ""TDGY" #"TWHT"############"TDGY"## " TNRM,
+ ""TDGY" #"TWHT"############"TDGY"### " TNRM,
+ ""TYLW" ##"TDGY"#"TWHT"###########"TDGY"##"TYLW"# " TNRM,
+ ""TYLW" ######"TDGY"#"TWHT"#######"TDGY"#"TYLW"###### " TNRM,
+ ""TYLW" #######"TDGY"#"TWHT"#####"TDGY"#"TYLW"####### " TNRM,
+ ""TYLW" #####"TDGY"#######"TYLW"##### " TNRM,
+ " " TNRM,
+ " " TNRM,
+ " " TNRM
+};
+
+/* 17 */
+const char *solaris_logo[] =
+{
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"██"TBLU"MMMM$MMMMMMMMMMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"█"TBLU"MMMM"TWHT"██"TBLU"MMMM"TWHT"█"TBLU"MMMMMMMMMMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"████████████"TBLU"MMMMMMMMMMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"██"TBLU"M"TWHT"██████████████"TBLU"MM"TWHT"█"TBLU"MMMMMMMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"████████████████████"TBLU"MMMMMMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"███████████████████"TBLU"MMMMMNMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMM"TWHT"██████████████████████████████"TBLU"MMMM"TNRM,
+ TBLU"MMMMMMMMMMMMMMMMMMMMMMMM"TWHT"█████████████████████████"TBLU"MMMMMM"TNRM,
+ TLBL"======================================================="TNRM,
+ TBLU"MMM"TWHT"###"TBLU"NMMMMM"TWHT"####"TBLU"MMMM"TWHT"##"TBLU"MMMMMM"TWHT"####"TBLU"MMMMM"TWHT"#####"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"###"TBLU"MM"TNRM,
+ TBLU"MM"TWHT"##"TBLU"MMMMMM"TWHT"###"TBLU"MM"TWHT"###"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMM"TWHT"##"TBLU"MMMM"TWHT"###"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"###"TBLU"MMMM"TNRM,
+ TBLU"M"TWHT"##"TBLU"MMMMMMM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMMMMMMMM"TWHT"##"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMMM"TNRM,
+ TBLU"MM"TWHT"####"TBLU"MMM"TWHT"###"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMMM"TWHT"#######"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MMM"TWHT"####"TBLU"MM"TNRM,
+ TBLU"MMMMM"TWHT"###"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MMMMMN"TWHT"##"TBLU"M"TNRM,
+ TBLU"MMMMMM"TWHT"##"TBLU"MM"TWHT"###"TBLU"MM"TWHT"###"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMM"TWHT"###"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MMMMMM"TWHT"##"TBLU"M"TNRM,
+ TBLU"M"TWHT"######"TBLU"MMMMM"TWHT"####"TBLU"MMMM="TWHT"####"TBLU"MM"TWHT"#######"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MM"TWHT"#####"TBLU"MM"TNRM
+};
+
+/* 17 */
+const char *angstrom_logo[] =
+{
+ " ",
+ " ",
+ " ",
+ " ",
+ ".---O---. ",
+ "| | .-. o o ",
+ "| | |-----.-----.-----.| | .----..-----.-----.",
+ "| | | __ | ---'| '--.| .-'| | |",
+ "| | | | | |--- || --'| | | ' | | | |",
+ "'---'---'--'--'--. |-----''----''--' '-----'-'-'-'",
+ " -' | ",
+ " '---' ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
+};
\ No newline at end of file
diff --git a/src/colors.h b/src/colors.h
deleted file mode 100644
index 96c8fae..0000000
--- a/src/colors.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* colors.h
- * Author: William Woodruff
- * -------------
- *
- * Macros for colorified terminal output.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#ifndef SCREENFETCH_C_COLORS_H
-#define SCREENFETCH_C_COLORS_H
-
-#define TNRM "\x1B[0m" /* normal */
-#define TBLK "\x1B[0;30m" /* black */
-#define TRED "\x1B[0;31m" /* red */
-#define TGRN "\x1B[0;32m" /* green */
-#define TBRN "\x1B[0;33m" /* brown */
-#define TBLU "\x1B[0;34m" /* blue */
-#define TPUR "\x1B[0;35m" /* purple */
-#define TCYN "\x1B[0;36m" /* cyan */
-#define TLGY "\x1B[0;37m" /* light gray */
-#define TDGY "\x1B[1;30m" /* dark gray */
-#define TLRD "\x1B[1;31m" /* light red */
-#define TLGN "\x1B[1;32m" /* light green */
-#define TYLW "\x1B[1;33m" /* yellow */
-#define TLBL "\x1B[1;34m" /* light blue */
-#define TLPR "\x1B[1;35m" /* light purple */
-#define TLCY "\x1B[1;36m" /* light cyan */
-#define TWHT "\x1B[1;37m" /* white */
-
-#endif
diff --git a/src/detect.h b/src/detect.h
deleted file mode 100644
index ec39c33..0000000
--- a/src/detect.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* detect.h
- * Author: William Woodruff
- * -------------
- *
- * The detection functions used by screenfetch-c are prototyped here.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#ifndef SCREENFETCH_C_DETECT_H
-#define SCREENFETCH_C_DETECT_H
-
-void detect_distro(char *str1, char *str2);
-/*void detect_arch(char *str);*/
-void detect_host(char *str1, char *str2);
-void detect_kernel(char *str);
-void detect_uptime(char *str);
-void detect_pkgs(char *str, const char *distro_str);
-void detect_cpu(char *str);
-void detect_gpu(char *str);
-void detect_disk(char *str);
-void detect_mem(char *str);
-void detect_shell(char *str);
-void detect_res(char *str);
-void detect_de(char *str);
-void detect_wm(char *str);
-void detect_wm_theme(char *str, const char *wm_str);
-void detect_gtk(char *str1, char *str2, char *str3);
-
-#endif /* SCREENFETCH_C_DETECT_H */
diff --git a/src/disp.c b/src/disp.c
index 744ec40..fba53f7 100644
--- a/src/disp.c
+++ b/src/disp.c
@@ -1,9 +1,10 @@
/* disp.c
* Author: William Woodruff
* -------------
+ * Edited by: Aaron Caffrey (trimmed 816 lines down to 155,
+ * while preserving the same screenfetch-c functionalities)
*
- * Functions used by screenfetch-c for displaying version
- * and help output to the user.
+ * The functions that output the detected data are defined here.
* Like the rest of screenfetch-c, this file is licensed under the MIT license.
*/
@@ -11,449 +12,103 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
+#include <inttypes.h>
/* program includes */
-#include "version.h"
-#include "logos.h"
-#include "colors.h"
#include "misc.h"
-#include "disp.h"
+#include "extern.h"
+#include "prototypes.h"
+#include "structs.h"
-/* display_version
- called if the -V (--version) flag is tripped
-*/
-void display_version(void)
-{
- printf("%s\n", "screenfetch-c - Version " SCREENFETCH_C_VERSION_MAJOR "."
- SCREENFETCH_C_VERSION_MINOR ", revision "
- SCREENFETCH_C_VERSION_RELEASE ".");
- return;
-}
-
-/* display_help
- called if the -h (--help) flag is tripped
-*/
-void display_help(void)
-{
- display_version();
- printf("\n%s\n", "Options:\n"
- " -m, --manual\t\t\t Enter manual mode.\n"
- " -v, --verbose\t\t\t Enable verbosity during output.\n"
- " -s, --screenshot\t\t Take a screenshot.\n"
- " -n, --no-logo\t\t\t Print output without a logo.\n"
- " -D, --distro [DISTRO]\t\t Print output with DISTRO's logo.\n"
- " -E, --suppress-errors\t\t Suppress error output.\n"
- " -p, --portrait\t\t Print output in portrait mode.\n"
- " -V, --version\t\t\t Output screenfetch-c's version and exit.\n"
- " -h, --help\t\t\t Output this help information.\n"
- " -L, --logo-only [DISTRO]\t Output only DISTRO's logo.\n"
- "For more information, consult screenfetch-c's man page.\n");
+#define DETECTED_ARR_LEN 17
- return;
-}
-
-/* display_verbose
- called if the -v (--verbose) flag is tripped
- arguments: char *data[], *data_names[] the system data and names
+/* process_data
+ print the detected and passed distro arguments
*/
-void display_verbose(char *data[], char *data_names[])
-{
- int i = 0;
- for (i = 0; i < 16; i++)
- VERBOSE_OUT(data_names[i], data[i]);
-
- return;
-}
-
-
-void process_logo_only(char *distro[], unsigned short int num)
+void process_data(const char *logo[], uint_fast16_t num, char *colour)
{
- unsigned short int x = 0;
+ uint_fast16_t x = 0;
- for (x = 0; x < num; x++)
- printf("%s\n", distro[x]);
-
- return;
-}
-
-/* output_logo_only
- outputs an ASCII logo based upon the distro name passed to it
- argument char *distro the name of the distro to output
-*/
-void output_logo_only(char *distro)
-{
- if (STREQ(distro, "Windows"))
- {
- process_logo_only(windows_logo, 16);
- }
- else if (strstr(distro, "OS X"))
- {
- process_logo_only(macosx_logo, 16);
- }
- else if (STREQ(distro, "Arch Linux - Old"))
- {
- process_logo_only(oldarch_logo, 18);
- }
- else if (STREQ(distro, "Arch Linux"))
- {
- process_logo_only(arch_logo, 19);
- }
- else if (STREQ(distro, "LinuxMint"))
- {
- process_logo_only(mint_logo, 18);
- }
- else if (STREQ(distro, "LMDE"))
- {
- process_logo_only(lmde_logo, 18);
- }
- else if (STREQ(distro, "Ubuntu") || STREQ(distro, "Lubuntu")
- || STREQ(distro, "Xubuntu"))
- {
- process_logo_only(ubuntu_logo, 18);
- }
- else if (STREQ(distro, "Debian"))
- {
- process_logo_only(debian_logo, 18);
- }
- else if (STREQ(distro, "CrunchBang"))
- {
- process_logo_only(crunchbang_logo, 18);
- }
- else if (STREQ(distro, "Gentoo"))
- {
- process_logo_only(gentoo_logo, 18);
- }
- else if (STREQ(distro, "Funtoo"))
- {
- process_logo_only(funtoo_logo, 18);
- }
- else if (STREQ(distro, "Fedora"))
- {
- process_logo_only(fedora_logo, 18);
- }
- else if (STREQ(distro, "Mandriva") || STREQ(distro, "Mandrake"))
- {
- process_logo_only(mandriva_mandrake_logo, 18);
- }
- else if (STREQ(distro, "OpenSUSE"))
- {
- process_logo_only(opensuse_logo, 18);
- }
- else if (STREQ(distro, "Slackware"))
- {
- process_logo_only(slackware_logo, 21);
- }
- else if (STREQ(distro, "Red Hat Linux"))
- {
- process_logo_only(redhat_logo, 18);
- }
- else if (STREQ(distro, "Frugalware"))
- {
- process_logo_only(frugalware_logo, 23);
- }
- else if (STREQ(distro, "Peppermint"))
- {
- process_logo_only(peppermint_logo, 19);
- }
- else if (STREQ(distro, "SolusOS"))
- {
- process_logo_only(solusos_logo, 18);
- }
- else if (STREQ(distro, "Mageia"))
- {
- process_logo_only(mageia_logo, 18);
- }
- else if (STREQ(distro, "ParabolaGNU/Linux-libre"))
- {
- process_logo_only(parabolagnu_linuxlibre_logo, 18);
- }
- else if (STREQ(distro, "Viperr"))
- {
- process_logo_only(viperr_logo, 18);
- }
- else if (STREQ(distro, "LinuxDeepin"))
- {
- process_logo_only(linuxdeepin_logo, 18);
- }
- else if (STREQ(distro, "Chakra"))
- {
- process_logo_only(chakra_logo, 18);
- }
- else if (STREQ(distro, "Fuduntu"))
- {
- process_logo_only(fuduntu_logo, 21);
- }
- else if (STREQ(distro, "Trisquel"))
- {
- process_logo_only(trisquel_logo, 18);
- }
- else if (STREQ(distro, "Manjaro"))
- {
- process_logo_only(manjaro_logo, 18);
- }
- else if (STREQ(distro, "elementary OS"))
- {
- process_logo_only(elementaryos_logo, 18);
- }
- else if (STREQ(distro, "Scientific Linux"))
- {
- process_logo_only(scientificlinux_logo, 20);
- }
- else if (STREQ(distro, "Backtrack Linux"))
- {
- process_logo_only(backtracklinux_logo, 21);
- }
- else if (STREQ(distro, "Kali Linux"))
- {
- process_logo_only(kalilinux_logo, 21);
- }
- else if (STREQ(distro, "Sabayon"))
- {
- process_logo_only(sabayon_logo, 18);
- }
- else if (STREQ(distro, "FreeBSD"))
- {
- process_logo_only(freebsd_logo, 18);
- }
- else if (STREQ(distro, "OpenBSD"))
- {
- process_logo_only(openbsd_logo, 23);
- }
- else if (STREQ(distro, "NetBSD"))
- {
- process_logo_only(netbsd_logo, 20);
- }
- else if (STREQ(distro, "DragonFly BSD"))
- {
- process_logo_only(dragonflybsd_logo, 18);
- }
- else if (STREQ(distro, "Android"))
- {
- process_logo_only(android_logo, 16);
- }
- else if (STREQ(distro, "Solaris"))
- {
- process_logo_only(solaris_logo, 17);
- }
- else if (STREQ(distro, "Angstrom"))
- {
- process_logo_only(angstrom_logo, 16);
- }
- else /* if (STREQ(distro_str, "Linux")) */
+ if (process_logo_only)
+ for (x = 0; x < num; x++)
+ printf("%s\n", logo[x]);
+ else
{
- process_logo_only(linux_logo, 16);
+ snprintf(host_str, MAX_STRLEN, "%s%s%s%s@%s%s%s%s",
+ colour, UseR, TNRM, TWHT, TNRM, colour, HosT, TNRM);
+
+ for (x = 0; x < num; x++)
+ if (x < DETECTED_ARR_LEN)
+ printf("%s %s%s%s%s%s\n", logo[x], TNRM, colour,
+ _(detected_arr_names[x]), TNRM, _(detected_arr[x]));
+ else
+ printf("%s\n", logo[x]);
}
return;
}
-/* process_data
- handle the detected distro arguments
+/* main_text_output
+ the secondary output for screenfetch-c - all info WITHOUT ASCII art
+ arguments bool verbose
*/
-void process_data(char *data[], char *data_names[], char *logo[], unsigned short int num1, unsigned short int num2, char *col1, char *col2, char *col3)
+void main_text_output(bool verbose)
{
- unsigned short int x = 0;
+ uint_fast16_t i = 0;
+
+ sprintf(host_str, "%s@%s", UseR, HosT);
- if (0 == num2)
- for (x = 0; x < num1; x++)
- printf("%s %s%s%s%s%s%s\n", logo[x], col1, col2, col3,
- data_names[x], TNRM, data[x]);
+ if (verbose)
+ for (i = 0; i < DETECTED_ARR_LEN; i++)
+ VERBOSE_OUT(_(detected_arr_names[i]), _(detected_arr[i]));
else
- for (x = 0; x < num1; x++)
- if (x < num2)
- printf("%s %s%s%s%s%s%s\n", logo[x], col1, col2, col3,
- data_names[x], TNRM, data[x]);
- else
- printf("%s\n", logo[x]);
+ for (i = 0; i < DETECTED_ARR_LEN; i++)
+ printf("%s %s%s\n", _(detected_arr_names[i]), TNRM, _(detected_arr[i]));
return;
}
/* main_ascii_output
the primary output for screenfetch-c
- arguments char *data[], char *data_names[]:
*/
-void main_ascii_output(char *data[], char *data_names[])
+void main_ascii_output(char *passed_distro)
{
- if (strstr(data[1], "Microsoft"))
- {
- process_data(data, data_names, windows_logo, 16, 0, TRED, TWHT, TRED);
- }
- else if (strstr(data[1], "OS X"))
- {
- process_data(data, data_names, macosx_logo, 16, 0, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Arch Linux - Old"))
- {
- process_data(data, data_names, oldarch_logo, 18, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Arch Linux"))
- {
- process_data(data, data_names, arch_logo, 19, 17, TLCY, TNRM, TLCY);
- }
- else if (STREQ(data[1], "LinuxMint"))
- {
- process_data(data, data_names, mint_logo, 18, 16, TLGN, TNRM, TLGN);
- }
- else if (STREQ(data[1], "LMDE"))
- {
- process_data(data, data_names, lmde_logo, 18, 16, TLGN, TNRM, TLGN);
- }
- else if (STREQ(data[1], "Ubuntu") || STREQ(data[1], "Lubuntu")
- || STREQ(data[1], "Xubuntu"))
- {
- process_data(data, data_names, ubuntu_logo, 18, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "Debian"))
- {
- process_data(data, data_names, debian_logo, 18, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "CrunchBang"))
- {
- process_data(data, data_names, crunchbang_logo, 18, 16, TDGY, TNRM, TDGY);
- }
- else if (STREQ(data[1], "Gentoo"))
- {
- process_data(data, data_names, gentoo_logo, 18, 16, TLPR, TNRM, TLPR);
- }
- else if (STREQ(data[1], "Funtoo"))
- {
- process_data(data, data_names, funtoo_logo, 18, 16, TLPR, TNRM, TLPR);
- }
- else if (STREQ(data[1], "Fedora"))
- {
- process_data(data, data_names, fedora_logo, 18, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Mandriva") || STREQ(data[1], "Mandrake"))
- {
- process_data(data, data_names, mandriva_mandrake_logo, 18, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "OpenSUSE"))
- {
- process_data(data, data_names, opensuse_logo, 18, 16, TLGN, TNRM, TLGN);
- }
- else if (STREQ(data[1], "Slackware"))
- {
- process_data(data, data_names, slackware_logo, 21, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Red Hat Linux"))
- {
- process_data(data, data_names, redhat_logo, 18, 16, TRED, TNRM, TRED);
- }
- else if (STREQ(data[1], "Frugalware"))
- {
- process_data(data, data_names, frugalware_logo, 23, 16, TLCY, TNRM, TLCY);
- }
- else if (STREQ(data[1], "Peppermint"))
- {
- process_data(data, data_names, peppermint_logo, 18, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "SolusOS"))
- {
- process_data(data, data_names, solusos_logo, 18, 16, TLGY, TNRM, TLGY);
- }
- else if (STREQ(data[1], "Mageia"))
- {
- process_data(data, data_names, mageia_logo, 18, 16, TLGY, TNRM, TLGY);
- }
- else if (STREQ(data[1], "ParabolaGNU/Linux-libre"))
- {
- process_data(data, data_names, parabolagnu_linuxlibre_logo, 18, 16, TLGY, TLPR, TLGY);
- }
- else if (STREQ(data[1], "Viperr"))
- {
- process_data(data, data_names, viperr_logo, 18, 16, TLGY, TNRM, TLGY);
- }
- else if (STREQ(data[1], "LinuxDeepin"))
- {
- process_data(data, data_names, linuxdeepin_logo, 18, 16, TLGN, TNRM, TLGN);
- }
- else if (STREQ(data[1], "Chakra"))
- {
- process_data(data, data_names, chakra_logo, 18, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Fuduntu"))
- {
- process_data(data, data_names, fuduntu_logo, 21, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "Trisquel"))
- {
- process_data(data, data_names, trisquel_logo, 18, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Manjaro"))
- {
- process_data(data, data_names, manjaro_logo, 18, 16, "", "", "");
- }
- else if (STREQ(data[1], "elementary OS"))
- {
- process_data(data, data_names, elementaryos_logo, 18, 16, TLGN, TNRM, TLGN);
- }
- else if (STREQ(data[1], "Scientific Linux"))
- {
- process_data(data, data_names, scientificlinux_logo, 20, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "Backtrack Linux"))
- {
- process_data(data, data_names, backtracklinux_logo, 21, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "Kali Linux"))
- {
- process_data(data, data_names, backtracklinux_logo, 21, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Sabayon"))
- {
- process_data(data, data_names, sabayon_logo, 18, 16, TLBL, TNRM, TLBL);
- }
- else if (STREQ(data[1], "Android"))
- {
- process_data(data, data_names, android_logo, 16, 12, TLGN, TNRM, TLGN);
- }
- else if (STREQ(data[1], "Angstrom"))
- {
- process_data(data, data_names, angstrom_logo, 16, 0, "", "", "");
- }
- else if (STREQ(data[1], "Linux"))
- {
- process_data(data, data_names, linux_logo, 18, 16, TLGY, TNRM, TLGY);
- }
- else if (STREQ(data[1], "FreeBSD"))
- {
- process_data(data, data_names, freebsd_logo, 18, 16, TLRD, TNRM, TLRD);
- }
- else if (STREQ(data[1], "OpenBSD"))
- {
- process_data(data, data_names, openbsd_logo, 23, 16, "", "", "");
- }
- else if (STREQ(data[1], "NetBSD"))
- {
- process_data(data, data_names, netbsd_logo, 23, 16, "", "", "");
- }
- else if (STREQ(data[1], "DragonFly BSD"))
- {
- process_data(data, data_names, dragonflybsd_logo, 23, 16, "", "", "");
- }
- else if (STREQ(data[1], "SunOS"))
- {
- process_data(data, data_names, solaris_logo, 17, 16, "", "", "");
- }
+ bool distro_match = false;
+ uint_fast16_t x = 0;
+ char distro[MAX_STRLEN];
+
+ process_logo_only = (STREQ(passed_distro, "") ? false : true);
+
+ sprintf(distro, "%s", (STREQ(passed_distro, "") ? detected_arr[1] : passed_distro));
+
+ for (x = 0; x < MAD_DOG_LEN; x++)
+ if (STREQ(distro, opt[x].distro))
+ {
+ distro_match = true;
+ break;
+ }
+
+ if (distro_match)
+ process_data(opt[x].logo, opt[x].len, opt[x].colour);
+
else
{
- ERR_REPORT("Could not find a logo for the distro.");
- }
+ if (strstr(distro, "Microsoft"))
+ process_data(windows_logo, MICROSOFT_LEN, TRED);
- return;
-}
+ else if (strstr(distro, "OS X"))
+ process_data(macosx_logo, MACOSX_LEN, TLBL);
-/* main_text_output
- the secondary output for screenfetch-c - all info WITHOUT ASCII art
- arguments char *data[], char *data_names[]
-*/
-void main_text_output(char *data[], char *data_names[])
-{
- int i;
+ else if (STREQ(distro, "Ubuntu") || STREQ(distro, "Lubuntu")
+ || STREQ(distro, "Xubuntu"))
+ process_data(ubuntu_logo, UBUNTU_LEN, TLRD);
- for (i = 0; i < 16; i++)
- printf("%s %s\n", data_names[i], data[i]);
+ else if (STREQ(distro, "Mandriva") || STREQ(distro, "Mandrake"))
+ process_data(mandriva_mandrake_logo, MANDRAKE_LEN, TLBL);
+
+ else
+ ERR_REPORT(_("Could not find a logo for the distro."));
+ }
return;
-}
+}
\ No newline at end of file
diff --git a/src/disp.h b/src/disp.h
deleted file mode 100644
index 7e4ab13..0000000
--- a/src/disp.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* disp.h
- * Author: William Woodruff
- * -------------
- *
- * Function prototypes for disp.c and macros for error/verbose outut.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- * You should have received a copy of it with this code.
- */
-
-#ifndef SCREENFETCH_C_DISP_H
-#define SCREENFETCH_C_DISP_H
-
-#include "colors.h"
-
-void display_version(void);
-void display_help(void);
-void display_verbose(char *data[], char *data_names[]);
-void process_logo_only(char *distro[], unsigned short int num);
-void output_logo_only(char *distro);
-void process_data(char *data[], char *data_names[], char *logo[], unsigned short int num1, unsigned short int num2, char *col1, char *col2, char *col3);
-void main_ascii_output(char *data[], char *data_names[]);
-void main_text_output(char *data[], char *data_names[]);
-
-#define ERR_REPORT(str) (fprintf(stderr, TWHT "[[ " TLRD "!" TWHT " ]] " TNRM "Error: %s\n", str))
-#define VERBOSE_OUT(str1, str2) (fprintf(stdout, TLRD ":: " TNRM "%s%s\n", str1, str2))
-
-#endif /* SCREENFETCH_C_DISP_H */
diff --git a/src/error_flag.c b/src/error_flag.c
deleted file mode 100644
index 163a4c7..0000000
--- a/src/error_flag.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* error_flag.c
- * Author: William Woodruff
- * -------------
- *
- * screenfetch-c's error flag is initialized in this file.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#include <stdbool.h>
-
-bool error = true;
diff --git a/src/error_flag.h b/src/error_flag.h
deleted file mode 100644
index d87cf6d..0000000
--- a/src/error_flag.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* error_flag.h
- * Author: William Woodruff
- * -------------
- *
- * screenfetch-c's error flag is externalized in this file.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#ifndef SCREENFETCH_C_ERROR_FLAG_H
-#define SCREENFETCH_C_ERROR_FLAG_H
-
-extern bool error;
-
-#endif /* SCREENFETCH_C_ERROR_FLAG_H */
\ No newline at end of file
diff --git a/src/extern.h b/src/extern.h
new file mode 100644
index 0000000..ca01966
--- /dev/null
+++ b/src/extern.h
@@ -0,0 +1,89 @@
+/* extern.h
+ * Authors: William Woodruff and Aaron Caffrey
+ * -------------
+ *
+ * All variables that will be accessed by the screenfetch-c modules are
+ * externalized here, think of them as 'globals'.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+#ifndef SCREENFETCH_C_EXTERN_H
+#define SCREENFETCH_C_EXTERN_H
+
+
+/* flags.c module */
+extern bool error;
+extern bool process_logo_only;
+extern bool verbose;
+extern bool main_logo;
+extern bool screenshot;
+extern bool portrait;
+extern bool break_requested;
+
+
+/* arrays.c module */
+#define MAX_STR 128
+extern char *detected_arr[];
+extern const char *detected_arr_names[];
+extern char host_str[MAX_STR];
+extern char distro_str[MAX_STR];
+extern char kernel_str[MAX_STR];
+extern char uptime_str[MAX_STR];
+extern char pkgs_str[MAX_STR];
+extern char cpu_str[MAX_STR];
+extern char gpu_str[MAX_STR];
+extern char disk_str[MAX_STR];
+extern char mem_str[MAX_STR];
+extern char shell_str[MAX_STR];
+extern char res_str[MAX_STR];
+extern char de_str[MAX_STR];
+extern char wm_str[MAX_STR];
+extern char wm_theme_str[MAX_STR];
+extern char gtk_str[MAX_STR];
+extern char icon_str[MAX_STR];
+extern char font_str[MAX_STR];
+extern char UseR[MAX_STR];
+extern char HosT[MAX_STR];
+extern char given_distro_str[MAX_STR];
+extern const char *oldarch_logo[];
+extern const char *arch_logo[];
+extern const char *mint_logo[];
+extern const char *lmde_logo[];
+extern const char *ubuntu_logo[];
+extern const char *debian_logo[];
+extern const char *crunchbang_logo[];
+extern const char *gentoo_logo[];
+extern const char *funtoo_logo[];
+extern const char *fedora_logo[];
+extern const char *freebsd_logo[];
+extern const char *openbsd_logo[];
+extern const char *dragonflybsd_logo[];
+extern const char *netbsd_logo[];
+extern const char *mandriva_mandrake_logo[];
+extern const char *opensuse_logo[];
+extern const char *slackware_logo[];
+extern const char *redhat_logo[];
+extern const char *frugalware_logo[];
+extern const char *peppermint_logo[];
+extern const char *solusos_logo[];
+extern const char *mageia_logo[];
+extern const char *parabolagnu_linuxlibre_logo[];
+extern const char *viperr_logo[];
+extern const char *linuxdeepin_logo[];
+extern const char *chakra_logo[];
+extern const char *fuduntu_logo[];
+extern const char *macosx_logo[];
+extern const char *windows_logo[];
+extern const char *trisquel_logo[];
+extern const char *manjaro_logo[];
+extern const char *elementaryos_logo[];
+extern const char *scientificlinux_logo[];
+extern const char *backtracklinux_logo[];
+extern const char *kalilinux_logo[];
+extern const char *sabayon_logo[];
+extern const char *android_logo[];
+extern const char *linux_logo[];
+extern const char *solaris_logo[];
+extern const char *angstrom_logo[];
+
+
+#endif /* SCREENFETCH_C_EXTERN_H */
\ No newline at end of file
diff --git a/src/flags.c b/src/flags.c
new file mode 100644
index 0000000..7c21e52
--- /dev/null
+++ b/src/flags.c
@@ -0,0 +1,18 @@
+/* flags.c
+ * Author: William Woodruff
+ * Edited by: Aaron Caffrey
+ * -------------
+ *
+ * screenfetch-c's flags are declared (and initialized) in this file.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+
+#include <stdbool.h>
+
+bool error = true;
+bool process_logo_only;
+bool main_logo = true;
+bool portrait = false;
+bool verbose = false;
+bool screenshot = false;
+bool break_requested = false;
\ No newline at end of file
diff --git a/src/gettext.h b/src/gettext.h
new file mode 100644
index 0000000..74e1a13
--- /dev/null
+++ b/src/gettext.h
@@ -0,0 +1,288 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2014 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+ the gettext() and ngettext() macros. This is an alternative to calling
+ textdomain(), and is useful for libraries. */
+# ifdef DEFAULT_TEXT_DOMAIN
+# undef gettext
+# define gettext(Msgid) \
+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+ <libintl.h>, which chokes if dcgettext is defined as a macro. So include
+ it now, to make later inclusions of <libintl.h> a NOP. */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
+# include <libintl.h>
+# endif
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# undef gettext
+# define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
+# define dcgettext(Domainname, Msgid, Category) \
+ ((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 \
+ ? ((void) (Msgid2), (const char *) (Msgid1)) \
+ : ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
+# undef textdomain
+# define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) \
+ ((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
+# define bind_textdomain_codeset(Domainname, Codeset) \
+ ((void) (Domainname), (const char *) (Codeset))
+
+#endif
+
+/* Prefer gnulib's setlocale override over libintl's setlocale override. */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+/* The separator between msgctxt and msgid in a .mo file. */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
+ short and rarely need to change.
+ The letter 'p' stands for 'particular' or 'special'. */
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ int category)
+{
+ const char *translation = dcgettext (domain, msg_ctxt_id, category);
+ if (translation == msg_ctxt_id)
+ return msgid;
+ else
+ return translation;
+}
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ const char *translation =
+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ if (translation == msg_ctxt_id || translation == msgid_plural)
+ return (n == 1 ? msgid : msgid_plural);
+ else
+ return translation;
+}
+
+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
+ can be arbitrary expressions. But for string literals these macros are
+ less efficient than those above. */
+
+#include <string.h>
+
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+ /* || __STDC_VERSION__ >= 199901L */ )
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcgettext (domain, msg_ctxt_id, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (translation != msg_ctxt_id)
+ return translation;
+ }
+ return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (!(translation == msg_ctxt_id || translation == msgid_plural))
+ return translation;
+ }
+ return (n == 1 ? msgid : msgid_plural);
+}
+
+#endif /* _LIBGETTEXT_H */
\ No newline at end of file
diff --git a/src/logos.c b/src/logos.c
deleted file mode 100644
index c526c56..0000000
--- a/src/logos.c
+++ /dev/null
@@ -1,950 +0,0 @@
-/* logos.c
- * Author: William Woodruff
- * -------------
- *
- * The ASCII logos used by screenfetch-c are initialized in this file.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#include "colors.h"
-
-/* 18 */
-char *oldarch_logo[] =
-{
- ""TWHT" __ " TNRM,
- ""TWHT" _=(SDGJT=_ " TNRM,
- ""TWHT" _GTDJHGGFCVS) " TNRM,
- ""TWHT" ,GTDJGGDTDFBGX0 " TNRM,
- ""TWHT" JDJDIJHRORVFSBSVL"TLBL"-=+=,_ " TNRM,
- ""TWHT" IJFDUFHJNXIXCDXDSV,"TLBL" \"DEBL " TNRM,
- ""TWHT" [LKDSDJTDU=OUSCSBFLD."TLBL" '?ZWX, " TNRM,
- ""TWHT" ,LMDSDSWH' `DCBOSI"TLBL" DRDS], " TNRM,
- ""TWHT" SDDFDFH' !YEWD,"TLBL" )HDROD " TNRM,
- ""TWHT" !KMDOCG &GSU|"TLBL"_GFHRGO' " TNRM,
- ""TWHT" HKLSGP'"TLBL" __"TWHT"TKM0"TLBL"GHRBV)' " TNRM,
- ""TWHT" JSNRVW'"TLBL" __+MNAEC"TWHT"IOI,"TLBL"BN' " TNRM,
- ""TWHT" HELK['"TLBL" __,=OFFXCBGHC"TWHT"FD) " TNRM,
- ""TWHT" ?KGHE "TLBL"_-#DASDFLSV='"TWHT" 'EF " TNRM,
- ""TWHT" 'EHTI !H " TNRM,
- ""TWHT" `0F' '! " TNRM,
- " " TNRM,
- " " TNRM
-};
-
-/* 19 */
-char *arch_logo[] =
-{
- ""TLCY" -` " TNRM,
- ""TLCY" .o+` " TNRM,
- ""TLCY" `ooo/ " TNRM,
- ""TLCY" `+oooo: " TNRM,
- ""TLCY" `+oooooo: " TNRM,
- ""TLCY" -+oooooo+: " TNRM,
- ""TLCY" `/:-:++oooo+: " TNRM,
- ""TLCY" `/++++/+++++++: " TNRM,
- ""TLCY" `/++++++++++++++: " TNRM,
- ""TLCY" `/+++o"TCYN"oooooooo"TLCY"oooo/` " TNRM,
- ""TCYN" "TLCY"./"TCYN"ooosssso++osssssso"TLCY"+` " TNRM,
- ""TCYN" .oossssso-````/ossssss+` " TNRM,
- ""TCYN" -osssssso. :ssssssso. " TNRM,
- ""TCYN" :osssssss/ osssso+++. " TNRM,
- ""TCYN" /ossssssss/ +ssssooo/- " TNRM,
- ""TCYN" `/ossssso+/:- -:/+osssso+- " TNRM,
- ""TCYN" `+sso+:-` `.-/+oso: " TNRM,
- ""TCYN" `++:. `-/+/" TNRM,
- ""TCYN" .` `/" TNRM
-};
-
-/* 18 */
-char *mint_logo[] =
-{
- " " TNRM,
- ""TLGN" MMMMMMMMMMMMMMMMMMMMMMMMMmds+. " TNRM,
- ""TLGN" MMm----::-://////////////oymNMd+` " TNRM,
- ""TLGN" MMd "TWHT"/++ "TLGN"-sNMd: " TNRM,
- ""TLGN" MMNso/` "TWHT"dMM `.::-. .-::.` "TLGN".hMN: " TNRM,
- ""TLGN" ddddMMh "TWHT"dMM :hNMNMNhNMNMNh: "TLGN"`NMm " TNRM,
- ""TLGN" NMm "TWHT"dMM .NMN/-+MMM+-/NMN` "TLGN"dMM " TNRM,
- ""TLGN" NMm "TWHT"dMM -MMm `MMM dMM. "TLGN"dMM " TNRM,
- ""TLGN" NMm "TWHT"dMM -MMm `MMM dMM. "TLGN"dMM " TNRM,
- ""TLGN" NMm "TWHT"dMM .mmd `mmm yMM. "TLGN"dMM " TNRM,
- ""TLGN" NMm "TWHT"dMM` ..` ... ydm. "TLGN"dMM " TNRM,
- ""TLGN" hMM- "TWHT"+MMd/-------...-:sdds "TLGN"dMM " TNRM,
- ""TLGN" -NMm- "TWHT":hNMNNNmdddddddddy/` "TLGN"dMM " TNRM,
- ""TLGN" -dMNs-"TWHT"``-::::-------.`` "TLGN"dMM " TNRM,
- ""TLGN" `/dMNmy+/:-------------:/yMMM " TNRM,
- ""TLGN" ./ydNMMMMMMMMMMMMMMMMMMMMM " TNRM,
- ""TLGN" .MMMMMMMMMMMMMMMMMMM " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *lmde_logo[] =
-{
- " "TWHT"`.-::---.. " TNRM,
- ""TLGN" .:++++ooooosssoo:. " TNRM,
- ""TLGN" .+o++::. `.:oos+. " TNRM,
- ""TLGN" :oo:.` -+oo"TWHT": " TNRM,
- ""TLGN" "TWHT"`"TLGN"+o/` ."TWHT"::::::"TLGN"-. .++-"TWHT"` " TNRM,
- ""TLGN" "TWHT"`"TLGN"/s/ .yyyyyyyyyyo: +o-"TWHT"` " TNRM,
- ""TLGN" "TWHT"`"TLGN"so .ss ohyo` :s-"TWHT": " TNRM,
- ""TLGN" "TWHT"`"TLGN"s/ .ss h m myy/ /s`"TWHT"` " TNRM,
- ""TLGN" `s: `oo s m Myy+-o:` " TNRM,
- ""TLGN" `oo :+sdoohyoydyso/. " TNRM,
- ""TLGN" :o. .:////////++: " TNRM,
- ""TLGN" `/++ "TWHT"-:::::- " TNRM,
- ""TLGN" "TWHT"`"TLGN"++- " TNRM,
- ""TLGN" "TWHT"`"TLGN"/+- " TNRM,
- ""TLGN" "TWHT"."TLGN"+/. " TNRM,
- ""TLGN" "TWHT"."TLGN":+-. " TNRM,
- ""TLGN" `--.`` " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *ubuntu_logo[] =
-{
- ""TLRD" ./+o+- " TNRM,
- ""TWHT" yyyyy- "TLRD"-yyyyyy+ " TNRM,
- ""TWHT" "TWHT"://+//////"TLRD"-yyyyyyo " TNRM,
- ""TYLW" .++ "TWHT".:/++++++/-"TLRD".+sss/` " TNRM,
- ""TYLW" .:++o: "TWHT"/++++++++/:--:/- " TNRM,
- ""TYLW" o:+o+:++."TWHT"`..```.-/oo+++++/ " TNRM,
- ""TYLW" .:+o:+o/."TWHT" `+sssoo+/ " TNRM,
- ""TWHT" .++/+:"TYLW"+oo+o:`"TWHT" /sssooo. " TNRM,
- ""TWHT" /+++//+:"TYLW"`oo+o"TWHT" /::--:. " TNRM,
- ""TWHT" +/+o+++"TYLW"`o++o"TLRD" ++////. " TNRM,
- ""TWHT" .++.o+"TYLW"++oo+:`"TLRD" /dddhhh. " TNRM,
- ""TYLW" .+.o+oo:."TLRD" `oddhhhh+ " TNRM,
- ""TYLW" +.++o+o``-``"TLRD"``.:ohdhhhhh+ " TNRM,
- ""TYLW" `:o+++ "TLRD"`ohhhhhhhhyo++os: " TNRM,
- ""TYLW" .o:"TLRD"`.syhhhhhhh/"TYLW".oo++o` " TNRM,
- ""TLRD" /osyyyyyyo"TYLW"++ooo+++/ " TNRM,
- ""TLRD" ````` "TYLW"+oo+++o: " TNRM,
- ""TYLW" `oo++. " TNRM
-};
-
-/* 18 */
-char *debian_logo[] =
-{
- " "TWHT" _,met$$$$$gg. " TNRM,
- " "TWHT" ,g$$$$$$$$$$$$$$$P. " TNRM,
- " "TWHT" ,g$$P\"\" \"\"\"Y$$.\". " TNRM,
- " "TWHT" ,$$P' `$$$. " TNRM,
- " "TWHT"',$$P ,ggs. `$$b: " TNRM,
- " "TWHT"`d$$' ,$P\"\' "TLRD"."TWHT" $$$ " TNRM,
- " "TWHT" $$P d$\' "TLRD","TWHT" $$P " TNRM,
- " "TWHT" $$: $$. "TLRD"-"TWHT" ,d$$' " TNRM,
- " "TWHT" $$; Y$b._ _,d$P' " TNRM,
- " "TWHT" Y$$. "TLRD"`."TWHT"`\"Y$$$$P\"' " TNRM,
- " "TWHT" `$$b "TLRD"\"-.__ " TNRM,
- " "TWHT" `Y$$ " TNRM,
- " "TWHT" `Y$$. " TNRM,
- " "TWHT" `$$b. " TNRM,
- " "TWHT" `Y$$b. " TNRM,
- " "TWHT" `\"Y$b._ " TNRM,
- " "TWHT" `\"\"\"\" " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *crunchbang_logo[] =
-{
- " "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
- " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
- " "TWHT"████████████████████████████ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TWHT"███ "TWHT"███ "TWHT"███ "TNRM"",
- " "TNRM""
-};
-
-/* 18 */
-char *gentoo_logo[] =
-{
- ""TLPR" -/oyddmdhs+:. " TNRM,
- ""TLPR" -o"TWHT"dNMMMMMMMMNNmhy+"TLPR"-` " TNRM,
- ""TLPR" -y"TWHT"NMMMMMMMMMMMNNNmmdhy"TLPR"+- " TNRM,
- ""TLPR" `o"TWHT"mMMMMMMMMMMMMNmdmmmmddhhy"TLPR"/` " TNRM,
- ""TLPR" om"TWHT"MMMMMMMMMMMN"TLPR"hhyyyo"TWHT"hmdddhhhd"TLPR"o` " TNRM,
- ""TLPR".y"TWHT"dMMMMMMMMMMd"TLPR"hs++so/s"TWHT"mdddhhhhdm"TLPR"+` " TNRM,
- ""TLPR" oy"TWHT"hdmNMMMMMMMN"TLPR"dyooy"TWHT"dmddddhhhhyhN"TLPR"d. " TNRM,
- ""TLPR" :o"TWHT"yhhdNNMMMMMMMNNNmmdddhhhhhyym"TLPR"Mh " TNRM,
- ""TLPR" .:"TWHT"+sydNMMMMMNNNmmmdddhhhhhhmM"TLPR"my " TNRM,
- ""TLPR" /m"TWHT"MMMMMMNNNmmmdddhhhhhmMNh"TLPR"s: " TNRM,
- ""TLPR" `o"TWHT"NMMMMMMMNNNmmmddddhhdmMNhs"TLPR"+` " TNRM,
- ""TLPR" `s"TWHT"NMMMMMMMMNNNmmmdddddmNMmhs"TLPR"/. " TNRM,
- ""TLPR" /N"TWHT"MMMMMMMMNNNNmmmdddmNMNdso"TLPR":` " TNRM,
- ""TLPR"+M"TWHT"MMMMMMNNNNNmmmmdmNMNdso"TLPR"/- " TNRM,
- ""TLPR"yM"TWHT"MNNNNNNNmmmmmNNMmhs+/"TLPR"-` " TNRM,
- ""TLPR"/h"TWHT"MMNNNNNNNNMNdhs++/"TLPR"-` " TNRM,
- ""TLPR"`/"TWHT"ohdmmddhys+++/:"TLPR".` " TNRM,
- ""TLPR" `-//////:--. " TNRM
-};
-
-/* 18 */
-char *funtoo_logo[] =
-{
- " " TNRM,
- " " TNRM,
- " " TNRM,
- " " TNRM,
- TWHT " _______ ____ " TNRM,
- TWHT " /MMMMMMM/ /MMMM| _____ _____ " TNRM,
- TWHT " __/M"TLPR".MMM."TWHT"M/_____________|M"TLPR".M"TWHT"MM|/MMMMM\\/MMMMM\\ " TNRM,
- TWHT "|MMMM"TLPR"MM'"TWHT"MMMMMMMMMMMMMMMMMMM"TLPR"MM"TWHT"MMMM"TLPR".MMMM..MMMM."TWHT"MM\\ " TNRM,
- TWHT "|MM"TLPR"MMMMMMM"TWHT"/m"TLPR"MMMMMMMMMMMMMMMMMMMMMM"TWHT"MMMM"TLPR"MM"TWHT"MMMM"TLPR"MM"TWHT"MM| " TNRM,
- TWHT "|MMMM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MMMMM"TLPR"\\MMM"TWHT"MMM"TLPR"MM"TWHT"MMMM"TLPR"MM"TWHT"MMMM"TLPR"MM"TWHT"MM| " TNRM,
- TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MMM"TWHT"MMMM"TLPR"'MMMM''MMMM'"TWHT"MM/ " TNRM,
- TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MMM"TWHT"MMM\\MMMMM/\\MMMMM/ " TNRM,
- TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MM"TWHT"MMMMMM"TLPR"MM"TWHT"MM"TLPR"MM"TWHT"MM"TLPR"MMMMM'"TWHT"M| " TNRM,
- TWHT " |MM"TLPR"MM"TWHT"MMM"TLPR"MMMMMMMMMMMMMMMMM MM'"TWHT"M/ " TNRM,
- TWHT " |MMMMMMMMMMMMMMMMMMMMMMMMMMMM/ " TNRM,
- " " TNRM,
- " " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *fedora_logo[] =
-{
- ""TLBL" :/------------:// " TNRM,
- ""TLBL" :------------------:// " TNRM,
- ""TLBL" :-----------"TWHT"/shhdhyo/"TLBL"-:// " TNRM,
- ""TLBL" /-----------"TWHT"omMMMNNNMMMd/"TLBL"-:/ " TNRM,
- ""TLBL" :-----------"TWHT"sMMMdo:/"TLBL" -:/ " TNRM,
- ""TLBL" :-----------"TWHT":MMMd"TLBL"------- --:/ " TNRM,
- ""TLBL" /-----------"TWHT":MMMy"TLBL"------- ---/ " TNRM,
- ""TLBL" :------ --"TWHT"/+MMMh/"TLBL"-- ---: " TNRM,
- ""TLBL" :--- "TWHT"oNMMMMMMMMMNho"TLBL" -----: " TNRM,
- ""TLBL" :-- "TWHT"+shhhMMMmhhy++"TLBL" ------: " TNRM,
- ""TLBL" :- -----"TWHT":MMMy"TLBL"--------------/ " TNRM,
- ""TLBL" :- ------"TWHT"/MMMy"TLBL"-------------: " TNRM,
- ""TLBL" :- ----"TWHT"/hMMM+"TLBL"------------: " TNRM,
- ""TLBL" :--"TWHT":dMMNdhhdNMMNo"TLBL"-----------: " TNRM,
- ""TLBL" :---"TWHT":sdNMMMMNds:"TLBL"----------: " TNRM,
- ""TLBL" :------"TWHT":://:"TLBL"-----------:// " TNRM,
- ""TLBL" :--------------------:// " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *freebsd_logo[] =
-{
- " " TNRM,
- " "TWHT"``` "TLRD"` " TNRM,
- " "TWHT"` `.....---..."TLRD"....--.``` -/ " TNRM,
- " "TWHT"+o .--` "TLRD"/y:` +. " TNRM,
- " "TWHT" yo`:. "TLRD":o `+- " TNRM,
- " "TWHT"y/ "TLRD"-/` -o/ " TNRM,
- " "TWHT".- "TLRD"::/sy+:. " TNRM,
- " "TWHT"/ "TLRD"`-- / " TNRM,
- " "TWHT"`: "TLRD":` " TNRM,
- " "TWHT"`: "TLRD":` " TNRM,
- " "TWHT"/ "TLRD"/ " TNRM,
- " "TWHT".- "TLRD"-. " TNRM,
- " "TWHT"-- "TLRD"-. " TNRM,
- " "TWHT"`:` "TLRD"`:` " TNRM,
- " "TLRD".-- `--. " TNRM,
- " "TLRD" .---.....----. " TNRM,
- " " TNRM,
- " " TNRM
-};
-
-/* 23 */
-char *openbsd_logo[] =
-{
- " "TLCY" _ "TNRM"",
- " "TLCY"(_) "TNRM"",
- ""TYLW" | . "TNRM"",
- ""TYLW" . |L /| . "TLCY" _ " TNRM,
- ""TYLW" _ . |\\ _| \\--+._/| . "TLCY"(_) " TNRM,
- ""TYLW" / ||\\| Y J ) / |/| ./ " TNRM,
- ""TYLW" J |)'( | \\` F\\`.'/ "TLCY" _ " TNRM,
- ""TYLW" -<| F __ .-< "TLCY"(_) " TNRM,
- ""TYLW" | / .-'"TLCY". "TYLW"\\`. /"TLCY"-. "TYLW"L___ " TNRM,
- ""TYLW" J \\ < "TLCY"\\ "TYLW" | | "TDGY"O"TLCY"\\\\"TYLW"|.-' "TLCY" _ " TNRM,
- ""TYLW" _J \\ .- \\\\"TLCY"/ "TDGY"O "TLCY"| "TYLW"| \\ |"TYLW"F "TLCY"(_) " TNRM,
- ""TYLW" '-F -<_. \\ .-' \\`-' L__ " TNRM,
- ""TYLW"__J _ _. >-' "TBRN")"TLRD"._. "TYLW"|-' "TNRM,
- ""TYLW" \\`-|.' /_. "TLRD"\\_| "TYLW" F "TNRM,
- ""TYLW" /.- . _.< " TNRM,
- ""TYLW" /' /.' .' \\`\\ " TNRM,
- ""TYLW" /L /' |/ _.-'-\\ "TNRM,
- ""TYLW" /'J ___.---'\\| " TNRM,
- ""TYLW" |\\ .--' V | \\`. \\` "TNRM,
- ""TYLW" |/\\`. \\`-. \\`._) " TNRM,
- ""TYLW" / .-.\\ " TNRM,
- ""TYLW" \\ ( \\`\\ "TNRM"",
- ""TYLW" \\`.\\ "TNRM""
-};
-
-/* 18 */
-char *dragonflybsd_logo[] =
-{
- " "TLRD" | " TNRM,
- " "TLRD" .-. " TNRM,
- " "TYLW" ()"TLRD"I"TYLW"() " TNRM,
- " "TLRD" \"==.__:-:__.==\" " TNRM,
- " "TLRD"\"==.__/~|~\\__.==\" " TNRM,
- " "TLRD"\"==._( Y )_.==\" " TNRM,
- " "TWHT".-'~~\"\"~=--...,__"TLRD"\\/|\\/"TWHT"__,...--=~\"\"~~'-. " TNRM,
- " "TWHT"( ..="TLRD"\\\\="TLRD"/"TWHT"=.. )" TNRM,
- " "TWHT"\\`'-. ,.-\"\\`;"TLRD"/=\\\\"TWHT" ;\"-.,_ .-'\\`" TNRM,
- " "TWHT" \\`~\"-=-~\\` .-~\\` "TLRD"|=|"TWHT" \\`~-. \\`~-=-\"~\\` " TNRM,
- " "TWHT" .-~\\` /"TLRD"|=|"TWHT"\\ \\`~-. " TNRM,
- " "TWHT" .~\\` / "TLRD"|=|"TWHT" \\ \\`~. " TNRM,
- " "TWHT" .-~\\` .' "TLRD"|=|"TWHT" \\\\\\`. \\`~-. " TNRM,
- " "TWHT" (\\` _,.-=\"\\` "TLRD" |=|"TWHT" \\`\"=-.,_ \\`) " TNRM,
- " "TWHT" \\`~\"~\"\\` "TLRD" |=|"TWHT" \\`\"~\"~\\` " TNRM,
- " "TLRD" /=\\ " TNRM,
- " "TLRD" \\=/ " TNRM,
- " "TLRD" ^ " TNRM
-};
-
-/* 20 */
-char *netbsd_logo[] =
-{
- " "TLRD"__,gnnnOCCCCCOObaau,_ " TNRM,
- " "TWHT"_._ "TLRD"__,gnnCCCCCCCCOPF\"'' " TNRM,
- " "TWHT"(N\\\\\\\\"TLRD"XCbngg,._____.,gnnndCCCCCCCCCCCCF\"___,,,,___ " TNRM,
- " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOPYvv. " TNRM,
- " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPF\"'' " TNRM,
- " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCCCCCCOF\"' " TNRM,
- " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCCCCCCOF\"' " TNRM,
- " "TWHT"\\\\N\\\\\\\\"TLRD"XCCCCCCCCCCCCCCCPF\"' " TNRM,
- " "TWHT"\\\\N\\\\\\\\"TLRD"\"PCOCCCOCCFP\"\" " TNRM,
- " "TWHT"\\\\N\\ " TNRM,
- " "TWHT"\\\\N\\ " TNRM,
- " "TWHT"\\\\N\\ " TNRM,
- " "TWHT"\\\\NN\\ " TNRM,
- " "TWHT"\\\\NN\\ " TNRM,
- " "TWHT"\\\\NNA. " TNRM,
- " "TWHT"\\\\NNA, " TNRM,
- " "TWHT"\\\\NNN, " TNRM,
- " "TWHT"\\\\NNN\\ " TNRM,
- " "TWHT"\\\\NNN\\ " TNRM,
- " "TWHT"\\\\NNNA" TNRM
-};
-
-/* 18 */
-char *mandriva_mandrake_logo[] =
-{
- " " TNRM,
- ""TYLW" `` " TNRM,
- ""TYLW" `-. " TNRM,
- ""TLBL" ` "TYLW".--- " TNRM,
- ""TLBL" -/ "TYLW"-::--` " TNRM,
- ""TLBL" `++ "TYLW"`----...```-:::::. " TNRM,
- ""TLBL" `os. "TYLW".::::::::::::::-``` ` ` " TNRM,
- ""TLBL" +s+ "TYLW".::::::::::::::::---...--` " TNRM,
- ""TLBL" -ss: "TYLW"`-::::::::::::::::-.``.`` " TNRM,
- ""TLBL" /ss- "TYLW".::::::::::::-.`` ` " TNRM,
- ""TLBL" +ss: "TYLW".::::::::::::- " TNRM,
- ""TLBL" /sso "TYLW".::::::-::::::- " TNRM,
- ""TLBL" .sss/ "TYLW"-:::-.` .::::: " TNRM,
- ""TLBL" /sss+. "TYLW"..`"TLBL" `--` "TYLW".::: " TNRM,
- ""TLBL" -ossso+/:://+/-` "TYLW".:` " TNRM,
- ""TLBL" -/+ooo+/-. "TYLW"` " TNRM,
- " " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *opensuse_logo[] =
-{
- ""TWHT" .;ldkO0000Okdl;. " TNRM,
- ""TWHT" .;d00xl:,'....';:ok00d;. " TNRM,
- ""TWHT" .d00l' ,o00d. " TNRM,
- ""TWHT" .d0Kd."TLGN" :Okxol:;'. "TWHT":O0d. " TNRM,
- ""TWHT" 'OK"TLGN"KKK0kOKKKKKKKKKKOxo:' "TWHT"lKO' " TNRM,
- ""TWHT" ,0K"TLGN"KKKKKKKKKKKKKKK0d:"TWHT",,,"TLGN":dx:"TWHT" ;00, " TNRM,
- ""TWHT" .OK"TLGN"KKKKKKKKKKKKKKKk."TWHT".oOkdl."TLGN"'0k."TWHT" cKO. " TNRM,
- ""TWHT" :KK"TLGN"KKKKKKKKKKKKKKK: "TWHT"kKx..od "TLGN"lKd"TWHT" .OK: " TNRM,
- ""TWHT" dKK"TLGN"KKKKKKKKKOx0KKKd "TWHT";0KKKO, "TLGN"kKKc"TWHT" dKd " TNRM,
- ""TWHT" dKK"TLGN"KKKKKKKKKK;.;oOKx,.."TWHT"'"TLGN"..;kKKK0."TWHT" dKd " TNRM,
- ""TWHT" :KK"TLGN"KKKKKKKKKK0o;...;cdxxOK0Oxc,. "TWHT".0K: " TNRM,
- ""TWHT" kKK"TLGN"KKKKKKKKKKKKK0xl;'......,cdo "TWHT"lKk " TNRM,
- ""TWHT" '0K"TLGN"KKKKKKKKKKKKKKKKKKKK00KKOo; "TWHT"c00' " TNRM,
- ""TWHT" .kK"TLGN"KKOxddxkOO00000Okxoc;'. "TWHT".dKk. " TNRM,
- ""TWHT" l0Ko. .c00l. " TNRM,
- ""TWHT" .l0Kk:. .;xK0l. " TNRM,
- ""TWHT" ,lkK0xl:;,,,,;:ldO0kl, " TNRM,
- ""TWHT" .':ldxkkkkxdl:'. " TNRM
-};
-
-/* 21 */
-char *slackware_logo[] =
-{
- ""TLBL" :::::::",
- ""TLBL" ::::::::::::::::::: " TNRM,
- ""TLBL" ::::::::::::::::::::::::: " TNRM,
- ""TLBL" ::::::::"TWHT"cllcccccllllllll"TLBL":::::: " TNRM,
- ""TLBL" :::::::::"TWHT"lc dc"TLBL"::::::: " TNRM,
- ""TLBL" ::::::::"TWHT"cl clllccllll oc"TLBL"::::::::: " TNRM,
- ""TLBL" :::::::::"TWHT"o lc"TLBL"::::::::"TWHT"co oc"TLBL":::::::::: " TNRM,
- ""TLBL" ::::::::::"TWHT"o cccclc"TLBL":::::"TWHT"clcc"TLBL":::::::::::: " TNRM,
- ""TLBL" :::::::::::"TWHT"lc cclccclc"TLBL"::::::::::::: " TNRM,
- ""TLBL" ::::::::::::::"TWHT"lcclcc lc"TLBL":::::::::::: " TNRM,
- ""TLBL" ::::::::::"TWHT"cclcc"TLBL":::::"TWHT"lccclc oc"TLBL"::::::::::: " TNRM,
- ""TLBL" ::::::::::"TWHT"o l"TLBL"::::::::::"TWHT"l lc"TLBL"::::::::::: " TNRM,
- ""TLBL" :::::"TWHT"cll"TLBL":"TWHT"o clcllcccll o"TLBL"::::::::::: " TNRM,
- ""TLBL" :::::"TWHT"occ"TLBL":"TWHT"o clc"TLBL"::::::::::: " TNRM,
- ""TLBL" ::::"TWHT"ocl"TLBL":"TWHT"ccslclccclclccclclc"TLBL"::::::::::::: " TNRM,
- ""TLBL" :::"TWHT"oclcccccccccccccllllllllllllll"TLBL"::::: " TNRM,
- ""TLBL" ::"TWHT"lcc1lcccccccccccccccccccccccco"TLBL":::: " TNRM,
- ""TLBL" :::::::::::::::::::::::::::::::: " TNRM,
- ""TLBL" :::::::::::::::::::::::::::: " TNRM,
- ""TLBL" ::::::::::::::::::::::" TNRM,
- ""TLBL" ::::::::::::" TNRM
-};
-
-/* 18 */
-char *redhat_logo[] =
-{
- " " TNRM,
- ""TLRD" `.-..........` " TNRM,
- ""TLRD" `////////::.`-/. " TNRM,
- ""TLRD" -: ....-////////. " TNRM,
- ""TLRD" //:-::///////////` " TNRM,
- ""TLRD" `--::: `-://////////////: " TNRM,
- ""TLRD" //////- ``.-:///////// .` " TNRM,
- ""TLRD" `://////:-.` :///////::///:` " TNRM,
- ""TLRD" .-/////////:---/////////////: " TNRM,
- ""TLRD" .-://////////////////////. " TNRM,
- ""TWHT" yMN+`.-"TLRD"::///////////////-` " TNRM,
- ""TWHT" .-`:NMMNMs` `..-------..` " TNRM,
- ""TWHT" MN+/mMMMMMhoooyysshsss " TNRM,
- ""TWHT" MMM MMMMMMMMMMMMMMyyddMMM+ " TNRM,
- ""TWHT" MMMM MMMMMMMMMMMMMNdyNMMh` hyhMMM " TNRM,
- ""TWHT" MMMMMMMMMMMMMMMMyoNNNMMM+. MMMMMMMM " TNRM,
- ""TWHT" MMNMMMNNMMMMMNM+ mhsMNyyyyMNMMMMsMM " TNRM,
- " " TNRM
-};
-
-/* 23 */
-char *frugalware_logo[] =
-{
- ""TLBL" `++/::-.` " TNRM,
- ""TLBL" /o+++++++++/::-.` " TNRM,
- ""TLBL" `o+++++++++++++++o++/::-.` " TNRM,
- ""TLBL" /+++++++++++++++++++++++oo++/:-.`` " TNRM,
- ""TLBL" .o+ooooooooooooooooooosssssssso++oo++/:-` " TNRM,
- ""TLBL" ++osoooooooooooosssssssssssssyyo+++++++o: " TNRM,
- ""TLBL" -o+ssoooooooooooosssssssssssssyyo+++++++s` " TNRM,
- ""TLBL" o++ssoooooo++++++++++++++sssyyyyo++++++o: " TNRM,
- ""TLBL" :o++ssoooooo"TWHT"/-------------"TLBL"+syyyyyo+++++oo " TNRM,
- ""TLBL" `o+++ssoooooo"TWHT"/-----"TLBL"+++++ooosyyyyyyo++++os: " TNRM,
- ""TLBL" /o+++ssoooooo"TWHT"/-----"TLBL"ooooooosyyyyyyyo+oooss " TNRM,
- ""TLBL" .o++++ssooooos"TWHT"/------------"TLBL"syyyyyyhsosssy- " TNRM,
- ""TLBL" ++++++ssooooss"TWHT"/-----"TLBL"+++++ooyyhhhhhdssssso " TNRM,
- ""TLBL" -s+++++syssssss"TWHT"/-----"TLBL"yyhhhhhhhhhhhddssssy. " TNRM,
- ""TLBL" sooooooyhyyyyyh"TWHT"/-----"TLBL"hhhhhhhhhhhddddyssy+ " TNRM,
- ""TLBL" :yooooooyhyyyhhhyyyyyyhhhhhhhhhhdddddyssy` " TNRM,
- ""TLBL" yoooooooyhyyhhhhhhhhhhhhhhhhhhhddddddysy/ " TNRM,
- ""TLBL"-ysooooooydhhhhhhhhhhhddddddddddddddddssy " TNRM,
- ""TLBL" .-:/+osssyyyysyyyyyyyyyyyyyyyyyyyyyyssy: " TNRM,
- ""TLBL" ``.-/+oosysssssssssssssssssssssss " TNRM,
- ""TLBL" ``.:/+osyysssssssssssssh. " TNRM,
- ""TLBL" `-:/+osyyssssyo",
- ""TLBL" .-:+++`" TNRM
-};
-
-/* 19 */
-char *peppermint_logo[] =
-{
- ""TLRD" 8ZZZZZZ"TWHT"MMMMM " TNRM,
- ""TLRD" .ZZZZZZZZZ"TWHT"MMMMMMM. " TNRM,
- ""TWHT" MM"TLRD"ZZZZZZZZZ"TWHT"MMMMMMM"TLRD"ZZZZ " TNRM,
- ""TWHT" MMMMM"TLRD"ZZZZZZZZ"TWHT"MMMMM"TLRD"ZZZZZZZM " TNRM,
- ""TWHT" MMMMMMM"TLRD"ZZZZZZZ"TWHT"MMMM"TLRD"ZZZZZZZZZ. " TNRM,
- ""TWHT" MMMMMMMMM"TLRD"ZZZZZZ"TWHT"MMM"TLRD"ZZZZZZZZZZZI " TNRM,
- ""TWHT" MMMMMMMMMMM"TLRD"ZZZZZZ"TWHT"MM"TLRD"ZZZZZZZZZZ"TWHT"MMM " TNRM,
- ""TLRD" .ZZZ"TWHT"MMMMMMMMMM"TLRD"IZZ"TWHT"MM"TLRD"ZZZZZ"TWHT"MMMMMMMMM " TNRM,
- ""TLRD" ZZZZZZZ"TWHT"MMMMMMMM"TLRD"ZZ"TWHT"M"TLRD"ZZZZ"TWHT"MMMMMMMMMMM " TNRM,
- ""TLRD" ZZZZZZZZZZZZZZZZ"TWHT"M"TLRD"Z"TWHT"MMMMMMMMMMMMMMM " TNRM,
- ""TLRD" .ZZZZZZZZZZZZZ"TWHT"MMM"TLRD"Z"TWHT"M"TLRD"ZZZZZZZZZZ"TWHT"MMMM " TNRM,
- ""TLRD" .ZZZZZZZZZZZ"TWHT"MMM"TLRD"7ZZ"TWHT"MM"TLRD"ZZZZZZZZZZ7"TWHT"M " TNRM,
- ""TLRD" ZZZZZZZZZ"TWHT"MMMM"TLRD"ZZZZ"TWHT"MMMM"TLRD"ZZZZZZZ77 " TNRM,
- ""TWHT" MMMMMMMMMMMM"TLRD"ZZZZZ"TWHT"MMMM"TLRD"ZZZZZ77 " TNRM,
- ""TWHT" MMMMMMMMMM"TLRD"7ZZZZZZ"TWHT"MMMMM"TLRD"ZZ77 " TNRM,
- ""TWHT" .MMMMMMM"TLRD"ZZZZZZZZ"TWHT"MMMMM"TLRD"Z7Z " TNRM,
- ""TWHT" MMMMM"TLRD"ZZZZZZZZZ"TWHT"MMMMMMM " TNRM,
- ""TLRD" NZZZZZZZZZZZ"TWHT"MMMMM " TNRM,
- ""TLRD" ZZZZZZZZZ"TWHT"MM" TNRM
-};
-
-/* 18 */
-char *solusos_logo[] =
-{
- ""TWHT" e e " TNRM,
- ""TWHT" eee ee " TNRM,
- ""TWHT" eeee eee " TNRM,
- ""TDGY" wwwwwwwww"TWHT"eeeeee " TNRM,
- ""TDGY" wwwwwwwwwwwwwww"TWHT"eee " TNRM,
- ""TDGY" wwwwwwwwwwwwwwwwwww"TWHT"eeeeeeee " TNRM,
- ""TDGY" wwwww "TWHT"eeeee"TDGY"wwwwww"TWHT"eeee " TNRM,
- ""TDGY" www "TWHT"eeee"TDGY"wwwwww"TWHT"e " TNRM,
- ""TDGY" ww "TWHT"ee"TDGY"wwwwww " TNRM,
- ""TDGY" w wwwww " TNRM,
- ""TDGY" wwwww " TNRM,
- ""TDGY" wwwww " TNRM,
- ""TDGY" wwwww " TNRM,
- ""TDGY" wwww " TNRM,
- ""TDGY" wwww " TNRM,
- ""TDGY" wwww " TNRM,
- ""TDGY" www " TNRM,
- ""TDGY" ww " TNRM
-};
-
-/* 18 */
-char *mageia_logo[] =
-{
- ""TLCY" .°°. " TNRM,
- ""TLCY" °° .°°. " TNRM,
- ""TLCY" .°°°. °° " TNRM,
- ""TLCY" . . " TNRM,
- ""TLCY" °°° .°°°. " TNRM,
- ""TLCY" .°°°. '___' " TNRM,
- ""TWHT" ."TLCY"'___' "TWHT" . " TNRM,
- ""TWHT" :dkxc;'. ..,cxkd; " TNRM,
- ""TWHT" .dkk. kkkkkkkkkk .kkd. " TNRM,
- ""TWHT" .dkk. ';cloolc;. .kkd " TNRM,
- ""TWHT" ckk. .kk; " TNRM,
- ""TWHT" xO: cOd " TNRM,
- ""TWHT" xO: lOd " TNRM,
- ""TWHT" lOO. .OO: " TNRM,
- ""TWHT" .k00. .00x " TNRM,
- ""TWHT" .k00; ;00O. " TNRM,
- ""TWHT" .lO0Kc;,,,,,,;c0KOc. " TNRM,
- ""TWHT" ;d00KKKKKK00d; " TNRM,
- ""TWHT" .,KKKK,. " TNRM
-};
-
-/* 18 */
-char *parabolagnu_linuxlibre_logo[] =
-{
- " " TNRM,
- ""TLPR" eeeeeeeee " TNRM,
- ""TLPR" eeeeeeeeeeeeeee " TNRM,
- ""TLPR" eeeeee"TWHT"//////////"TLPR"eeeee " TNRM,
- ""TLPR" eeeee"TWHT"///////////////"TLPR"eeeee " TNRM,
- ""TLPR" eeeee"TWHT"/// ////"TLPR"eeee " TNRM,
- ""TLPR" eeee"TWHT"// ///"TLPR"eeeee " TNRM,
- ""TLPR" eee "TWHT"///"TLPR"eeeee " TNRM,
- ""TLPR"ee "TWHT"//"TLPR"eeeeee " TNRM,
- ""TLPR"e "TWHT"/"TLPR"eeeeeee " TNRM,
- ""TLPR" eeeeeee " TNRM,
- ""TLPR" eeeeee " TNRM,
- ""TLPR" eeeeee " TNRM,
- ""TLPR" eeeee " TNRM,
- ""TLPR" eeee " TNRM,
- ""TLPR" eee " TNRM,
- ""TLPR" ee " TNRM,
- ""TLPR" e " TNRM
-};
-
-/* 18 */
-char *viperr_logo[] =
-{
- ""TWHT" wwzapd dlzazw " TNRM,
- ""TWHT" an"TDGY"#"TWHT"zncmqzepweeirzpas"TDGY"#"TWHT"xz " TNRM,
- ""TWHT" apez"TDGY"##"TWHT"qzdkawweemvmzdm"TDGY"##"TWHT"dcmv " TNRM,
- ""TWHT"zwepd"TDGY"####"TWHT"qzdweewksza"TDGY"####"TWHT"ezqpa " TNRM,
- ""TWHT"ezqpdkapeifjeeazezqpdkazdkwqz " TNRM,
- ""TWHT" ezqpdksz"TDGY"##"TWHT"wepuizp"TDGY"##"TWHT"wzeiapdk " TNRM,
- ""TWHT" zqpakdpa"TDGY"#"TWHT"azwewep"TDGY"#"TWHT"zqpdkqze " TNRM,
- ""TWHT" apqxalqpewenwazqmzazq " TNRM,
- ""TWHT" mn"TDGY"##"TWHT"=="TDGY"#######"TWHT"=="TDGY"##"TWHT"qp " TNRM,
- ""TWHT" qw"TDGY"##"TWHT"="TDGY"#######"TWHT"="TDGY"##"TWHT"zl " TNRM,
- ""TWHT" z0"TDGY"######"TWHT"="TDGY"######"TWHT"0a " TNRM,
- ""TWHT" qp"TDGY"#####"TWHT"="TDGY"#####"TWHT"mq " TNRM,
- ""TWHT" az"TDGY"####"TWHT"==="TDGY"####"TWHT"mn " TNRM,
- ""TWHT" ap"TDGY"#########"TWHT"qz " TNRM,
- ""TWHT" 9qlzskwdewz " TNRM,
- ""TWHT" zqwpakaiw " TNRM,
- ""TWHT" qoqpe " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *linuxdeepin_logo[] =
-{
- ""TLGN" eeeeeeeeeeeeeeeeeeeeeeeeeeee " TNRM,
- ""TLGN" eee eeeeeee eeeeeeee " TNRM,
- ""TLGN"ee eeeeeeeee eeeeeeeee ee " TNRM,
- ""TLGN"e eeeeeeeee eeeeeeeee e " TNRM,
- ""TLGN"e eeeeeee eeeeeeeeee e " TNRM,
- ""TLGN"e eeeeee eeeee e " TNRM,
- ""TLGN"e eeeee eee eee e " TNRM,
- ""TLGN"e eeeee ee eeeeee e " TNRM,
- ""TLGN"e eeeee eee eee e " TNRM,
- ""TLGN"e eeeeeeeeee eeee e " TNRM,
- ""TLGN"e eeeee eeee e " TNRM,
- ""TLGN"e eeeeee e " TNRM,
- ""TLGN"e eeeeeee e " TNRM,
- ""TLGN"e eee eeeeeeee e " TNRM,
- ""TLGN"eeeeeeeeeeeeeeee e " TNRM,
- ""TLGN"eeeeeeeeeeeee ee " TNRM,
- ""TLGN" eeeeeeeeeee eee " TNRM,
- ""TLGN" eeeeeeeeeeeeeeeeeeeeeeeeeeee " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *chakra_logo[] =
-{
- ""TLBL" _ _ _ \"kkkkkkkk. " TNRM,
- ""TLBL" ,kkkkkkkk., \'kkkkkkkkk, " TNRM,
- ""TLBL" ,kkkkkkkkkkkk., \'kkkkkkkkk. " TNRM,
- ""TLBL" ,kkkkkkkkkkkkkkkk,\'kkkkkkkk, " TNRM,
- ""TLBL" ,kkkkkkkkkkkkkkkkkkk\'kkkkkkk. " TNRM,
- ""TLBL" \"\'\'\"\'\'\',;::,,\"\'\'kkk\'\'kkkkk; __ " TNRM,
- ""TLBL" ,kkkkkkkkkk, \"k\'\'kkkkk\' ,kkkk " TNRM,
- ""TLBL" ,kkkkkkk\' ., \' .: \'kkkk\',kkkkkk " TNRM,
- ""TLBL" ,kkkkkkkk\'.k\' , ,kkkk;kkkkkkkkk " TNRM,
- ""TLBL" ,kkkkkkkk\';kk \'k \"\'k\',kkkkkkkkkkkk " TNRM,
- ""TLBL" .kkkkkkkkk.kkkk.\'kkkkkkkkkkkkkkkkkk\' " TNRM,
- ""TLBL" ;kkkkkkkk\'\'kkkkkk;\'kkkkkkkkkkkkk\'\' " TNRM,
- ""TLBL" \'kkkkkkk; \'kkkkkkkk.,\"\"\'\'\"\'\'\"\" " TNRM,
- ""TLBL" \'\'kkkk; \'kkkkkkkkkk., " TNRM,
- ""TLBL" \';\' \'kkkkkkkkkkkk., " TNRM,
- ""TLBL" ';kkkkkkkkkk\' " TNRM,
- ""TLBL" ';kkkkkk\' " TNRM,
- ""TLBL" \"\'\'\" " TNRM
-};
-
-/* 21 */
-char *fuduntu_logo[] =
-{
- ""TDGY" `dwoapfjsod`"TYLW" `dwoapfjsod` " TNRM,
- ""TDGY" `xdwdsfasdfjaapz`"TYLW" `dwdsfasdfjaapzx` " TNRM,
- ""TDGY" `wadladfladlafsozmm`"TYLW" `wadladfladlafsozmm` " TNRM,
- ""TDGY" `aodowpwafjwodisosoaas`"TYLW" `odowpwafjwodisosoaaso` " TNRM,
- ""TDGY" `adowofaowiefawodpmmxs`"TYLW" `dowofaowiefawodpmmxso` " TNRM,
- ""TDGY" `asdjafoweiafdoafojffw`"TYLW" `sdjafoweiafdoafojffwq` " TNRM,
- ""TDGY" `dasdfjalsdfjasdlfjdd`"TYLW" `asdfjalsdfjasdlfjdda` " TNRM,
- ""TDGY" `dddwdsfasdfjaapzxaw`"TYLW" `ddwdsfasdfjaapzxawo` " TNRM,
- ""TDGY" `dddwoapfjsowzocmw`"TYLW" `ddwoapfjsowzocmwp` " TNRM,
- ""TDGY" `ddasowjfowiejao`"TYLW" `dasowjfowiejaow` " TNRM,
- " " TNRM,
- ""TLRD" `ddasowjfowiejao`"TWHT" `dasowjfowiejaow` " TNRM,
- ""TLRD" `dddwoapfjsowzocmw`"TWHT" `ddwoapfjsowzocmwp` " TNRM,
- ""TLRD" `dddwdsfasdfjaapzxaw`"TWHT" `ddwdsfasdfjaapzxawo` " TNRM,
- ""TLRD" `dasdfjalsdfjasdlfjdd`"TWHT" `asdfjalsdfjasdlfjdda` " TNRM,
- ""TLRD" `asdjafoweiafdoafojffw`"TWHT" `sdjafoweiafdoafojffwq` " TNRM,
- ""TLRD" `adowofaowiefawodpmmxs`"TWHT" `dowofaowiefawodpmmxso` " TNRM,
- ""TLRD" `aodowpwafjwodisosoaas`"TWHT" `odowpwafjwodisosoaaso` " TNRM,
- ""TLRD" `wadladfladlafsozmm`"TWHT" `wadladfladlafsozmm` " TNRM,
- ""TLRD" `dwdsfasdfjaapzx`"TWHT" `dwdsfasdfjaapzx`" TNRM,
- ""TLRD" `woapfjsod`"TWHT" `woapfjsod`" TNRM
-};
-
-/* 16 */
-char *macosx_logo[] =
-{
- "\n"TGRN" -/+:. " TNRM,
- ""TGRN" :++++. " TNRM,
- ""TGRN" /+++/. " TNRM,
- ""TGRN" .:-::- .+/:-``.::- " TNRM,
- ""TGRN" .:/++++++/::::/++++++/:` " TNRM,
- ""TBRN" .:///////////////////////:` " TNRM,
- ""TBRN" ////////////////////////` " TNRM,
- ""TLRD" -+++++++++++++++++++++++` " TNRM,
- ""TLRD" /++++++++++++++++++++++/ " TNRM,
- ""TRED" /sssssssssssssssssssssss. " TNRM,
- ""TRED" :ssssssssssssssssssssssss- " TNRM,
- ""TPUR" osssssssssssssssssssssssso/` " TNRM,
- ""TPUR" `syyyyyyyyyyyyyyyyyyyyyyyy+` " TNRM,
- ""TBLU" `ossssssssssssssssssssss/ " TNRM,
- ""TBLU" :ooooooooooooooooooo+. " TNRM,
- ""TBLU" `:+oo+/:-..-:/+o+/- "TNRM"",
-};
-
-/* 16 */
-char *windows_logo[] =
-{
- ""TLRD" ,.=:!!t3Z3z., " TNRM,
- ""TLRD" :tt:::tt333EE3 " TNRM,
- ""TLRD" Et:::ztt33EEEL"TLGN" @Ee., .., " TNRM,
- ""TLRD" ;tt:::tt333EE7"TLGN" ;EEEEEEttttt33# " TNRM,
- ""TLRD" :Et:::zt333EEQ."TLGN" $EEEEEttttt33QL " TNRM,
- ""TLRD" it::::tt333EEF"TLGN" @EEEEEEttttt33F " TNRM,
- ""TLRD" ;3=*^```\"*4EEV"TLGN" :EEEEEEttttt33@. " TNRM,
- ""TLBL" ,.=::::!t=., "TLRD"`"TLGN" @EEEEEEtttz33QF " TNRM,
- ""TLBL" ;::::::::zt33)"TLGN" \"4EEEtttji3P* " TNRM,
- ""TLBL" :t::::::::tt33."TYLW":Z3z.."TLGN" ``"TYLW" ,..g. " TNRM,
- ""TLBL" i::::::::zt33F"TYLW" AEEEtttt::::ztF " TNRM,
- ""TLBL" ;:::::::::t33V"TYLW" ;EEEttttt::::t3 " TNRM,
- ""TLBL" E::::::::zt33L"TYLW" @EEEtttt::::z3F " TNRM,
- ""TLBL"{3=*^```\"*4E3)"TYLW" ;EEEtttt:::::tZ` " TNRM,
- ""TLBL" `"TYLW" :EEEEtttt::::z7 " TNRM,
- ""TYLW" \"VEzjt:;;z>*` " TNRM
-};
-
-/* 18 */
-char *trisquel_logo[] =
-{
- ""TLBL" ▄▄▄▄▄▄ " TNRM,
- ""TLBL" ▄█████████▄ " TNRM,
- ""TLBL" ▄▄▄▄▄▄ ████▀ ▀████ " TNRM,
- ""TLBL" ▄██████████▄ ████▀ ▄▄ ▀███ " TNRM,
- ""TLBL" ▄███▀▀ ▀▀████ ███▄ ▄█ ███ " TNRM,
- ""TLBL" ▄███ ▄▄▄ ████▄ ▀██████ ▄███ " TNRM,
- ""TLBL" ███ █▀▀██▄ █████▄ ▀▀ ▄████ " TNRM,
- ""TLBL" ▀███ ███ ███████▄▄ ▄▄██████ " TNRM,
- ""TLBL" ▀███▄ ▄███ █████████████"TLCY"████▀ " TNRM,
- ""TLBL" ▀█████████ ███████"TLCY"███▀▀▀ " TNRM,
- ""TLBL" ▀▀███▀▀ ██"TLCY"████▀▀ " TNRM,
- ""TLCY" ██████▀ ▄▄▄▄ " TNRM,
- ""TLCY" █████▀ ████████ " TNRM,
- ""TLCY" █████ ███▀ ▀███ " TNRM,
- ""TLCY" ████▄ ██▄▄▄ ███ " TNRM,
- ""TLCY" █████▄ ▀▀ ▄██ " TNRM,
- ""TLCY" ██████▄▄▄████ " TNRM,
- ""TLCY" ▀▀█████▀▀ " TNRM
-};
-
-/* 18 */
-char *manjaro_logo[] =
-{
- ""TLGN" ██████████████████ ████████ " TNRM,
- ""TLGN" ██████████████████ ████████ " TNRM,
- ""TLGN" ██████████████████ ████████ " TNRM,
- ""TLGN" ██████████████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- ""TLGN" ████████ ████████ ████████ " TNRM,
- " " TNRM
-};
-
-/* 18 */
-char *elementaryos_logo[] =
-{
- " ",
- ""TWHT" $?77777$$$IO " TNRM,
- ""TWHT" $III777ZZZZ$$$ZZ$8 " TNRM,
- ""TWHT" ZI777 OZZZ$ " TNRM,
- ""TWHT" Z777 O7ZZO8 " TNRM,
- ""TWHT" Z777 O$ZZZ8 " TNRM,
- ""TWHT" I$$ O$ZZZD " TNRM,
- ""TWHT" 0$$O O$$ZZ " TNRM,
- ""TWHT" 0$$O 8$$$$ " TNRM,
- ""TWHT" 0$$O 8$$$$ " TNRM,
- ""TWHT" $ZZ O$$ZZ D " TNRM,
- ""TWHT" ZZZ8ZZZZ O88 " TNRM,
- ""TWHT" DZZZZ8 D888 " TNRM,
- ""TWHT" ZZZZDMMMMMMMMMMDO888 " TNRM,
- ""TWHT" ZOOOOOOOOOOOO888 " TNRM,
- ""TWHT" N8OOOOOOO8D " TNRM,
- " " TNRM,
- " " TNRM
-};
-
-/* 20 */
-char *scientificlinux_logo[] =
-{
- ""TLBL" =/;;/- " TNRM,
- ""TLBL" +: // " TNRM,
- ""TLBL" /; /; " TNRM,
- ""TLBL" -X H. " TNRM,
- ""TLBL" .//;;;:;;-, X= :+ .-;:=;:;#;. " TNRM,
- ""TLBL" M- ,=;;;#:, ,:#;;:=, ,@ " TNRM,
- ""TLBL" :# :#.=/++++/=.$= #= " TNRM,
- ""TLBL" ,#; #/:+/;,,/++:+/ ;+. " TNRM,
- ""TLBL" ,+/. ,;@+, ,#H;, ,/+, " TNRM,
- ""TLBL" ;+;;/= @. "TLRD".H"TWHT"#"TLRD"#X "TLBL"-X :///+; " TNRM,
- ""TLBL" ;+=;;;.@, "TWHT".X"TLRD"M"TWHT"@$. "TLBL"=X.//;=#/. " TNRM,
- ""TLBL" ,;: :@#= =$H: .+#- " TNRM,
- ""TLBL" ,#= #;-///==///-// =#, " TNRM,
- ""TLBL" ;+ :#-;;;:;;;;-X- +: " TNRM,
- ""TLBL" @- .-;;;;M- =M/;;;-. -X " TNRM,
- ""TLBL" :;;::;;-. #- :+ ,-;;-;:== " TNRM,
- ""TLBL" ,X H. " TNRM,
- ""TLBL" ;/ #= " TNRM,
- ""TLBL" // +; " TNRM,
- ""TLBL" '////'" TNRM
-};
-
-/* 20 */
-char *backtracklinux_logo[] =
-{
- ""TWHT".............. " TNRM,
- ""TWHT" ..,;:ccc,. " TNRM,
- ""TWHT" ......''';lxO. " TNRM,
- ""TWHT".....''''..........,:ld; " TNRM,
- ""TWHT" .';;;:::;,,.x, " TNRM,
- ""TWHT" ..'''. 0Xxoc:,. ... " TNRM,
- ""TWHT" .... ,ONkc;,;cokOdc',. " TNRM,
- ""TWHT" . OMo ':"TLRD"dd"TWHT"o. " TNRM,
- ""TWHT" dMc :OO; " TNRM,
- ""TWHT" 0M. .:o. " TNRM,
- ""TWHT" ;Wd " TNRM,
- ""TWHT" ;XO, " TNRM,
- ""TWHT" ,d0Odlc;,.. " TNRM,
- ""TWHT" ..',;:cdOOd::,. " TNRM,
- ""TWHT" .:d;.':;. " TNRM,
- ""TWHT" 'd, .' " TNRM,
- ""TWHT" ;l .." TNRM,
- ""TWHT" .o " TNRM,
- ""TWHT" c " TNRM,
- ""TWHT" .' " TNRM,
- ""TWHT" . " TNRM
-};
-
-/* 20 */
-char *kalilinux_logo[] =
-{
- ""TLBL".............. " TNRM,
- ""TLBL" ..,;:ccc,. " TNRM,
- ""TLBL" ......''';lxO. " TNRM,
- ""TLBL".....''''..........,:ld; " TNRM,
- ""TLBL" .';;;:::;,,.x, " TNRM,
- ""TLBL" ..'''. 0Xxoc:,. ... " TNRM,
- ""TLBL" .... ,ONkc;,;cokOdc',. " TNRM,
- ""TLBL" . OMo ':"TBLK"dd"TLBL"o. " TNRM,
- ""TLBL" dMc :OO; " TNRM,
- ""TLBL" 0M. .:o. " TNRM,
- ""TLBL" ;Wd " TNRM,
- ""TLBL" ;XO, " TNRM,
- ""TLBL" ,d0Odlc;,.. " TNRM,
- ""TLBL" ..',;:cdOOd::,. " TNRM,
- ""TLBL" .:d;.':;. " TNRM,
- ""TLBL" 'd, .' " TNRM,
- ""TLBL" ;l .." TNRM,
- ""TLBL" .o " TNRM,
- ""TLBL" c " TNRM,
- ""TLBL" .' " TNRM,
- ""TLBL" . " TNRM
-};
-
-/* 18 */
-char *sabayon_logo[] =
-{
- ""TLBL" ........... " TNRM,
- ""TLBL" .. .. " TNRM,
- ""TLBL" .. .. " TNRM,
- ""TLBL" .. "TWHT"o "TLBL".. " TNRM,
- ""TLBL" .. "TWHT":W' "TLBL".. " TNRM,
- ""TLBL" .. "TWHT".d. "TLBL".. " TNRM,
- ""TLBL":. "TWHT".KNO "TLBL".: " TNRM,
- ""TLBL":. "TWHT"cNNN. "TLBL".: " TNRM,
- ""TLBL": "TWHT"dXXX, "TLBL": " TNRM,
- ""TLBL": "TWHT". dXXX, .cd, "TLBL": " TNRM,
- ""TLBL": "TWHT"'kc .. dKKK. ,ll;:' "TLBL": " TNRM,
- ""TLBL": "TWHT".xkkxc;..dkkkc',cxkkl "TLBL": " TNRM,
- ""TLBL":. "TWHT".,cdddddddddddddo:. "TLBL".: " TNRM,
- ""TLBL" .. "TWHT":lllllll: "TLBL".. " TNRM,
- ""TLBL" .. "TWHT"',,,,, "TLBL".. " TNRM,
- ""TLBL" .. .. " TNRM,
- ""TLBL" .. .. " TNRM,
- ""TLBL" ............... " TNRM
-};
-
-/* 16 */
-char *android_logo[] =
-{
- ""TLGN" ▀▄ ▂▂▂▂▂ ▄▀ " TNRM,
- ""TLGN " ▗▟█████████▙▖ " TNRM,
- ""TLGN" ▟██▀▀█████▀▀██▙ " TNRM,
- ""TLGN" ███▄▄█████▄▄███▌ " TNRM,
- ""TLGN" █████████████████ " TNRM,
- ""TLGN"▟█▙ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▟█▙" TNRM,
- ""TLGN"███ █████████████████ ███" TNRM,
- ""TLGN"███ █████████████████ ███" TNRM,
- ""TLGN"███ █████████████████ ███" TNRM,
- ""TLGN"███ █████████████████ ███" TNRM,
- ""TLGN"███ █████████████████ ███" TNRM,
- ""TLGN"▜█▛ █████████████████ ▜█▛" TNRM,
- ""TLGN" ▀███████████████▀ " TNRM,
- ""TLGN" ████ ████ " TNRM,
- ""TLGN" ████ ████ " TNRM,
- ""TLGN" ▜██▛ ▜██▛ " TNRM
-};
-
-/* 18 */
-char *linux_logo[] =
-{
- " " TNRM,
- " " TNRM,
- " " TNRM,
- ""TDGY" ##### " TNRM,
- ""TDGY" ####### " TNRM,
- ""TDGY" ##"TWHT"O"TDGY"#"TWHT"O"TDGY"## " TNRM,
- ""TDGY" #"TYLW"#####"TDGY"# " TNRM,
- ""TDGY" ##"TWHT"##"TYLW"###"TWHT"##"TDGY"## " TNRM,
- ""TDGY" #"TWHT"##########"TDGY"## " TNRM,
- ""TDGY" #"TWHT"############"TDGY"## " TNRM,
- ""TDGY" #"TWHT"############"TDGY"### " TNRM,
- ""TYLW" ##"TDGY"#"TWHT"###########"TDGY"##"TYLW"# " TNRM,
- ""TYLW" ######"TDGY"#"TWHT"#######"TDGY"#"TYLW"###### " TNRM,
- ""TYLW" #######"TDGY"#"TWHT"#####"TDGY"#"TYLW"####### " TNRM,
- ""TYLW" #####"TDGY"#######"TYLW"##### " TNRM,
- " " TNRM,
- " " TNRM,
- " " TNRM
-};
-
-/* 17 */
-char *solaris_logo[] =
-{
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"██"TBLU"MMMM$MMMMMMMMMMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"█"TBLU"MMMM"TWHT"██"TBLU"MMMM"TWHT"█"TBLU"MMMMMMMMMMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"████████████"TBLU"MMMMMMMMMMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"██"TBLU"M"TWHT"██████████████"TBLU"MM"TWHT"█"TBLU"MMMMMMMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"████████████████████"TBLU"MMMMMMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMMMMM"TWHT"███████████████████"TBLU"MMMMMNMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMM"TWHT"██████████████████████████████"TBLU"MMMM"TNRM,
- TBLU"MMMMMMMMMMMMMMMMMMMMMMMM"TWHT"█████████████████████████"TBLU"MMMMMM"TNRM,
- TLBL"======================================================="TNRM,
- TBLU"MMM"TWHT"###"TBLU"NMMMMM"TWHT"####"TBLU"MMMM"TWHT"##"TBLU"MMMMMM"TWHT"####"TBLU"MMMMM"TWHT"#####"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"###"TBLU"MM"TNRM,
- TBLU"MM"TWHT"##"TBLU"MMMMMM"TWHT"###"TBLU"MM"TWHT"###"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMM"TWHT"##"TBLU"MMMM"TWHT"###"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"###"TBLU"MMMM"TNRM,
- TBLU"M"TWHT"##"TBLU"MMMMMMM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMMMMMMMM"TWHT"##"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMMM"TNRM,
- TBLU"MM"TWHT"####"TBLU"MMM"TWHT"###"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMMM"TWHT"#######"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MMM"TWHT"####"TBLU"MM"TNRM,
- TBLU"MMMMM"TWHT"###"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MMMMMN"TWHT"##"TBLU"M"TNRM,
- TBLU"MMMMMM"TWHT"##"TBLU"MM"TWHT"###"TBLU"MM"TWHT"###"TBLU"MM"TWHT"##"TBLU"MMMM"TWHT"##"TBLU"MMM"TWHT"###"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MMMMMM"TWHT"##"TBLU"M"TNRM,
- TBLU"M"TWHT"######"TBLU"MMMMM"TWHT"####"TBLU"MMMM="TWHT"####"TBLU"MM"TWHT"#######"TBLU"MMM"TWHT"##"TBLU"MMMMM"TWHT"##"TBLU"MM"TWHT"#####"TBLU"MM"TNRM
-};
-
-/* 16 */
-char *angstrom_logo[] =
-{
- " ",
- " ",
- " ",
- " ",
- ".---O---. ",
- "| | .-. o o ",
- "| | |-----.-----.-----.| | .----..-----.-----.",
- "| | | __ | ---'| '--.| .-'| | |",
- "| | | | | |--- || --'| | | ' | | | |",
- "'---'---'--'--'--. |-----''----''--' '-----'-'-'-'",
- " -' | ",
- " '---' ",
- " ",
- " ",
- " ",
- " "
-};
diff --git a/src/logos.h b/src/logos.h
deleted file mode 100644
index 356f8a1..0000000
--- a/src/logos.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* logos.h
- * Author: William Woodruff
- * -------------
- *
- * The ASCII logos used by screenfetch-c are externalized in this file.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#ifndef SCREENFETCH_C_LOGOS_H
-#define SCREENFETCH_C_LOGOS_H
-
-extern char *oldarch_logo[];
-extern char *arch_logo[];
-extern char *mint_logo[];
-extern char *lmde_logo[];
-extern char *ubuntu_logo[];
-extern char *debian_logo[];
-extern char *crunchbang_logo[];
-extern char *gentoo_logo[];
-extern char *funtoo_logo[];
-extern char *fedora_logo[];
-extern char *freebsd_logo[];
-extern char *openbsd_logo[];
-extern char *dragonflybsd_logo[];
-extern char *netbsd_logo[];
-extern char *mandriva_mandrake_logo[];
-extern char *opensuse_logo[];
-extern char *slackware_logo[];
-extern char *redhat_logo[];
-extern char *frugalware_logo[];
-extern char *peppermint_logo[];
-extern char *solusos_logo[];
-extern char *mageia_logo[];
-extern char *parabolagnu_linuxlibre_logo[];
-extern char *viperr_logo[];
-extern char *linuxdeepin_logo[];
-extern char *chakra_logo[];
-extern char *fuduntu_logo[];
-extern char *macosx_logo[];
-extern char *windows_logo[];
-extern char *trisquel_logo[];
-extern char *manjaro_logo[];
-extern char *elementaryos_logo[];
-extern char *scientificlinux_logo[];
-extern char *backtracklinux_logo[];
-extern char *kalilinux_logo[];
-extern char *sabayon_logo[];
-extern char *android_logo[];
-extern char *linux_logo[];
-extern char *solaris_logo[];
-extern char *angstrom_logo[];
-
-#endif /* SCREENFETCH_C_LOGOS_H */
diff --git a/src/main.c b/src/main.c
index afac74c..8823127 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,6 @@
/* main.c
* Author: William Woodruff
+ * Edited by: Aaron Caffrey
* -------------
*
* screenfetch-c is a rewrite of screenFetch.sh in C.
@@ -18,223 +19,59 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
-#include <getopt.h>
+#include <inttypes.h>
/* program includes */
-#include "detect.h"
-#include "disp.h"
-#include "logos.h"
-#include "colors.h"
#include "misc.h"
-#include "util.h"
-#include "error_flag.h"
+#include "extern.h"
+#include "prototypes.h"
int main(int argc, char **argv)
{
- char given_distro_str[MAX_STRLEN] = "Unknown";
- char distro_str[MAX_STRLEN] = "Unknown";
- /*char arch_str[MAX_STRLEN] = "Unknown";*/
- char host_str[MAX_STRLEN] = "Unknown";
- char kernel_str[MAX_STRLEN] = "Unknown";
- char uptime_str[MAX_STRLEN] = "Unknown";
- char pkgs_str[MAX_STRLEN] = "Unknown";
- char cpu_str[MAX_STRLEN] = "Unknown";
- char gpu_str[MAX_STRLEN] = "Unknown";
- char disk_str[MAX_STRLEN] = "Unknown";
- char mem_str[MAX_STRLEN] = "Unknown";
- char shell_str[MAX_STRLEN] = "Unknown";
- char res_str[MAX_STRLEN] = "Unknown";
- char de_str[MAX_STRLEN] = "Unknown";
- char wm_str[MAX_STRLEN] = "Unknown";
- char wm_theme_str[MAX_STRLEN] = "Unknown";
- char gtk_str[MAX_STRLEN] = "Unknown";
- char icon_str[MAX_STRLEN] = "Unknown";
- char font_str[MAX_STRLEN] = "Unknown";
+ setlocale(LC_ALL, "");
+ textdomain(GETTEXT_PACKAGE);
+ bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
- char host_colour[10];
+ if (argc > 1)
+ Init_parseR(argc, argv);
- char *detected_arr[17] =
+ if (!break_requested)
{
- host_str,
- distro_str,
- kernel_str,
- cpu_str,
- gpu_str,
- shell_str,
- pkgs_str,
- disk_str,
- mem_str,
- uptime_str,
- res_str,
- de_str,
- wm_str,
- wm_theme_str,
- gtk_str,
- icon_str,
- font_str
- };
-
- char *detected_arr_names[17] =
- {
- "",
- "OS: ",
- "Kernel: ",
- "CPU: ",
- "GPU: ",
- "Shell: ",
- "Packages: ",
- "Disk: ",
- "Memory: ",
- "Uptime: ",
- "Resolution: ",
- "DE: ",
- "WM: ",
- "WM Theme: ",
- "GTK: ",
- "Icon Theme: ",
- "Font: "
- };
-
- bool manual = false, logo = true, portrait = false;
- bool verbose = false, screenshot = false;
-
- struct option options[] =
- {
- { "manual", no_argument, 0, 'm' },
- { "verbose", no_argument, 0, 'v' },
- { "no-logo", no_argument, 0, 'n' },
- { "screenshot", no_argument, 0, 's' },
- { "distro", required_argument, 0, 'D' },
- { "suppress-errors", no_argument, 0, 'E' },
- { "portrait", no_argument, 0, 'p'},
- { "version", no_argument, 0, 'V' },
- { "help", no_argument, 0, 'h' },
- { "logo-only", required_argument, 0, 'L' },
- { 0, 0, 0, 0 }
- };
-
- signed char c;
- int index = 0;
- while ((c = getopt_long(argc, argv, "mvnsD:EpVhL:", options, &index)) != -1)
- {
- switch (c)
+ detect_distro();
+ detect_host();
+ detect_kernel();
+ detect_uptime();
+ detect_pkgs();
+ detect_cpu();
+ detect_gpu();
+ detect_disk();
+ detect_mem();
+ detect_shell();
+ detect_res();
+ detect_de();
+ detect_wm();
+ detect_wm_theme();
+ detect_gtk();
+
+ if (!STREQ(given_distro_str, "Unknown"))
+ safe_strncpy(distro_str, given_distro_str, MAX_STRLEN);
+
+ if (verbose)
+ main_text_output(true);
+
+ if (portrait)
{
- case 'm':
- manual = true;
- break;
- case 'v':
- verbose = true;
- break;
- case 'n':
- logo = false;
- break;
- case 's':
- screenshot = true;
- break;
- case 'D':
- SET_GIVEN_DISTRO(optarg);
- break;
- case 'E':
- error = false;
- break;
- case 'p':
- portrait = true;
- break;
- case 'V':
- display_version();
- return EXIT_SUCCESS;
- case 'h':
- display_help();
- return EXIT_SUCCESS;
- case 'L':
- output_logo_only(optarg);
- return EXIT_SUCCESS;
- default:
- return EXIT_FAILURE;
+ main_ascii_output(distro_str);
+ main_text_output(false);
}
- }
-
- if (manual) /* triggered by -m (--manual) flag */
- {
- int stat = manual_input(detected_arr, verbose);
-
- if (stat == EXIT_SUCCESS)
- {
- /* these sections are ALWAYS detected */
- detect_uptime(uptime_str);
- detect_pkgs(pkgs_str, distro_str);
- detect_disk(disk_str);
- detect_mem(mem_str);
+ else if (main_logo)
+ main_ascii_output("");
+ else
+ main_text_output(false);
- /* if the user specifies an asterisk, fill the data in for them */
- if (STREQ(distro_str, "*"))
- detect_distro(distro_str, host_colour);
- /*if (STREQ(arch_str, "*"))
- detect_arch(arch_str);*/
- if (STREQ(host_str, "*"))
- detect_host(host_str, host_colour);
- if (STREQ(kernel_str, "*"))
- detect_kernel(kernel_str);
- if (STREQ(cpu_str, "*"))
- detect_cpu(cpu_str);
- if (STREQ(gpu_str, "*"))
- detect_gpu(gpu_str);
- if (STREQ(shell_str, "*"))
- detect_shell(shell_str);
- if (STREQ(res_str, "*"))
- detect_res(res_str);
- if (STREQ(de_str, "*"))
- detect_de(de_str);
- if (STREQ(wm_str, "*"))
- detect_wm(wm_str);
- if (STREQ(wm_theme_str, "*"))
- detect_wm_theme(wm_theme_str, wm_str);
- if (STREQ(gtk_str, "*"))
- detect_gtk(gtk_str, icon_str, font_str);
- }
-
- else /* if the user decided to leave manual mode without input */
- return EXIT_SUCCESS;
- }
- else /* each string is filled by its respective function */
- {
- detect_distro(distro_str, host_colour);
- /*detect_arch(arch_str);*/
- detect_host(host_str, host_colour);
- detect_kernel(kernel_str);
- detect_uptime(uptime_str);
- detect_pkgs(pkgs_str, distro_str);
- detect_cpu(cpu_str);
- detect_gpu(gpu_str);
- detect_disk(disk_str);
- detect_mem(mem_str);
- detect_shell(shell_str);
- detect_res(res_str);
- detect_de(de_str);
- detect_wm(wm_str);
- detect_wm_theme(wm_theme_str, wm_str);
- detect_gtk(gtk_str, icon_str, font_str);
+ if (screenshot)
+ take_screenshot();
}
-
- /* if the user specified a different OS to display, set distro_set to it */
- if (!STREQ(given_distro_str, "Unknown"))
- safe_strncpy(distro_str, given_distro_str, MAX_STRLEN);
-
- if (verbose)
- display_verbose(detected_arr, detected_arr_names);
-
- if (portrait)
- {
- output_logo_only(distro_str);
- main_text_output(detected_arr, detected_arr_names);
- }
- else if (logo)
- main_ascii_output(detected_arr, detected_arr_names);
- else
- main_text_output(detected_arr, detected_arr_names);
-
- if (screenshot)
- take_screenshot(verbose);
-
return EXIT_SUCCESS;
-}
+}
\ No newline at end of file
diff --git a/src/misc.h b/src/misc.h
index ac394d1..cabe98a 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -1,5 +1,5 @@
/* misc.h
- * Author: William Woodruff
+ * Authors: William Woodruff and Aaron Caffrey
*
* Miscellaneous macros used in screenfetch-c.
* Like the rest of screenfetch-c, this file is licensed under the MIT license.
@@ -8,6 +8,7 @@
#ifndef SCREENFETCH_C_MISC_H
#define SCREENFETCH_C_MISC_H
+
#define KB (1024)
#define MB (KB * KB)
#define GB (MB * KB)
@@ -16,4 +17,47 @@
#define STREQ(x, y) (!strcmp(x, y))
#define FILE_EXISTS(file) (!access(file, F_OK))
-#endif /* SCREENFETCH_C_MISC_H */
+/* two-dimensional arrays only */
+#define ARR_LEN(array) (sizeof(array) / 16)
+
+
+/* Text and logo colorization constants */
+#define TNRM "\x1B[0;0m" /* normal */
+#define TBLK "\x1B[0;30m" /* black */
+#define TRED "\x1B[0;31m" /* red */
+#define TGRN "\x1B[0;32m" /* green */
+#define TBRN "\x1B[0;33m" /* brown */
+#define TBLU "\x1B[0;34m" /* blue */
+#define TPUR "\x1B[0;35m" /* purple */
+#define TCYN "\x1B[0;36m" /* cyan */
+#define TLGY "\x1B[0;37m" /* light gray */
+#define TDGY "\x1B[1;30m" /* dark gray */
+#define TLRD "\x1B[1;31m" /* light red */
+#define TLGN "\x1B[1;32m" /* light green */
+#define TYLW "\x1B[1;33m" /* yellow */
+#define TLBL "\x1B[1;34m" /* light blue */
+#define TLPR "\x1B[1;35m" /* light purple */
+#define TLCY "\x1B[1;36m" /* light cyan */
+#define TWHT "\x1B[1;37m" /* white */
+
+
+/* internationalization macros */
+#include "config.h" /* Auto generated from configure */
+#ifdef _LIBC
+# include <libintl.h>
+# undef dgettext
+# define dgettext(domain, msgid) \
+ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
+#else
+# include "gettext.h"
+#endif
+#define N_(msgid) msgid
+#define _(str) gettext(str)
+
+
+/* feedback */
+#define ERR_REPORT(str) (fprintf(stderr, TWHT "[[ " TLRD "!" TWHT " ]] " TNRM "%s: %s\n", _("Error"), str))
+#define VERBOSE_OUT(str1, str2) (fprintf(stdout, TLRD ":: " TNRM "%s%s\n", str1, str2))
+
+
+#endif /* SCREENFETCH_C_MISC_H */
\ No newline at end of file
diff --git a/src/parser.c b/src/parser.c
new file mode 100644
index 0000000..6046a0e
--- /dev/null
+++ b/src/parser.c
@@ -0,0 +1,70 @@
+/* parser.c
+ * Authors: William Woodruff and Aaron Caffrey
+ * -------------
+ *
+ * The primary argument(s) parser in screenfetch-c.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+
+#include <argp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <inttypes.h>
+
+#include "misc.h"
+#include "extern.h"
+#include "prototypes.h"
+
+
+const char *argp_program_version = "screenfetch-c "PROG_VERSION;
+const char *argp_program_bug_address = "https://github.com/woodruffw/screenfetch-c ";
+static const char doc[] = N_("Display computer information and an ASCII logo");
+
+static const struct argp_option options[] =
+{
+ { .doc = N_("Main operation mode:") },
+ { .name = "verbose", .key = 'v', .doc = N_("Enable verbosity during output.") },
+ { .name = "screenshot", .key = 's', .doc = N_("Take a screenshot.") },
+ { .name = "suppress-errors", .key = 'E', .doc = N_("Suppress error output.") },
+ { .name = "portrait", .key = 'p', .doc = N_("Print output in portrait mode.") },
+ { .name = "logo-only", .key = 'L', .arg = "DISTRO", .doc = N_("Output only DISTRO's logo.") },
+ { .name = "distro", .key = 'D', .arg = "DISTRO", .doc = N_("Print output with DISTRO's logo.") },
+ { .name = "no-logo", .key = 'n', .doc = N_("Print output without a logo.") },
+ { .doc = NULL }
+
+};
+
+/* The parsing state structure is pretty much overkiller for this program */
+static error_t parse_opt(int key, char *arg, struct argp_state *state)
+{
+ switch(key)
+ {
+ case 'v': verbose = true;
+ break;
+ case 'n': main_logo = false;
+ break;
+ case 's': screenshot = true;
+ break;
+ case 'D': SET_GIVEN_DISTRO(arg);
+ break;
+ case 'E': error = false;
+ break;
+ case 'p': portrait = true;
+ break;
+ case 'L': break_requested = true;
+ main_ascii_output(arg);
+ break;
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+ return EXIT_SUCCESS;
+}
+
+void Init_parseR(int argc, char **argv)
+{
+ static const struct argp arg_parser = { .parser = parse_opt, .options = options, .doc = doc };
+
+ argp_parse(&arg_parser, argc, argv, ARGP_IN_ORDER, NULL, NULL);
+}
\ No newline at end of file
diff --git a/src/plat/bsd/detect.c b/src/plat/bsd/detect.c
index 65c8ee2..ecd6649 100644
--- a/src/plat/bsd/detect.c
+++ b/src/plat/bsd/detect.c
@@ -1,5 +1,6 @@
/* detect.c
* Author: William Woodruff
+ * Edited by: Aaron Caffrey
* -------------
*
* The detection functions used by screenfetch-c on *BSD are implemented here.
@@ -12,7 +13,7 @@
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
-#include <getopt.h>
+#include <inttypes.h>
/* BSD-specific includes */
#include <sys/statvfs.h>
@@ -28,87 +29,65 @@
/* program includes */
#include "../../misc.h"
-#include "../../disp.h"
-#include "../../util.h"
-#include "../../error_flag.h"
+#include "../../extern.h"
+#include "../../prototypes.h"
/* detect_distro
detects the computer's distribution
- argument char *str: the char array to be filled with the distro name
*/
-void detect_distro(char *str)
+void detect_distro(void)
{
struct utsname distro_info;
uname(&distro_info);
- snprintf(str, MAX_STRLEN, "%s", distro_info.sysname);
-
- return;
-}
-
-/* detect_arch
- detects the computer's architecture
- argument char *str: the char array to be filled with the architecture
-*/
-void detect_arch(char *str)
-{
- struct utsname arch_info;
-
- uname(&arch_info);
- safe_strncpy(str, arch_info.machine, MAX_STRLEN);
+ snprintf(host_str, MAX_STRLEN, "%s", distro_info.sysname);
return;
}
/* detect_host
detects the computer's hostname and active user and formats them
- argument char *str: the char array to be filled with the host info
*/
-void detect_host(char *str)
+void detect_host(void)
{
char *given_user = "Unknown";
char given_host[MAX_STRLEN] = "Unknown";
struct utsname host_info;
given_user = getlogin();
-
uname(&host_info);
safe_strncpy(given_host, host_info.nodename, MAX_STRLEN);
- snprintf(str, MAX_STRLEN, "%s@%s", given_user, given_host);
+ snprintf(UseR, MAX_STRLEN, "%s", given_user);
+ snprintf(HosT, MAX_STRLEN, "%s", given_host);
return;
}
/* detect_kernel
detects the computer's kernel
- argument char *str: the char array to be filled with the kernel name
*/
-void detect_kernel(char *str)
+void detect_kernel(void)
{
struct utsname kern_info;
uname(&kern_info);
- snprintf(str, MAX_STRLEN, "%s", kern_info.release);
+ snprintf(kernel_str, MAX_STRLEN, "%s", kern_info.release);
return;
}
/* detect_uptime
detects the computer's uptime
- argument char *str: the char array to be filled with the uptime
*/
-void detect_uptime(char *str)
+void detect_uptime(void)
{
long uptime = 0;
#if !defined(__NetBSD__)
long currtime = 0, boottime = 0;
#endif
FILE *uptime_file;
- int secs = 0;
- int mins = 0;
- int hrs = 0;
- int days = 0;
+ uint_least32_t secs = 0, mins = 0, hrs = 0, days = 0;
#if defined(__NetBSD__)
uptime_file = popen("cut -d ' ' -f 1 < /proc/uptime", "r");
@@ -136,20 +115,23 @@ void detect_uptime(char *str)
split_uptime(uptime, &secs, &mins, &hrs, &days);
if (days > 0)
- snprintf(str, MAX_STRLEN, "%dd %dh %dm %ds", days, hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"d %"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ days, hrs, mins, secs);
else
- snprintf(str, MAX_STRLEN, "%dh %dm %ds", hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ hrs, mins, secs);
return;
}
/* detect_pkgs
detects the number of packages installed on the computer
- argument char *str: the char array to be filled with the number of packages
*/
-void detect_pkgs(char *str, const char *distro_str)
+void detect_pkgs(void)
{
- int packages = 0;
+ uint_fast16_t packages = 0;
#if defined(__FreeBSD__) || defined(__OpenBSD__)
FILE *pkgs_file;
#endif
@@ -157,29 +139,28 @@ void detect_pkgs(char *str, const char *distro_str)
#if defined(__FreeBSD__)
pkgs_file = popen("pkg info | wc -l", "r");
- fscanf(pkgs_file, "%d", &packages);
+ fscanf(pkgs_file, "%"SCNuFAST16, &packages);
pclose(pkgs_file);
+ snprintf(pkgs_str, MAX_STRLEN, "%"PRIuFAST16, packages);
#elif defined(__OpenBSD__)
pkgs_file = popen("pkg_info | wc -l", "r");
- fscanf(pkgs_file, "%d", &packages);
+ fscanf(pkgs_file, "%"SCNuFAST16, &packages);
pclose(pkgs_file);
+ snprintf(pkgs_str, MAX_STRLEN, "%"PRIuFAST16, packages);
#else
- safe_strncpy(str, "Not Found", MAX_STRLEN);
+ safe_strncpy(pkgs_str, "Not Found", MAX_STRLEN);
if (error)
- ERR_REPORT("Could not find packages on current OS.");
+ ERR_REPORT(_("Could not find packages on current OS."));
#endif
- snprintf(str, MAX_STRLEN, "%d", packages);
-
return;
}
/* detect_cpu
detects the computer's CPU brand/name-string
- argument char *str: the char array to be filled with the CPU name
*/
-void detect_cpu(char *str)
+void detect_cpu(void)
{
FILE *cpu_file;
@@ -187,27 +168,28 @@ void detect_cpu(char *str)
cpu_file = popen("awk 'BEGIN{FS=\":\"} /model name/ { print $2; exit }' "
"/proc/cpuinfo | sed -e 's/ @/\\n/' -e 's/^ *//g' -e 's/ *$//g' "
"| head -1 | tr -d '\\n'", "r");
- fgets(str, MAX_STRLEN, cpu_file);
+ fgets(cpu_str, MAX_STRLEN, cpu_file);
pclose(cpu_file);
#else
cpu_file = popen("sysctl -n hw.model | tr -d '\\n'", "r");
- fgets(str, MAX_STRLEN, cpu_file);
+ fgets(cpu_str, MAX_STRLEN, cpu_file);
pclose(cpu_file);
#endif
+ remove_excess_cpu_txt();
+
return;
}
/* detect_gpu
detects the computer's GPU brand/name-string
- argument char *str: the char array to be filled with the GPU name
*/
-void detect_gpu(char *str)
+void detect_gpu(void)
{
FILE *gpu_file;
gpu_file = popen("detectgpu 2>/dev/null", "r");
- fgets(str, MAX_STRLEN, gpu_file);
+ fgets(gpu_str, MAX_STRLEN, gpu_file);
pclose(gpu_file);
return;
@@ -215,12 +197,11 @@ void detect_gpu(char *str)
/* detect_disk
detects the computer's total disk capacity and usage
- argument char *str: the char array to be filled with the disk data
*/
-void detect_disk(char *str)
+void detect_disk(void)
{
struct statvfs disk_info;
- unsigned long disk_total = 0, disk_used = 0, disk_percentage = 0;
+ uintmax_t disk_total = 0, disk_used = 0, disk_percentage = 0;
if (!(statvfs(getenv("HOME"), &disk_info)))
{
@@ -228,120 +209,51 @@ void detect_disk(char *str)
disk_used = (((disk_info.f_blocks - disk_info.f_bfree)
* disk_info.f_bsize) / GB);
disk_percentage = (((float) disk_used / disk_total) * 100);
- snprintf(str, MAX_STRLEN, "%ldG / %ldG (%ld%%)", disk_used, disk_total,
- disk_percentage);
+ snprintf(disk_str, MAX_STRLEN, "%"PRIuMAX"G / %"PRIuMAX"G (%"PRIuMAX"%%)",
+ disk_used, disk_total, disk_percentage);
}
else if (error)
- {
- ERR_REPORT("Could not stat $HOME for filesystem statistics.");
- }
+ ERR_REPORT(_("Could not stat $HOME for filesystem statistics."));
return;
}
/* detect_mem
detects the computer's total and used RAM
- argument char *str: the char array to be filled with the memory data
*/
-void detect_mem(char *str)
+void detect_mem(void)
{
FILE *mem_file;
- long long total_mem = 0;
+ uintmax_t total_mem = 0;
mem_file = popen("sysctl -n hw.physmem", "r");
- fscanf(mem_file, "%lld", &total_mem);
+ fscanf(mem_file, "%"SCNuMAX, &total_mem);
pclose(mem_file);
- total_mem /= (long) MB;
-
- snprintf(str, MAX_STRLEN, "%lld%s", total_mem, "MB");
-
- return;
-}
-
-/* detect_shell
- detects the shell currently running on the computer
- argument char *str: the char array to be filled with the shell name and version
- --
- CAVEAT: shell version detection relies on the standard versioning format for
- each shell. If any shell's older (or newer versions) suddenly begin to use a new
- scheme, the version may be displayed incorrectly.
- --
-*/
-void detect_shell(char *str)
-{
- FILE *shell_file;
- char *shell_name;
- char vers_str[MAX_STRLEN];
-
- shell_name = getenv("SHELL");
-
- if (shell_name == NULL)
- {
- if (error)
- ERR_REPORT("Could not detect a shell.");
-
- return;
- }
+ total_mem /= (uintmax_t) MB;
- if (STREQ(shell_name, "/bin/sh"))
- {
- safe_strncpy(str, "POSIX sh", MAX_STRLEN);
- }
- else if (strstr(shell_name, "bash"))
- {
- shell_file = popen("bash --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "bash %.*s", 17, vers_str + 10);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "zsh"))
- {
- shell_file = popen("zsh --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "zsh %.*s", 5, vers_str + 4);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "csh"))
- {
- shell_file = popen("csh --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "csh %.*s", 7, vers_str + 5);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "fish"))
- {
- shell_file = popen("fish --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "fish %.*s", 13, vers_str + 6);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "dash") || strstr(shell_name, "ash")
- || strstr(shell_name, "ksh"))
- {
- /* i don't have a version detection system for these, yet */
- safe_strncpy(str, shell_name, MAX_STRLEN);
- }
+ snprintf(mem_str, MAX_STRLEN, "%"PRIuMAX"%s", total_mem, "MB");
return;
}
/* detect_res
- detects the combined resolution of all monitors attached to the computer
- argument char *str: the char array to be filled with the resolution
*/
-void detect_res(char *str)
+void detect_res(void)
{
FILE *res_file;
res_file = popen("xdpyinfo 2> /dev/null | sed -n 's/.*dim.* "
"\\([0-9]*x[0-9]*\\) .*/\\1/pg' | tr '\\n' ' '", "r");
- fgets(str, MAX_STRLEN, res_file);
+ fgets(res_str, MAX_STRLEN, res_file);
pclose(res_file);
- if (STREQ(str, "Unknown"))
+ if (STREQ(res_str, "Unknown"))
{
- safe_strncpy(str, "No X Server", MAX_STRLEN);
+ safe_strncpy(res_str, "No X Server", MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Could not open an X display (detect_res)"));
}
return;
@@ -349,41 +261,34 @@ void detect_res(char *str)
/* detect_de
detects the desktop environment currently running on top of the OS
- argument char *str: the char array to be filled with the DE name
--
CAVEAT: This function relies on the presence of 'detectde', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_de(char *str)
+void detect_de(void)
{
char *curr_de;
if ((curr_de = getenv("XDG_CURRENT_DESKTOP")))
- {
- safe_strncpy(str, curr_de, MAX_STRLEN);
- }
+ safe_strncpy(de_str, curr_de, MAX_STRLEN);
+
else
{
if (getenv("GNOME_DESKTOP_SESSION_ID"))
- {
- safe_strncpy(str, "Gnome", MAX_STRLEN);
- }
+ safe_strncpy(de_str, "Gnome", MAX_STRLEN);
+
else if (getenv("MATE_DESKTOP_SESSION_ID"))
- {
- safe_strncpy(str, "MATE", MAX_STRLEN);
- }
+ safe_strncpy(de_str, "MATE", MAX_STRLEN);
+
else if (getenv("KDE_FULL_SESSION"))
- {
/* KDE_SESSION_VERSION only exists on KDE4+, so
getenv will return NULL on KDE <= 3.
*/
- snprintf(str, MAX_STRLEN, "KDE%s", getenv("KDE_SESSION_VERSION"));
- }
+ snprintf(de_str, MAX_STRLEN, "KDE%s", getenv("KDE_SESSION_VERSION"));
+
else if (error)
- {
- ERR_REPORT("No desktop environment found.");
- }
+ ERR_REPORT(_("No desktop environment found."));
}
return;
@@ -391,18 +296,17 @@ void detect_de(char *str)
/* detect_wm
detects the window manager currently running on top of the OS
- argument char *str: the char array to be filled with the WM name
--
CAVEAT: This function relies on the presence of 'detectwm', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_wm(char *str)
+void detect_wm(void)
{
FILE *wm_file;
wm_file = popen("detectwm 2> /dev/null", "r");
- fgets(str, MAX_STRLEN, wm_file);
+ fgets(wm_str, MAX_STRLEN, wm_file);
pclose(wm_file);
return;
@@ -410,13 +314,12 @@ void detect_wm(char *str)
/* detect_wm_theme
detects the theme associated with the WM detected in detect_wm()
- argument char *str: the char array to be filled with the WM Theme name
--
CAVEAT: This function relies on the presence of 'detectwmtheme', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_wm_theme(char *str, const char *wm_str)
+void detect_wm_theme(void)
{
char exec_str[MAX_STRLEN];
FILE *wm_theme_file;
@@ -424,7 +327,7 @@ void detect_wm_theme(char *str, const char *wm_str)
snprintf(exec_str, MAX_STRLEN, "detectwmtheme %s 2> /dev/null", wm_str);
wm_theme_file = popen(exec_str, "r");
- fgets(str, MAX_STRLEN, wm_theme_file);
+ fgets(wm_theme_str, MAX_STRLEN, wm_theme_file);
pclose(wm_theme_file);
return;
@@ -432,32 +335,36 @@ void detect_wm_theme(char *str, const char *wm_str)
/* detect_gtk
detects the theme, icon(s), and font(s) associated with a GTK DE (if present)
- argument char *str: the char array to be filled with the GTK info
--
CAVEAT: This function relies on the presence of 'detectgtk', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_gtk(char *str)
+void detect_gtk(void)
{
FILE *gtk_file;
- char gtk2_str[MAX_STRLEN] = "Unknown";
- char gtk3_str[MAX_STRLEN] = "Unknown";
- char gtk_icons_str[MAX_STRLEN] = "Unknown";
- char font_str[MAX_STRLEN] = "Unknown";
+ char gtk2_str[MAX_STRLEN] = "Unknown";
+ char gtk3_str[MAX_STRLEN] = "Unknown";
+ char gtk_icons[MAX_STRLEN] = "Unknown";
+ char fonts[MAX_STRLEN] = "Unknown";
gtk_file = popen("detectgtk 2> /dev/null", "r");
- fscanf(gtk_file, "%s%s%s%s", gtk2_str, gtk3_str, gtk_icons_str, font_str);
+ fscanf(gtk_file, "%s%s%s%s", gtk2_str, gtk3_str, gtk_icons, fonts);
pclose(gtk_file);
if (STREQ(gtk3_str, "Unknown"))
- snprintf(str, MAX_STRLEN, "%s (GTK2), %s (Icons)", gtk2_str,
- gtk_icons_str);
+ snprintf(gtk_str, MAX_STRLEN, "%s (%s2), %s (%s)", gtk2_str,
+ _("GTK"), gtk_icons, _("Icons"));
+
else if (STREQ(gtk2_str, "Unknown"))
- snprintf(str, MAX_STRLEN, "%s (GTK3), %s (Icons)", gtk3_str,
- gtk_icons_str);
+ snprintf(gtk_str, MAX_STRLEN, "%s (%s3), %s (%s)", gtk3_str,
+ _("GTK"), gtk_icons, _("Icons"));
else
- snprintf(str, MAX_STRLEN, "%s (GTK2), %s (GTK3)", gtk2_str, gtk3_str);
+ snprintf(gtk_str, MAX_STRLEN, "%s (%s2), %s (%s3)", gtk2_str,
+ _("GTK"), gtk3_str, _("GTK"));
+
+ snprintf(icon_str, MAX_STRLEN, "%s", gtk_icons);
+ snprintf(font_str, MAX_STRLEN, "%s", fonts);
return;
-}
+}
\ No newline at end of file
diff --git a/src/plat/common.c b/src/plat/common.c
new file mode 100644
index 0000000..640c549
--- /dev/null
+++ b/src/plat/common.c
@@ -0,0 +1,64 @@
+/* common.c
+ * Authors: William Woodruff and Aaron Caffrey
+ * -------------
+ *
+ * The detection functions that are cross-platform available are defined here.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include "../misc.h"
+#include "../extern.h"
+#include "../prototypes.h"
+
+
+/* detect_shell
+ detects the shell currently running on the computer
+*/
+void detect_shell(void)
+{
+ char *shell_name;
+ uint_fast16_t x = 0;
+ bool found_shell = false;
+
+ const char *mult_shell_arr[][2] =
+ {
+ {"bash --version | head -1", "bash"},
+ {"zsh --version", "zsh"},
+ {"csh --version | head -1", "csh"},
+ {"fish --version", "fish"}
+ };
+
+ const size_t shells_num = ARR_LEN(mult_shell_arr);
+
+ if (!(shell_name = getenv("SHELL")))
+ {
+ if (error)
+ ERR_REPORT(_("Could not detect a shell - $SHELL not defined."));
+ }
+
+ else if (STREQ(shell_name, "/bin/sh"))
+ safe_strncpy(shell_str, "POSIX sh", MAX_STRLEN);
+
+ else
+ {
+ for (x = 0; x < shells_num; x++)
+ if (strstr(shell_name, mult_shell_arr[x][1]))
+ {
+ found_shell = true;
+ break;
+ }
+
+ if (found_shell)
+ popen_raw_shell_version(mult_shell_arr[x][0], mult_shell_arr[x][1]);
+ else
+ safe_strncpy(shell_str, shell_name, MAX_STRLEN);
+ }
+
+ return;
+}
\ No newline at end of file
diff --git a/src/plat/darwin/detect.c b/src/plat/darwin/detect.c
index c9ccf85..d3e9254 100644
--- a/src/plat/darwin/detect.c
+++ b/src/plat/darwin/detect.c
@@ -1,5 +1,6 @@
/* detect.c
* Author: William Woodruff
+ * Edited by: Aaron Caffrey
* -------------
*
* The detection functions used by screenfetch-c on OS X (Darwin) are implemented here.
@@ -12,7 +13,7 @@
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
-#include <getopt.h>
+#include <inttypes.h>
/* OS X-specific includes */
#include <sys/types.h>
@@ -29,15 +30,13 @@
/* program includes */
#include "../../misc.h"
-#include "../../disp.h"
-#include "../../util.h"
-#include "../../error_flag.h"
+#include "../../extern.h"
+#include "../../prototypes.h"
/* detect_distro
detects the computer's distribution (OS X release)
- argument char *str: the char array to be filled with the distro name
*/
-void detect_distro(char *str)
+void detect_distro(void)
{
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
int ver_maj, ver_min, ver_bug;
@@ -54,37 +53,22 @@ void detect_distro(char *str)
Gestalt(gestaltSystemVersionMinor, (SInt32 *) &ver_min);
Gestalt(gestaltSystemVersionBugFix, (SInt32 *) &ver_bug);
- snprintf(str, MAX_STRLEN, "Max OS X %d.%d.%d", ver_maj, ver_min, ver_bug);
+ snprintf(distro_str, MAX_STRLEN, "Max OS X %d.%d.%d", ver_maj, ver_min, ver_bug);
#else
distro_file = popen("sw_vers -productVersion | tr -d '\\n'", "r");
fgets(distro_name_str, MAX_STRLEN, distro_file);
pclose(distro_file);
- snprintf(str, MAX_STRLEN, "Mac OS X %s", distro_name_str);
+ snprintf(distro_str, MAX_STRLEN, "Mac OS X %s", distro_name_str);
#endif
return;
}
-/* detect_arch
- detects the computer's architecture
- argument char *str: the char array to be filled with the architecture
-*/
-void detect_arch(char *str)
-{
- struct utsname arch_info;
-
- uname(&arch_info);
- safe_strncpy(str, arch_info.machine, MAX_STRLEN);
-
- return;
-}
-
/* detect_host
detects the computer's hostname and active user and formats them
- argument char *str: the char array to be filled with the host info
*/
-void detect_host(char *str)
+void detect_host(void)
{
char *given_user = "Unknown";
char given_host[MAX_STRLEN] = "Unknown";
@@ -94,36 +78,33 @@ void detect_host(char *str)
uname(&host_info);
safe_strncpy(given_host, host_info.nodename, MAX_STRLEN);
- snprintf(str, MAX_STRLEN, "%s@%s", given_user, given_host);
+ snprintf(UseR, MAX_STRLEN, "%s", given_user);
+ snprintf(HosT, MAX_STRLEN, "%s", given_host);
return;
}
/* detect_kernel
detects the computer's kernel
- argument char *str: the char array to be filled with the kernel name
*/
-void detect_kernel(char *str)
+void detect_kernel(void)
{
struct utsname kern_info;
uname(&kern_info);
- snprintf(str, MAX_STRLEN, "%s %s", kern_info.sysname, kern_info.release);
+ snprintf(kernel_str, MAX_STRLEN, "%s %s %s", kern_info.sysname,
+ kern_info.release, kern_info.machine);
return;
}
/* detect_uptime
detects the computer's uptime
- argument char *str: the char array to be filled with the uptime
*/
-void detect_uptime(char *str)
+void detect_uptime(void)
{
- long long uptime = 0;
- int secs = 0;
- int mins = 0;
- int hrs = 0;
- int days = 0;
+ long uptime = 0;
+ uint_least32_t secs = 0, mins = 0, hrs = 0, days = 0;
/* three cheers for undocumented functions and structs */
static mach_timebase_info_data_t timebase_info;
@@ -133,79 +114,79 @@ void detect_uptime(char *str)
(void) mach_timebase_info(&timebase_info);
}
- uptime = (long long)((mach_absolute_time() * timebase_info.numer) /
+ uptime = (long)((mach_absolute_time() * timebase_info.numer) /
(1000* 1000 * timebase_info.denom));
uptime /= 1000;
split_uptime(uptime, &secs, &mins, &hrs, &days);
if (days > 0)
- snprintf(str, MAX_STRLEN, "%dd %dh %dm %ds", days, hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"d %"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ days, hrs, mins, secs);
else
- snprintf(str, MAX_STRLEN, "%dh %dm %ds", hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ hrs, mins, secs);
return;
}
/* detect_pkgs
detects the number of packages installed on the computer
- argument char *str: the char array to be filled with the number of packages
*/
-void detect_pkgs(char *str, const char *distro_str)
+void detect_pkgs(void)
{
- int packages = 0;
+ uint_fast16_t packages = 0;
glob_t gl;
if (glob("/usr/local/Cellar/*", GLOB_NOSORT, NULL, &gl) == 0)
- {
packages = gl.gl_pathc;
- }
+
else if (error)
- {
- ERR_REPORT("Failure while globbing packages.");
- }
+ ERR_REPORT(_("Failure while globbing packages."));
globfree(&gl);
- snprintf(str, MAX_STRLEN, "%d", packages);
+ snprintf(pkgs_str, MAX_STRLEN, "%"PRIuFAST16, packages);
return;
}
/* detect_cpu
detects the computer's CPU brand/name-string
- argument char *str: the char array to be filled with the CPU name
*/
-void detect_cpu(char *str)
+void detect_cpu(void)
{
FILE *cpu_file;
/*
something like:
int len = MAX_STRLEN;
- sysctlbyname("machdep.cpu.brand_string", str, &len, NULL, 0);
+ sysctlbyname("machdep.cpu.brand_string", cpu_str, &len, NULL, 0);
*/
cpu_file = popen("sysctl -n machdep.cpu.brand_string | "
"sed 's/(\\([Tt][Mm]\\))//g;s/(\\([Rr]\\))//g;s/^//g' | "
"tr -d '\\n' | tr -s ' '", "r");
- fgets(str, MAX_STRLEN, cpu_file);
+ fgets(cpu_str, MAX_STRLEN, cpu_file);
pclose(cpu_file);
+ remove_excess_cpu_txt();
+
return;
}
/* detect_gpu
detects the computer's GPU brand/name-string
- argument char *str: the char array to be filled with the GPU name
*/
-void detect_gpu(char *str)
+void detect_gpu(void)
{
FILE *gpu_file;
gpu_file = popen("system_profiler SPDisplaysDataType | "
"awk -F': ' '/^\\ *Chipset Model:/ {print $2}' | "
"tr -d '\\n'", "r");
- fgets(str, MAX_STRLEN, gpu_file);
+ fgets(gpu_str, MAX_STRLEN, gpu_file);
pclose(gpu_file);
return;
@@ -213,12 +194,11 @@ void detect_gpu(char *str)
/* detect_disk
detects the computer's total disk capacity and usage
- argument char *str: the char array to be filled with the disk data
*/
-void detect_disk(char *str)
+void detect_disk(void)
{
struct statfs disk_info;
- long disk_total = 0, disk_used = 0, disk_percentage = 0;
+ uintmax_t disk_total = 0, disk_used = 0, disk_percentage = 0;
if (!(statfs(getenv("HOME"), &disk_info)))
{
@@ -226,126 +206,53 @@ void detect_disk(char *str)
disk_used = (((disk_info.f_blocks - disk_info.f_bfree)
* disk_info.f_bsize) / GB);
disk_percentage = (((float) disk_used / disk_total) * 100);
- snprintf(str, MAX_STRLEN, "%ldG / %ldG (%ld%%)", disk_used, disk_total,
- disk_percentage);
+ snprintf(disk_str, MAX_STRLEN, "%"PRIuMAX"G / %"PRIuMAX"G (%"PRIuMAX"%%)",
+ disk_used, disk_total, disk_percentage);
}
else if (error)
- {
- ERR_REPORT("Could not stat $HOME for filesystem statistics.");
- }
+ ERR_REPORT(_("Could not stat $HOME for filesystem statistics."));
return;
}
/* detect_mem
detects the computer's total and used RAM
- argument char *str: the char array to be filled with the memory data
*/
-void detect_mem(char *str)
+void detect_mem(void)
{
FILE *mem_file;
- long long total_mem = 0;
- long long free_mem = 0;
- long long used_mem = 0;
+ uintmax_t total_mem = 0, used_mem = 0, free_mem;
mem_file = popen("sysctl -n hw.memsize", "r");
- fscanf(mem_file, "%lld", &total_mem);
+ fscanf(mem_file, "%"SCNuMAX, &total_mem);
pclose(mem_file);
mem_file = popen("vm_stat | head -2 | tail -1 | tr -d 'Pages free: .'", "r");
- fscanf(mem_file, "%lld", &free_mem);
+ fscanf(mem_file, "%"SCNuMAX, &free_mem);
pclose(mem_file);
- total_mem /= (long) MB;
+ total_mem /= (uintmax_t) MB;
- free_mem *= 4096; /* 4KiB is OS X's page size */
- free_mem /= (long) MB;
+ free_mem *= 4096; /* 4KiB is OS X's page size, only if 64-bit */
+ free_mem /= (uintmax_t) MB;
used_mem = total_mem - free_mem;
- snprintf(str, MAX_STRLEN, "%lld%s / %lld%s", used_mem, "MB", total_mem, "MB");
-
- return;
-}
-
-/* detect_shell
- detects the shell currently running on the computer
- argument char *str: the char array to be filled with the shell info
- --
- CAVEAT: shell version detection relies on the standard versioning format for
- each shell. If any shell's older (or newer versions) suddenly begin to use a
- new scheme, the version may be displayed incorrectly.
- --
-*/
-void detect_shell(char *str)
-{
- FILE *shell_file;
- char *shell_name;
- char vers_str[MAX_STRLEN];
-
- shell_name = getenv("SHELL");
-
- if (shell_name == NULL)
- {
- if (error)
- ERR_REPORT("Could not detect a shell.");
-
- return;
- }
-
- if (STREQ(shell_name, "/bin/sh"))
- {
- safe_strncpy(str, "POSIX sh", MAX_STRLEN);
- }
- else if (strstr(shell_name, "bash"))
- {
- shell_file = popen("bash --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "bash %.*s", 17, vers_str + 10);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "zsh"))
- {
- shell_file = popen("zsh --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "zsh %.*s", 5, vers_str + 4);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "csh"))
- {
- shell_file = popen("csh --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "csh %.*s", 7, vers_str + 5);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "fish"))
- {
- shell_file = popen("fish --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "fish %.*s", 13, vers_str + 6);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "dash") || strstr(shell_name, "ash")
- || strstr(shell_name, "ksh"))
- {
- /* i don't have a version detection system for these, yet */
- safe_strncpy(str, shell_name, MAX_STRLEN);
- }
+ snprintf(mem_str, MAX_STRLEN, "%"PRIuMAX"%s / %"PRIuMAX"%s", used_mem, "MB", total_mem, "MB");
return;
}
/* detect_res
detects the combined resolution of all monitors attached to the computer
- argument char *str: the char array to be filled with the resolution
*/
-void detect_res(char *str)
+void detect_res(void)
{
FILE *res_file;
res_file = popen("system_profiler SPDisplaysDataType | "
"awk '/Resolution:/ {print $2\"x\"$4}' | tr -d '\\n'", "r");
- fgets(str, MAX_STRLEN, res_file);
+ fgets(res_str, MAX_STRLEN, res_file);
pclose(res_file);
return;
@@ -354,11 +261,10 @@ void detect_res(char *str)
/* detect_de
detects the desktop environment currently running on top of the OS.
On OS X, this will always be Aqua.
- argument char *str: the char array to be filled with the DE name
*/
-void detect_de(char *str)
+void detect_de(void)
{
- safe_strncpy(str, "Aqua", MAX_STRLEN);
+ safe_strncpy(de_str, "Aqua", MAX_STRLEN);
return;
}
@@ -366,11 +272,10 @@ void detect_de(char *str)
/* detect_wm
detects the window manager currently running on top of the OS.
On OS X, this will always be the Quartz Compositor.
- argument char *str: the char array to be filled with the WM name
*/
-void detect_wm(char *str)
+void detect_wm(void)
{
- safe_strncpy(str, "Quartz Compositor", MAX_STRLEN);
+ safe_strncpy(wm_str, "Quartz Compositor", MAX_STRLEN);
return;
}
@@ -378,22 +283,20 @@ void detect_wm(char *str)
/* detect_wm_theme
detects the theme associated with the WM detected in detect_wm().
On OS X, this will always be Aqua.
- argument char *str: the char array to be filled with the WM Theme name
*/
-void detect_wm_theme(char *str, const char *wm_str)
+void detect_wm_theme(void)
{
- safe_strncpy(str, "Aqua", MAX_STRLEN);
+ safe_strncpy(wm_theme_str, "Aqua", MAX_STRLEN);
return;
}
/* detect_gtk
OS X doesn't use GTK, so this function fills str with "Not Applicable"
- argument char *str: the char array to be filled with any GTK info
*/
-void detect_gtk(char *str)
+void detect_gtk(void)
{
- safe_strncpy(str, "Not Applicable", MAX_STRLEN);
+ safe_strncpy(gtk_str, "Not Applicable", MAX_STRLEN);
return;
-}
+}
\ No newline at end of file
diff --git a/src/plat/linux/detect.c b/src/plat/linux/detect.c
index c2f313e..9f6bb44 100644
--- a/src/plat/linux/detect.c
+++ b/src/plat/linux/detect.c
@@ -1,5 +1,6 @@
/* detect.c
* Author: William Woodruff
+ * Edited by: Aaron Caffrey
* -------------
*
* The detection functions used by screenfetch-c on Linux are implemented here.
@@ -11,7 +12,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
-#include <getopt.h>
+#include <inttypes.h>
/* linux-specific includes */
#include <unistd.h>
@@ -20,142 +21,116 @@
#include <sys/statvfs.h>
#include <sys/types.h>
#include <pwd.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
#include <glob.h>
/* program includes */
#include "../../misc.h"
-#include "../../disp.h"
-#include "../../util.h"
-#include "../../error_flag.h"
+#include "../../extern.h"
+#include "../../prototypes.h"
+
+#if defined (HAVE_X11_XLIB_H)
+# include <X11/Xlib.h>
+# include <X11/Xatom.h>
+#endif
+
+#if defined (HAVE_GL_GLX_H)
+# include <GL/gl.h>
+# include <GL/glx.h>
+#endif
/* detect_distro
detects the computer's distribution (really only relevant on Linux)
- argument char *str1: the char array to be filled with the distro name
- argument char *str2: the char array to be filled with the distro colour
- so we can print "user@hostname" with the same colour as the detected distro one
*/
-void detect_distro(char *str1, char *str2)
+void detect_distro(void)
{
- /* if distro_str was NOT set by the -D flag or manual mode */
- if (STREQ(str1, "Unknown") || STREQ(str1, "*"))
+ /* if distro_str was NOT set by the -D flag */
+ if (STREQ(distro_str, "Unknown") || STREQ(distro_str, "*"))
{
- FILE *distro_file;
-
- char distro_name_str[MAX_STRLEN];
-
if (FILE_EXISTS("/system/bin/getprop"))
- {
- safe_strncpy(str1, "Android", MAX_STRLEN);
- sprintf(str2, "%s", TLGN);
- }
+ safe_strncpy(distro_str, "Android", MAX_STRLEN);
+
else
{
bool detected = false;
+ uint_fast16_t x = 0;
- /* Bad solution, as /etc/issue contains junk on some distros */
- distro_file = fopen("/etc/issue", "r");
+ const char *distro_arr[][2] =
+ {
+ {"Kali", "Kali Linux"},
+ {"Back", "Backtrack Linux"},
+ {"Crun", "CrunchBang"},
+ {"LMDE", "LMDE"},
+ {"Debi", "Debian"},
+ {"Rasp", "Debian"}
+ };
+ const size_t len_distro_arr = ARR_LEN(distro_arr);
+
+ char distro_name_str[MAX_STRLEN];
+ /* Bad solution, as /etc/issue contains junk on some distros */
+ FILE *distro_file = fopen("/etc/issue", "r");
if (distro_file != NULL)
{
/* get the first 4 chars, that's all we need */
fscanf(distro_file, "%4s", distro_name_str);
fclose(distro_file);
- if (STREQ(distro_name_str, "Kali"))
- {
- safe_strncpy(str1, "Kali Linux", MAX_STRLEN);
- detected = true;
- sprintf(str2, "%s", TLBL);
- }
- else if (STREQ(distro_name_str, "Back"))
- {
- safe_strncpy(str1, "Backtrack Linux", MAX_STRLEN);
- detected = true;
- sprintf(str2, "%s", TLRD);
- }
- else if (STREQ(distro_name_str, "Crun"))
- {
- safe_strncpy(str1, "CrunchBang", MAX_STRLEN);
- detected = true;
- sprintf(str2, "%s", TDGY);
- }
- else if (STREQ(distro_name_str, "LMDE"))
- {
- safe_strncpy(str1, "LMDE", MAX_STRLEN);
- detected = true;
- sprintf(str2, "%s", TLGN);
- }
- else if (STREQ(distro_name_str, "Debi")
- || STREQ(distro_name_str, "Rasp"))
- {
- safe_strncpy(str1, "Debian", MAX_STRLEN);
- detected = true;
- sprintf(str2, "%s", TLRD);
- }
+ for (x = 0; x < len_distro_arr; x++)
+ if (STREQ(distro_name_str, distro_arr[x][0]))
+ {
+ safe_strncpy(distro_str, distro_arr[x][1], MAX_STRLEN);
+ detected = true;
+ break;
+ }
}
if (!detected)
{
- if (FILE_EXISTS("/etc/fedora-release"))
- {
- safe_strncpy(str1, "Fedora", MAX_STRLEN);
- sprintf(str2, "%s", TLBL);
- }
- else if (FILE_EXISTS("/etc/SuSE-release"))
+ bool found_distro = false;
+ const char *distro_file_arr[][2] =
{
- safe_strncpy(str1, "OpenSUSE", MAX_STRLEN);
- sprintf(str2, "%s", TLGN);
- }
- else if (FILE_EXISTS("/etc/arch-release"))
- {
- safe_strncpy(str1, "Arch Linux", MAX_STRLEN);
- sprintf(str2, "%s", TLCY);
- }
- else if (FILE_EXISTS("/etc/gentoo-release"))
- {
- safe_strncpy(str1, "Gentoo", MAX_STRLEN);
- sprintf(str2, "%s", TLPR);
- }
- else if (FILE_EXISTS("/etc/angstrom-version"))
- {
- safe_strncpy(str1, "Angstrom", MAX_STRLEN);
- sprintf(str2, "%s", TNRM);
- }
- else if (FILE_EXISTS("/etc/manjaro-release"))
- {
- safe_strncpy(str1, "Manjaro", MAX_STRLEN);
- sprintf(str2, "%s", TLGN);
- }
- else if (FILE_EXISTS("/etc/lsb-release"))
- {
- distro_file = fopen("/etc/lsb-release", "r");
- fscanf(distro_file, "%s ", distro_name_str);
- fclose(distro_file);
+ {"/etc/fedora-release", "Fedora"},
+ {"/etc/SuSE-release", "OpenSUSE"},
+ {"/etc/arch-release", "Arch Linux"},
+ {"/etc/gentoo-release", "Gentoo"},
+ {"/etc/angstrom-version", "Angstrom"},
+ {"/etc/manjaro-release", "Manjaro"}
+ };
+ const size_t len_distro_file_arr = ARR_LEN(distro_file_arr);
+
+ for (x = 0; x < len_distro_file_arr; x++)
+ if (FILE_EXISTS(distro_file_arr[x][0]))
+ {
+ safe_strncpy(distro_str, distro_file_arr[x][1], MAX_STRLEN);
+ found_distro = true;
+ break;
+ }
- snprintf(str1, MAX_STRLEN, "%s", distro_name_str + 11);
- sprintf(str2, "%s", TLRD);
- }
- else if (FILE_EXISTS("/etc/os-release"))
- {
- /*
- TODO: Parse NAME or PRETTY_NAME from os-release
- Until then, spit out an error message.
- */
- if (error)
- ERR_REPORT("Failed to detect a Linux distro (1).");
- }
- else
+ if (!found_distro)
{
- safe_strncpy(str1, "Linux", MAX_STRLEN);
- sprintf(str2, "%s", TLGY);
+ if (FILE_EXISTS("/etc/lsb-release"))
+ {
+ distro_file = fopen("/etc/lsb-release", "r");
+ fscanf(distro_file, "%s ", distro_name_str);
+ fclose(distro_file);
- if (error)
+ snprintf(distro_str, MAX_STRLEN, "%s", distro_name_str + 11);
+ }
+ else if (FILE_EXISTS("/etc/os-release"))
+ {
+ /*
+ TODO: Parse NAME or PRETTY_NAME from os-release
+ Until then, spit out an error message.
+ */
+ if (error)
+ ERR_REPORT(_("Failed to detect a Linux distro (1)."));
+ }
+ else
{
- ERR_REPORT("Failed to detect a Linux distro (2).");
+ safe_strncpy(distro_str, "Linux", MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Failed to detect a Linux distro (2)."));
}
}
}
@@ -165,25 +140,10 @@ void detect_distro(char *str1, char *str2)
return;
}
-/* detect_arch
- detects the computer's architecture
- argument char *str: the char array to be filled with the architecture
-*/
-/*void detect_arch(char *str)
-{
- struct utsname arch_info;
- uname(&arch_info);
- safe_strncpy(str, arch_info.machine, MAX_STRLEN);
-
- return;
-}*/
-
/* detect_host
detects the computer's hostname and active user and formats them
- argument char *str1: the char array to be filled with the host info
- argument char *str2: the passed distro colour for "user@hostname"
*/
-void detect_host(char *str1, char *str2)
+void detect_host(void)
{
char given_user[MAX_STRLEN] = "Unknown";
char given_host[MAX_STRLEN] = "Unknown";
@@ -191,60 +151,46 @@ void detect_host(char *str1, char *str2)
struct utsname host_info;
if ((user_info = getpwuid(geteuid())))
- {
safe_strncpy(given_user, user_info->pw_name, MAX_STRLEN);
- }
+
else if (error)
- {
- ERR_REPORT("Could not detect username.");
- }
+ ERR_REPORT(_("Could not detect username."));
if (!(uname(&host_info)))
- {
safe_strncpy(given_host, host_info.nodename, MAX_STRLEN);
- }
+
else if (error)
- {
- ERR_REPORT("Could not detect hostname.");
- }
+ ERR_REPORT(_("Could not detect hostname."));
- snprintf(str1, MAX_STRLEN, "%s%s%s%s@%s%s%s%s",
- str2, given_user, TNRM, TWHT, TNRM, str2, given_host, TNRM);
+ snprintf(UseR, MAX_STRLEN, "%s", given_user);
+ snprintf(HosT, MAX_STRLEN, "%s", given_host);
return;
}
/* detect_kernel
detects the computer's kernel
- argument char *str: the char array to be filled with the kernel name
*/
-void detect_kernel(char *str)
+void detect_kernel(void)
{
struct utsname kern_info;
if (!(uname(&kern_info)))
- {
- snprintf(str, MAX_STRLEN, "%s %s %s", kern_info.sysname, kern_info.release, kern_info.machine);
- }
+ snprintf(kernel_str, MAX_STRLEN, "%s %s %s",
+ kern_info.sysname, kern_info.release, kern_info.machine);
+
else if (error)
- {
- ERR_REPORT("Could not detect kernel information.");
- safe_strncpy(str, "Linux", MAX_STRLEN);
- }
+ ERR_REPORT(_("Could not detect kernel information."));
return;
}
/* detect_uptime
detects the computer's uptime
- argument char *str: the char array to be filled with the uptime
*/
-void detect_uptime(char *str)
+void detect_uptime(void)
{
- int secs = 0;
- int mins = 0;
- int hrs = 0;
- int days = 0;
+ uint_least32_t secs = 0, mins = 0, hrs = 0, days = 0;
struct sysinfo si_upt;
if (!(sysinfo(&si_upt)))
@@ -252,47 +198,56 @@ void detect_uptime(char *str)
split_uptime(si_upt.uptime, &secs, &mins, &hrs, &days);
if (days > 0)
- snprintf(str, MAX_STRLEN, "%dd %dh %dm %ds", days, hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"d %"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ days, hrs, mins, secs);
else
- snprintf(str, MAX_STRLEN, "%dh %dm %ds", hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ hrs, mins, secs);
}
else
- {
- ERR_REPORT("Could not detect system uptime.");
- }
+ ERR_REPORT(_("Could not detect system uptime."));
return;
}
+static uint_fast16_t glob_packages(char *str1);
+
+static uint_fast16_t glob_packages(char *str1)
+{
+ uint_fast16_t packs_num = 0;
+ glob_t gl;
+
+ if (!(glob(str1, GLOB_NOSORT, NULL, &gl)))
+ packs_num = gl.gl_pathc;
+
+ else if (error)
+ ERR_REPORT(_("Failure while globbing packages."));
+
+ globfree(&gl);
+
+ return packs_num;
+}
+
/* detect_pkgs
detects the number of packages installed on the computer
- argument char *str: the char array to be filled with the number of packages
*/
-void detect_pkgs(char *str, const char *distro_str)
+void detect_pkgs(void)
{
FILE *pkgs_file;
- int packages = 0;
- glob_t gl;
+ uint_fast16_t packages = 0;
if (STREQ(distro_str, "Arch Linux")
|| STREQ(distro_str, "ParabolaGNU/Linux-libre")
|| STREQ(distro_str, "Chakra") || STREQ(distro_str, "Manjaro"))
- {
- if (!(glob("/var/lib/pacman/local/*", GLOB_NOSORT, NULL, &gl)))
- {
- packages = gl.gl_pathc;
- }
- else if (error)
- {
- ERR_REPORT("Failure while globbing packages.");
- }
- globfree(&gl);
- }
+ packages = glob_packages("/var/lib/pacman/local/*");
+
else if (STREQ(distro_str, "Frugalware"))
{
pkgs_file = popen("pacman-g2 -Q 2> /dev/null | wc -l", "r");
- fscanf(pkgs_file, "%d", &packages);
+ fscanf(pkgs_file, "%"SCNuFAST16, &packages);
pclose(pkgs_file);
}
else if (STREQ(distro_str, "Ubuntu") || STREQ(distro_str, "Lubuntu")
@@ -304,45 +259,15 @@ void detect_pkgs(char *str, const char *distro_str)
|| STREQ(distro_str, "elementary OS")
|| STREQ(distro_str, "Backtrack Linux")
|| STREQ(distro_str, "Kali Linux"))
- {
- if (!(glob("/var/lib/dpkg/info/*.list", GLOB_NOSORT, NULL, &gl)))
- {
- packages = gl.gl_pathc;
- }
- else if (error)
- {
- ERR_REPORT("Failure while globbing packages.");
- }
+ packages = glob_packages("/var/lib/dpkg/info/*.list");
- globfree(&gl);
- }
else if (STREQ(distro_str, "Slackware"))
- {
- if (!(glob("/var/log/packages/*", GLOB_NOSORT, NULL, &gl)))
- {
- packages = gl.gl_pathc;
- }
- else if (error)
- {
- ERR_REPORT("Failure while globbing packages.");
- }
+ packages = glob_packages("/var/log/packages/*");
- globfree(&gl);
- }
else if (STREQ(distro_str, "Gentoo") || STREQ(distro_str, "Sabayon")
|| STREQ(distro_str, "Funtoo"))
- {
- if (!(glob("/var/db/pkg/*/*", GLOB_NOSORT, NULL, &gl)))
- {
- packages = gl.gl_pathc;
- }
- else if (error)
- {
- ERR_REPORT("Failure while globbing packages.");
- }
+ packages = glob_packages("/var/db/pkg/*/*");
- globfree(&gl);
- }
else if (STREQ(distro_str, "Fuduntu") || STREQ(distro_str, "Fedora")
|| STREQ(distro_str, "OpenSUSE")
|| STREQ(distro_str, "Red Hat Linux")
@@ -351,48 +276,49 @@ void detect_pkgs(char *str, const char *distro_str)
{
/* RPM uses Berkeley DBs internally, so this won't change soon */
pkgs_file = popen("rpm -qa 2> /dev/null | wc -l", "r");
- fscanf(pkgs_file, "%d", &packages);
+ fscanf(pkgs_file, "%"SCNuFAST16, &packages);
pclose(pkgs_file);
}
else if (STREQ(distro_str, "Angstrom"))
{
pkgs_file = popen("opkg list-installed 2> /dev/null | wc -l", "r");
- fscanf(pkgs_file, "%d", &packages);
+ fscanf(pkgs_file, "%"SCNuFAST16, &packages);
pclose(pkgs_file);
}
- else if (STREQ(distro_str, "Linux")) /* if linux disto detection failed */
+ else /* if linux disto detection failed */
{
- safe_strncpy(str, "Not Found", MAX_STRLEN);
+ safe_strncpy(pkgs_str, _("Not Found"), MAX_STRLEN);
if (error)
- ERR_REPORT("Packages cannot be detected on an unknown "
- "Linux distro.");
+ ERR_REPORT(_("Packages cannot be detected on an unknown Linux distro."));
+
+ return;
}
- snprintf(str, MAX_STRLEN, "%d", packages);
+ snprintf(pkgs_str, MAX_STRLEN, "%"PRIuFAST16, packages);
return;
}
/* detect_cpu
detects the computer's CPU brand/name-string
- argument char *str: the char array to be filled with the CPU name
*/
-void detect_cpu(char *str)
+void detect_cpu(void)
{
FILE *cpu_file;
char cpuinfo_buf[MAX_STRLEN];
char *cpuinfo_line;
- int end;
+ size_t end;
+ uint_fast16_t i = 0;
if ((cpu_file = fopen("/proc/cpuinfo", "r")))
{
/* read past the first 4 lines (#5 is model name) */
- for (int i = 0; i < 5; i++)
+ for (i = 0; i < 5; i++)
{
if (!(fgets(cpuinfo_buf, MAX_STRLEN, cpu_file)))
{
- ERR_REPORT("Fatal error while reading /proc/cpuinfo");
+ ERR_REPORT(_("Fatal error while reading /proc/cpuinfo"));
return;
}
}
@@ -400,7 +326,7 @@ void detect_cpu(char *str)
/* fail to match a colon. this should never happen, but check anyways */
if (!(cpuinfo_line = strchr(cpuinfo_buf, ':')))
{
- ERR_REPORT("Fatal error matching in /proc/cpuinfo");
+ ERR_REPORT(_("Fatal error matching in /proc/cpuinfo"));
return;
}
@@ -411,28 +337,26 @@ void detect_cpu(char *str)
cpuinfo_line[end - 1] = '\0';
if (STREQ(cpuinfo_line, "ARMv6-compatible processor rev 7 (v6l)"))
- {
- safe_strncpy(str, "BCM2708 (Raspberry Pi)", MAX_STRLEN);
- }
+ safe_strncpy(cpu_str, "BCM2708 (Raspberry Pi)", MAX_STRLEN);
+
else
- {
- safe_strncpy(str, cpuinfo_line, MAX_STRLEN);
- }
+ safe_strncpy(cpu_str, cpuinfo_line, MAX_STRLEN);
+
+ remove_excess_cpu_txt();
}
else if (error)
- {
- ERR_REPORT("Failed to open /proc/cpuinfo. Ancient Linux kernel?");
- }
+ ERR_REPORT(_("Failed to open /proc/cpuinfo. Ancient Linux kernel?"));
return;
}
/* detect_gpu
detects the computer's GPU brand/name-string
- argument char *str: the char array to be filled with the GPU name
*/
-void detect_gpu(char *str)
+void detect_gpu(void)
{
+#if defined (HAVE_X11_XLIB_H) && defined (HAVE_GL_GLX_H)
+
Display *disp = NULL;
Window wind;
GLint attr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };
@@ -448,153 +372,90 @@ void detect_gpu(char *str)
if ((context = glXCreateContext(disp, visual_info, NULL, GL_TRUE)))
{
glXMakeCurrent(disp, wind, context);
- safe_strncpy(str, (const char *) glGetString(GL_RENDERER),
+ safe_strncpy(gpu_str, (const char *) glGetString(GL_RENDERER),
MAX_STRLEN);
glXDestroyContext(disp, context);
}
else if (error)
- {
- ERR_REPORT("Failed to create OpenGL context.");
- }
+ ERR_REPORT(_("Failed to create OpenGL context."));
XFree((void *) visual_info);
}
else if (error)
- {
- ERR_REPORT("Failed to select a proper X visual.");
- }
+ ERR_REPORT(_("Failed to select a proper X visual."));
XCloseDisplay(disp);
}
- else if (error)
+ else
{
- safe_strncpy(str, "No X Server", MAX_STRLEN);
- ERR_REPORT("Could not open an X display (detect_gpu).");
+ safe_strncpy(gpu_str, _("No X Server"), MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Could not open an X display (detect_gpu)."));
}
+#else /* fallback to the detectgpu bash script */
+
+ FILE *gpu_file = popen("detectgpu 2> /dev/null", "r");
+ fgets(gpu_str, MAX_STRLEN, gpu_file);
+ pclose(gpu_file);
+
+#endif
+
return;
}
/* detect_disk
detects the computer's total disk capacity and usage
- argument char *str: the char array to be filled with the disk data
*/
-void detect_disk(char *str)
+void detect_disk(void)
{
struct statvfs disk_info;
- unsigned long disk_total = 0, disk_used = 0, disk_percentage = 0;
+ uintmax_t disk_total = 0, disk_used = 0, disk_percentage = 0;
if (!(statvfs(getenv("HOME"), &disk_info)))
{
disk_total = ((disk_info.f_blocks * disk_info.f_bsize) / GB);
disk_used = (((disk_info.f_blocks - disk_info.f_bfree) * disk_info.f_bsize) / GB);
disk_percentage = (((float) disk_used / disk_total) * 100);
- snprintf(str, MAX_STRLEN, "%ldG / %ldG (%ld%%)", disk_used, disk_total, disk_percentage);
+ snprintf(disk_str, MAX_STRLEN, "%"PRIuMAX"G / %"PRIuMAX"G (%"PRIuMAX"%%)",
+ disk_used, disk_total, disk_percentage);
}
else if (error)
- {
- ERR_REPORT("Could not stat $HOME for filesystem statistics.");
- }
+ ERR_REPORT(_("Could not stat $HOME for filesystem statistics."));
return;
}
/* detect_mem
detects the computer's total and used RAM
- argument char *str: the char array to be filled with the memory data
*/
-void detect_mem(char *str)
+void detect_mem(void)
{
- long long total_mem = 0, free_mem = 0, used_mem = 0;
+ uintmax_t total_mem = 0, used_mem = 0;
struct sysinfo si_mem;
- /* known problem: because linux utilizes free ram in caches/buffers,
- the amount of memory sysinfo reports as free is very small.
- */
sysinfo(&si_mem);
- total_mem = (long long) (si_mem.totalram * si_mem.mem_unit) / MB;
- free_mem = (long long) (si_mem.freeram * si_mem.mem_unit) / MB;
- used_mem = (long long) total_mem - free_mem;
+ total_mem = (uintmax_t) (si_mem.totalram * si_mem.mem_unit) / MB;
+ used_mem = (uintmax_t) ((si_mem.totalram - si_mem.freeram - si_mem.bufferram
+ - si_mem.sharedram) * si_mem.mem_unit) / MB;
- snprintf(str, MAX_STRLEN, "%lld%s / %lld%s", used_mem, "MB", total_mem, "MB");
-
- return;
-}
-
-/* detect_shell
- detects the shell currently running on the computer
- argument char *str: the char array to be filled with the shell name and version
- --
- CAVEAT: shell version detection relies on the standard versioning format for
- each shell. If any shell's older (or newer versions) suddenly begin to use a new
- scheme, the version may be displayed incorrectly.
- --
-*/
-void detect_shell(char *str)
-{
- FILE *shell_file;
- char *shell_name;
- char vers_str[MAX_STRLEN];
-
- if (!(shell_name = getenv("SHELL")))
- {
- if (error)
- ERR_REPORT("Could not detect a shell - $SHELL not defined.");
-
- return;
- }
-
- if (STREQ(shell_name, "/bin/sh"))
- {
- safe_strncpy(str, "POSIX sh", MAX_STRLEN);
- }
- else if (strstr(shell_name, "bash"))
- {
- shell_file = popen("bash --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "bash %.*s", 17, vers_str + 10);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "zsh"))
- {
- shell_file = popen("zsh --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "zsh %.*s", 5, vers_str + 4);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "csh"))
- {
- shell_file = popen("csh --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "csh %.*s", 7, vers_str + 5);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "fish"))
- {
- shell_file = popen("fish --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "fish %.*s", 13, vers_str + 6);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "dash") || strstr(shell_name, "ash")
- || strstr(shell_name, "ksh"))
- {
- /* i don't have a version detection system for these, yet */
- safe_strncpy(str, shell_name, MAX_STRLEN);
- }
+ snprintf(mem_str, MAX_STRLEN, "%"PRIuMAX"%s / %"PRIuMAX"%s",
+ used_mem, "MB", total_mem, "MB");
return;
}
/* detect_res
detects the combined resolution of all monitors attached to the computer
- argument char *str: the char array to be filled with the resolution
*/
-void detect_res(char *str)
+void detect_res(void)
{
- int width = 0, height = 0;
+#if defined (HAVE_X11_XLIB_H)
+
+ uint_fast16_t width = 0, height = 0;
Display *disp;
Screen *screen;
@@ -604,54 +465,63 @@ void detect_res(char *str)
width = WidthOfScreen(screen);
height = HeightOfScreen(screen);
- snprintf(str, MAX_STRLEN, "%dx%d", width, height);
+ snprintf(res_str, MAX_STRLEN, "%"PRIuFAST16"x%"PRIuFAST16, width, height);
XCloseDisplay(disp);
}
else
{
- safe_strncpy(str, "No X Server", MAX_STRLEN);
+ safe_strncpy(res_str, _("No X Server"), MAX_STRLEN);
if (error)
- ERR_REPORT("Could not open an X display (detect_res)");
+ ERR_REPORT(_("Could not open an X display (detect_res)"));
}
+#else /* fallback to `xdpyinfo' */
+
+ FILE *res_file = popen("xdpyinfo | awk '/dimension/ {printf \"%s\",$2}'", "r");
+ fgets(res_str, MAX_STRLEN, res_file);
+ pclose(res_file);
+
+ if (STREQ(res_str, "Unknown"))
+ {
+ safe_strncpy(res_str, _("No X Server"), MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Could not open an X display (detect_res)"));
+ }
+
+#endif
+
return;
}
/* detect_de
detects the desktop environment currently running on top of the OS
- argument char *str: the char array to be filled with the DE name
*/
-void detect_de(char *str)
+void detect_de(void)
{
char *curr_de;
if ((curr_de = getenv("XDG_CURRENT_DESKTOP")))
- {
- safe_strncpy(str, curr_de, MAX_STRLEN);
- }
+ safe_strncpy(de_str, curr_de, MAX_STRLEN);
+
else
{
if (getenv("GNOME_DESKTOP_SESSION_ID"))
- {
- safe_strncpy(str, "Gnome", MAX_STRLEN);
- }
+ safe_strncpy(de_str, "Gnome", MAX_STRLEN);
+
else if (getenv("MATE_DESKTOP_SESSION_ID"))
- {
- safe_strncpy(str, "MATE", MAX_STRLEN);
- }
+ safe_strncpy(de_str, "MATE", MAX_STRLEN);
+
else if (getenv("KDE_FULL_SESSION"))
- {
/* KDE_SESSION_VERSION only exists on KDE4+, so
getenv will return NULL on KDE <= 3.
*/
- snprintf(str, MAX_STRLEN, "KDE%s", getenv("KDE_SESSION_VERSION"));
- }
+ snprintf(de_str, MAX_STRLEN, "KDE%s", getenv("KDE_SESSION_VERSION"));
+
else if (error)
- {
- ERR_REPORT("No desktop environment found.");
- }
+ ERR_REPORT(_("No desktop environment found."));
}
return;
@@ -659,15 +529,15 @@ void detect_de(char *str)
/* detect_wm
detects the window manager currently running on top of the OS
- argument char *str: the char array to be filled with the WM name
*/
-void detect_wm(char *str)
+void detect_wm(void)
{
+#if defined (HAVE_X11_XLIB_H)
+
Display *disp;
Atom actual_type;
int actual_format;
- unsigned long nitems;
- unsigned long bytes;
+ unsigned long nitems, bytes;
char *wm_name = '\0';
Window *wm_check_window;
@@ -683,40 +553,47 @@ void detect_wm(char *str)
XInternAtom(disp, "UTF8_STRING", true), &actual_type,
&actual_format, &nitems, &bytes, (unsigned char **) &wm_name)))
{
- safe_strncpy(str, wm_name, MAX_STRLEN);
+ safe_strncpy(wm_str, wm_name, MAX_STRLEN);
XFree(wm_name);
}
else if (error)
- {
- ERR_REPORT("No _NET_WM_NAME property found.");
- }
+ ERR_REPORT(_("No _NET_WM_NAME property found."));
XFree(wm_check_window);
}
else if (error)
- {
- ERR_REPORT("No WM detected (non-EWMH compliant?)");
- }
+ ERR_REPORT(_("No WM detected (non-EWMH compliant?)"));
XCloseDisplay(disp);
}
- else if (error)
+ else
{
- ERR_REPORT("Could not open an X display. (detect_wm)");
+ safe_strncpy(wm_str, _("No X Server"), MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Could not open an X display. (detect_wm)"));
}
+#else /* fallback to the detectwm bash script */
+
+ FILE *wm_file;
+
+ wm_file = popen("detectwm 2> /dev/null", "r");
+ fgets(wm_str, MAX_STRLEN, wm_file);
+ pclose(wm_file);
+
+#endif
return;
}
/* detect_wm_theme
detects the theme associated with the WM detected in detect_wm()
- argument char *str: the char array to be filled with the WM Theme name
--
CAVEAT: This function relies on the presence of 'detectwmtheme', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_wm_theme(char *str, const char *wm_str)
+void detect_wm_theme(void)
{
char exec_str[MAX_STRLEN];
FILE *wm_theme_file;
@@ -724,7 +601,7 @@ void detect_wm_theme(char *str, const char *wm_str)
snprintf(exec_str, MAX_STRLEN, "detectwmtheme %s 2> /dev/null", wm_str);
wm_theme_file = popen(exec_str, "r");
- fgets(str, MAX_STRLEN, wm_theme_file);
+ fgets(wm_theme_str, MAX_STRLEN, wm_theme_file);
pclose(wm_theme_file);
return;
@@ -732,38 +609,36 @@ void detect_wm_theme(char *str, const char *wm_str)
/* detect_gtk
detects the theme, icon(s), and font(s) associated with a GTK DE (if present)
- argument char *str1: the char array to be filled with the GTK info
- argument char *str2: the char array to be filled with GTK icons
- argument char *str3: the char array to be filled with Font
--
CAVEAT: This function relies on the presence of 'detectgtk', a shell script.
If it isn't present somewhere in the PATH, the GTK will be set as 'Unknown'
--
*/
-void detect_gtk(char *str1, char *str2, char *str3)
+void detect_gtk(void)
{
FILE *gtk_file;
- char gtk2_str[MAX_STRLEN] = "Unknown";
- char gtk3_str[MAX_STRLEN] = "Unknown";
- char gtk_icons_str[MAX_STRLEN] = "Unknown";
- char font_str[MAX_STRLEN] = "Unknown";
+ char gtk2_str[MAX_STRLEN] = "Unknown";
+ char gtk3_str[MAX_STRLEN] = "Unknown";
+ char gtk_icons[MAX_STRLEN] = "Unknown";
+ char fonts[MAX_STRLEN] = "Unknown";
gtk_file = popen("detectgtk 2> /dev/null", "r");
- fscanf(gtk_file, "%s%s%s%s", gtk2_str, gtk3_str, gtk_icons_str, font_str);
+ fscanf(gtk_file, "%s%s%s%s", gtk2_str, gtk3_str, gtk_icons, fonts);
pclose(gtk_file);
if (STREQ(gtk3_str, "Unknown"))
- snprintf(str1, MAX_STRLEN, "%s (GTK2), %s (Icons)", gtk2_str,
- gtk_icons_str);
+ snprintf(gtk_str, MAX_STRLEN, "%s (%s2), %s (%s)", gtk2_str,
+ _("GTK"), gtk_icons, _("Icons"));
+
else if (STREQ(gtk2_str, "Unknown"))
- snprintf(str1, MAX_STRLEN, "%s (GTK3), %s (Icons)", gtk3_str,
- gtk_icons_str);
+ snprintf(gtk_str, MAX_STRLEN, "%s (%s3), %s (%s)", gtk3_str,
+ _("GTK"), gtk_icons, _("Icons"));
else
- snprintf(str1, MAX_STRLEN, "%s (GTK2), %s (GTK3)", gtk2_str, gtk3_str);
-
- snprintf(str2, MAX_STRLEN, "%s", gtk_icons_str);
+ snprintf(gtk_str, MAX_STRLEN, "%s (%s2), %s (%s3)", gtk2_str,
+ _("GTK"), gtk3_str, _("GTK"));
- snprintf(str3, MAX_STRLEN, "%s", font_str);
+ snprintf(icon_str, MAX_STRLEN, "%s", gtk_icons);
+ snprintf(font_str, MAX_STRLEN, "%s", fonts);
return;
-}
+}
\ No newline at end of file
diff --git a/src/plat/sun/detect.c b/src/plat/sun/detect.c
index 33d49bd..a369cf8 100644
--- a/src/plat/sun/detect.c
+++ b/src/plat/sun/detect.c
@@ -1,5 +1,6 @@
/* detect.c
* Author: William Woodruff
+ * Edited by: Aaron Caffrey
* -------------
*
* The detection functions used by screenfetch-c on Solaris are implemented here.
@@ -12,7 +13,7 @@
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
-#include <getopt.h>
+#include <inttypes.h>
/* Solaris-specific includes */
#include <utmpx.h>
@@ -21,48 +22,34 @@
#include <sys/param.h>
#include <sys/utsname.h>
#include <sys/statvfs.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
/* program includes */
#include "../../misc.h"
-#include "../../disp.h"
-#include "../../util.h"
-#include "../../error_flag.h"
+#include "../../extern.h"
+#include "../../prototypes.h"
+
+#if defined (HAVE_X11_XLIB_H)
+# include <X11/Xlib.h>
+# include <X11/Xatom.h>
+#endif
/* detect_distro
detects the computer's distribution
- argument char *str: the char array to be filled with the distro name
*/
-void detect_distro(char *str)
+void detect_distro(void)
{
struct utsname distro_info;
uname(&distro_info);
- snprintf(str, MAX_STRLEN, "%s", distro_info.sysname);
-
- return;
-}
-
-/* detect_arch
- detects the computer's architecture
- argument char *str: the char array to be filled with the architecture
-*/
-void detect_arch(char *str)
-{
- struct utsname arch_info;
-
- uname(&arch_info);
- safe_strncpy(str, arch_info.machine, MAX_STRLEN);
+ snprintf(distro_str, MAX_STRLEN, "%s", distro_info.sysname);
return;
}
/* detect_host
detects the computer's hostname and active user and formats them
- argument char *str: the char array to be filled with the host info
*/
-void detect_host(char *str)
+void detect_host(void)
{
char *given_user = "Unknown";
char given_host[MAX_STRLEN] = "Unknown";
@@ -72,36 +59,32 @@ void detect_host(char *str)
uname(&host_info);
safe_strncpy(given_host, host_info.nodename, MAX_STRLEN);
- snprintf(str, MAX_STRLEN, "%s@%s", given_user, given_host);
+ snprintf(UseR, MAX_STRLEN, "%s", given_user);
+ snprintf(HosT, MAX_STRLEN, "%s", given_host);
return;
}
/* detect_kernel
detects the computer's kernel
- argument char *str: the char array to be filled with the kernel name
*/
-void detect_kernel(char *str)
+void detect_kernel(void)
{
struct utsname kern_info;
uname(&kern_info);
- snprintf(str, MAX_STRLEN, "%s", kern_info.release);
+ snprintf(kernel_str, MAX_STRLEN, "%s", kern_info.release);
return;
}
/* detect_uptime
detects the computer's uptime
- argument char *str: the char array to be filled with the uptime
*/
-void detect_uptime(char *str)
+void detect_uptime(void)
{
long uptime = 0, currtime = 0, boottime = 0;
- int secs = 0;
- int mins = 0;
- int hrs = 0;
- int days = 0;
+ uint_least32_t secs = 0, mins = 0, hrs = 0, days = 0;
struct utmpx *ent;
currtime = time(NULL);
@@ -109,9 +92,7 @@ void detect_uptime(char *str)
while ((ent = getutxent()))
{
if (STREQ("system boot", ent->ut_line))
- {
boottime = ent->ut_tv.tv_sec;
- }
}
uptime = currtime - boottime;
@@ -119,56 +100,59 @@ void detect_uptime(char *str)
split_uptime(uptime, &secs, &mins, &hrs, &days);
if (days > 0)
- snprintf(str, MAX_STRLEN, "%dd %dh %dm %ds", days, hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"d %"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ days, hrs, mins, secs);
else
- snprintf(str, MAX_STRLEN, "%dh %dm %ds", hrs, mins, secs);
+ snprintf(uptime_str, MAX_STRLEN,
+ "%"PRIuLEAST32"h %"PRIuLEAST32"m %"PRIuLEAST32"s",
+ hrs, mins, secs);
return;
}
/* detect_pkgs
detects the number of packages installed on the computer
- argument char *str: the char array to be filled with the number of packages
*/
-void detect_pkgs(char *str, const char *distro_str)
+void detect_pkgs(void)
{
FILE *pkgs_file;
- int packages = 0;
+ uint_fast16_t packages = 0;
pkgs_file = popen("pkg list | wc -l", "r");
- fscanf(pkgs_file, "%d", &packages);
+ fscanf(pkgs_file, "%"SCNuFAST16, &packages);
pclose(pkgs_file);
- snprintf(str, MAX_STRLEN, "%d", packages);
+ snprintf(pkgs_str, MAX_STRLEN, "%"PRIuFAST16, packages);
return;
}
/* detect_cpu
detects the computer's CPU brand/name-string
- argument char *str: the char array to be filled with the CPU name
*/
-void detect_cpu(char *str)
+void detect_cpu(void)
{
FILE *cpu_file;
cpu_file = popen("psrinfo -pv | tail -1 | tr -d '\\t\\n'", "r");
- fgets(str, MAX_STRLEN, cpu_file);
+ fgets(cpu_str, MAX_STRLEN, cpu_file);
pclose(cpu_file);
+ remove_excess_cpu_txt();
+
return;
}
/* detect_gpu
detects the computer's GPU brand/name-string
- argument char *str: the char array to be filled with the GPU name
*/
-void detect_gpu(char *str)
+void detect_gpu(void)
{
FILE *gpu_file;
gpu_file = popen("detectgpu 2>/dev/null", "r");
- fgets(str, MAX_STRLEN, gpu_file);
+ fgets(gpu_str, MAX_STRLEN, gpu_file);
pclose(gpu_file);
return;
@@ -176,121 +160,51 @@ void detect_gpu(char *str)
/* detect_disk
detects the computer's total disk capacity and usage
- argument char *str: the char array to be filled with the disk data
*/
-void detect_disk(char *str)
+void detect_disk(void)
{
struct statvfs disk_info;
- unsigned long disk_total = 0, disk_used = 0, disk_percentage = 0;
+ uintmax_t disk_total = 0, disk_used = 0, disk_percentage = 0;
if (!(statvfs(getenv("HOME"), &disk_info)))
{
disk_total = ((disk_info.f_blocks * disk_info.f_bsize) / GB);
disk_used = (((disk_info.f_blocks - disk_info.f_bfree) * disk_info.f_bsize) / GB);
disk_percentage = (((float) disk_used / disk_total) * 100);
- snprintf(str, MAX_STRLEN, "%ldG / %ldG (%ld%%)", disk_used, disk_total, disk_percentage);
+ snprintf(disk_str, MAX_STRLEN, "%"PRIuMAX"G / %"PRIuMAX"G (%"PRIuMAX"%%)",
+ disk_used, disk_total, disk_percentage);
}
else if (error)
- {
- ERR_REPORT("Could not stat $HOME for filesystem statistics.");
- }
+ ERR_REPORT(_("Could not stat $HOME for filesystem statistics."));
return;
}
/* detect_mem
detects the computer's total and used RAM
- argument char *str: the char array to be filled with the memory data
*/
-void detect_mem(char *str)
+void detect_mem(void)
{
- long long total_mem = 0;
+ uintmax_t total_mem = 0;
- total_mem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
- total_mem /= MB;
+ total_mem = (uintmax_t) (sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE));
+ total_mem /= (uintmax_t) MB;
/* sar -r 1 to get free pages? */
- snprintf(str, MAX_STRLEN, "%lld%s", total_mem, "MB");
-
- return;
-}
-
-/* detect_shell
- detects the shell currently running on the computer
- argument char *str: the char array to be filled with the shell name and version
- --
- CAVEAT: shell version detection relies on the standard versioning format for
- each shell. If any shell's older (or newer versions) suddenly begin to use a new
- scheme, the version may be displayed incorrectly.
- --
-*/
-void detect_shell(char *str)
-{
- FILE *shell_file;
- char *shell_name;
- char vers_str[MAX_STRLEN];
-
- shell_name = getenv("SHELL");
-
- if (shell_name == NULL)
- {
- if (error)
- ERR_REPORT("Could not detect a shell.");
-
- return;
- }
-
- if (STREQ(shell_name, "/bin/sh"))
- {
- safe_strncpy(str, "POSIX sh", MAX_STRLEN);
- }
- else if (strstr(shell_name, "bash"))
- {
- shell_file = popen("bash --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "bash %.*s", 17, vers_str + 10);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "zsh"))
- {
- shell_file = popen("zsh --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "zsh %.*s", 5, vers_str + 4);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "csh"))
- {
- shell_file = popen("csh --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "csh %.*s", 7, vers_str + 5);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "fish"))
- {
- shell_file = popen("fish --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "fish %.*s", 13, vers_str + 6);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "dash") || strstr(shell_name, "ash")
- || strstr(shell_name, "ksh"))
- {
- /* i don't have a version detection system for these, yet */
- safe_strncpy(str, shell_name, MAX_STRLEN);
- }
+ snprintf(mem_str, MAX_STRLEN, "%"PRIuMAX"%s", total_mem, "MB");
return;
}
/* detect_res
detects the combined resolution of all monitors attached to the computer
- argument char *str: the char array to be filled with the resolution
*/
-void detect_res(char *str)
+void detect_res(void)
{
- int width = 0;
- int height = 0;
+#if defined (HAVE_X11_XLIB_H)
+
+ uint_fast16_t width = 0, height = 0;
Display *disp;
Screen *screen;
@@ -299,54 +213,64 @@ void detect_res(char *str)
screen = XDefaultScreenOfDisplay(disp);
width = WidthOfScreen(screen);
height = HeightOfScreen(screen);
- snprintf(str, MAX_STRLEN, "%dx%d", width, height);
+
+ snprintf(res_str, MAX_STRLEN, "%"PRIuFAST16"x%"PRIuFAST16, width, height);
+
+ XCloseDisplay(disp);
}
else
{
- safe_strncpy(str, "No X Server", MAX_STRLEN);
+ safe_strncpy(res_str, _("No X Server"), MAX_STRLEN);
if (error)
- ERR_REPORT("Problem detecting X display resolution.");
+ ERR_REPORT(_("Could not open an X display (detect_res)"));
}
- XCloseDisplay(disp);
+#else /* fallback to `xdpyinfo' */
+
+ FILE *res_file = popen("xdpyinfo | awk '/dimension/ {printf \"%s\",$2}'", "r");
+ fgets(res_str, MAX_STRLEN, res_file);
+ pclose(res_file);
+
+ if (STREQ(res_str, "Unknown"))
+ {
+ safe_strncpy(res_str, _("No X Server"), MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Could not open an X display (detect_res)"));
+ }
+
+#endif
return;
}
/* detect_de
detects the desktop environment currently running on top of the OS
- argument char *str: the char array to be filled with the DE name
*/
-void detect_de(char *str)
+void detect_de(void)
{
char *curr_de;
if ((curr_de = getenv("XDG_CURRENT_DESKTOP")))
- {
- safe_strncpy(str, curr_de, MAX_STRLEN);
- }
+ safe_strncpy(de_str, curr_de, MAX_STRLEN);
+
else
{
if (getenv("GNOME_DESKTOP_SESSION_ID"))
- {
- safe_strncpy(str, "Gnome", MAX_STRLEN);
- }
+ safe_strncpy(de_str, "Gnome", MAX_STRLEN);
+
else if (getenv("MATE_DESKTOP_SESSION_ID"))
- {
- safe_strncpy(str, "MATE", MAX_STRLEN);
- }
+ safe_strncpy(de_str, "MATE", MAX_STRLEN);
+
else if (getenv("KDE_FULL_SESSION"))
- {
/* KDE_SESSION_VERSION only exists on KDE4+, so
getenv will return NULL on KDE <= 3.
*/
- snprintf(str, MAX_STRLEN, "KDE%s", getenv("KDE_SESSION_VERSION"));
- }
+ snprintf(de_str, MAX_STRLEN, "KDE%s", getenv("KDE_SESSION_VERSION"));
+
else if (error)
- {
- ERR_REPORT("No desktop environment found.");
- }
+ ERR_REPORT(_("No desktop environment found."));
}
return;
@@ -354,19 +278,19 @@ void detect_de(char *str)
/* detect_wm
detects the window manager currently running on top of the OS
- argument char *str: the char array to be filled with the WM name
--
CAVEAT: This function relies on the presence of 'detectwm', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_wm(char *str)
+void detect_wm(void)
{
+#if defined (HAVE_X11_XLIB_H)
+
Display *disp;
Atom actual_type;
int actual_format;
- unsigned long nitems;
- unsigned long bytes;
+ unsigned long nitems, bytes;
char *wm_name = '\0';
Window *wm_check_window;
@@ -382,40 +306,47 @@ void detect_wm(char *str)
XInternAtom(disp, "UTF8_STRING", true), &actual_type,
&actual_format, &nitems, &bytes, (unsigned char **) &wm_name)))
{
- safe_strncpy(str, wm_name, MAX_STRLEN);
+ safe_strncpy(wm_str, wm_name, MAX_STRLEN);
XFree(wm_name);
}
else if (error)
- {
- ERR_REPORT("No _NET_WM_NAME property found.");
- }
+ ERR_REPORT(_("No _NET_WM_NAME property found."));
XFree(wm_check_window);
}
else if (error)
- {
- ERR_REPORT("WM cannot be detected without EWMH compliance.");
- }
+ ERR_REPORT(_("No WM detected (non-EWMH compliant?)"));
XCloseDisplay(disp);
}
- else if (error)
+ else
{
- ERR_REPORT("Could not open an X display.");
+ safe_strncpy(wm_str, _("No X Server"), MAX_STRLEN);
+
+ if (error)
+ ERR_REPORT(_("Could not open an X display. (detect_wm)"));
}
+#else /* fallback to the detectwm bash script */
+
+ FILE *wm_file;
+
+ wm_file = popen("detectwm 2> /dev/null", "r");
+ fgets(wm_str, MAX_STRLEN, wm_file);
+ pclose(wm_file);
+
+#endif
return;
}
/* detect_wm_theme
detects the theme associated with the WM detected in detect_wm()
- argument char *str: the char array to be filled with the WM Theme name
--
CAVEAT: This function relies on the presence of 'detectwmtheme', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_wm_theme(char *str, const char *wm_str)
+void detect_wm_theme(void)
{
char exec_str[MAX_STRLEN];
FILE *wm_theme_file;
@@ -423,7 +354,7 @@ void detect_wm_theme(char *str, const char *wm_str)
snprintf(exec_str, MAX_STRLEN, "detectwmtheme %s 2> /dev/null", wm_str);
wm_theme_file = popen(exec_str, "r");
- fgets(str, MAX_STRLEN, wm_theme_file);
+ fgets(wm_theme_str, MAX_STRLEN, wm_theme_file);
pclose(wm_theme_file);
return;
@@ -431,15 +362,14 @@ void detect_wm_theme(char *str, const char *wm_str)
/* detect_gtk
detects the theme, icon(s), and font(s) associated with a GTK DE (if present)
- argument char *str: the char array to be filled with the GTK info
--
CAVEAT: This function relies on the presence of 'detectgtk', a shell script.
If it isn't present somewhere in the PATH, the WM Theme will be set as 'Unknown'
--
*/
-void detect_gtk(char *str)
+void detect_gtk(void)
{
- safe_strncpy(str, "Not implemented", MAX_STRLEN);
+ safe_strncpy(gtk_str, "Not implemented", MAX_STRLEN);
return;
-}
+}
\ No newline at end of file
diff --git a/src/plat/win32/detect.c b/src/plat/win32/detect.c
index 0d53885..e56f648 100644
--- a/src/plat/win32/detect.c
+++ b/src/plat/win32/detect.c
@@ -22,9 +22,8 @@ extern int pclose(FILE *stream);
/* program includes */
#include "../../misc.h"
-#include "../../disp.h"
-#include "../../util.h"
-#include "../../error_flag.h"
+#include "../../extern.h"
+#include "../../prototypes.h"
/* detect_distro
detects the computer's distribution (Windows version)
@@ -32,8 +31,8 @@ extern int pclose(FILE *stream);
*/
void detect_distro(char *str)
{
- /* if distro_str was NOT set by the -D flag or manual mode */
- if (STREQ(str, "Unknown") || STREQ(str, "*"))
+ /* if distro_str was NOT set by the -D flag */
+ if (STREQ(str, "Unknown"))
{
#if defined(NTDDI_WIN7)
safe_strncpy(str, "Microsoft Windows 7", MAX_STRLEN);
@@ -57,39 +56,6 @@ void detect_distro(char *str)
return;
}
-/* detect_arch
- detects the computer's architecture
- argument char *str: the char array to be filled with the architecture
-*/
-void detect_arch(char *str)
-{
- SYSTEM_INFO arch_info;
- GetNativeSystemInfo(&arch_info);
-
- if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- {
- safe_strncpy(str, "AMD64", MAX_STRLEN);
- }
- else if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM)
- {
- safe_strncpy(str, "ARM", MAX_STRLEN);
- }
- else if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
- {
- safe_strncpy(str, "IA64", MAX_STRLEN);
- }
- else if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
- {
- safe_strncpy(str, "x86", MAX_STRLEN);
- }
- else
- {
- safe_strncpy(str, "Unknown", MAX_STRLEN);
- }
-
- return;
-}
-
/* detect_host
detects the computer's hostname and active user and formats them
argument char *str: the char array to be filled with the host info
@@ -124,13 +90,39 @@ void detect_host(char *str)
void detect_kernel(char *str)
{
OSVERSIONINFO kern_info;
+ SYSTEM_INFO arch_info;
+ char arch_str[MAX_STRLEN];
ZeroMemory(&kern_info, sizeof(OSVERSIONINFO));
kern_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&kern_info);
- snprintf(str, MAX_STRLEN, "Windows NT %d.%d build %d",
+
+ GetNativeSystemInfo(&arch_info);
+
+ if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ {
+ safe_strncpy(arch_str, "AMD64", MAX_STRLEN);
+ }
+ else if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM)
+ {
+ safe_strncpy(arch_str, "ARM", MAX_STRLEN);
+ }
+ else if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
+ {
+ safe_strncpy(arch_str, "IA64", MAX_STRLEN);
+ }
+ else if (arch_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ {
+ safe_strncpy(arch_str, "x86", MAX_STRLEN);
+ }
+ else
+ {
+ safe_strncpy(arch_str, "Unknown", MAX_STRLEN);
+ }
+
+ snprintf(str, MAX_STRLEN, "Windows NT %d.%d build %d (%s)",
(int) kern_info.dwMajorVersion, (int) kern_info.dwMinorVersion,
- (int) kern_info.dwBuildNumber);
+ (int) kern_info.dwBuildNumber, arch_str);
return;
}
@@ -277,73 +269,6 @@ void detect_mem(char *str)
return;
}
-/* detect_shell
- detects the shell currently running on the computer
- argument char *str: the char array to be filled with the shell name and version
- --
- CAVEAT: shell version detection relies on the standard versioning format for
- each shell. If any shell's older (or newer versions) suddenly begin to use a new
- scheme, the version may be displayed incorrectly.
- --
-*/
-void detect_shell(char *str)
-{
- FILE *shell_file;
- char *shell_name;
- char vers_str[MAX_STRLEN];
-
- shell_name = getenv("SHELL");
-
- if (shell_name == NULL)
- {
- if (error)
- ERR_REPORT("Could not detect a shell.");
-
- return;
- }
-
- if (STREQ(shell_name, "/bin/sh"))
- {
- safe_strncpy(str, "POSIX sh", MAX_STRLEN);
- }
- else if (strstr(shell_name, "bash"))
- {
- shell_file = popen("bash --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "bash %.*s", 17, vers_str + 10);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "zsh"))
- {
- shell_file = popen("zsh --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "zsh %.*s", 5, vers_str + 4);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "csh"))
- {
- shell_file = popen("csh --version | head -1", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "csh %.*s", 7, vers_str + 5);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "fish"))
- {
- shell_file = popen("fish --version", "r");
- fgets(vers_str, MAX_STRLEN, shell_file);
- snprintf(str, MAX_STRLEN, "fish %.*s", 13, vers_str + 6);
- pclose(shell_file);
- }
- else if (strstr(shell_name, "dash") || strstr(shell_name, "ash")
- || strstr(shell_name, "ksh"))
- {
- /* i don't have a version detection system for these, yet */
- safe_strncpy(str, shell_name, MAX_STRLEN);
- }
-
- return;
-}
-
/* detect_res
detects the combined resolution of all monitors attached to the computer
argument char *str: the char array to be filled with the resolution
diff --git a/src/prototypes.h b/src/prototypes.h
new file mode 100644
index 0000000..431d025
--- /dev/null
+++ b/src/prototypes.h
@@ -0,0 +1,51 @@
+/* prototypes.h
+ * Authors: William Woodruff and Aaron Caffrey
+ *
+ * Function prototypes for all screenfetch-c modules.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+
+#ifndef SCREENFETCH_C_PROTOTYPES_H
+#define SCREENFETCH_C_PROTOTYPES_H
+
+
+/* util.c module */
+void popen_raw_shell_version(const char *str1, const char *str2);
+void remove_excess_cpu_txt(void);
+char *safe_strncpy(char *destination, const char *source, size_t num);
+void split_uptime(long uptime, uint_least32_t *secs, uint_least32_t *mins, uint_least32_t *hrs, uint_least32_t *days);
+void take_screenshot(void);
+
+
+/* parser.c module */
+void Init_parseR(int argc, char **argv);
+
+
+/* disp.c module */
+void process_data(const char *logo[], uint_fast16_t num, char *colour);
+void main_text_output(bool verbose);
+void main_ascii_output(char *passed_distro);
+
+
+/* plat/'os'/detect.c module */
+void detect_distro(void);
+void detect_host(void);
+void detect_kernel(void);
+void detect_uptime(void);
+void detect_pkgs(void);
+void detect_cpu(void);
+void detect_gpu(void);
+void detect_disk(void);
+void detect_mem(void);
+void detect_res(void);
+void detect_de(void);
+void detect_wm(void);
+void detect_wm_theme(void);
+void detect_gtk(void);
+
+
+/* plat/common.c module */
+void detect_shell(void);
+
+
+#endif /* SCREENFETCH_C_PROTOTYPES_H */
\ No newline at end of file
diff --git a/src/scripts/detectgpu b/src/scripts/detectgpu
index 24f7597..bf82f41 100644
--- a/src/scripts/detectgpu
+++ b/src/scripts/detectgpu
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# detectgpu
+# Edited by: Aaron Caffrey
# attempt to detect and output the name and model of the computer's GPU
# only meant to be run on Linux/*BSD
# Original Author: Brett Bohnenkamper (KittyKatt) in screenfetch-dev
@@ -45,4 +46,4 @@ else
gpu="Unknown"
fi
-echo ${gpu}
+echo -en ${gpu}
\ No newline at end of file
diff --git a/src/scripts/detectgtk b/src/scripts/detectgtk
index b5eb185..715ff3f 100755
--- a/src/scripts/detectgtk
+++ b/src/scripts/detectgtk
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# detectgtk
+# Edited by: Aaron Caffrey
# detect and output any GTK information, if present
# only meant to be run on Linux/*BSD
# DEPENDS UPON: detectde for the name of the DE
@@ -172,16 +173,26 @@ case $DE in
if grep -q gtk-theme ${usr_gtkrc_two}; then
gtk2Theme=$(awk -F '"' '/^gtk-theme/ {print $2}' ${usr_gtkrc_two})
fi
- if grep -q icon-theme ${usr_gtkrc_two}; then
+ if grep -q gtk-icon-theme ${usr_gtkrc_two}; then
gtkIcons=$(awk -F '"' '/^gtk-icon-theme/ {print $2}' ${usr_gtkrc_two})
fi
- if grep -q font ${usr_gtkrc_two}; then
+ if grep -q gtk-font-name ${usr_gtkrc_two}; then
gtkFont=$(awk -F '"' '/^gtk-font-name/ {print $2}' ${usr_gtkrc_two})
fi
fi
+ #/etc/gtk-3.0/settings.ini Tested on Mint 14,15,16
+ etc_gtk_three='/etc/gtk-3.0/settings.ini'
+ if [[ -f ${etc_gtk_three} && ! -f ${usr_gtkrc_two} && ! -f ${home_gtkrc_mine} && ! -f ${home_gtkrc_two} ]]; then
+ if grep -q gtk-theme ${etc_gtk_three}; then
+ gtk2Theme=$(awk -F '= ' '/^gtk-theme/ {print $2}' ${etc_gtk_three})
+ fi
+ if grep -q gtk-icon-theme-name ${etc_gtk_three}; then
+ gtkIcons=$(awk -F '= ' '/^gtk-icon-theme-name/ {print $2}' ${etc_gtk_three})
+ fi
+ fi
# /etc/gtk-2.0/gtkrc compatability
etc_gtkrc_two='/etc/gtk-2.0/gtkrc'
- if [[ -f ${etc_gtkrc_two} && ! -f ${home_gtkrc_two} && ! -f ${home_gtkrc_mine} && ! -f ${usr_gtkrc_two} ]]; then
+ if [[ -f ${etc_gtkrc_two} && ! -f ${home_gtkrc_two} && ! -f ${home_gtkrc_mine} && ! -f ${usr_gtkrc_two} && ! -f ${etc_gtk_three} ]]; then
if grep -q gtk-theme-name ${etc_gtkrc_two}; then
gtk2Theme=$(awk -F '"' '/^gtk-theme-name/ {print $2}' ${etc_gtkrc_two})
fi
diff --git a/src/scripts/detectwm b/src/scripts/detectwm
index 4af5066..11ea05a 100755
--- a/src/scripts/detectwm
+++ b/src/scripts/detectwm
@@ -1,117 +1,85 @@
#!/usr/bin/env bash
# detectwm
+# Edited by: Aaron Caffrey
# detect and output the name of the Window Manager, if present
# only meant to be run on Linux/*BSD
# Original Author: Brett Bohnenkamper (KittyKatt) in screenfetch-dev
# Modified to stand alone by William Woodruff (woodruffw) in screenfetch-c
-wmnames=( fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm fvwm dwm awesome wmaker stumpwm musca i3 xmonad ratpoison scrotwm spectrwm wmfs wmii beryl subtle e16 enlightenment sawfish emerald monsterwm dminiwm compiz Finder herbstluftwm )
+wmnames=( fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm fvwm dwm awesome wmaker stumpwm musca i3 xmonad ratpoison scrotwm spectrwm wmfs wmii beryl subtle e16 enlightenment sawfish emerald monsterwm dminiwm compiz Finder herbstluftwm 2bwm budgiewm budgie-wm echinus gala mutter 'gnome shell' muffin notion swm bspwm cinnamon e17 )
WM="Unknown"
if [[ -n ${DISPLAY} ]]; then
- if type -p xprop >/dev/null 2>&1; then
- WM=$(xprop -root _NET_SUPPORTING_WM_CHECK)
- if [[ "$WM" =~ 'Unknown' ]]; then
- WM="Unknown"
- elif [[ "$WM" =~ 'Unknown' ]]; then
- WM="Unknown"
- elif [[ "$WM" =~ '[Ii]nvalid window id format' ]]; then
- WM="Unknown"
- elif [[ "$WM" =~ "no such" ]]; then
- WM="Unknown"
- else
- WM=${WM//* }
- WM=$(xprop -id ${WM} 8s _NET_WM_NAME)
- WM=$(echo $(WM=${WM//*= }; echo ${WM//\"}))
+ for each in "${wmnames[@]}"; do
+ PID="$(pgrep -U ${UID} "^$each*")"
+ if [ "$PID" ]; then
+ case $each in
+ '2bwm') WM="2bwm";;
+ 'awesome') WM="Awesome";;
+ 'beryl') WM="Beryl";;
+ 'bspwm') WM="bspwm";;
+ 'blackbox') WM="BlackBox";;
+ 'budgiewm'|'budgie-wm') WM="BudgieWM";;
+ 'cinnamon') WM="Cinnamon";;
+ 'compiz') WM="Compiz";;
+ 'dminiwm') WM="dminiwm";;
+ 'dwm') WM="dwm";;
+ 'e16') WM="E16";;
+ 'echinus') WM="echinus";;
+ 'emerald') WM="Emerald";;
+ 'enlightenment'|'e17') WM="E17";;
+ 'fluxbox') WM="FluxBox";;
+ 'fvwm') WM="FVWM";;
+ 'herbstluftwm') WM="herbstluftwm";;
+ 'icewm') WM="IceWM";;
+ 'kwin') WM="KWin";;
+ 'metacity') WM="Metacity";;
+ 'monsterwm') WM="monsterwm";;
+ 'musca') WM="Musca";;
+ *'gala'*) WM="Gala";;
+ 'mutter'*) WM="Mutter";;
+ 'gnome shell'*) WM="Mutter";;
+ 'muffin') WM="Muffin";;
+ 'notion') WM="Notion";;
+ 'openbox') WM="OpenBox";;
+ 'pekwm') WM="PekWM";;
+ 'ratpoison') WM="Ratpoison";;
+ 'sawfish') WM="Sawfish";;
+ 'scrotwm') WM="ScrotWM";;
+ 'spectrwm') WM="SpectrWM";;
+ 'stumpwm') WM="StumpWM";;
+ 'subtle') WM="subtle";;
+ 'swm') WM="swm";;
+ 'wmaker') WM="WindowMaker";;
+ 'wmfs') WM="WMFS";;
+ 'wmii') WM="wmii";;
+ 'xfwm4') WM="Xfwm4";;
+ 'xmonad') WM="XMonad";;
+ 'i3') WM="i3";;
+ esac
fi
- fi
+
+ if [[ ${WM} != "Unknown" ]]; then
+ break 1
+ fi
+ done
+
+ # Detection failed, fallback to `xprop'
if [[ ${WM} == "Unknown" ]]; then
- for each in $wmnames; do
- PID="$(pgrep -U ${UID} $each)"
- if [ "$PID" ]; then
- case $each in
- 'awesome') WM="Awesome";;
- 'beryl') WM="Beryl";;
- 'blackbox') WM="Blackbox";;
- 'cinnamon') WM="Cinnamon";;
- 'compiz') WM="Compiz";;
- 'dminiwm') WM="dminiwm";;
- 'dwm') WM="DWM";;
- 'e16') WM="E16";;
- 'emerald') WM="Emerald";;
- 'enlightenment') WM="E17";;
- 'fluxbox') WM="FluxBox";;
- 'fvwm') WM="FVWM";;
- 'herbstluftwm') WM="herbstluftwm";;
- 'icewm') WM="IceWM";;
- 'kwin') WM="KWin";;
- 'metacity') WM="Metacity";;
- 'monsterwm') WM="monsterwm";;
- 'musca') WM="Musca";;
- 'openbox') WM="OpenBox";;
- 'pekwm') WM="PekWM";;
- 'ratpoison') WM="Ratpoison";;
- 'sawfish') WM="Sawfish";;
- 'scrotwm') WM="ScrotWM";;
- 'spectrwm') WM="SpectrWM";;
- 'stumpwm') WM="StumpWM";;
- 'subtle') WM="subtle";;
- 'wmaker') WM="WindowMaker";;
- 'wmfs') WM="WMFS";;
- 'wmii') WM="wmii";;
- 'xfwm4') WM="Xfwm4";;
- 'xmonad') WM="XMonad";;
- 'i3') WM="i3";;
- esac
- fi
- if [[ ${WM} != "Unknown" ]]; then
- break 1
- fi
- done
- else
- if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
- if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
- WM=${WM,,}
+ if type -p xprop >/dev/null 2>&1; then
+ WM=$(xprop -root _NET_SUPPORTING_WM_CHECK)
+ if [[ "$WM" =~ 'Unknown' ]]; then
+ WM="Unknown"
+ elif [[ "$WM" =~ '[Ii]nvalid window id format' ]]; then
+ WM="Unknown"
+ elif [[ "$WM" =~ "no such" ]]; then
+ WM="Unknown"
else
- WM="$(tr '[:upper:]' '[:lower:]' <<< ${WM})"
+ WM=${WM//* }
+ WM=$(xprop -id ${WM} 8s _NET_WM_NAME)
+ WM=$(echo $(WM=${WM//*= }; echo ${WM//\"}))
fi
- else
- WM="$(tr '[:upper:]' '[:lower:]' <<< ${WM})"
fi
- case ${WM} in
- 'awesome') WM="Awesome";;
- 'beryl') WM="Beryl";;
- 'blackbox') WM="Blackbox";;
- 'cinnamon') WM="Cinnamon";;
- 'compiz') WM="Compiz";;
- 'dminiwm') WM="dminiwm";;
- 'dwm') WM="DWM";;
- 'e16') WM="E16";;
- 'emerald') WM="Emerald";;
- 'enlightenment') WM="E17";;
- 'fluxbox') WM="FluxBox";;
- 'fvwm') WM="FVWM";;
- 'herbstluftwm') WM="herbstluftwm";;
- 'icewm') WM="IceWM";;
- 'kwin') WM="KWin";;
- 'metacity') WM="Metacity";;
- 'monsterwm') WM="monsterwm";;
- 'musca') WM="Musca";;
- 'openbox') WM="OpenBox";;
- 'pekwm') WM="PekWM";;
- 'ratpoison') WM="Ratpoison";;
- 'sawfish') WM="Sawfish";;
- 'scrotwm') WM="ScrotWM";;
- 'spectrwm') WM="SpectrWM";;
- 'stumpwm') WM="StumpWM";;
- 'subtle') WM="subtle";;
- 'wmaker') WM="WindowMaker";;
- 'wmfs') WM="WMFS";;
- 'wmii') WM="wmii";;
- 'xfwm4') WM="Xfwm4";;
- 'xmonad') WM="XMonad";;
- 'i3') WM="i3";;
- esac
fi
fi
-printf $WM
\ No newline at end of file
+echo -en $WM
\ No newline at end of file
diff --git a/src/structs.h b/src/structs.h
new file mode 100644
index 0000000..d24af86
--- /dev/null
+++ b/src/structs.h
@@ -0,0 +1,147 @@
+/* structs.h
+ * Author: Aaron Caffrey
+ * -------------
+ *
+ * All structures and their members are declared, initialized (and externalized)
+ * here for use by other screenfetch-c modules.
+ * Like the rest of screenfetch-c, this file is licensed under the MIT license.
+ */
+
+#ifndef SCREENFETCH_C_STRUCTS_H
+#define SCREENFETCH_C_STRUCTS_H
+
+
+/* see "uint_fast16_t len" */
+#define MICROSOFT_LEN 17
+#define MACOSX_LEN 17
+#define ARCH_OLD_LEN 18
+#define ARCH_LEN 19
+#define MINT_LEN 18
+#define LMDE_LEN 18
+#define UBUNTU_LEN 18
+#define DEBIAN_LEN 18
+#define CRUNCHBANG_LEN 18
+#define GENTOO_LEN 18
+#define FUNTOO_LEN 18
+#define FEDORA_LEN 18
+#define MANDRAKE_LEN 18
+#define OPENSUSE_LEN 18
+#define SLACKWARE_LEN 21
+#define REDHAT_LEN 18
+#define FRUGALWARE_LEN 23
+#define PEPPERMINT_LEN 18
+#define SOLUSOS_LEN 18
+#define MAGEIA_LEN 18
+#define PARABOLA_LEN 18
+#define VIPERR_LEN 18
+#define DEEPIN_LEN 18
+#define CHAKRA_LEN 18
+#define FUDUNTU_LEN 21
+#define TRISQUEL_LEN 18
+#define MANJARO_LEN 18
+#define ELEMENTARY_LEN 18
+#define SCIENTIFIC_LEN 20
+#define BACKTRACK_LEN 21
+#define KALI_LEN 21
+#define SABAYON_LEN 18
+#define ANDROID_LEN 17
+#define ANGSTROM_LEN 17
+#define LINUX_LEN 18
+#define FREEBSD_LEN 18
+#define OPENBSD_LEN 23
+#define DRAGONFLYBSD_LEN 18
+#define NETBSD_LEN 19
+#define SUNOS_LEN 17
+
+
+typedef struct
+{
+ const char **logo; /* the ascii logo in arrays.c */
+ uint_fast16_t len; /* controls the process_data() 'for' loop iteration cycles */
+ char *colour; /* colorize detected_arr_names[x] and "user@hostname" with the given colour */
+ char *distro; /* the distro name to match in main_ascii_output() */
+} mad_dog_struct;
+
+
+#define MAD_DOG_LEN 36
+/* keep in mind to change the 'MAD_DOG_LEN'
+ value whenever you add/remove distro/OS
+*/
+const mad_dog_struct opt[] =
+{
+ {.logo = oldarch_logo, .len = ARCH_OLD_LEN, .colour = TLBL, .distro = "Arch Linux - Old"},
+
+ {.logo = arch_logo, .len = ARCH_LEN, .colour = TLCY, .distro = "Arch Linux"},
+
+ {.logo = mint_logo, .len = MINT_LEN, .colour = TLGN, .distro = "LinuxMint"},
+
+ {.logo = lmde_logo, .len = LMDE_LEN, .colour = TLGN, .distro = "LMDE"},
+
+ {.logo = debian_logo, .len = DEBIAN_LEN, .colour = TLRD, .distro = "Debian"},
+
+ {.logo = crunchbang_logo, .len = CRUNCHBANG_LEN, .colour = TDGY, .distro = "CrunchBang"},
+
+ {.logo = gentoo_logo, .len = GENTOO_LEN, .colour = TLPR, .distro = "Gentoo"},
+
+ {.logo = funtoo_logo, .len = FUNTOO_LEN, .colour = TLPR, .distro = "Funtoo"},
+
+ {.logo = fedora_logo, .len = FEDORA_LEN, .colour = TLBL, .distro = "Fedora"},
+
+ {.logo = opensuse_logo, .len = OPENSUSE_LEN, .colour = TLGN, .distro = "OpenSUSE"},
+
+ {.logo = slackware_logo, .len = SLACKWARE_LEN, .colour = TLBL, .distro = "Slackware"},
+
+ {.logo = redhat_logo, .len = REDHAT_LEN, .colour = TRED, .distro = "Red Hat Linux"},
+
+ {.logo = frugalware_logo, .len = FRUGALWARE_LEN, .colour = TLBL, .distro = "Frugalware"},
+
+ {.logo = peppermint_logo, .len = PEPPERMINT_LEN, .colour = TLRD, .distro = "Peppermint"},
+
+ {.logo = solusos_logo, .len = SOLUSOS_LEN, .colour = TDGY, .distro = "SolusOS"},
+
+ {.logo = mageia_logo, .len = MAGEIA_LEN, .colour = TLCY, .distro = "Mageia"},
+
+ {.logo = parabolagnu_linuxlibre_logo, .len = PARABOLA_LEN, .colour = TLPR, .distro = "ParabolaGNU/Linux-libre"},
+
+ {.logo = viperr_logo, .len = VIPERR_LEN, .colour = TDGY, .distro = "Viperr"},
+
+ {.logo = linuxdeepin_logo, .len = DEEPIN_LEN, .colour = TLGN, .distro = "LinuxDeepin"},
+
+ {.logo = chakra_logo, .len = CHAKRA_LEN, .colour = TLBL, .distro = "Chakra"},
+
+ {.logo = fuduntu_logo, .len = FUDUNTU_LEN, .colour = TLRD, .distro = "Fuduntu"},
+
+ {.logo = trisquel_logo, .len = TRISQUEL_LEN, .colour = TLBL, .distro = "Trisquel"},
+
+ {.logo = manjaro_logo, .len = MANJARO_LEN, .colour = TLGN, .distro = "Manjaro"},
+
+ {.logo = elementaryos_logo, .len = ELEMENTARY_LEN, .colour = TDGY, .distro = "elementary OS"},
+
+ {.logo = scientificlinux_logo, .len = SCIENTIFIC_LEN, .colour = TLBL, .distro = "Scientific Linux"},
+
+ {.logo = backtracklinux_logo, .len = BACKTRACK_LEN, .colour = TLRD, .distro = "Backtrack Linux"},
+
+ {.logo = kalilinux_logo, .len = KALI_LEN, .colour = TLBL, .distro = "Kali Linux"},
+
+ {.logo = sabayon_logo, .len = SABAYON_LEN, .colour = TLBL, .distro = "Sabayon"},
+
+ {.logo = android_logo, .len = ANDROID_LEN, .colour = TLGN, .distro = "Android"},
+
+ {.logo = angstrom_logo, .len = ANGSTROM_LEN, .colour = "", .distro = "Angstrom"},
+
+ {.logo = linux_logo, .len = LINUX_LEN, .colour = TDGY, .distro = "Linux"},
+
+ {.logo = freebsd_logo, .len = FREEBSD_LEN, .colour = TLRD, .distro = "FreeBSD"},
+
+ {.logo = openbsd_logo, .len = OPENBSD_LEN, .colour = TYLW, .distro = "OpenBSD"},
+
+ {.logo = netbsd_logo, .len = NETBSD_LEN, .colour = TLRD, .distro = "NetBSD"},
+
+ {.logo = dragonflybsd_logo, .len = DRAGONFLYBSD_LEN, .colour = TLRD, .distro = "DragonFly BSD"},
+
+ {.logo = solaris_logo, .len = SUNOS_LEN, .colour = TBLU, .distro = "SunOS"}
+
+};
+
+
+#endif /* SCREENFETCH_C_STRUCTS_H */
\ No newline at end of file
diff --git a/src/util.c b/src/util.c
index be41e1c..4be9aa6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,5 +1,6 @@
/* util.c
* Author: William Woodruff
+ * Edited by: Aaron Caffrey
* -------------
*
* Utility functions used by screenfetch-c.
@@ -12,16 +13,118 @@
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
+#include <time.h>
+#include <ctype.h>
+#include <regex.h>
+#include <inttypes.h>
+#include <malloc.h>
/* program includes */
-#include "disp.h"
#include "misc.h"
-#include "error_flag.h"
+#include "extern.h"
+#include "prototypes.h"
#if defined(__CYGWIN__)
#include <Windows.h>
#endif
+#if defined (HAVE_X11_XLIB_H) && defined (HAVE_JPEGLIB_H)
+# include <X11/Xlib.h>
+# include <X11/Xutil.h>
+# include <jpeglib.h>
+#endif
+
+/* popen_raw_shell_version
+ get the raw shell version line and workaround
+ the problem when the shell version has:
+ GNU bash, version x.x.x(x)-release (x86_64-unknown-linux-gnu)
+ Even if the shell version is x.x.xx(x) it will be handled properly
+*/
+void popen_raw_shell_version(const char *str1, const char *str2)
+{
+ FILE *shell_file;
+ char vers_arr[MAX_STRLEN], temp_arr[MAX_STRLEN];
+ uint_fast16_t x = 0, z = 0;
+
+ shell_file = popen(str1, "r");
+ fgets(vers_arr, MAX_STRLEN, shell_file);
+ pclose(shell_file);
+
+ size_t str_len = strlen(vers_arr);
+
+ for (z = 0, x = 0; x < str_len; x++)
+ {
+ if (isdigit(vers_arr[x]) || vers_arr[x] == '.') /* ispunct() includes comma */
+ temp_arr[z++] = vers_arr[x];
+
+ if (isspace(vers_arr[x]) && z > 0)
+ break;
+ }
+
+ if (STREQ(str2, "bash"))
+ temp_arr[z-1] = '\0'; /* we don't want (x) in x.x.x(x) */
+ else
+ temp_arr[z] = '\0';
+
+ snprintf(shell_str, MAX_STRLEN, "%s %s", str2, temp_arr);
+
+}
+
+/* remove_excess_cpu_txt
+ Remove unnecessary cpu text like: (tm), (TM), Processor
+ AMD Athlon(tm) II X3 455 Processor -> AMD Athlon II X3 455
+*/
+void remove_excess_cpu_txt(void)
+{
+ char str1_copy[MAX_STRLEN];
+
+ safe_strncpy(str1_copy, cpu_str, MAX_STRLEN);
+
+ bool tm_bool = false, processor_bool = false;
+ const char tokseps[] = " ()"; /* (TM), (tm) */
+ char *sep_str = strtok(str1_copy, tokseps);
+
+ /* verify that str1_copy has 'TM' or 'tm' and 'Processor' */
+ while (sep_str != NULL)
+ {
+ if (STREQ(sep_str, "tm") || STREQ(sep_str, "TM"))
+ tm_bool = true;
+
+ if (STREQ(sep_str, "Processor"))
+ processor_bool = true;
+
+ /* retrieve the next separated string (if any) */
+ sep_str = strtok(NULL, tokseps);
+ }
+
+ if (tm_bool && processor_bool)
+ {
+ regex_t PatterN;
+ regmatch_t match[3];
+ char temp_arr[MAX_STRLEN];
+ int x = 0, z = 0;
+
+ regcomp(&PatterN, "(.*)[^-](tm|TM)", REG_EXTENDED);
+ regexec(&PatterN, cpu_str, 3, match, 0);
+
+ int first_end = match[1].rm_eo;
+
+ for (x = match[1].rm_so; x < first_end; x++)
+ temp_arr[z++] = cpu_str[x];
+
+ regcomp(&PatterN, "(.*) Processor", REG_EXTENDED);
+ regexec(&PatterN, cpu_str, 3, match, 0);
+
+ for (x = (first_end+4); x < match[1].rm_eo; x++)
+ temp_arr[z++] = cpu_str[x];
+
+ temp_arr[z] = '\0';
+ snprintf(cpu_str, MAX_STRLEN, "%s", temp_arr);
+
+ regfree(&PatterN);
+ }
+}
+
/* safe_strncpy
calls strncpy with the given params, then inserts a terminating NULL
returns a pointer to a string containing the copied data
@@ -36,17 +139,18 @@ char *safe_strncpy(char *destination, const char *source, size_t num)
/* split_uptime
splits param uptime into individual time-units
argument long uptime: the uptime, in seconds, to be split
- arguments int *secs..*days: pointers to ints for storing the uptime
+ arguments int *secs..*days: pointers to unsigned ints
+ for storing the uptime
--
CAVEAT: uptime MUST be in seconds
--
*/
-void split_uptime(long uptime, int *secs, int *mins, int *hrs, int *days)
+void split_uptime(long uptime, uint_least32_t *secs, uint_least32_t *mins, uint_least32_t *hrs, uint_least32_t *days)
{
- *secs = (int) uptime % 60;
- *mins = (int) (uptime / 60) % 60;
- *hrs = (int) (uptime / 3600) % 24;
- *days = (int) (uptime / 86400);
+ *secs = (uint_least32_t) uptime % 60;
+ *mins = (uint_least32_t) (uptime / 60) % 60;
+ *hrs = (uint_least32_t) (uptime / 3600) % 24;
+ *days = (uint_least32_t) (uptime / 86400);
return;
}
@@ -54,11 +158,112 @@ void split_uptime(long uptime, int *secs, int *mins, int *hrs, int *days)
/* take_screenshot
takes a screenshot and saves it to $HOME/screenfetch_screenshot.png
*/
-void take_screenshot(bool verbose)
+void take_screenshot(void)
{
+ char time_str[MAX_STRLEN], shot_location[MAX_STRLEN];
+ time_t t = time(NULL);
+ strftime(time_str, MAX_STRLEN, "%Y-%m-%d-%H%M%S", localtime(&t));
+
+#if defined (HAVE_X11_XLIB_H) && defined (HAVE_JPEGLIB_H)
+
+ Display *disp = XOpenDisplay(NULL);
+
+ if (disp)
+ {
+ printf("%s", "Taking shot in 3..");
+ fflush(stdout);
+ sleep(1);
+ printf("%s", "2..");
+ fflush(stdout);
+ sleep(1);
+ printf("%s", "1..");
+ fflush(stdout);
+ sleep(1);
+ printf("%s\n", "0");
+
+ uint_least32_t pixel;
+ uint_fast16_t height, width, x, y;
+ struct jpeg_compress_struct instance;
+ struct jpeg_error_mgr jerr;
+
+ FILE *file;
+ JSAMPROW row_ptr;
+ Screen *screen = ScreenOfDisplay(disp, DefaultScreen(disp));
+ Window root = RootWindow(disp, XScreenNumberOfScreen(screen));
+ width = WidthOfScreen(screen);
+ height = HeightOfScreen(screen);
+
+ XImage *img = XGetImage(disp, root, 0, 0, width, height, XAllPlanes(), ZPixmap);
+
+ sprintf(shot_location, "%s/screenfetch-%s_%s.jpg", getenv("HOME"), time_str, res_str);
+
+ if ((file = fopen(shot_location, "wb")) == NULL)
+ {
+ XCloseDisplay(disp);
+ fprintf(stderr, "Could not open \"%s\" for writing\n", shot_location);
+ exit(1);
+ }
+
+ char *tmp = malloc(sizeof(char)*3*width*height);
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ pixel = XGetPixel(img,x,y);
+ tmp[y*width*3+x*3+0] = (pixel>>16);
+ tmp[y*width*3+x*3+1] = ((pixel&0x00ff00)>>8);
+ tmp[y*width*3+x*3+2] = (pixel&0x0000ff);
+ }
+ }
+
+ instance.err = jpeg_std_error(&jerr);
+ jpeg_create_compress(&instance);
+ jpeg_stdio_dest(&instance, file);
+
+ instance.image_width = width;
+ instance.image_height = height;
+ instance.input_components = 3;
+ instance.in_color_space = JCS_RGB;
+
+ jpeg_set_defaults(&instance);
+ jpeg_set_quality(&instance, 100, TRUE);
+ jpeg_start_compress(&instance, TRUE);
+
+ while (instance.next_scanline < instance.image_height)
+ {
+ row_ptr = (JSAMPROW)\
+ &tmp[instance.next_scanline*(img->depth>>3)*width];
+ jpeg_write_scanlines(&instance, &row_ptr, 1);
+ }
+
+ free(tmp);
+ jpeg_finish_compress(&instance);
+ fclose(file);
+
+ jpeg_destroy_compress(&instance);
+ XDestroyImage(img);
+ XCloseDisplay(disp);
+
+ if (FILE_EXISTS(shot_location) && verbose)
+ VERBOSE_OUT(_("Screenshot successfully saved."), "");
+
+ else if (!FILE_EXISTS(shot_location) && error)
+ ERR_REPORT(_("Problem saving screenshot."));
+
+ }
+ else
+ {
+ ERR_REPORT(_("No X server, aborting the creation of screenshot."));
+ return;
+ }
+
+#else
+
#if !defined(__CYGWIN__)
int call_status = 1;
- char file_loc[MAX_STRLEN];
+ char shot_str[MAX_STRLEN+MAX_STRLEN], file_loc[MAX_STRLEN+MAX_STRLEN];
+ sprintf(shot_location, "/screenfetch-%s_%s.png", time_str, res_str);
#endif
printf("%s", "Taking shot in 3..");
@@ -77,7 +282,7 @@ void take_screenshot(bool verbose)
keybd_event(VK_SNAPSHOT, 0, 0, 0);
if (verbose)
- VERBOSE_OUT("Screenshot has been saved to the clipboard.", "");
+ VERBOSE_OUT(_("Screenshot has been saved to the clipboard."), "");
/* NOT FINSISHED - HBITMAP needs to be saved
HDC screen_dc = GetDC(NULL);
@@ -96,148 +301,24 @@ void take_screenshot(bool verbose)
DeleteDC(mem_dc);
*/
#elif defined(__APPLE__) && defined(__MACH__)
- call_status = system("screencapture -x ~/screenfetch_screenshot.png 2> /dev/null");
+ sprintf(shot_str, "screencapture -x ~%s 2> /dev/null", shot_location);
#else
- call_status = system("scrot ~/screenfetch_screenshot.png 2> /dev/null");
+ sprintf(shot_str, "scrot ~%s 2> /dev/null", shot_location);
#endif
#if !defined(__CYGWIN__)
+ call_status = system(shot_str);
safe_strncpy(file_loc, getenv("HOME"), MAX_STRLEN);
- strncat(file_loc, "/screenfetch_screenshot.png", MAX_STRLEN);
+ strncat(file_loc, shot_location, MAX_STRLEN);
if (FILE_EXISTS(file_loc) && verbose)
- {
- VERBOSE_OUT("Screenshot successfully saved.", "");
- }
+ VERBOSE_OUT(_("Screenshot successfully saved."), "");
+
else if (call_status && error)
- {
- ERR_REPORT("Problem saving screenshot.");
- }
+ ERR_REPORT(_("Problem saving screenshot."));
+
#endif
+#endif /* xlib_h, jpeg_h */
return;
-}
-
-/* manual_input
- generates (or reads) the ~/.screenfetchc file based upon user input
- returns an int indicating status (SUCCESS or FAILURE)
-*/
-int manual_input(char **data, bool verbose)
-{
- FILE *config_file;
- char config_file_loc[MAX_STRLEN];
-
- safe_strncpy(config_file_loc, getenv("HOME"), MAX_STRLEN);
- strncat(config_file_loc, "/.screenfetchc", MAX_STRLEN);
-
- if (!FILE_EXISTS(config_file_loc))
- {
- #if defined(__CYGWIN__)
- printf("%s\n", TBLU "WARNING: There is currenly a bug involving manual mode on Windows." TNRM);
- printf("%s\n", TBLU "Only continue if you are ABSOLUTELY sure." TNRM);
- #endif
-
- printf("%s\n", "This appears to be your first time running screenfetch-c in manual mode.");
- printf("%s", "Would you like to continue? (y/n) ");
-
- char choice = getchar();
- getchar(); /* flush the newline */
-
- if (choice == 'y' || choice == 'Y')
- {
- char input[MAX_STRLEN];
- config_file = fopen(config_file_loc, "w");
-
- printf("%s\n", "We are now going to begin the manual mode input process.");
- printf("%s\n", "Please enter exactly what is asked for.");
- printf("%s\n", "If you are unsure about format, please consult the manpage.");
-
- printf("%s", "Please enter the name of your distribution/OS: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your architecture: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your username@hostname: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your kernel: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your CPU name: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your GPU name: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your shell name and version: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your monitor resolution: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your DE name: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your WM name: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter your WM Theme name: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s", "Please enter any GTK info: ");
- fgets(input, MAX_STRLEN, stdin);
- fprintf(config_file, "%s", input);
-
- printf("%s\n", "That concludes the manual input.");
- printf("%s\n", "From now on, screenfetch-c will use this information when called with -m.");
-
- fclose(config_file);
- }
- else
- {
- printf("%s\n", "Exiting manual mode and screenfetch-c.");
- printf("%s\n", "If you wish to run screenfetch-c normally, do not use the -m (--manual) flag next time.");
- }
-
- return EXIT_FAILURE;
- }
- else
- {
- if (verbose)
- VERBOSE_OUT("Found config file. Reading...", "");
-
- config_file = fopen(config_file_loc, "r");
-
- /* store anything without a newline it it,
- then swallow any whitespace characters (" ").
- */
- fscanf(config_file, "%[^\n] ", data[1]);
- fscanf(config_file, "%[^\n] ", data[3]);
- fscanf(config_file, "%[^\n] ", data[0]);
- fscanf(config_file, "%[^\n] ", data[2]);
- fscanf(config_file, "%[^\n] ", data[4]);
- fscanf(config_file, "%[^\n] ", data[5]);
- fscanf(config_file, "%[^\n] ", data[6]);
- fscanf(config_file, "%[^\n] ", data[11]);
- fscanf(config_file, "%[^\n] ", data[12]);
- fscanf(config_file, "%[^\n] ", data[13]);
- fscanf(config_file, "%[^\n] ", data[14]);
- fscanf(config_file, "%[^\n] ", data[15]);
-
- fclose(config_file);
-
- return EXIT_SUCCESS;
- }
-}
+}
\ No newline at end of file
diff --git a/src/util.h b/src/util.h
deleted file mode 100644
index 7976e03..0000000
--- a/src/util.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* util.h
- * Author: William Woodruff
- * -------------
- *
- * Function prototypes for util.c.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#ifndef SCREENFETCH_C_UTIL_H
-#define SCREENFETCH_C_UTIL_H
-
-char *safe_strncpy(char *destination, const char *source, size_t num);
-void split_uptime(long uptime, int *secs, int *mins, int *hrs, int *days);
-void take_screenshot(bool verbose);
-int manual_input(char **data, bool verbose);
-
-#endif /* SCREENFETCH_C_UTIL_H */
diff --git a/src/version.h b/src/version.h
deleted file mode 100644
index b8b82ae..0000000
--- a/src/version.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* version.h
- * Author: William Woodruff
- * -------------
- *
- * Macros for screenfetch-c's macjor, minor, and release numbers.
- * Like the rest of screenfetch-c, this file is licensed under the MIT license.
- */
-
-#ifndef SCREENFETCH_C_VERSION_H
-#define SCREENFETCH_C_VERSION_H
-
-/* version macros */
-#define SCREENFETCH_C_VERSION_MAJOR "1"
-#define SCREENFETCH_C_VERSION_MINOR "3"
-#define SCREENFETCH_C_VERSION_RELEASE "9"
-
-#endif /* SCREENFETCH_C_VERSION_H */
diff --git a/tests/gltest.c b/tests/gltest.c
deleted file mode 100644
index ec528e3..0000000
--- a/tests/gltest.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* gltest.c
- * Author: William Woodruff
- *
- * Tests for the presence of the OpenGL headers.
- */
-
-#include <GL/gl.h>
-#include <GL/glx.h>
-
-int main(void)
-{
- ;
-}
diff --git a/tests/x11test.c b/tests/x11test.c
deleted file mode 100644
index 4cc8df3..0000000
--- a/tests/x11test.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* x11test.c
- * Author: William Woodruff
- *
- * Tests for the presence of the X11 headers.
- */
-
-#include <X11/Xlib.h>
-
-int main(void)
-{
- ;
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment