Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
3457f008
Commit
3457f008
authored
Jan 02, 2017
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ascii: Simplify function
parent
d8551216
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
241 additions
and
41 deletions
+241
-41
neofetch
neofetch
+241
-41
No files found.
neofetch
View file @
3457f008
...
...
@@ -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
[[
-f
"/usr/share/neofetch/ascii/distro/
${
ascii
/ *
}
"
]]
;
then
ascii
=
"/usr/share/neofetch/ascii/distro/
${
ascii
/ *
}
"
if
[[
-d
"/usr/share/neofetch/ascii/distro"
]]
;
then
ascii_dir
=
"/usr/share/neofetch/ascii/distro"
elif
[[
-
f
"/usr/local/share/neofetch/ascii/distro/
${
ascii
/ *
}
"
]]
;
then
ascii
=
"/usr/local/share/neofetch/ascii/distro/
${
ascii
/ *
}
"
elif
[[
-
d
"/usr/local/share/neofetch/ascii/distro
"
]]
;
then
ascii
_dir
=
"/usr/local/share/neofetch/ascii/distro
"
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"
;;
"Kogaion"
*)
set_colors 4 7 1
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"
;;
"
RFRemix
"
*)
"
Slackware
"
*)
set_colors 4 7 1
ascii_distro=
"Fedora"
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"
*)
set_colors 4 5 7 6
ascii_file=
"crux"
;;
"Chakra"
*)
set_colors 4 5 7 6
ascii_file=
"chakra"
;;
"
CRUX"
* |
"Chakra"
* |
"gNewSense"
* |
"SailfishOS"
* |
"Alpine"
* |
"Ubuntu-GNOME"
* |
"Qubes
"
*)
"
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"
*)
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"
;;
"
Debian"
* |
"Ubuntu"
* |
"DragonFly"
* |
"PacBSD"
* |
"Oracle"
* |
"BlankOn"
* |
"DracOS"
* |
"Peppermint"
* |
"Minix
"
*)
"
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() {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment