Merge branch 'master' into fahrenheit

This commit is contained in:
Dylan Araps 2017-01-02 11:16:05 +11:00
commit 3f7dd84ef8
4 changed files with 92 additions and 87 deletions

View File

@ -22,7 +22,8 @@ Neofetch now has an irc channel at `#neofetch` on Freenode. If you have any ques
- Added support for AntiX. - Added support for AntiX.
- Added support for TrueOS. - Added support for TrueOS.
- Added support for SalentOS. - Added support for SalentOS.
- Merged all GNU Hurd instances to Linux since they work exactly the same way. - Added support for Gentoo FreeBSD.
- Added support for Joyent SmartOS.
## General ## General
@ -154,6 +155,11 @@ Neofetch now has an irc channel at `#neofetch` on Freenode. If you have any ques
- Fixed bug where image mode would attempt to run in a TTY. - Fixed bug where image mode would attempt to run in a TTY.
## Wallpaper
- Decode URI filenames.
## Ascii ## Ascii
- Added Ubuntu-Studio. **[@konimex](https://github.com/konimex)** - Added Ubuntu-Studio. **[@konimex](https://github.com/konimex)**

17
ascii/distro/smartos Normal file
View File

@ -0,0 +1,17 @@
${c1}yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
yyyys oyyyyyyyyyyyyyyyy
yyyys yyyyyyyyy oyyyyyyyyyyyyyyyy
yyyys yyyyyyyyy oyyyyyyyyyyyyyyyy
yyyys yyyyyyyyy oyyyyyyyyyyyyyyyy
yyyys yyyyyyyyy oyyyyyyyyyyyyyyyy
yyyys yyyyyyyyyyyyyyyyyyyyyyyyyyyy
yyyyy syyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyy syyyy
yyyyyyyyyyyyyyyy syyyyyyyyy syyyy
yyyyyyyyyyyyyyyy oyyyyyyyyy syyyy
yyyyyyyyyyyyyyyy oyyyyyyyyy syyyy
yyyyyyyyyyyyyyyy syyyyyyyyy syyyy
yyyyyyyyyyyyyyyy yyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

128
neofetch
View File

@ -53,7 +53,7 @@ get_distro() {
[[ "$distro" ]] && return [[ "$distro" ]] && return
case "$os" in case "$os" in
"Linux") "Linux" | "BSD" | "MINIX")
if [[ "$(< /proc/version)" == *"Microsoft"* || "$(< /proc/sys/kernel/osrelease)" == *"Microsoft"* ]]; then if [[ "$(< /proc/version)" == *"Microsoft"* || "$(< /proc/sys/kernel/osrelease)" == *"Microsoft"* ]]; then
case "$distro_shorthand" in case "$distro_shorthand" in
"on") distro="$(lsb_release -sir) [Windows 10]" ;; "on") distro="$(lsb_release -sir) [Windows 10]" ;;
@ -95,9 +95,9 @@ get_distro() {
elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then
distro="Android $(getprop ro.build.version.release)" distro="Android $(getprop ro.build.version.release)"
else elif [[ -f "/etc/os-release" || -f "/usr/lib/os-release" ]]; then
# Source the os-release file. # Source the os-release file
for file in /etc/os-release /usr/lib/os-release /etc/*release /usr/lib/*release; do for file in /etc/os-release /usr/lib/os-release; do
source "$file" 2>/dev/null && break source "$file" 2>/dev/null && break
done done
@ -109,8 +109,25 @@ get_distro() {
esac esac
# Workarounds for distros that go against the os-release standard. # Workarounds for distros that go against the os-release standard.
[[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease /usr/lib/*ease)" [[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/os-release /usr/lib/os-release)"
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/*ease /usr/lib/*ease)" [[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/os-release /usr/lib/os-release)"
else
for release_file in /etc/*-release; do
distro+="$(< "$release_file")"
done
if [[ -z "$distro" ]]; then
case "$distro_shorthand" in
"on" | "tiny") distro="$kernel_name" ;;
*) distro="$kernel_name $kernel_version" ;;
esac
distro="${distro/DragonFly/DragonFlyBSD}"
# Workarounds for FreeBSD based distros.
[[ -f "/etc/pcbsd-lang" ]] && distro="PCBSD"
[[ -f "/etc/rc.conf.trueos" ]] && distro="TrueOS"
[[ -f "/etc/pacbsd-release" ]] && distro="PacBSD" # /etc/pacbsd-release is an empty file
fi
fi fi
distro="$(trim_quotes "$distro")" distro="$(trim_quotes "$distro")"
;; ;;
@ -153,20 +170,6 @@ get_distro() {
os_arch="off" os_arch="off"
;; ;;
"BSD" | "MINIX")
case "$distro_shorthand" in
"tiny" | "on") distro="$kernel_name" ;;
*) distro="$kernel_name $kernel_version" ;;
esac
distro="${distro/DragonFly/DragonFlyBSD}"
# Workarounds for FreeBSD based distros.
[[ -f "/etc/pcbsd-lang" ]] && distro="PCBSD"
[[ -f "/etc/trueos-lang" ]] && distro="TrueOS"
[[ -f "/etc/pacbsd-release" ]] && distro="PacBSD"
;;
"Windows") "Windows")
distro="$(wmic os get Caption /value)" distro="$(wmic os get Caption /value)"
@ -393,7 +396,7 @@ get_packages() {
local PATH="${PATH#:}" local PATH="${PATH#:}"
case "$os" in case "$os" in
"Linux" | "iPhone OS" | "Solaris") "Linux" | "BSD" | "iPhone OS" | "Solaris")
type -p pacman >/dev/null && \ type -p pacman >/dev/null && \
packages="$(pacman -Qq --color never | wc -l)" packages="$(pacman -Qq --color never | wc -l)"
@ -442,18 +445,19 @@ get_packages() {
type -p Compile >/dev/null && \ type -p Compile >/dev/null && \
packages="$((packages+=$(ls -d -1 /Programs/*/ | wc -l)))" packages="$((packages+=$(ls -d -1 /Programs/*/ | wc -l)))"
# pisi is sometimes unavailable in Solus(?). This uses eopkg type -p eopkg >/dev/null && \
# instead if pisi isn't found.
if type -p pisi >/dev/null; then
packages="$((packages+=$(pisi list-installed | wc -l)))"
elif type -p eopkg >/dev/null; then
packages="$((packages+=$(eopkg list-installed | wc -l)))" packages="$((packages+=$(eopkg list-installed | wc -l)))"
fi
type -p pkg_info >/dev/null && \
packages="$((packages+=$(pkg_info | wc -l)))"
if type -p pkg >/dev/null; then if type -p pkg >/dev/null; then
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))" case "$kernel_name" in
(("$packages" == "0")) && packages="$((packages+=$(pkg list | wc -l)))" "FreeBSD") packages="$((packages+=$(pkg info | wc -l)))" ;;
*)
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))"
(("$packages" == "0")) && packages="$((packages+=$(pkg list | wc -l)))"
esac
fi fi
;; ;;
@ -471,21 +475,6 @@ get_packages() {
packages="$((packages + $(pkgin list | wc -l)))" packages="$((packages + $(pkgin list | wc -l)))"
;; ;;
"BSD")
case "$distro" in
# PacBSD has both pacman and pkg, but only pacman is used.
"PacBSD"*) packages="$(pacman -Qq --color never | wc -l)" ;;
*)
if type -p pkg_info >/dev/null; then
packages="$(pkg_info | wc -l)"
elif type -p pkg >/dev/null; then
packages="$(pkg info | wc -l)"
fi
;;
esac
;;
"Windows") "Windows")
packages="$(cygcheck -cd | wc -l)" packages="$(cygcheck -cd | wc -l)"
@ -511,7 +500,7 @@ get_shell() {
if [[ "$shell_version" == "on" ]]; then if [[ "$shell_version" == "on" ]]; then
case "${SHELL##*/}" in case "${SHELL##*/}" in
"bash") shell+="${BASH_VERSION/-*}" ;; "bash") shell+="${BASH_VERSION/-*}" ;;
"sh") ;; "sh" | "ash" | "dash") ;;
"mksh" | "ksh") "mksh" | "ksh")
shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')" shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')"
@ -2567,7 +2556,7 @@ get_distro_colors() {
"antiX"*) "antiX"*)
set_colors 1 7 3 set_colors 1 7 3
ascii_Distro="antix" ascii_distro="antix"
;; ;;
"FreeBSD"*) "FreeBSD"*)
@ -2602,18 +2591,28 @@ get_distro_colors() {
set_colors 4 3 set_colors 4 3
;; ;;
"NetBSD"* | "Parabola"* | "Tails"* | "BLAG"* | "Gentoo"* | "Funtoo"* | "SteamOS"* | "Devuan"*) "NetBSD"* | "Parabola"* | "Tails"* | "BLAG"* | "Funtoo"* | "SteamOS"* | "Devuan"*)
set_colors 5 7 set_colors 5 7
;; ;;
"Gentoo"*)
set_colors 5 7
ascii_distro="gentoo"
;;
"OpenBSD"* | "GuixSD"* | "Pardus"*) "OpenBSD"* | "GuixSD"* | "Pardus"*)
set_colors 3 7 6 1 8 set_colors 3 7 6 1 8
;; ;;
*"SUSE"* | "Manjaro"* | "Deepin"* |"LMDE"* | "Chapeau"* | "Bitrig"*) "Manjaro"* | "Deepin"* | "LMDE"* | "Chapeau"* | "Bitrig"*)
set_colors 2 7 set_colors 2 7
;; ;;
*"SUSE"*)
set_colors 2 7
ascii_distro="suse"
;;
"KDE"*) "KDE"*)
set_colors 2 7 set_colors 2 7
ascii_distro="kde" ascii_distro="kde"
@ -2661,7 +2660,7 @@ get_distro_colors() {
set_colors 2 8 set_colors 2 8
;; ;;
"Mageia"* | "Porteus"* | "Parrot"*) "Mageia"* | "Porteus"* | "Parrot"* | "SmartOS"*)
set_colors 6 7 set_colors 6 7
;; ;;
@ -3147,8 +3146,7 @@ NOTE: Every launch flag has a config option.
Options: Options:
INFO INFO:
--disable infoname Allows you to disable an info line from appearing --disable infoname Allows you to disable an info line from appearing
in the output. in the output.
@ -3202,23 +3200,20 @@ INFO
--install_time_format 12h/24h --install_time_format 12h/24h
Set time format in Install Date to be 12 hour or 24 hour. Set time format in Install Date to be 12 hour or 24 hour.
TEXT FORMATTING TEXT FORMATTING:
--colors x x x x x x Changes the text colors in this order: --colors x x x x x x Changes the text colors in this order:
title, @, underline, subtitle, colon, info title, @, underline, subtitle, colon, info
--underline on/off Enable/Disable the underline. --underline on/off Enable/Disable the underline.
--underline_char char Character to use when underlining title --underline_char char Character to use when underlining title
--bold on/off Enable/Disable bold text --bold on/off Enable/Disable bold text
COLOR BLOCKS COLOR BLOCKS:
--color_blocks on/off Enable/Disable the color blocks --color_blocks on/off Enable/Disable the color blocks
--block_width num Width of color blocks in spaces --block_width num Width of color blocks in spaces
--block_height num Height of color blocks in lines --block_height num Height of color blocks in lines
--block_range num num Range of colors to print as blocks --block_range num num Range of colors to print as blocks
BARS BARS:
--bar_char 'elapsed char' 'total char' --bar_char 'elapsed char' 'total char'
Characters to use when drawing bars. Characters to use when drawing bars.
--bar_border on/off Whether or not to surround the bar with '[]' --bar_border on/off Whether or not to surround the bar with '[]'
@ -3233,8 +3228,7 @@ BARS
Takes: bar, infobar, barinfo, off Takes: bar, infobar, barinfo, off
--disk_display mode Bar mode. --disk_display mode Bar mode.
Takes: bar, infobar, barinfo, off Takes: bar, infobar, barinfo, off
IMAGE IMAGE:
--image type Image source. Where and what image we display. --image type Image source. Where and what image we display.
Possible values: wall, ascii, Possible values: wall, ascii,
/path/to/img, /path/to/dir/, off /path/to/img, /path/to/dir/, off
@ -3258,8 +3252,7 @@ IMAGE
--clean Delete cached files and thumbnails. --clean Delete cached files and thumbnails.
ASCII ASCII:
--ascii value Where to get the ascii from, Possible values: --ascii value Where to get the ascii from, Possible values:
distro, /path/to/ascii distro, /path/to/ascii
--ascii_colors x x x x x x Colors to print the ascii art --ascii_colors x x x x x x Colors to print the ascii art
@ -3280,16 +3273,14 @@ ASCII
--ascii_bold on/off Whether or not to bold the ascii logo. --ascii_bold on/off Whether or not to bold the ascii logo.
-L, --logo Hide the info text and only show the ascii logo. -L, --logo Hide the info text and only show the ascii logo.
SCREENSHOT SCREENSHOT:
-s, --scrot /path/to/img Take a screenshot, if path is left empty the screen- -s, --scrot /path/to/img Take a screenshot, if path is left empty the screen-
shot function will use \$scrot_dir and \$scrot_name. shot function will use \$scrot_dir and \$scrot_name.
-su, --upload /path/to/img Same as --scrot but uploads the scrot to a website. -su, --upload /path/to/img Same as --scrot but uploads the scrot to a website.
--image_host Website to upload scrots to. Takes: imgur, teknik --image_host Website to upload scrots to. Takes: imgur, teknik
--scrot_cmd cmd Screenshot program to launch --scrot_cmd cmd Screenshot program to launch
OTHER OTHER:
--config /path/to/config Specify a path to a custom config file --config /path/to/config Specify a path to a custom config file
--config none Launch the script without a config file --config none Launch the script without a config file
--help Print this text and exit --help Print this text and exit
@ -3297,8 +3288,7 @@ OTHER
-v Display error messages. -v Display error messages.
-vv Display a verbose log for error reporting. -vv Display a verbose log for error reporting.
DEVELOPER DEVELOPER:
--gen-man Generate a manpage for Neofetch in your PWD. (Requires GNU help2man) --gen-man Generate a manpage for Neofetch in your PWD. (Requires GNU help2man)
@ -3503,7 +3493,7 @@ main() {
get_os get_os
get_default_config 2>/dev/null get_default_config 2>/dev/null
get_args "$@" get_args "$@"
get_distro get_distro 2>/dev/null
get_bold get_bold
get_distro_colors get_distro_colors

View File

@ -12,7 +12,7 @@ or any ASCII file of your choice.
.PP .PP
NOTE: Every launch flag has a config option. NOTE: Every launch flag has a config option.
.SH OPTIONS .SH OPTIONS
INFO .SS "INFO:"
.TP .TP
\fB\-\-disable\fR infoname \fB\-\-disable\fR infoname
Allows you to disable an info line from appearing Allows you to disable an info line from appearing
@ -101,8 +101,7 @@ Enable/Disable showing the time in Install Date output.
.TP .TP
\fB\-\-install_time_format\fR 12h/24h \fB\-\-install_time_format\fR 12h/24h
Set time format in Install Date to be 12 hour or 24 hour. Set time format in Install Date to be 12 hour or 24 hour.
.PP .SS "TEXT FORMATTING:"
TEXT FORMATTING
.TP .TP
\fB\-\-colors\fR x x x x x x \fB\-\-colors\fR x x x x x x
Changes the text colors in this order: Changes the text colors in this order:
@ -116,8 +115,7 @@ Character to use when underlining title
.TP .TP
\fB\-\-bold\fR on/off \fB\-\-bold\fR on/off
Enable/Disable bold text Enable/Disable bold text
.PP .SS "COLOR BLOCKS:"
COLOR BLOCKS
.TP .TP
\fB\-\-color_blocks\fR on/off \fB\-\-color_blocks\fR on/off
Enable/Disable the color blocks Enable/Disable the color blocks
@ -130,8 +128,7 @@ Height of color blocks in lines
.TP .TP
\fB\-\-block_range\fR num num \fB\-\-block_range\fR num num
Range of colors to print as blocks Range of colors to print as blocks
.PP .SS "BARS:"
BARS
.TP .TP
\fB\-\-bar_char\fR 'elapsed char' 'total char' \fB\-\-bar_char\fR 'elapsed char' 'total char'
Characters to use when drawing bars. Characters to use when drawing bars.
@ -161,8 +158,7 @@ Takes: bar, infobar, barinfo, off
\fB\-\-disk_display\fR mode \fB\-\-disk_display\fR mode
Bar mode. Bar mode.
Takes: bar, infobar, barinfo, off Takes: bar, infobar, barinfo, off
.PP .SS "IMAGE:"
IMAGE
.TP .TP
\fB\-\-image\fR type \fB\-\-image\fR type
Image source. Where and what image we display. Image source. Where and what image we display.
@ -201,8 +197,7 @@ NOTE: \fB\-\-gap\fR can take a negative value which will move the text closer to
.TP .TP
\fB\-\-clean\fR \fB\-\-clean\fR
Delete cached files and thumbnails. Delete cached files and thumbnails.
.PP .SS "ASCII:"
ASCII
.TP .TP
\fB\-\-ascii\fR value \fB\-\-ascii\fR value
Where to get the ascii from, Possible values: Where to get the ascii from, Possible values:
@ -231,8 +226,7 @@ Whether or not to bold the ascii logo.
.TP .TP
\fB\-L\fR, \fB\-\-logo\fR \fB\-L\fR, \fB\-\-logo\fR
Hide the info text and only show the ascii logo. Hide the info text and only show the ascii logo.
.PP .SS "SCREENSHOT:"
SCREENSHOT
.TP .TP
\fB\-s\fR, \fB\-\-scrot\fR \fI\,/path/to/img\/\fP \fB\-s\fR, \fB\-\-scrot\fR \fI\,/path/to/img\/\fP
Take a screenshot, if path is left empty the screenshot function will use $scrot_dir and $scrot_name. Take a screenshot, if path is left empty the screenshot function will use $scrot_dir and $scrot_name.
@ -245,8 +239,7 @@ Website to upload scrots to. Takes: imgur, teknik
.TP .TP
\fB\-\-scrot_cmd\fR cmd \fB\-\-scrot_cmd\fR cmd
Screenshot program to launch Screenshot program to launch
.PP .SS "OTHER:"
OTHER
.TP .TP
\fB\-\-config\fR \fI\,/path/to/config\/\fP \fB\-\-config\fR \fI\,/path/to/config\/\fP
Specify a path to a custom config file Specify a path to a custom config file
@ -265,8 +258,7 @@ Display error messages.
.TP .TP
\fB\-vv\fR \fB\-vv\fR
Display a verbose log for error reporting. Display a verbose log for error reporting.
.PP .SS "DEVELOPER:"
DEVELOPER
.TP .TP
\fB\-\-gen\-man\fR \fB\-\-gen\-man\fR
Generate a manpage for Neofetch in your PWD. (Requires GNU help2man) Generate a manpage for Neofetch in your PWD. (Requires GNU help2man)