From 3457f008b2fb7dd45d717153e1c840e7a72b1cce Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 16:40:30 +1100 Subject: [PATCH 01/11] Ascii: Simplify function --- neofetch | 282 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 241 insertions(+), 41 deletions(-) diff --git a/neofetch b/neofetch index 5cce848c..b4d9c8c9 100755 --- a/neofetch +++ b/neofetch @@ -1906,35 +1906,24 @@ get_ascii() { [[ "$ascii" != "distro" && ! -f "$ascii" ]] && \ err "Ascii: Ascii file not found, using distro ascii." - # Lowercase the distro name so we can match it to a file. - if (("$bash_version" <= 3)); then - ascii="$(tr '[:upper:]' '[:lower:]' <<< "$ascii_distro")" - else - ascii="${ascii_distro,,}" - fi + if [[ -d "/usr/share/neofetch/ascii/distro" ]]; then + ascii_dir="/usr/share/neofetch/ascii/distro" - if [[ -f "/usr/share/neofetch/ascii/distro/${ascii/ *}" ]]; then - ascii="/usr/share/neofetch/ascii/distro/${ascii/ *}" + elif [[ -d "/usr/local/share/neofetch/ascii/distro" ]]; then + ascii_dir="/usr/local/share/neofetch/ascii/distro" - elif [[ -f "/usr/local/share/neofetch/ascii/distro/${ascii/ *}" ]]; then - ascii="/usr/local/share/neofetch/ascii/distro/${ascii/ *}" - - elif [[ -f "/data/data/com.termux/files/usr/share/neofetch/ascii/distro/${ascii/ *}" ]]; then - ascii="/data/data/com.termux/files/usr/share/neofetch/ascii/distro/${ascii/ *}" + elif [[ -d "/data/data/com.termux/files/usr/share/neofetch/ascii/distro" ]]; then + ascii_dir="/data/data/com.termux/files/usr/share/neofetch/ascii/distro" else get_script_dir 2>/dev/null + ascii_dir="${script_dir}/ascii/distro" - # If the ascii file doesn't exist fallback to text mode. - if [[ -f "$script_dir/ascii/distro/${ascii/ *}" ]]; then - ascii="$script_dir/ascii/distro/${ascii/ *}" - - else - to_off "Ascii: Ascii file not found, falling back to text mode." - return - fi + [[ -d "$ascii_dir" ]] || \ + { to_off "Ascii: Ascii file not found, falling back to text mode."; return; } fi fi + ascii="${ascii_dir}/${ascii_file}" # Set locale to get correct padding. export LC_ALL="$sys_locale" @@ -2500,81 +2489,299 @@ get_distro_colors() { # # $ascii_distro is the same as $distro. case "$ascii_distro" in - "Arch"* | "Kogaion"* | "Elementary"* | "GalliumOS"* | "Rosa"* | "OpenWrt"* | "Netrunner"* | "PCLinuxOS"* | "Slackware"* | "KaOS"* | "Kubuntu"* | "Lubuntu"* | "Xubuntu"* | "OpenIndiana"* | "Fedora"* | "Korora"* | "Sabayon"* | "Frugalware"* | "Exherbo"* | "Scientific"* | "Solus"* | "ChaletOS"* | "Apricity"* | "SwagArch"* | "AOSC"* | "Ubuntu-Budgie"*) + "Arch"*) set_colors 4 7 1 + ascii_file="arch" ;; - "RFRemix"*) + "Kogaion"*) set_colors 4 7 1 - ascii_distro="Fedora" + ascii_file="kogaion" + ;; + + "Elementary"*) + set_colors 4 7 1 + ascii_file="elementary" + ;; + + "GalliumOS"*) + set_colors 4 7 1 + ascii_file="galliumos" + ;; + + "Rosa"*) + set_colors 4 7 1 + ascii_file="rosa" + ;; + + "OpenWrt"*) + set_colors 4 7 1 + ascii_file="openwrt" + ;; + + "Netrunner"*) + set_colors 4 7 1 + ascii_file="netrunner" + ;; + + "PCLinuxOS"*) + set_colors 4 7 1 + ascii_file="pclinuxos" + ;; + + "Slackware"*) + set_colors 4 7 1 + ascii_file="slackware" + ;; + + "KaOS"*) + set_colors 4 7 1 + ascii_file="kaos" + ;; + + "Kubuntu"*) + set_colors 4 7 1 + ascii_file="kubuntu" + ;; + + "Lubuntu"*) + set_colors 4 7 1 + ascii_file="lubuntu" + ;; + + "Xubuntu"*) + set_colors 4 7 1 + ascii_file="xubuntu" + ;; + + "OpenIndiana"*) + set_colors 4 7 1 + ascii_file="openindiana" + ;; + + "Fedora"* | "RFRemix"*) + set_colors 4 7 1 + ascii_file="fedora" + ;; + + "Korora"*) + set_colors 4 7 1 + ascii_file="korora" + ;; + + "Sabayon"*) + set_colors 4 7 1 + ascii_file="sabayon" + ;; + + "Frugalware"*) + set_colors 4 7 1 + ascii_file="frugalware" + ;; + + "Exherbo"*) + set_colors 4 7 1 + ascii_file="exherbo" + ;; + + "Scientific"*) + set_colors 4 7 1 + ascii_file="scientific" + ;; + + "Solus"*) + set_colors 4 7 1 + ascii_file="solus" + ;; + + "ChaletOS"*) + set_colors 4 7 1 + ascii_file="chaletos" + ;; + + "Apricity"*) + set_colors 4 7 1 + ascii_file="apricity" + ;; + + "SwagArch"*) + set_colors 4 7 1 + ascii_file="swagarch" + ;; + + "AOSC"*) + set_colors 4 7 1 + ascii_file="aosc" + ;; + + "Ubuntu-Budgie"*) + set_colors 4 7 1 + ascii_file="ubuntu-budgie" ;; "CentOS"*) set_colors 3 2 4 5 7 + ascii_file="centos" ;; "GoboLinux"*) set_colors 5 4 6 2 + ascii_file="gobolinux" ;; "SalentOS"*) set_colors 2 1 3 7 + ascii_file="salentos" ;; - "CRUX"* | "Chakra"* | "gNewSense"* | "SailfishOS"* | "Alpine"* | "Ubuntu-GNOME"* | "Qubes"*) + "CRUX"*) set_colors 4 5 7 6 + ascii_file="crux" + ;; + + "Chakra"*) + set_colors 4 5 7 6 + ascii_file="chakra" + ;; + + "gNewSense"*) + set_colors 4 5 7 6 + ascii_file="gnewsense" + ;; + + "SailfishOS"*) + set_colors 4 5 7 6 + ascii_file="sailfishos" + ;; + + "Alpine"*) + set_colors 4 5 7 6 + ascii_file="alpine" + ;; + + "Ubuntu-GNOME"*) + set_colors 4 5 7 6 + ascii_file="ubuntu-gnome" + ;; + + "Qubes"*) + set_colors 4 5 7 6 + ascii_file="qubes" ;; "Chrom"*) set_colors 2 1 3 4 7 - ascii_distro="chrome" + ascii_file="chrome" ;; "Raspbian"*) set_colors 2 1 + ascii_file="raspbian" ;; - "Debian"* | "Ubuntu"* | "DragonFly"* | "PacBSD"* | "Oracle"* | "BlankOn"* | "DracOS"* | "Peppermint"* | "Minix"*) + "Debian"*) set_colors 1 7 3 + ascii_file="debian" + ;; + + "Ubuntu"*) + set_colors 1 7 3 + ascii_file="ubuntu" + ;; + + "DragonFly"*) + set_colors 1 7 3 + ascii_file="dragonflybsd" + ;; + + "PacBSD"*) + set_colors 1 7 3 + ascii_file="pacbsd" + ;; + + "Oracle"*) + set_colors 1 7 3 + ascii_file="oracle" + ;; + + "BlankOn"*) + set_colors 1 7 3 + ascii_file="blankon" + ;; + + "DracOS"*) + set_colors 1 7 3 + ascii_file="dracos" + ;; + + "Peppermint"*) + set_colors 1 7 3 + ascii_file="peppermint" + ;; + + "Minix"*) + set_colors 1 7 3 + ascii_file="minix" ;; "antiX"*) set_colors 1 7 3 - ascii_distro="antix" + ascii_file="antix" ;; "FreeBSD"*) set_colors 1 7 3 - ascii_distro="freebsd" + ascii_file="freebsd" ;; "PCBSD"* | "TrueOS"*) set_colors 1 7 3 - ascii_distro="trueos" + ascii_file="trueos" ;; - "Red Star"* | "Redstar") + "Red Star"* | "Redstar"*) set_colors 1 7 3 - ascii_distro="redstar" + ascii_file="redstar" ;; + # TODO (Before PR is merged): Make this glob less greedy. "Red"*) set_colors 1 7 3 - ascii_distro="redhat" + ascii_file="redhat" ;; "Kali"*) set_colors 4 8 + ascii_file="kali" ;; "BunsenLabs"*) - set_colors fg 7 + set_colors 0 7 + ascii_file="bunsenlabs" ;; "OpenMandriva"*) set_colors 4 3 + ascii_file="openmadriva" ;; + "NetBSD"*) + set_colors 5 7 + ascii_file="netbsd" + ;; + esac + + # Overwrite distro colors if '$ascii_colors' doesn't + # equal 'distro'. + if [[ "${ascii_colors[0]}" != "distro" ]]; then + color_text="off" + set_colors "${ascii_colors[@]}" + fi +} + +# Here temporarily. +get_distro_colors_old() { + case "$ascii_distro" in "NetBSD"* | "Parabola"* | "Tails"* | "BLAG"* | "Funtoo"* | "SteamOS"* | "Devuan"*) set_colors 5 7 ;; @@ -2690,13 +2897,6 @@ get_distro_colors() { esac ;; esac - - # Overwrite distro colors if '$ascii_colors' doesn't - # equal 'distro'. - if [[ "${ascii_colors[0]}" != "distro" ]]; then - color_text="off" - set_colors "${ascii_colors[@]}" - fi } set_colors() { From fd6dd9fd6ba85f45403d6d613e5af4a9a8fbcc36 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 16:53:05 +1100 Subject: [PATCH 02/11] Ascii: More cleanup --- neofetch | 337 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 217 insertions(+), 120 deletions(-) diff --git a/neofetch b/neofetch index b4d9c8c9..fdd8b937 100755 --- a/neofetch +++ b/neofetch @@ -2769,6 +2769,223 @@ get_distro_colors() { set_colors 5 7 ascii_file="netbsd" ;; + + "Parabola"*) + set_colors 5 7 + ascii_file="parabola" + ;; + + "Tails"*) + set_colors 5 7 + ascii_file="tails" + ;; + + "BLAG"*) + set_colors 5 7 + ascii_file="blag" + ;; + + "Funtoo"*) + set_colors 5 7 + ascii_file="funtoo" + ;; + + "SteamOS"*) + set_colors 5 7 + ascii_file="steamos" + ;; + + "Devuan"*) + set_colors 5 7 + ascii_file="devuan" + ;; + + "Gentoo"*) + set_colors 5 7 + ascii_file="gentoo" + ;; + + "OpenBSD"*) + set_colors 3 7 6 1 8 + ascii_file="openbsd" + ;; + + "GuixSD"*) + set_colors 3 7 6 1 8 + ascii_file="guixsd" + ;; + + "Pardus"*) + set_colors 3 7 6 1 8 + ascii_file="pardus" + ;; + + "Manjaro"*) + set_colors 2 7 + ascii_file="manjaro" + ;; + + "Deepin"*) + set_colors 2 7 + ascii_file="deepin" + ;; + + "LMDE"*) + set_colors 2 7 + ascii_file="lmde" + ;; + + "Chapeau"*) + set_colors 2 7 + ascii_file="chapeau" + ;; + + "Bitrig"*) + set_colors 2 7 + ascii_file="bitrig" + ;; + + # TODO (Before PR is merged): Make this glob less greedy. + *"SUSE"*) + set_colors 2 7 + ascii_distro="suse" + ;; + + "KDE"*) + set_colors 2 7 + ascii_file="kde" + ;; + + "Android"*) + set_colors 2 7 + ascii_file="android" + ascii_length_force="19" + ;; + + # TODO (Before PR is merged): Make this glob less greedy. + *"Mint"*) + set_colors 2 7 + ascii_file="mint" + ;; + + "Puppy"* | "Quirky Werewolf"* | "Precise Puppy"*) + set_colors 4 7 + ascii_file="puppy" + ;; + + "Sparky"*) + set_colors 1 7 + ascii_file="sparky" + ;; + + "Trisquel"*) + set_colors 4 6 + ascii_file="trisquel" + ;; + + "NixOS"*) + set_colors 4 6 + ascii_file="nixOS" + ;; + + "Zorin"*) + set_colors 4 6 + ascii_file="zorin" + ;; + + "Antergos"*) + set_colors 4 6 + ascii_file="antergos" + ;; + + "MX"*) + set_colors 4 6 7 + ascii_file="mx" + ;; + + "Travis") + set_colors 1 2 3 4 5 6 + ascii_file="travis" + ;; + + "Grombyang"*) + set_colors 4 2 1 + ascii_file="grombyang" + ;; + + "Void"*) + set_colors 2 8 + ascii_file="void" + ;; + + "Haiku"*) + set_colors 2 8 + ascii_file="haiku" + ;; + + "Mageia"*) + set_colors 6 7 + ascii_file="mageia" + ;; + + "Porteus"*) + set_colors 6 7 + ascii_file="porteus" + ;; + + "Parrot"*) + set_colors 6 7 + ascii_file="parrot" + ;; + + "SmartOS"*) + set_colors 6 7 + ascii_file="smartos" + ;; + + "Windows 8"* | "Windows 10"*) + set_colors 6 7 + ascii_file="windows10" + ;; + + "Windows"*) + set_colors 1 2 4 3 + ascii_file="windows" + ;; + + *"OS X"* | *"iOS"* | "Mac" | *"macOS"*) + set_colors 2 3 1 1 5 4 + ascii_file="mac" + ;; + + "Linux") + set_colors fg 8 3 + ascii_file="linix" + ;; + + *) + case "$kernel_name" in + "Linux") + ascii_file="linux" + set_colors fg 8 3 + ;; + + *"BSD") + ascii_file="bsd" + set_colors 1 7 4 3 6 + ;; + + "GNU"*) + ascii_file="gnu" + set_colors fg + ;; + + "SunOS") + ascii_file="solaris" + set_colors 3 + ;; + esac + ;; esac # Overwrite distro colors if '$ascii_colors' doesn't @@ -2779,126 +2996,6 @@ get_distro_colors() { fi } -# Here temporarily. -get_distro_colors_old() { - case "$ascii_distro" in - "NetBSD"* | "Parabola"* | "Tails"* | "BLAG"* | "Funtoo"* | "SteamOS"* | "Devuan"*) - set_colors 5 7 - ;; - - "Gentoo"*) - set_colors 5 7 - ascii_distro="gentoo" - ;; - - "OpenBSD"* | "GuixSD"* | "Pardus"*) - set_colors 3 7 6 1 8 - ;; - - "Manjaro"* | "Deepin"* | "LMDE"* | "Chapeau"* | "Bitrig"*) - set_colors 2 7 - ;; - - *"SUSE"*) - set_colors 2 7 - ascii_distro="suse" - ;; - - "KDE"*) - set_colors 2 7 - ascii_distro="kde" - ;; - - "Android"*) - set_colors 2 7 - ascii_length_force="19" - ;; - - *"Mint"*) - set_colors 2 7 - ascii_distro="mint" - ;; - - "Puppy"* | "Quirky Werewolf"* | "Precise Puppy"*) - set_colors 4 7 - ascii_distro="puppy" - ;; - - "Sparky"*) - set_colors 1 7 - ascii_distro="sparky" - ;; - - "Trisquel"* | "NixOS"* | "Zorin"* | "Antergos"*) - set_colors 4 6 - ;; - - "MX"*) - set_colors 4 6 7 - ascii_distro="mx" - ;; - - "Travis") - set_colors 1 2 3 4 5 6 - ;; - - "Grombyang"*) - set_colors 4 2 1 - ascii_distro="grombyang" - ;; - - "Void"* | "Haiku"*) - set_colors 2 8 - ;; - - "Mageia"* | "Porteus"* | "Parrot"* | "SmartOS"*) - set_colors 6 7 - ;; - - "Windows 8"* | "Windows 10"*) - set_colors 6 7 - ascii_distro="windows10" - ;; - - "Windows"*) - set_colors 1 2 4 3 - ;; - - "Linux") - set_colors fg 8 3 - ;; - - *"OS X"* | *"iOS"* | "Mac" | *"macOS"*) - set_colors 2 3 1 1 5 4 - ascii_distro="mac" - ;; - - *) - case "$kernel_name" in - "Linux") - ascii_distro="linux" - set_colors fg 8 3 - ;; - - *"BSD") - ascii_distro="bsd" - set_colors 1 7 4 3 6 - ;; - - "GNU"*) - ascii_distro="gnu" - set_colors fg - ;; - - "SunOS") - ascii_distro="solaris" - set_colors 3 - ;; - esac - ;; - esac -} - set_colors() { c1="$(color "$1")${ascii_bold}" c2="$(color "$2")${ascii_bold}" From 4a5d1b7e8afe1f3b0330160e1a3704e7ee1f771d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 16:55:08 +1100 Subject: [PATCH 03/11] Ascii: Fix format --- neofetch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index fdd8b937..de9bb8f6 100755 --- a/neofetch +++ b/neofetch @@ -2756,7 +2756,7 @@ get_distro_colors() { ;; "BunsenLabs"*) - set_colors 0 7 + set_colors fg 7 ascii_file="bunsenlabs" ;; @@ -2960,29 +2960,29 @@ get_distro_colors() { "Linux") set_colors fg 8 3 - ascii_file="linix" + ascii_file="linux" ;; *) case "$kernel_name" in "Linux") - ascii_file="linux" set_colors fg 8 3 + ascii_file="linux" ;; *"BSD") - ascii_file="bsd" set_colors 1 7 4 3 6 + ascii_file="bsd" ;; "GNU"*) - ascii_file="gnu" set_colors fg + ascii_file="gnu" ;; "SunOS") - ascii_file="solaris" set_colors 3 + ascii_file="solaris" ;; esac ;; From 484a306831416d99ec78bb3b38df1d96e0e0589f Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 17:30:43 +1100 Subject: [PATCH 04/11] Ascii: Add _value variants to get_distro_colors() --- neofetch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/neofetch b/neofetch index de9bb8f6..ea4a5d5b 100755 --- a/neofetch +++ b/neofetch @@ -2489,6 +2489,16 @@ get_distro_colors() { # # $ascii_distro is the same as $distro. case "$ascii_distro" in + "arch_small") + set_colors 4 7 1 + ascii_file="arch_small" + ;; + + "arch_old") + set_colors 4 7 1 + ascii_file="arch_old" + ;; + "Arch"*) set_colors 4 7 1 ascii_file="arch" @@ -2634,6 +2644,11 @@ get_distro_colors() { ascii_file="salentos" ;; + "crux_small") + set_colors 4 5 7 6 + ascii_file="crux_small" + ;; + "CRUX"*) set_colors 4 5 7 6 ascii_file="crux" @@ -2684,6 +2699,11 @@ get_distro_colors() { ascii_file="debian" ;; + "ubuntu_old") + set_colors 1 7 3 + ascii_file="ubuntu_old" + ;; + "Ubuntu"*) set_colors 1 7 3 ascii_file="ubuntu" @@ -2800,11 +2820,21 @@ get_distro_colors() { ascii_file="devuan" ;; + "gentoo_small") + set_colors 5 7 + ascii_file="gentoo_small" + ;; + "Gentoo"*) set_colors 5 7 ascii_file="gentoo" ;; + "openbsd_small") + set_colors 3 7 6 1 8 + ascii_file="openbsd_small" + ;; + "OpenBSD"*) set_colors 3 7 6 1 8 ascii_file="openbsd" From d4f5ee4435e39a74439ec6915328849ee9b3d731 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:02:28 +1100 Subject: [PATCH 05/11] Ascii: Alphabetize distro names --- neofetch | 736 +++++++++++++++++++++++++++---------------------------- 1 file changed, 368 insertions(+), 368 deletions(-) diff --git a/neofetch b/neofetch index ea4a5d5b..702a43a6 100755 --- a/neofetch +++ b/neofetch @@ -2489,6 +2489,37 @@ get_distro_colors() { # # $ascii_distro is the same as $distro. case "$ascii_distro" in + "Alpine"*) + set_colors 4 5 7 6 + ascii_file="alpine" + ;; + + "Android"*) + set_colors 2 7 + ascii_file="android" + ascii_length_force="19" + ;; + + "Antergos"*) + set_colors 4 6 + ascii_file="antergos" + ;; + + "antiX"*) + set_colors 1 7 3 + ascii_file="antix" + ;; + + "AOSC"*) + set_colors 4 7 1 + ascii_file="aosc" + ;; + + "Apricity"*) + set_colors 4 7 1 + ascii_file="apricity" + ;; + "arch_small") set_colors 4 7 1 ascii_file="arch_small" @@ -2504,129 +2535,24 @@ get_distro_colors() { ascii_file="arch" ;; - "Kogaion"*) - set_colors 4 7 1 - ascii_file="kogaion" + "Bitrig"*) + set_colors 2 7 + ascii_file="bitrig" ;; - "Elementary"*) - set_colors 4 7 1 - ascii_file="elementary" + "BLAG"*) + set_colors 5 7 + ascii_file="blag" ;; - "GalliumOS"*) - set_colors 4 7 1 - ascii_file="galliumos" + "BlankOn"*) + set_colors 1 7 3 + ascii_file="blankon" ;; - "Rosa"*) - set_colors 4 7 1 - ascii_file="rosa" - ;; - - "OpenWrt"*) - set_colors 4 7 1 - ascii_file="openwrt" - ;; - - "Netrunner"*) - set_colors 4 7 1 - ascii_file="netrunner" - ;; - - "PCLinuxOS"*) - set_colors 4 7 1 - ascii_file="pclinuxos" - ;; - - "Slackware"*) - set_colors 4 7 1 - ascii_file="slackware" - ;; - - "KaOS"*) - set_colors 4 7 1 - ascii_file="kaos" - ;; - - "Kubuntu"*) - set_colors 4 7 1 - ascii_file="kubuntu" - ;; - - "Lubuntu"*) - set_colors 4 7 1 - ascii_file="lubuntu" - ;; - - "Xubuntu"*) - set_colors 4 7 1 - ascii_file="xubuntu" - ;; - - "OpenIndiana"*) - set_colors 4 7 1 - ascii_file="openindiana" - ;; - - "Fedora"* | "RFRemix"*) - set_colors 4 7 1 - ascii_file="fedora" - ;; - - "Korora"*) - set_colors 4 7 1 - ascii_file="korora" - ;; - - "Sabayon"*) - set_colors 4 7 1 - ascii_file="sabayon" - ;; - - "Frugalware"*) - set_colors 4 7 1 - ascii_file="frugalware" - ;; - - "Exherbo"*) - set_colors 4 7 1 - ascii_file="exherbo" - ;; - - "Scientific"*) - set_colors 4 7 1 - ascii_file="scientific" - ;; - - "Solus"*) - set_colors 4 7 1 - ascii_file="solus" - ;; - - "ChaletOS"*) - set_colors 4 7 1 - ascii_file="chaletos" - ;; - - "Apricity"*) - set_colors 4 7 1 - ascii_file="apricity" - ;; - - "SwagArch"*) - set_colors 4 7 1 - ascii_file="swagarch" - ;; - - "AOSC"*) - set_colors 4 7 1 - ascii_file="aosc" - ;; - - "Ubuntu-Budgie"*) - set_colors 4 7 1 - ascii_file="ubuntu-budgie" + "BunsenLabs"*) + set_colors fg 7 + ascii_file="bunsenlabs" ;; "CentOS"*) @@ -2634,14 +2560,24 @@ get_distro_colors() { ascii_file="centos" ;; - "GoboLinux"*) - set_colors 5 4 6 2 - ascii_file="gobolinux" + "Chakra"*) + set_colors 4 5 7 6 + ascii_file="chakra" ;; - "SalentOS"*) - set_colors 2 1 3 7 - ascii_file="salentos" + "ChaletOS"*) + set_colors 4 7 1 + ascii_file="chaletos" + ;; + + "Chapeau"*) + set_colors 2 7 + ascii_file="chapeau" + ;; + + "Chrom"*) + set_colors 2 1 3 4 7 + ascii_file="chrome" ;; "crux_small") @@ -2654,79 +2590,19 @@ get_distro_colors() { ascii_file="crux" ;; - "Chakra"*) - set_colors 4 5 7 6 - ascii_file="chakra" - ;; - - "gNewSense"*) - set_colors 4 5 7 6 - ascii_file="gnewsense" - ;; - - "SailfishOS"*) - set_colors 4 5 7 6 - ascii_file="sailfishos" - ;; - - "Alpine"*) - set_colors 4 5 7 6 - ascii_file="alpine" - ;; - - "Ubuntu-GNOME"*) - set_colors 4 5 7 6 - ascii_file="ubuntu-gnome" - ;; - - "Qubes"*) - set_colors 4 5 7 6 - ascii_file="qubes" - ;; - - "Chrom"*) - set_colors 2 1 3 4 7 - ascii_file="chrome" - ;; - - "Raspbian"*) - set_colors 2 1 - ascii_file="raspbian" - ;; - "Debian"*) set_colors 1 7 3 ascii_file="debian" ;; - "ubuntu_old") - set_colors 1 7 3 - ascii_file="ubuntu_old" + "Deepin"*) + set_colors 2 7 + ascii_file="deepin" ;; - "Ubuntu"*) - set_colors 1 7 3 - ascii_file="ubuntu" - ;; - - "DragonFly"*) - set_colors 1 7 3 - ascii_file="dragonflybsd" - ;; - - "PacBSD"*) - set_colors 1 7 3 - ascii_file="pacbsd" - ;; - - "Oracle"*) - set_colors 1 7 3 - ascii_file="oracle" - ;; - - "BlankOn"*) - set_colors 1 7 3 - ascii_file="blankon" + "Devuan"*) + set_colors 5 7 + ascii_file="devuan" ;; "DracOS"*) @@ -2734,19 +2610,24 @@ get_distro_colors() { ascii_file="dracos" ;; - "Peppermint"*) + "DragonFly"*) set_colors 1 7 3 - ascii_file="peppermint" + ascii_file="dragonflybsd" ;; - "Minix"*) - set_colors 1 7 3 - ascii_file="minix" + "Elementary"*) + set_colors 4 7 1 + ascii_file="elementary" ;; - "antiX"*) - set_colors 1 7 3 - ascii_file="antix" + "Exherbo"*) + set_colors 4 7 1 + ascii_file="exherbo" + ;; + + "Fedora"* | "RFRemix"*) + set_colors 4 7 1 + ascii_file="fedora" ;; "FreeBSD"*) @@ -2754,11 +2635,227 @@ get_distro_colors() { ascii_file="freebsd" ;; + "Frugalware"*) + set_colors 4 7 1 + ascii_file="frugalware" + ;; + + "Funtoo"*) + set_colors 5 7 + ascii_file="funtoo" + ;; + + "GalliumOS"*) + set_colors 4 7 1 + ascii_file="galliumos" + ;; + + "gentoo_small") + set_colors 5 7 + ascii_file="gentoo_small" + ;; + + "Gentoo"*) + set_colors 5 7 + ascii_file="gentoo" + ;; + + "gNewSense"*) + set_colors 4 5 7 6 + ascii_file="gnewsense" + ;; + + "GoboLinux"*) + set_colors 5 4 6 2 + ascii_file="gobolinux" + ;; + + "Grombyang"*) + set_colors 4 2 1 + ascii_file="grombyang" + ;; + + "GuixSD"*) + set_colors 3 7 6 1 8 + ascii_file="guixsd" + ;; + + "Haiku"*) + set_colors 2 8 + ascii_file="haiku" + ;; + + "Kali"*) + set_colors 4 8 + ascii_file="kali" + ;; + + "KaOS"*) + set_colors 4 7 1 + ascii_file="kaos" + ;; + + "KDE"*) + set_colors 2 7 + ascii_file="kde" + ;; + + "Kogaion"*) + set_colors 4 7 1 + ascii_file="kogaion" + ;; + + "Korora"*) + set_colors 4 7 1 + ascii_file="korora" + ;; + + "Kubuntu"*) + set_colors 4 7 1 + ascii_file="kubuntu" + ;; + + "Linux") + set_colors fg 8 3 + ascii_file="linux" + ;; + + "LMDE"*) + set_colors 2 7 + ascii_file="lmde" + ;; + + "Lubuntu"*) + set_colors 4 7 1 + ascii_file="lubuntu" + ;; + + "Mageia"*) + set_colors 6 7 + ascii_file="mageia" + ;; + + "Manjaro"*) + set_colors 2 7 + ascii_file="manjaro" + ;; + + "Minix"*) + set_colors 1 7 3 + ascii_file="minix" + ;; + + # TODO (Before PR is merged): Make this glob less greedy. + *"Mint"*) + set_colors 2 7 + ascii_file="mint" + ;; + + "MX"*) + set_colors 4 6 7 + ascii_file="mx" + ;; + + "NetBSD"*) + set_colors 5 7 + ascii_file="netbsd" + ;; + + "Netrunner"*) + set_colors 4 7 1 + ascii_file="netrunner" + ;; + + "NixOS"*) + set_colors 4 6 + ascii_file="nixOS" + ;; + + "openbsd_small") + set_colors 3 7 6 1 8 + ascii_file="openbsd_small" + ;; + + "OpenBSD"*) + set_colors 3 7 6 1 8 + ascii_file="openbsd" + ;; + + "OpenIndiana"*) + set_colors 4 7 1 + ascii_file="openindiana" + ;; + + "OpenMandriva"*) + set_colors 4 3 + ascii_file="openmadriva" + ;; + + "OpenWrt"*) + set_colors 4 7 1 + ascii_file="openwrt" + ;; + + "Oracle"*) + set_colors 1 7 3 + ascii_file="oracle" + ;; + + "PacBSD"*) + set_colors 1 7 3 + ascii_file="pacbsd" + ;; + + "Parabola"*) + set_colors 5 7 + ascii_file="parabola" + ;; + + "Pardus"*) + set_colors 3 7 6 1 8 + ascii_file="pardus" + ;; + + "Parrot"*) + set_colors 6 7 + ascii_file="parrot" + ;; + "PCBSD"* | "TrueOS"*) set_colors 1 7 3 ascii_file="trueos" ;; + "PCLinuxOS"*) + set_colors 4 7 1 + ascii_file="pclinuxos" + ;; + + "Peppermint"*) + set_colors 1 7 3 + ascii_file="peppermint" + ;; + + "Porteus"*) + set_colors 6 7 + ascii_file="porteus" + ;; + + "Puppy"* | "Quirky Werewolf"* | "Precise Puppy"*) + set_colors 4 7 + ascii_file="puppy" + ;; + + "Qubes"*) + set_colors 4 5 7 6 + ascii_file="qubes" + ;; + + "Raspbian"*) + set_colors 2 1 + ascii_file="raspbian" + ;; + "Red Star"* | "Redstar"*) set_colors 1 7 3 ascii_file="redstar" @@ -2770,44 +2867,49 @@ get_distro_colors() { ascii_file="redhat" ;; - "Kali"*) - set_colors 4 8 - ascii_file="kali" + "Rosa"*) + set_colors 4 7 1 + ascii_file="rosa" ;; - "BunsenLabs"*) - set_colors fg 7 - ascii_file="bunsenlabs" + "Sabayon"*) + set_colors 4 7 1 + ascii_file="sabayon" ;; - "OpenMandriva"*) - set_colors 4 3 - ascii_file="openmadriva" + "SailfishOS"*) + set_colors 4 5 7 6 + ascii_file="sailfishos" ;; - "NetBSD"*) - set_colors 5 7 - ascii_file="netbsd" + "SalentOS"*) + set_colors 2 1 3 7 + ascii_file="salentos" ;; - "Parabola"*) - set_colors 5 7 - ascii_file="parabola" + "Scientific"*) + set_colors 4 7 1 + ascii_file="scientific" ;; - "Tails"*) - set_colors 5 7 - ascii_file="tails" + "Slackware"*) + set_colors 4 7 1 + ascii_file="slackware" ;; - "BLAG"*) - set_colors 5 7 - ascii_file="blag" + "SmartOS"*) + set_colors 6 7 + ascii_file="smartos" ;; - "Funtoo"*) - set_colors 5 7 - ascii_file="funtoo" + "Solus"*) + set_colors 4 7 1 + ascii_file="solus" + ;; + + "Sparky"*) + set_colors 1 7 + ascii_file="sparky" ;; "SteamOS"*) @@ -2815,122 +2917,20 @@ get_distro_colors() { ascii_file="steamos" ;; - "Devuan"*) - set_colors 5 7 - ascii_file="devuan" - ;; - - "gentoo_small") - set_colors 5 7 - ascii_file="gentoo_small" - ;; - - "Gentoo"*) - set_colors 5 7 - ascii_file="gentoo" - ;; - - "openbsd_small") - set_colors 3 7 6 1 8 - ascii_file="openbsd_small" - ;; - - "OpenBSD"*) - set_colors 3 7 6 1 8 - ascii_file="openbsd" - ;; - - "GuixSD"*) - set_colors 3 7 6 1 8 - ascii_file="guixsd" - ;; - - "Pardus"*) - set_colors 3 7 6 1 8 - ascii_file="pardus" - ;; - - "Manjaro"*) - set_colors 2 7 - ascii_file="manjaro" - ;; - - "Deepin"*) - set_colors 2 7 - ascii_file="deepin" - ;; - - "LMDE"*) - set_colors 2 7 - ascii_file="lmde" - ;; - - "Chapeau"*) - set_colors 2 7 - ascii_file="chapeau" - ;; - - "Bitrig"*) - set_colors 2 7 - ascii_file="bitrig" - ;; - # TODO (Before PR is merged): Make this glob less greedy. *"SUSE"*) set_colors 2 7 ascii_distro="suse" ;; - "KDE"*) - set_colors 2 7 - ascii_file="kde" + "SwagArch"*) + set_colors 4 7 1 + ascii_file="swagarch" ;; - "Android"*) - set_colors 2 7 - ascii_file="android" - ascii_length_force="19" - ;; - - # TODO (Before PR is merged): Make this glob less greedy. - *"Mint"*) - set_colors 2 7 - ascii_file="mint" - ;; - - "Puppy"* | "Quirky Werewolf"* | "Precise Puppy"*) - set_colors 4 7 - ascii_file="puppy" - ;; - - "Sparky"*) - set_colors 1 7 - ascii_file="sparky" - ;; - - "Trisquel"*) - set_colors 4 6 - ascii_file="trisquel" - ;; - - "NixOS"*) - set_colors 4 6 - ascii_file="nixOS" - ;; - - "Zorin"*) - set_colors 4 6 - ascii_file="zorin" - ;; - - "Antergos"*) - set_colors 4 6 - ascii_file="antergos" - ;; - - "MX"*) - set_colors 4 6 7 - ascii_file="mx" + "Tails"*) + set_colors 5 7 + ascii_file="tails" ;; "Travis") @@ -2938,9 +2938,29 @@ get_distro_colors() { ascii_file="travis" ;; - "Grombyang"*) - set_colors 4 2 1 - ascii_file="grombyang" + "Trisquel"*) + set_colors 4 6 + ascii_file="trisquel" + ;; + + "Ubuntu-Budgie"*) + set_colors 4 7 1 + ascii_file="ubuntu-budgie" + ;; + + "Ubuntu-GNOME"*) + set_colors 4 5 7 6 + ascii_file="ubuntu-gnome" + ;; + + "ubuntu_old") + set_colors 1 7 3 + ascii_file="ubuntu_old" + ;; + + "Ubuntu"*) + set_colors 1 7 3 + ascii_file="ubuntu" ;; "Void"*) @@ -2948,31 +2968,6 @@ get_distro_colors() { ascii_file="void" ;; - "Haiku"*) - set_colors 2 8 - ascii_file="haiku" - ;; - - "Mageia"*) - set_colors 6 7 - ascii_file="mageia" - ;; - - "Porteus"*) - set_colors 6 7 - ascii_file="porteus" - ;; - - "Parrot"*) - set_colors 6 7 - ascii_file="parrot" - ;; - - "SmartOS"*) - set_colors 6 7 - ascii_file="smartos" - ;; - "Windows 8"* | "Windows 10"*) set_colors 6 7 ascii_file="windows10" @@ -2983,33 +2978,38 @@ get_distro_colors() { ascii_file="windows" ;; - *"OS X"* | *"iOS"* | "Mac" | *"macOS"*) - set_colors 2 3 1 1 5 4 - ascii_file="mac" + "Xubuntu"*) + set_colors 4 7 1 + ascii_file="xubuntu" ;; - "Linux") - set_colors fg 8 3 - ascii_file="linux" + "Zorin"*) + set_colors 4 6 + ascii_file="zorin" ;; *) case "$kernel_name" in - "Linux") - set_colors fg 8 3 - ascii_file="linux" - ;; - *"BSD") set_colors 1 7 4 3 6 ascii_file="bsd" ;; + "Darwin") + set_colors 2 3 1 1 5 4 + ascii_file="mac" + ;; + "GNU"*) set_colors fg ascii_file="gnu" ;; + "Linux") + set_colors fg 8 3 + ascii_file="linux" + ;; + "SunOS") set_colors 3 ascii_file="solaris" From a1ace8157749bfa1e3f0a77e648bbcba17fc4677 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:03:44 +1100 Subject: [PATCH 06/11] Ascii: Remove travis art as it's no longer used --- ascii/distro/travis | 6 ------ neofetch | 5 ----- 2 files changed, 11 deletions(-) delete mode 100644 ascii/distro/travis diff --git a/ascii/distro/travis b/ascii/distro/travis deleted file mode 100644 index c4ab4efa..00000000 --- a/ascii/distro/travis +++ /dev/null @@ -1,6 +0,0 @@ -${c1} _______ _ -${c2}|__ __| | | -${c3} | | ___ ___| |_ -${c4} | |/ _ \/ __| __| -${c5} | | __/\__ \ |_ -${c6} |_|\___||___/\__| diff --git a/neofetch b/neofetch index 702a43a6..84ee3e4d 100755 --- a/neofetch +++ b/neofetch @@ -2933,11 +2933,6 @@ get_distro_colors() { ascii_file="tails" ;; - "Travis") - set_colors 1 2 3 4 5 6 - ascii_file="travis" - ;; - "Trisquel"*) set_colors 4 6 ascii_file="trisquel" From 2662c42adc3688ad3239d2404598e527a9811a26 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:06:27 +1100 Subject: [PATCH 07/11] Ascii: Fix bug when using custom ascii art --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 84ee3e4d..ac3928a9 100755 --- a/neofetch +++ b/neofetch @@ -1922,8 +1922,9 @@ get_ascii() { [[ -d "$ascii_dir" ]] || \ { to_off "Ascii: Ascii file not found, falling back to text mode."; return; } fi + + ascii="${ascii_dir}/${ascii_file}" fi - ascii="${ascii_dir}/${ascii_file}" # Set locale to get correct padding. export LC_ALL="$sys_locale" From 8639275809a3d2cd11839969b5f659dd0ba93394 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:26:45 +1100 Subject: [PATCH 08/11] Ascii: Fix various bugs with spelling --- neofetch | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index ac3928a9..a3cb71c2 100755 --- a/neofetch +++ b/neofetch @@ -2551,6 +2551,11 @@ get_distro_colors() { ascii_file="blankon" ;; + "BSD") + set_colors 1 7 4 3 6 + ascii_file="bsd" + ;; + "BunsenLabs"*) set_colors fg 7 ascii_file="bunsenlabs" @@ -2666,6 +2671,11 @@ get_distro_colors() { ascii_file="gnewsense" ;; + "GNU") + set_colors fg 7 + ascii_file="gnu" + ;; + "GoboLinux"*) set_colors 5 4 6 2 ascii_file="gobolinux" @@ -2731,6 +2741,11 @@ get_distro_colors() { ascii_file="lubuntu" ;; + "mac" | "Darwin") + set_colors 2 3 1 1 5 4 + ascii_file="mac" + ;; + "Mageia"*) set_colors 6 7 ascii_file="mageia" @@ -2769,7 +2784,7 @@ get_distro_colors() { "NixOS"*) set_colors 4 6 - ascii_file="nixOS" + ascii_file="nixos" ;; "openbsd_small") @@ -2789,7 +2804,7 @@ get_distro_colors() { "OpenMandriva"*) set_colors 4 3 - ascii_file="openmadriva" + ascii_file="openmandriva" ;; "OpenWrt"*) @@ -2918,6 +2933,11 @@ get_distro_colors() { ascii_file="steamos" ;; + "SunOS" | "Solaris") + set_colors 3 7 + ascii_file="solaris" + ;; + # TODO (Before PR is merged): Make this glob less greedy. *"SUSE"*) set_colors 2 7 @@ -2997,7 +3017,7 @@ get_distro_colors() { ;; "GNU"*) - set_colors fg + set_colors fg 7 ascii_file="gnu" ;; @@ -3007,7 +3027,7 @@ get_distro_colors() { ;; "SunOS") - set_colors 3 + set_colors 3 7 ascii_file="solaris" ;; esac From deb508fde8615494f0f8ccefe2a1130428e50e27 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:33:38 +1100 Subject: [PATCH 09/11] Ascii: Remove greedy globs --- neofetch | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index a3cb71c2..fa11652b 100755 --- a/neofetch +++ b/neofetch @@ -2761,8 +2761,7 @@ get_distro_colors() { ascii_file="minix" ;; - # TODO (Before PR is merged): Make this glob less greedy. - *"Mint"*) + "Linux Mint"* | "LinuxMint"*) set_colors 2 7 ascii_file="mint" ;; @@ -2877,8 +2876,7 @@ get_distro_colors() { ascii_file="redstar" ;; - # TODO (Before PR is merged): Make this glob less greedy. - "Red"*) + "Redhat"* | "Red Hat"*) set_colors 1 7 3 ascii_file="redhat" ;; @@ -2938,8 +2936,7 @@ get_distro_colors() { ascii_file="solaris" ;; - # TODO (Before PR is merged): Make this glob less greedy. - *"SUSE"*) + "openSUSE"* | "open SUSE") set_colors 2 7 ascii_distro="suse" ;; From ba7066753915f5eeab396e667a2d139cdf0e7252 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:39:12 +1100 Subject: [PATCH 10/11] Ascii: Add another match for Red Hat --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index fa11652b..c5008280 100755 --- a/neofetch +++ b/neofetch @@ -2876,7 +2876,7 @@ get_distro_colors() { ascii_file="redstar" ;; - "Redhat"* | "Red Hat"*) + "Redhat"* | "Red Hat"* | "rhel"*) set_colors 1 7 3 ascii_file="redhat" ;; From ce649ab7596ecfeb161729b89e584f657643de3e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 18:48:35 +1100 Subject: [PATCH 11/11] Ascii: Add SUSE* --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index c5008280..2a1ab338 100755 --- a/neofetch +++ b/neofetch @@ -2936,7 +2936,7 @@ get_distro_colors() { ascii_file="solaris" ;; - "openSUSE"* | "open SUSE") + "openSUSE"* | "open SUSE"* | "SUSE"*) set_colors 2 7 ascii_distro="suse" ;;