diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index d2b657cb..e51b6bbd 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,13 +1,14 @@ ## Description -Only fill in the fields below if relevant. If you're -suggesting a new feature then just a description will suffice. +If you're suggesting a new feature then just a description will suffice. #### Neofetch version ## Screenshot +## Config file + ## Verbose log 1. Run `neofetch -vv 2> neofetchlog` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c5f37c7b..f5d1e076 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,11 +2,9 @@ Only fill in the fields below if relevant. + ## Features ## Issues ## TODO - - - diff --git a/.travis.yml b/.travis.yml index 383f4711..388082b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,27 @@ language: bash sudo: required +addons: + apt: + sources: + - debian-sid + packages: + - shellcheck + os: - linux - osx before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install screenresolution; fi script: - - time ./neofetch --ascii --config travis --ascii_distro travis -v + - time ./neofetch --ascii --config config/travis.conf -v + # See this wiki page for why we're disabling these errors. + # https://github.com/dylanaraps/neofetch/wiki/Shellcheck-Exclusions + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck neofetch -e SC1090,SC2009,SC2012,SC2016,SC2034,SC2128,SC2153,SC2154,SC2178,SC2010,SC1004; fi + # The if statement is here to invert the exit code from grep. + # grep normally errors if no match is found but we want the opposite. + # We invert it so grep fails if a match is found. + - if grep '.\{101\}' neofetch; then (exit 1); else (exit 0); fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 74065af6..560033d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,133 +1,27 @@ ## Contributors -- **[@konimex](https://github.com/konimex)** -- **[@TonCherAmi](https://github.com/TonCherAmi)** -- **[@JorgeGonzalez](https://github.com/JorgeGonzalez)** -- **[@iandrewt](https://github.com/iandrewt)** -- **[@iwamatsu](https://github.com/iwamatsu)** +- [**@yslgirl**](https://github.com/yslgirl) +- [**@iandrewt**](https://github.com/iandrewt) +- [**@chrisweeksnz**](https://github.com/chrisweeksnz) -## Packages - -- Neofetch is now in Debian's official repos. -- Neofetch is now in Ubuntu's official repos. - - -## General - -- All functions/variables now follow the same naming scheme. `example_func_name` -- Call `uname` once and cache the output instead of calling `uname` 4-5 times. -- Cleaned up and rewrote large chunks of the script. -- Convert math tests to correct syntax. -- Fixed `--disable` and capitalized arguments. -- Fixed issue where `bold=off` wouldn't work. -- Fixed issue where info wasn't detected properly but the subtitle was still displayed. -- Fixed issue where using `--disable func func` broke other args. -- Removed all traces of `eval` from neofetch. -- Removed all vim fold markers and stopped enforcing folding for vim users. - - See [#431](https://github.com/dylanaraps/neofetch/pull/431) -- Rewrote all of config file documentation. -- Swap all tests from `[` to `[[`. - - -## Operating System - -- Added support for ChaletOS. -- Added support for DracOS. -- Added support for GNU Hurd. **[@konimex](https://github.com/konimex)** -- Added support for Haiku. **[@konimex](https://github.com/konimex)** -- Added support for Korora. **[@konimex](https://github.com/konimex)** -- Added support for Netrunner. **[@konimex](https://github.com/konimex)** -- Added support for Pardus. -- Added support for iPhone 7 and 7 Plus. - - -## Ascii - -- Ascii art is no longer read as a script and is now read as plain text. - - See this wiki page about the new ascii art format. - - https://github.com/dylanaraps/neofetch/wiki/Custom-Ascii-art-file-format -- Neofetch now displays your OS's ascii logo if your distro's logo isn't found. **[@konimex](https://github.com/konimex)** - - Example: [Linux] Tux is displayed if there's no distro ascii. -- `neofetch --ascii_distro x` now sets the mode to ascii for you. You no longer have to use a combination of `--ascii` and `--ascii_distro`. -- [Arch Linux] Changed default ascii colors. -- [Bunsenlabs] Changed default ascii colors. -- Fixed issue with Solarized and certain ascii art. -- Remove all duplicates from `get_distro_colors()`. -- Remove execution permission flag from ascii art files. **[@iwamatsu](https://github.com/iwamatsu)** -- Rename `colors()` to `get_distro_colors()`. -- Rename `setcolors()` to `set_colors()`. -- Update Netrunner ascii art. - - -## Images - -- Fixed images not appearing in st. -- Added `to_ascii()` and `to_off()`. - - These functions are used when falling back to different image modes. -- Renamed `check_old_flags()` to `old_flags()` to match `old_functions()`. -- Split `get_image()` into `get_term_size()`, `get_image_size()`, `get_image_program()` and `make_thumbnail()`. -- Use `$XDG_CACHE_HOME` as the thumbnail dir if available. - - -## Bars - -- Rename all `progress_` variables to `bar_` to match the function name. +## OS +- Fixed detection bug with Gentoo. +- Added support for macOS High Sierra. [**@yslgirl**](https://github.com/yslgirl) +- Added support for Container Linux by CoreOS. [**@chrisweeksnz**](https://github.com/chrisweeksnz) +- Added support for 2017 iOS devices [**@iandrewt**](https://github.com/iandrewt) ## Info -**Distro**
+**Window Manager** -- [Linux] Source `/etc/*-release` files instead of having a dozen separate `awk` commands. - - We source `/etc/os-release` before falling back to `/etc/*-release`. -- Remove lsb_release detection. - - This change was made since lsb_release prints innacurate results on some distros. -- Added fallback when distro isn't found. **[@konimex](https://github.com/konimex)** - - Example: `Linux (Unknown)` +- [macOS] Fixed chunkwm being detected as Kwm. [**@iandrewt**](https://github.com/iandrewt) -**Packages**
+**Install Date** -- [Solus] If `pisi` is unavailable, use `eopkg`. -- Added package detection for Lunar Linux. **[@konimex](https://github.com/konimex)** -- Added package detection for TinyCore. **[@konimex](https://github.com/konimex)** -- Remove `/usr/games` from `$PATH` to fix issues with pacman game. +- [macOS] Fixed Install Date. [**@iandrewt**](https://github.com/iandrewt) -**GPU**
+**Resolution** -- [Linux] Properly detect gpu in multi gpu setups. **[@TonCherAmi](https://github.com/TonCherAmi)** - -**Terminal**
- -- Added support for HyperTerm. **[@JorgeGonzalez](https://github.com/JorgeGonzalez)** - -**Terminal Font**
- -- Added support for HyperTerm. **[@JorgeGonzalez](https://github.com/JorgeGonzalez)** - -**CPU**
- -- [BSD] Added cpu_temp support. **[@konimex](https://github.com/konimex)** - -**CPU Usage**
- -- [iOS] Fixed CPU usage. - -**Shell**
- -- [bash] Simplify bash version. - -**Song**
- -- Added support for Clementine. **[@konimex](https://github.com/konimex)** -- Added support for GNOME Music. **[@konimex](https://github.com/konimex)** -- Added support for Lollypop. **[@konimex](https://github.com/konimex)** -- Added support for Pragha. **[@konimex](https://github.com/konimex)** - -**Public IP**
- -- [dig] Fixed connection timed out with public_ip. **[@iandrewt](https://github.com/iandrewt)** - -**Resolution**
- -- [MacOS] If refresh rate is empty don't append Hz. +- [macOS] Fixed errors on non-retina screens. [**@iandrewt**](https://github.com/iandrewt) diff --git a/LICENSE.md b/LICENSE.md index 5ba78a5a..851d9f6a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Dylan Araps +Copyright (c) 2016-2017 Dylan Araps Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,6 +9,9 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/Makefile b/Makefile index 71def674..99ec43b2 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,29 @@ -PREFIX ?= /usr -RM ?= rm -f -INSTALL_DIR ?= install -m755 -d -INSTALL_PROG ?= install -m755 -INSTALL_FILE ?= install -m644 +PREFIX ?= /usr +SYSCONFDIR ?= /etc +MANDIR ?= $(PREFIX)/share/man all: - @echo Run \'make install\' to install Neofetch + @echo Run \'make install\' to install Neofetch. install: - $(INSTALL_DIR) $(DESTDIR)$(PREFIX)/bin - $(INSTALL_DIR) $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro - $(INSTALL_DIR) $(DESTDIR)$(PREFIX)/share/man/man1 - $(INSTALL_PROG) neofetch $(DESTDIR)$(PREFIX)/bin/neofetch - $(INSTALL_FILE) neofetch.1 $(DESTDIR)$(PREFIX)/share/man/man1/neofetch.1 - $(INSTALL_PROG) config/config $(DESTDIR)$(PREFIX)/share/neofetch/config - $(INSTALL_FILE) ascii/distro/* $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro + @echo 'Making directories...' + @mkdir -p $(DESTDIR)$(PREFIX)/bin + @mkdir -p $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro + @mkdir -p $(DESTDIR)$(MANDIR)/man1 + @mkdir -p $(DESTDIR)$(SYSCONFDIR)/neofetch + + @echo 'Installing binaries...' + @sed "s|ASCIIDIR|$(PREFIX)/share/neofetch/ascii/distro|g;s|CONFDIR|$(SYSCONFDIR)/neofetch|g" < neofetch > $(DESTDIR)$(PREFIX)/bin/neofetch + @chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch + + @echo 'Installing ASCII files, man page and config file...' + @cp -p ascii/distro/* $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro + @cp -p neofetch.1 $(DESTDIR)$(MANDIR)/man1 + @cp -p config/config.conf $(DESTDIR)$(SYSCONFDIR)/neofetch/config.conf uninstall: - $(RM) $(DESTDIR)$(PREFIX)/bin/neofetch - $(RM) $(DESTDIR)$(PREFIX)/share/man/man1/neofetch.1 - $(RM) -r $(DESTDIR)$(PREFIX)/share/neofetch - - + @echo 'Removing files...' + @rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch + @rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1* + @rm -rf $(DESTDIR)$(PREFIX)/share/neofetch + @rm -rf $(DESTDIR)$(SYSCONFDIR)/neofetch diff --git a/README.md b/README.md index 62989414..16ad5e91 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ # Neofetch -[![Gitter](https://badges.gitter.im/dylanaraps/fetch.svg)](https://gitter.im/dylanaraps/fetch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build Status](https://travis-ci.org/dylanaraps/neofetch.svg?branch=master)](https://travis-ci.org/dylanaraps/neofetch) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) [![Latest release](https://img.shields.io/github/release/dylanaraps/neofetch.svg)](https://github.com/dylanaraps/neofetch/releases) +[![Gitter](https://badges.gitter.im/dylanaraps/fetch.svg)](https://gitter.im/dylanaraps/fetch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Build Status](https://travis-ci.org/dylanaraps/neofetch.svg?branch=master)](https://travis-ci.org/dylanaraps/neofetch) +[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) +[![Latest release](https://img.shields.io/github/release/dylanaraps/neofetch.svg)](https://github.com/dylanaraps/neofetch/releases) +[![Donate](https://img.shields.io/badge/donate-patreon-yellow.svg)](https://www.patreon.com/dyla) -Neofetch is a CLI system information tool written in BASH. Neofetch displays information about your system next to an image, your OS logo, or any ascii file of your choice. The main purpose of neofetch is to be used in screenshots to show other users what OS/Distro you're running, what Theme/Icons you're using and etc. +Neofetch is a CLI system information tool written in BASH. Neofetch displays information about your system next to an image, your OS logo, or any ASCII file of your choice. The main purpose of Neofetch is to be used in screenshots to show other users what OS/Distro you're running, what Theme/Icons you're using etc. -Neofetch is highly customizable through the use of commandline flags or the user config file. There are over 50 config options to mess around with and there's the `print_info()` function and friends which let you add your own custom info. +Neofetch is highly customizable through the use of command line flags or the user config file. There are over 50 config options to mess around with and there's the `print_info()` function and friends which let you add your own custom info. -Neofetch can be used on any OS that has BASH, it's just a matter of adding support. If your OS/Distro isn't in the list below, feel free to open an issue on the repo and I'll gladly add support. Neofetch currently supports `Linux`, `MacOS`, `iOS`, `BSD`, `Solaris`, `Android`, `Haiku`, `GNU Hurd` and `Windows (Cygwin/Windows 10 Linux subsystem)`. +Neofetch can be used on any OS that has BASH 3.2+, it's just a matter of adding support. If your OS/Distro isn't in the list below, feel free to open an issue on the repo and I'll gladly add support. Neofetch currently supports `Linux`, `MacOS`, `iOS`, `BSD`, `Solaris`, `Android`, `Haiku`, `GNU Hurd`, `MINIX`, `AIX`, `IRIX`, and `Windows (Cygwin/MSYS2/MinGW/Windows 10 Linux subsystem)`. For more information: **https://github.com/dylanaraps/neofetch/wiki** -![1](https://ipfs.pics/ipfs/QmTtF9Sx8o617QE88GH3Z4yX7mRyi4yS1hsMHyRVmn14vJ) +![neofetch screenshot](https://u.teknik.io/KlBsD.png) ## Dependencies @@ -34,15 +38,17 @@ Neofetch will by default create a config file at `$HOME/.config/neofetch/config` You can launch the script without a config file by using the flag `--config none` and you can specify a custom config location using `--config path/to/config`. +See this wiki page for the default config: https://github.com/dylanaraps/neofetch/wiki/Config-File + ### Customizing what info gets displayed -https://github.com/dylanaraps/fetch/wiki/Customizing-Info +https://github.com/dylanaraps/neofetch/wiki/Customizing-Info ### Customizing the script using a custom alias -If you don't want to use the config file you can customize almost everything using launch flags! +If you don't want to use the config file you can customize almost everything using launch flags. Here's an example neofetch alias: @@ -58,60 +64,28 @@ alias neofetch2="neofetch \ ``` -## Frequently Asked Questions - - -### How do I enable screenfetch mode? - -Launching the script with `--ascii` or setting `image="ascii"` inside the config file will launch the script in "screenfetch mode". The script will display your distro's ascii next to the info, exactly like screenfetch. - -**NOTE:** If you **don't** have an image-mode dependency installed screenfetch mode will be used automatically. - -### Why doesn't Neofetch support my wallpaper setter? - -It's hard to add support for other wallpaper setters as they don't provide a way of getting the current wallpaper from the cli. - -If your wallpaper setter **does** provide a way of getting the current wallpaper or you know where the wallpaper is stored then adding support won't be a problem! - - -## Issues and Workarounds - -### getgpu doesn't show my exact video card name - -If your `lspci | grep "VGA"` output looks like this: - -``` -01:00.0 VGA compatible controller: NVIDIA Corporation Device 1401 (rev a1) -``` - -Instead of this: - -``` -01:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1) -``` - -Then you're affected by the issue. - -This is caused by your `/usr/share/misc/pci.ids*` files being outdated and you can fix it by running this command as root. - -``` -sudo update-pciids -``` - -### Neofetch doesn't work correctly with ConEmu. - -You need to be using the CYGWIN/Msys connector for Neofetch to work seamlessly with ConEmu. - -https://conemu.github.io/en/CygwinMsysConnector.html - - ## Thanks Thanks to: +- [Contributors](https://github.com/dylanaraps/neofetch/contributors) + - Thanks for making Neofetch better, I really appreciate it. +- [Packagers](https://github.com/dylanaraps/neofetch/issues/115) + - Thanks for maintaining Neofetch packages. +- Users + - Thanks for using Neofetch! - [Screenfetch](https://github.com/KittyKatt/screenFetch): - - I've used some snippets as a base for a few functions in this script. - - Some of the ascii logos. + - We've used some snippets as a base for a few functions in this script. + - Some of the ASCII logos. - [ufetch](https://github.com/jschx/ufetch): - - Tiny ascii logos -- Everyone else helped out in one way or another. I'd list all of the names but there's just too many of you. :) + - Tiny ASCII logos + + + +## Donate + +Donations will allow me to spend more time working on `neofetch`. + +If you like `neofetch` and want to give back in some way you can donate here: + +**https://patreon.com/dyla** diff --git a/ascii/distro/aix b/ascii/distro/aix new file mode 100644 index 00000000..8526b7c6 --- /dev/null +++ b/ascii/distro/aix @@ -0,0 +1,20 @@ +${c1} `:+ssssossossss+-` + .oys///oyhddddhyo///sy+. + /yo:+hNNNNNNNNNNNNNNNNh+:oy/ + :h/:yNNNNNNNNNNNNNNNNNNNNNNy-+h: + `ys.yNNNNNNNNNNNNNNNNNNNNNNNNNNy.ys + `h+-mNNNNNNNNNNNNNNNNNNNNNNNNNNNNm-oh + h+-NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.oy +/d`mNNNNNNN/::mNNNd::m+:/dNNNo::dNNNd`m: +h//NNNNNNN: . .NNNh mNo od. -dNNNNN:+y +N.sNNNNNN+ -N/ -NNh mNNd. sNNNNNNNo-m +N.sNNNNNs +oo /Nh mNNs` ` /mNNNNNNo-m +h//NNNNh ossss` +h md- .hm/ `sNNNNN:+y +:d`mNNN+/yNNNNNd//y//h//oNNNNy//sNNNd`m- + yo-NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNm.ss + `h+-mNNNNNNNNNNNNNNNNNNNNNNNNNNNNm-oy + sy.yNNNNNNNNNNNNNNNNNNNNNNNNNNs.yo + :h+-yNNNNNNNNNNNNNNNNNNNNNNs-oh- + :ys:/yNNNNNNNNNNNNNNNmy/:sy: + .+ys///osyhhhhys+///sy+. + -/osssossossso/- diff --git a/ascii/distro/alpine_small b/ascii/distro/alpine_small new file mode 100644 index 00000000..9949011c --- /dev/null +++ b/ascii/distro/alpine_small @@ -0,0 +1,6 @@ +${c1} /\\ /\\ + /${c2}/ ${c1}\\ \\ + /${c2}/ ${c1}\\ \\ +/${c2}// ${c1}\\ \\ +${c2}// ${c1}\\ \\ + \\ diff --git a/ascii/distro/amazon b/ascii/distro/amazon new file mode 100644 index 00000000..050c5b3a --- /dev/null +++ b/ascii/distro/amazon @@ -0,0 +1,19 @@ +${c1} `-/oydNNdyo:.` + `.:+shmMMMMMMMMMMMMMMmhs+:.` + -+hNNMMMMMMMMMMMMMMMMMMMMMMNNho- +.`` -/+shmNNMMMMMMNNmhs+/- ``. +dNmhs+:. `.:/oo/:.` .:+shmNd +dMMMMMMMNdhs+:.. ..:+shdNMMMMMMMd +dMMMMMMMMMMMMMMNds odNMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +dMMMMMMMMMMMMMMMMh yMMMMMMMMMMMMMMMMd +.:+ydNMMMMMMMMMMMh yMMMMMMMMMMMNdy+:. + `.:+shNMMMMMh yMMMMMNhs+:`` + `-+shy shs+:` diff --git a/ascii/distro/antix b/ascii/distro/antix new file mode 100644 index 00000000..c383774e --- /dev/null +++ b/ascii/distro/antix @@ -0,0 +1,13 @@ +${c1} + \ + , - ~ ^ ~ - \ / + , ' \ ' , / + , \ '/ + , \ / , + ,___, \/ , + / | _ _ _|_ o /\ , +|, | / |/ | | | / \ , + \,_/\_/ | |_/|_/|_/_/ \, + , / ,\ + , / , ' \ + ' - , _ _ _ , ' diff --git a/ascii/distro/aosc b/ascii/distro/aosc new file mode 100644 index 00000000..785ba7d9 --- /dev/null +++ b/ascii/distro/aosc @@ -0,0 +1,20 @@ +${c2} .:+syhhhhys+:. + .ohNMMMMMMMMMMMMMMNho. + `+mMMMMMMMMMMmdmNMMMMMMMMm+` + +NMMMMMMMMMMMM/ `./smMMMMMN+ + .mMMMMMMMMMMMMMMo -yMMMMMm. + :NMMMMMMMMMMMMMMMs .hMMMMN: + .NMMMMhmMMMMMMMMMMm+/- oMMMMN. + dMMMMs ./ymMMMMMMMMMMNy. sMMMMd +-MMMMN` oMMMMMMMMMMMN: `NMMMM- +/MMMMh NMMMMMMMMMMMMm hMMMM/ +/MMMMh NMMMMMMMMMMMMm hMMMM/ +-MMMMN` :MMMMMMMMMMMMy. `NMMMM- + dMMMMs .yNMMMMMMMMMMMNy/. sMMMMd + .NMMMMo -/+sMMMMMMMMMMMmMMMMN. + :NMMMMh. .MMMMMMMMMMMMMMMN: + .mMMMMMy- NMMMMMMMMMMMMMm. + +NMMMMMms/.` mMMMMMMMMMMMN+ + `+mMMMMMMMMNmddMMMMMMMMMMm+` + .ohNMMMMMMMMMMMMMMNho. + .:+syhhhhys+:. diff --git a/ascii/distro/apricity b/ascii/distro/apricity new file mode 100644 index 00000000..eada9d6d --- /dev/null +++ b/ascii/distro/apricity @@ -0,0 +1,18 @@ +${c2} ./o- + ``...`` `:. -/: + `-+ymNMMMMMNmho-` :sdNNm/ + `+dMMMMMMMMMMMMMMMmo` sh:.:::- + /mMMMMMMMMMMMMMMMMMMMm/`sNd/ + oMMMMMMMMMMMMMMMMMMMMMMMs -` +:MMMMMMMMMMMMMMMMMMMMMMMMM/ +NMMMMMMMMMMMMMMMMMMMMMMMMMd +MMMMMMMmdmMMMMMMMMMMMMMMMMd +MMMMMMy` .mMMMMMMMMMMMmho:` +MMMMMMNo/sMMMMMMMNdy+-.`-/ +MMMMMMMMMMMMNdy+:.`.:ohmm: +MMMMMMMmhs+-.`.:+ymNMMMy. +MMMMMM/`.-/ohmNMMMMMMy- +MMMMMMNmNNMMMMMMMMmo. +MMMMMMMMMMMMMMMms:` +MMMMMMMMMMNds/. +dhhyys+/-` diff --git a/ascii/distro/arch b/ascii/distro/arch index d6fb1977..3de103bb 100644 --- a/ascii/distro/arch +++ b/ascii/distro/arch @@ -7,9 +7,9 @@ ${c1} -` `/:-:++oooo+: `/++++/+++++++: `/++++++++++++++: - `/+++ooooooooooooo/` - ./ooosssso++osssssso+` - .oossssso-````/ossssss+` + `/+++o${c2}oooooooo${c1}oooo/` +${c2} ${c1}./${c2}ooosssso++osssssso${c1}+` +${c2} .oossssso-````/ossssss+` -osssssso. :ssssssso. :osssssss/ osssso+++. /ossssssss/ +ssssooo/- diff --git a/ascii/distro/arch_old b/ascii/distro/arch_old new file mode 100644 index 00000000..dbd6cefa --- /dev/null +++ b/ascii/distro/arch_old @@ -0,0 +1,16 @@ +${c1} __ + _=(SDGJT=_ + _GTDJHGGFCVS) + ,GTDJGGDTDFBGX0 +${c1} JDJDIJHRORVFSBSVL${c2}-=+=,_ +${c1} IJFDUFHJNXIXCDXDSV,${c2} "DEBL +${c1} [LKDSDJTDU=OUSCSBFLD.${c2} '?ZWX, +${c1} ,LMDSDSWH' `DCBOSI${c2} DRDS], +${c1} SDDFDFH' !YEWD,${c2} )HDROD +${c1} !KMDOCG &GSU|${c2}\_GFHRGO\' +${c1} HKLSGP'${c2} __${c1}\TKM0${c2}\GHRBV)' +${c1}JSNRVW'${c2} __+MNAEC${c1}\IOI,${c2}\BN' +${c1}HELK['${c2} __,=OFFXCBGHC${c1}\FD) +${c1}?KGHE ${c2}\_-#DASDFLSV='${c1} 'EF +'EHTI !H + `0F' '! diff --git a/ascii/distro/arch_xferience b/ascii/distro/arch_xferience new file mode 100644 index 00000000..f1757f92 --- /dev/null +++ b/ascii/distro/arch_xferience @@ -0,0 +1,19 @@ +${c1} ``--:::::::-.` + .-/+++ooooooooo+++:-` + `-/+oooooooooooooooooo++:. + -/+oooooo/+ooooooooo+/ooo++:` + `/+oo++oo. .+oooooo+.-: +:-o+- + `/+o/. -o. :oooooo+ ```:.+oo+- +`:+oo- -/` :oooooo+ .`-`+oooo/. +.+ooo+. .` `://///+-+..oooooo+:` +-+ooo:` ``.-+oooooo+/` +-+oo/` :+oooo/. +.+oo: ..-/. . -+oo+/` +`/++- -:::++::/. -+oo+- + ./o: `:///+- `./ooo+:` + .++- `` /-` -:/+oooo+:` + .:+/:`` `-:ooooooo++- + ./+o+//:...../+oooooooo++:` + `:/++ooooooooooooo++/-` + `.-//++++++//:-.` + `````` diff --git a/ascii/distro/archbox b/ascii/distro/archbox new file mode 100644 index 00000000..a35a15c6 --- /dev/null +++ b/ascii/distro/archbox @@ -0,0 +1,19 @@ +${c1} ...:+oh/:::.. + ..-/oshhhhhh` `::::-. + .:/ohhhhhhhhhhhh` `-::::. + .+shhhhhhhhhhhhhhhhh` `.::-. + /`-:+shhhhhhhhhhhhhh` .-/+shh + / .:/ohhhhhhhhh` .:/ohhhhhhhh + / `-:+shhh` ..:+shhhhhhhhhhhh + / .:ohhhhhhhhhhhhhhhhhhh + / `hhhhhhhhhhhhhhhhhhhh + / `hhhhhhhhhhhhhhhhhhhh + / `hhhhhhhhhhhhhhhhhhhh + / `hhhhhhhhhhhhhhhhhhhh + / .+o+ `hhhhhhhhhhhhhhhhhhhh + / -hhhhh `hhhhhhhhhhhhhhhhhhhh + / ohhhhho `hhhhhhhhhhhhhhhhhhhh + /:::+`hhhhoos` `hhhhhhhhhhhhhhhhhs+` + `--/:` /: `hhhhhhhhhhhho/- + -/:. `hhhhhhs+:-` + ::::/ho/-` diff --git a/ascii/distro/archlabs b/ascii/distro/archlabs new file mode 100644 index 00000000..8e0b840e --- /dev/null +++ b/ascii/distro/archlabs @@ -0,0 +1,18 @@ +${c1} sy + h--d + d---: + :----/N + :------/N + N/----:---+ + N/---+/ :--:o + N/--:/ ::::s + +--- ::::s + N+---+ ::::s + N+----o +:o s::::s + N/----:: s:::s h:::::s + N/----:::y::::+ o::::::o + N/---::::::::::s d::::::::+N + /--::::::::::::dd::::::::::+N + :-:::/+syhd NNN N dhys+/:::/ + d::+ydN /s+/d +arc y\\. diff --git a/ascii/distro/artix b/ascii/distro/artix new file mode 100644 index 00000000..3ac30d3d --- /dev/null +++ b/ascii/distro/artix @@ -0,0 +1,19 @@ +${c1} d${c2}c. +${c1} x${c2}dc. +${c1} '.${c4}.${c1} d${c2}dlc. +${c1} c${c2}0d:${c1}o${c2}xllc; +${c1} :${c2}0ddlolc,lc, +${c1} :${c1}ko${c4}.${c1}:${c2}0ddollc..dlc. +${c1} ;${c1}K${c2}kxoOddollc' cllc. +${c1} ,${c1}K${c2}kkkxdddllc, ${c4}.${c2}lll: +${c1} ,${c1}X${c2}kkkddddlll;${c3}...';${c1}d${c2}llll${c3}dxk: +${c1} ,${c1}X${c2}kkkddddllll${c3}oxxxddo${c2}lll${c3}oooo, +${c3} xxk${c1}0${c2}kkkdddd${c1}o${c2}lll${c1}o${c3}ooooooolooooc;${c1}. +${c3} ddd${c2}kkk${c1}d${c2}ddd${c1}ol${c2}lc:${c3}:;,'.${c3}... .${c2}lll; +${c1} .${c3}xd${c1}x${c2}kk${c1}xd${c2}dl${c1}'cl:${c4}. ${c2}.llc, +${c1} .${c1}0${c2}kkkxddl${c4}. ${c2};'${c4}. ${c2};llc. +${c1} .${c1}K${c2}Okdcddl${c4}. ${c2}cllc${c4}. +${c1} 0${c2}Okd''dc. .cll; +${c1} k${c2}Okd' .llc, +${c1} d${c2}Od, 'lc. +${c1} :,${c4}. ${c2}... diff --git a/ascii/distro/arya b/ascii/distro/arya new file mode 100644 index 00000000..7d603e20 --- /dev/null +++ b/ascii/distro/arya @@ -0,0 +1,15 @@ +${c1} `oyyy/${c2}-yyyyyy+ +${c1} -syyyy/${c2}-yyyyyy+ +${c1} .syyyyy/${c2}-yyyyyy+ +${c1} :yyyyyy/${c2}-yyyyyy+ +${c1} `/ :yyyyyy/${c2}-yyyyyy+ +${c1} .+s :yyyyyy/${c2}-yyyyyy+ +${c1} .oys :yyyyyy/${c2}-yyyyyy+ +${c1} -oyys :yyyyyy/${c2}-yyyyyy+ +${c1} :syyys :yyyyyy/${c2}-yyyyyy+ +${c1} /syyyys :yyyyyy/${c2}-yyyyyy+ +${c1} +yyyyyys :yyyyyy/${c2}-yyyyyy+ +${c1} .oyyyyyyo. :yyyyyy/${c2}-yyyyyy+ --------- +${c1} .syyyyyy+` :yyyyyy/${c2}-yyyyy+-+syyyyyyyy +${c1} -syyyyyy/ :yyyyyy/${c2}-yyys:.syyyyyyyyyy +${c1}:syyyyyy/ :yyyyyy/${c2}-yyo.:syyyyyyyyyyy diff --git a/ascii/distro/bsd b/ascii/distro/bsd index 1ff85783..91c9a7ae 100644 --- a/ascii/distro/bsd +++ b/ascii/distro/bsd @@ -16,4 +16,4 @@ ${c4}<----|====${c1}O)))${c4}==${c1}) \) /${c4}====| \ / /\ ${c5}______${c1}( (_ / \______/ ${c5},' ,-----' | - `--{__________) + `--{__________) diff --git a/ascii/distro/cloveros b/ascii/distro/cloveros new file mode 100644 index 00000000..9996c77c --- /dev/null +++ b/ascii/distro/cloveros @@ -0,0 +1,20 @@ +${c1} `omo``omo` + `oNMMMNNMMMNo` + `oNMMMMMMMMMMMMNo` + oNMMMMMMMMMMMMMMMMNo + `sNMMMMMMMMMMMMMMNs` + `omo` `sNMMMMMMMMMMNs` `omo` + `oNMMMNo` `sNMMMMMMNs` `oNMMMNo` + `oNMMMMMMMNo` `oNMMNs` `oNMMMMMMMNo` +oNMMMMMMMMMMMNo` `sy` `oNMMMMMMMMMMMNo +`sNMMMMMMMMMMMMNo.${c2}oNNs${c1}.oNMMMMMMMMMMMMNs` +`oNMMMMMMMMMMMMNs.${c2}oNNs${c1}.oNMMMMMMMMMMMMNo` +oNMMMMMMMMMMMNs` `sy` `oNMMMMMMMMMMMNo + `oNMMMMMMMNs` `oNMMNo` `oNMMMMMMMNs` + `oNMMMNs` `sNMMMMMMNs` `oNMMMNs` + `oNs` `sNMMMMMMMMMMNs` `oNs` + `sNMMMMMMMMMMMMMMNs` + +NMMMMMMMMMMMMMMMMNo + `oNMMMMMMMMMMMMNo` + `oNMMMNNMMMNs` + `omo``oNs` diff --git a/ascii/distro/coreos b/ascii/distro/coreos new file mode 100644 index 00000000..605d5050 --- /dev/null +++ b/ascii/distro/coreos @@ -0,0 +1,20 @@ +${c1} ..... + .';:cccccccc:;'. + ':ccccclc${c3}lllllllll${c1}cc:. + .;cccccccc${c3}lllllllllllllll${c1}c, + ;clllccccc${c3}llllllllllllllllll${c1}c, + .cllclccccc${c3}lllll${c2}lll${c3}llllllllllll${c1}c: + ccclclcccc${c3}cllll${c2}kWMMNKk${c3}llllllllll${c1}c: + :ccclclcccc${c3}llll${c2}oWMMMMMMWO${c3}lllllllll${c1}c, +.ccllllllccc${c3}clll${c2}OMMMMMMMMM0${c3}lllllllll${c1}c +.lllllclcccc${c3}llll${c2}KMMMMMMMMMMo${c3}llllllll${c1}c. +.lllllllcccc${c3}clll${c2}KMMMMMMMMN0${c3}lllllllll${c1}c. +.cclllllcccc${c3}lllld${c2}xkkxxdo${c3}llllllllllc${c1}lc + :cccllllllcccc${c3}lllccllllcclccc${c1}cccccc; + .ccclllllllcccccccc${c3}lll${c1}ccccclccccccc + .cllllllllllclcccclccclccllllcllc + :cllllllllccclcllllllllllllcc; + .cccccccccccccclcccccccccc:. + .;cccclccccccllllllccc,. + .';ccccclllccc:;.. + ..... diff --git a/ascii/distro/debian_small b/ascii/distro/debian_small new file mode 100644 index 00000000..64cbb56c --- /dev/null +++ b/ascii/distro/debian_small @@ -0,0 +1,6 @@ + ${c1}_____ + / __ \\ +| / | +| \\___- +-_ + --_ diff --git a/ascii/distro/desaos b/ascii/distro/desaos new file mode 100644 index 00000000..81d8b55e --- /dev/null +++ b/ascii/distro/desaos @@ -0,0 +1,16 @@ +${c1}███████████████████████ +███████████████████████ +███████████████████████ +███████████████████████ +████████ ███████ +████████ ███████ +████████ ███████ +████████ ███████ +████████ ███████ +████████ ███████ +████████ ███████ +██████████████████████████████ +██████████████████████████████ +████████████████████████ +████████████████████████ +████████████████████████ diff --git a/ascii/distro/endless b/ascii/distro/endless new file mode 100644 index 00000000..fbff54b9 --- /dev/null +++ b/ascii/distro/endless @@ -0,0 +1,21 @@ +${c1} `:+yhmNMMMMNmhy+:` + -odMMNhso//////oshNMMdo- + /dMMh+. .+hMMd/ + /mMNo` `oNMm: + `yMMo` `oMMy` + `dMN- -NMd` + hMN. .NMh +/MM/ -os` /MM/ +dMm `smNmmhs/- `:sNMd+ `` mMd +MMy oMd--:+yMMMMMNo.:ohmMMMNy` yMM +MMy -NNyyhmMNh+oNMMMMMy:. dMo yMM +dMm `/++/-``/yNNh+/sdNMNddMm- mMd +/MM/ `dNy: `-::- /MM/ + hMN. .NMh + `dMN- -NMd` + `yMMo` `oMMy` + /mMNo` `oNMm/ + /dMMh+. .+hMMd/ + -odMMNhso//////oshNMMdo- + `:+yhmNMMMMNmhy+:` + diff --git a/ascii/distro/freebsd_small b/ascii/distro/freebsd_small new file mode 100644 index 00000000..943c147e --- /dev/null +++ b/ascii/distro/freebsd_small @@ -0,0 +1,7 @@ +${c1} /\\ _____ /\\ + \\_) (_/ + / \ +| | +| | + \ / + --_____-- diff --git a/ascii/distro/gobolinux b/ascii/distro/gobolinux new file mode 100644 index 00000000..443cfbca --- /dev/null +++ b/ascii/distro/gobolinux @@ -0,0 +1,6 @@ +${c1}_____ _ +/ ____| | | +| | __ ___ | |__ ___ +| | |_ |/ _ \| '_ \ / _ \ +| |__| | (_) | |_) | (_) | + \_____|\___/|_.__/ \___/ diff --git a/ascii/distro/grombyang b/ascii/distro/grombyang new file mode 100644 index 00000000..6dfbea9b --- /dev/null +++ b/ascii/distro/grombyang @@ -0,0 +1,18 @@ +${c1} eeeeeeeeeeee + eeeeeeeeeeeeeeeee + eeeeeeeeeeeeeeeeeeeeeee + eeeee ${c2}.o+ ${c1}eeee + eeee ${c2}`ooo/ ${c1}eeee + eeee ${c2}`+oooo: ${c1}eeee +eee ${c2}`+oooooo: ${c1}eee +eee ${c2}-+oooooo+: ${c1}eee +ee ${c2}`/:oooooooo+: ${c1}ee +ee ${c2}`/+ +++ +: ${c1}ee +ee ${c2}+o+\ ${c1}ee +eee ${c2}+o+\ ${c1}eee +eee ${c2}// \\ooo/ \\\ ${c1}eee + eee ${c2}//++++oooo++++\\\ ${c1}eee + eeee ${c2}::::++oooo+::::: ${c1}eeee + eeeee ${c3}Grombyang OS ${c1} eeee + eeeeeeeeeeeeeeeeeeeeeee + eeeeeeeeeeeeeeeee diff --git a/ascii/distro/irix b/ascii/distro/irix new file mode 100644 index 00000000..57ce2121 --- /dev/null +++ b/ascii/distro/irix @@ -0,0 +1,19 @@ +${c1} ./ohmNd/ +dNmho/- + `:+ydNMMMMMMMM.-MMMMMMMMMdyo:. + `hMMMMMMNhs/sMMM-:MMM+/shNMMMMMMh` + -NMMMMMmo-` /MMM-/MMM- `-omMMMMMN. + `.`-+hNMMMMMNhyMMM-/MMMshmMMMMMmy+...` ++mMNds:-:sdNMMMMMMMyyMMMMMMMNdo:.:sdMMm+ +dMMMMMMmy+.-/ymNMMMMMMMMNmy/-.+hmMMMMMMd +oMMMMmMMMMNds:.+MMMmmMMN/.-odNMMMMmMMMM+ +.MMMM-/ymMMMMMmNMMy..hMMNmMMMMMmy/-MMMM. + hMMM/ `/dMMMMMMMN////NMMMMMMMd/. /MMMh + /MMMdhmMMMmyyMMMMMMMMMMMMhymMMMmhdMMM: + `mMMMMNho//sdMMMMM//NMMMMms//ohNMMMMd + `/so/:+ymMMMNMMMM` mMMMMMMMmh+::+o/` + `yNMMNho-yMMMM` NMMMm.+hNMMNh` + -MMMMd: oMMMM. NMMMh :hMMMM- + -yNMMMmooMMMM- NMMMyomMMMNy- + .omMMMMMMMM-`NMMMMMMMmo. + `:hMMMMMM. NMMMMMh/` + .odNm+ /dNms. diff --git a/ascii/distro/kslinux b/ascii/distro/kslinux new file mode 100644 index 00000000..53385bd8 --- /dev/null +++ b/ascii/distro/kslinux @@ -0,0 +1,11 @@ +${c1} K K U U RRRR ooo + K K U U R R o o + KKK U U RRRR o o + K K U U R R o o + K K UUU R R ooo + +${c2} SSS AAA W W AAA + S A A W W A A + SSS AAAAA W W W AAAAA + S A A WW WW A A + SSS A A W W A A diff --git a/ascii/distro/lunar b/ascii/distro/lunar new file mode 100644 index 00000000..26bd295c --- /dev/null +++ b/ascii/distro/lunar @@ -0,0 +1,13 @@ +${c1}`-. `-. + -ohys/-` `:+shy/` + -omNNdyo/` :+shmNNy/` + ${c3} - + /mMmo + hMMMN` + .NMMs + ${c1} -:+oooo+//: ${c3}/MN${c1}. -///oooo+/-` + /:.` ${c3}/${c1} `.:/` +${c3} __ + | | _ _ ___ ___ ___ + | |__| | | | .'| _| + |_____|___|_|_|__,|_| diff --git a/ascii/distro/mac b/ascii/distro/mac index 6dc4de69..3ca5ea31 100644 --- a/ascii/distro/mac +++ b/ascii/distro/mac @@ -1,16 +1,18 @@ -${c1} -/+:. - :++++. - /+++/. - .:-::- .+/:-``.::- - .:/++++++/::::/++++++/:` -${c2} .:///////////////////////:` - ////////////////////////` -${c3}-+++++++++++++++++++++++` -/++++++++++++++++++++++/ -${c4}/sssssssssssssssssssssss. -:ssssssssssssssssssssssss- -${c5} osssssssssssssssssssssssso/` - `syyyyyyyyyyyyyyyyyyyyyyyy+` -${c6} `ossssssssssssssssssssss/ - :ooooooooooooooooooo+. - `:+oo+/:-..-:/+o+/- +${c1} 'c. + ,xNMM. + .OMMMMo + OMMM0, + .;loddo:' loolloddol;. + cKMMMMMMMMMMNWMMMMMMMMMM0: +${c2} .KMMMMMMMMMMMMMMMMMMMMMMMWd. + XMMMMMMMMMMMMMMMMMMMMMMMX. +${c3};MMMMMMMMMMMMMMMMMMMMMMMM: +:MMMMMMMMMMMMMMMMMMMMMMMM: +${c4}.MMMMMMMMMMMMMMMMMMMMMMMMX. + kMMMMMMMMMMMMMMMMMMMMMMMMWd. + ${c5}.XMMMMMMMMMMMMMMMMMMMMMMMMMMk + .XMMMMMMMMMMMMMMMMMMMMMMMMK. + ${c6}kMMMMMMMMMMMMMMMMMMMMMMd + ;KMMMMMMMWXXWMMMMMMMk. + .cooc,. .,coo:. + diff --git a/ascii/distro/mac_small b/ascii/distro/mac_small new file mode 100644 index 00000000..24852ff1 --- /dev/null +++ b/ascii/distro/mac_small @@ -0,0 +1,8 @@ +${c1} .:' + _ :'_ +${c2} .'`_`-'_``. +:________.-' +${c3}:_______: +:_______: +${c4} :_______`-; +${c5} `._.-._.' diff --git a/ascii/distro/manjaro b/ascii/distro/manjaro index d0d37c42..89fa7a2f 100644 --- a/ascii/distro/manjaro +++ b/ascii/distro/manjaro @@ -12,6 +12,3 @@ ${c1}██████████████████ ██████ ████████ ████████ ████████ ████████ ████████ ████████ ████████ ████████ ████████ -████████ ████████ ████████ -████████ ████████ ████████ -████████ ████████ ████████ diff --git a/ascii/distro/maui b/ascii/distro/maui new file mode 100644 index 00000000..1ab9c07d --- /dev/null +++ b/ascii/distro/maui @@ -0,0 +1,20 @@ +${c1} `.-://////:--` + .:/oooooooooooooooo+:. + `:+ooooooooooooooooooooooo:` + `:oooooooooooooooooooooooooooo/` + ..```-oooooo/-`` `:oooooo+:.` `-- + :. +oo+-` /ooo/` -/ + -o. `o+- +o/` -o: +`oo` ::` :o/ `+. .+o` /oo. +/o+ . -+oo- ` /oo/ `ooo/ ++o- /ooo+` .+ooo. :ooo+ +++ .+oooo: -oooo+ `oooo+ +:. .oooooo` :ooooo- :oooo: +` .oooooo: :ooooo+ `ooo+-` + .+oooooo` -oooooo: `o/- + +oooooo: .ooooooo. + /ooooooo` /ooooooo/ .. + `:oooooooo/:::/ooooooooo+:--:/:` + `:+oooooooooooooooooooooo+:` + .:+oooooooooooooooo+:. + `.-://////:-.` diff --git a/ascii/distro/mer b/ascii/distro/mer new file mode 100644 index 00000000..a98f3eb1 --- /dev/null +++ b/ascii/distro/mer @@ -0,0 +1,27 @@ +${c1} dMs + .-` + `y`-o+` + ``NMMy + .--`:++. + .hNNNNs + /MMMMMN + `ommmd/ +/ + ```` +/ + `:+sssso/-` + .-::. `-::-` `smNMNmdmNMNd/ .://-` +.ymNMNNdmNMMNm+` -dMMh:.....+dMMs `sNNMMNo +dMN+::NMMy::hMM+ mMMo `ohhy/ `dMM+ yMMy::- +MMm yMM- :MMs NMN` `:::::--sMMh dMM` +MMm yMM- -MMs mMM+ `ymmdsymMMMs dMM` +NNd sNN- -NNs -mMNs-.--..:dMMh` dNN +--- .--` `--. .smMMmdddmMNdo` .-- + ./ohddds+:` + +h- `.:-. + ./`.dMMMN+ + +MMMMMd + `+dmmy- + ``` .+` + .dMNo-y. + `hmm/ + .:` + dMs diff --git a/ascii/distro/minix b/ascii/distro/minix new file mode 100644 index 00000000..a0ff143c --- /dev/null +++ b/ascii/distro/minix @@ -0,0 +1,17 @@ +${c2} -sdhyo+:-` -/syymm: + sdyooymmNNy. `` .smNmmdysNd + odyoso+syNNmysoyhhdhsoomNmm+/osdm/ + :hhy+-/syNNmddhddddddmNMNo:sdNd: + `smNNdNmmNmddddddddddmmmmmmmy` + `ohhhhdddddmmNNdmddNmNNmdddddmdh- + odNNNmdyo/:/-/hNddNy-`..-+ydNNNmd: + `+mNho:` smmd/ sNNh :dmms` -+ymmo. +-od/ -m${c1}mm${c2}mo -NN+ +m${c1}mm${c2}m- yms: ++sms -.` :so: .NN+ :os/ .-`mNh: +.-hyh+:////- -sNNd:` .--://ohNs- + `:hNNNNNNNMMd/sNMmhsdMMh/ymmNNNmmNNy/ + -+sNNNNMMNNNsmNMo: :NNmymNNNNMMMms: + //oydNMMMMydMMNysNMMmsMMMMMNyo/` + ../-yNMMy--/::/-.sMMmos+.` + -+oyhNsooo+omy/``` + `::ohdmds-` diff --git a/ascii/distro/mx b/ascii/distro/mx new file mode 100644 index 00000000..9fc44075 --- /dev/null +++ b/ascii/distro/mx @@ -0,0 +1,17 @@ +${c3}MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMM +MMMMMMMMMMNs..yMMMMMMMMMMMMMm: +NMMMMMMM +MMMMMMMMMN+ :mMMMMMMMMMNo` -dMMMMMMMM +MMMMMMMMMMMs. `oNMMMMMMh- `sNMMMMMMMMM +MMMMMMMMMMMMN/ -hMMMN+ :dMMMMMMMMMMM +MMMMMMMMMMMMMMh- +ms. .sMMMMMMMMMMMMM +MMMMMMMMMMMMMMMN+` ` +NMMMMMMMMMMMMMM +MMMMMMMMMMMMMMNMMd: .dMMMMMMMMMMMMMMM +MMMMMMMMMMMMm/-hMd- `sNMMMMMMMMMMMMM +MMMMMMMMMMNo` -` :h/ -dMMMMMMMMMMMM +MMMMMMMMMd: /NMMh- `+NMMMMMMMMMM +MMMMMMMNo` :mMMN+` `-hMMMMMMMM +MMMMMMh. `oNMMd: `/mMMMMMM +MMMMm/ -hMd- `sNMMMM +MMNs` - :dMMM +Mm: `oMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM diff --git a/ascii/distro/nitrux b/ascii/distro/nitrux new file mode 100644 index 00000000..2f49d638 --- /dev/null +++ b/ascii/distro/nitrux @@ -0,0 +1,18 @@ +${c1}`:/. +`/yo +`/yo +`/yo .+:. +`/yo .sys+:.` +`/yo `-/sys+:.` +`/yo ./sss+:.` +`/yo .:oss+:-` +`/yo ./o///:-` +`/yo `.-:///////:` +`/yo `.://///++//-`` +`/yo `.-:////++++/-` +`/yo `-://///++o+/-` +`/yo `-/+o+++ooo+/-` +`/s+:+oooossso/.` +`//+sssssso:. +`+syyyy+:` +:+s+- diff --git a/ascii/distro/nixos_small b/ascii/distro/nixos_small new file mode 100644 index 00000000..0917ff8e --- /dev/null +++ b/ascii/distro/nixos_small @@ -0,0 +1,7 @@ + ${c1}\\\\ \\\\ // + ==\\\\__\\\\/ // + // \\\\// +==// //== + //\\\\___// +// /\\\\ \\\\== + // \\\\ \\\\ diff --git a/ascii/distro/nurunner b/ascii/distro/nurunner new file mode 100644 index 00000000..e5529673 --- /dev/null +++ b/ascii/distro/nurunner @@ -0,0 +1,19 @@ +${c1} ,xc + ;00cxXl + ;K0, .xNo. + :KO' .lXx. + cXk. ;xl cXk. + cXk. ;k:.,xo. cXk. + .lXx. :x::0MNl,dd. :KO, + .xNx. cx;:KMMMMMNo'dx. ;KK; + .dNl. cd,cXMMMMMMMMMWd,ox' 'OK: +;WK. 'K,.KMMMMMMMMMMMMMWc.Kx lMO + 'OK: 'dl'xWMMMMMMMMMM0::x: 'OK: + .kNo .xo'xWMMMMMM0;:O: ;KK; + .dXd. .do,oNMMO;ck: ;00, + oNd. .dx,;'cO; ;K0, + oNx. okk; ;K0, + lXx. :KO' + cKk' cXk. + ;00:lXx. + ,kd. diff --git a/ascii/distro/obrevenge b/ascii/distro/obrevenge new file mode 100644 index 00000000..87b50f40 --- /dev/null +++ b/ascii/distro/obrevenge @@ -0,0 +1,18 @@ +${c1} __ __ + _@@@@ @@@g_ + _@@@@@@ @@@@@@ + _@@@@@@M W@@@@@@_ + j@@@@P ^W@@@@ + @@@@L____ _____Q@@@@ +Q@@@@@@@@@@j@@@@@@@@@@ +@@@@@ T@j@ T@@@@@ +@@@@@ ___Q@J@ _@@@@@ +@@@@@fMMM@@j@jggg@@@@@@ +@@@@@ j@j@^MW@P @@@@ +Q@@@@@ggg@@f@ @@@@@@L +^@@@@WWMMP ^ Q@@@@ + @@@@@_ _@@@@l + W@@@@@g_____g@@@@@P + @@@@@@@@@@@@@@@@l + ^W@@@@@@@@@@@P + ^TMMMMTll diff --git a/ascii/distro/openbsd b/ascii/distro/openbsd index e5749985..d3812019 100644 --- a/ascii/distro/openbsd +++ b/ascii/distro/openbsd @@ -7,8 +7,8 @@ ${c1} / ||\| Y J ) / |/| ./ J |)'( | ` F`.'/ ${c3} _ ${c1} -<| F __ .-< ${c3}(_) ${c1} | / .-'${c3}. ${c1}`. /${c3}-. ${c1}L___ - J \\ < ${c3}\ ${c1} | | ${c5}O${c3}\\\\${c1}|.-' ${c3} _ -${c1} _J \\ .- \\\\${c3}/ ${c5}O ${c3}| ${c1}| \\ |${c1}F ${c3}(_) + J \\ < ${c3}\ ${c1} | | ${c5}O${c3}\\${c1}|.-' ${c3} _ +${c1} _J \\ .- \\${c3}/ ${c5}O ${c3}| ${c1}| \\ |${c1}F ${c3}(_) ${c1} '-F -<_. \\ .-' `-' L__ __J _ _. >-' ${c1})${c4}._. ${c1}|-' ${c1} `-|.' /_. ${c4}\_| ${c1} F diff --git a/ascii/distro/osmc b/ascii/distro/osmc new file mode 100644 index 00000000..f18c2e99 --- /dev/null +++ b/ascii/distro/osmc @@ -0,0 +1,20 @@ +${c1} -+shdmNNNNmdhs+- + .+hMNho/:..``..:/ohNMh+. + :hMdo. .odMh: + -dMy- -yMd- + sMd- -dMs + hMy +. .+ yMh + yMy dMs. .sMd yMy +:Mm dMNMs` `sMNMd `mM: +yM+ dM//mNs``sNm//Md +My +mM- dM: +NNNN+ :Md -Mm +mM- dM: `oNN+ :Md -Mm +yM+ dM/+NNo` :Md +My +:Mm` dMMNs` :Md `mM: + yMy dMs` -ms yMy + hMy +. yMh + sMd- -dMs + -dMy- -yMd- + :hMdo. .odMh: + .+hMNho/:..``..:/ohNMh+. + -+shdmNNNNmdhs+- diff --git a/ascii/distro/parabola b/ascii/distro/parabola index fb257c2b..33c38bd5 100644 --- a/ascii/distro/parabola +++ b/ascii/distro/parabola @@ -1,17 +1,16 @@ -${c1} eeeeeeeee - eeeeeeeeeeeeeee - eeeeee${c2}//////////${c1}eeeee - eeeee${c2}///////////////${c1}eeeee - eeeee${c2}/// ////${c1}eeee - eeee${c2}// ///${c1}eeeee - eee ${c2}///${c1}eeeee -ee ${c2}//${c1}eeeeee -e ${c2}/${c1}eeeeeee - eeeeeee - eeeeee - eeeeee - eeeee - eeee - eee - ee - e +${c1} `.-. `. + `.` `:++. `-+o+. + `` `:+/. `:+/. `-+oooo+ + ``-::-.:+/. `:+/. `-+oooooo+ + `.-:///- ..` .-. `-+oooooooo- + `..-..` `+ooooooooo: +`` :oooooooo/ + `ooooooo: + `oooooo: + -oooo+. + +ooo/` + -ooo- + `+o/. + /+- + //` + -. diff --git a/ascii/distro/parrot b/ascii/distro/parrot new file mode 100644 index 00000000..af98994d --- /dev/null +++ b/ascii/distro/parrot @@ -0,0 +1,24 @@ +${c1} `:oho/-` +`mMMMMMMMMMMMNmmdhy- + dMMMMMMMMMMMMMMMMMMs` + +MMsohNMMMMMMMMMMMMMm/ + .My .+dMMMMMMMMMMMMMh. + + :NMMMMMMMMMMMMNo + `yMMMMMMMMMMMMMm: + /NMMMMMMMMMMMMMy` + .hMMMMMMMMMMMMMN+ + ``-NMMMMMMMMMd- + /MMMMMMMMMMMs` + mMMMMMMMsyNMN/ + +MMMMMMMo :sNh. + `NMMMMMMm -o/ + oMMMMMMM. + `NMMMMMM+ + +MMd/NMh + mMm -mN` + /MM `h: + dM` . + :M- + d: + -+ + - diff --git a/ascii/distro/parsix b/ascii/distro/parsix new file mode 100644 index 00000000..2753a461 --- /dev/null +++ b/ascii/distro/parsix @@ -0,0 +1,21 @@ + ${c2}-/+/:. + ${c2}.syssssys. + ${c1}.--. ${c2}ssssssssso${c1} ..--. + :++++++: ${c2}+ssssssss+${c1} ./++/+++: + /+++++++++.${c2}.yssooooy`${c1}-+///////o- + /++++++++++.${c2}+soooos:${c1}:+////////+- + :+++++////o-${c2}oooooo-${c1}+/////////- + `-/++//++-${c4}.-----.-${c1}:+/////:- + ${c3}-://::--${c1}-:/:${c4}.--.````.--.${c1}:::-${c3}--::::::. +${c3}-/:::::::://:${c4}.:-` `-:${c3}`:/:::::::--/- +${c3}/::::::::::/-${c4}--. .-.${c3}-/://///::::/ +${c3}-/:::::::::/:${c4}`:-. .-:${c3}`:///////////- + `${c3}-::::--${c1}.-://.${c4}---....---${c1}`:+/:-${c3}--::::-` + ${c1}-/+///+o/-${c4}.----.${c1}.:oo+++o+. + ${c1}-+/////+++o:${c2}syyyyy.${c1}o+++++++++: + ${c1}.+////+++++-${c2}+sssssy+${c1}.++++++++++\ + ${c1}.+:/++++++.${c2}.yssssssy-${c1}`+++++++++: + ${c1}:/+++++- ${c2}+sssssssss ${c1}-++++++- + ${c1}`--` ${c2}+sssssssso ${c1}`--` + ${c2}+sssssy+` + ${c2}`.::-` diff --git a/ascii/distro/raspbian b/ascii/distro/raspbian index 3da139fc..472b74eb 100644 --- a/ascii/distro/raspbian +++ b/ascii/distro/raspbian @@ -1,18 +1,23 @@ -${c1} .',;:cc;,'. .,;::c:,,. - ,ooolcloooo: 'oooooccloo: - .looooc;;:ol :oc;;:ooooo' - ;oooooo: ,ooooooc. - .,:;'. .;:;'. - ${c2}.... ..'''''. .... - .''. ..'''''. ..''. - .. ..... ..... .. - . .''''''' .''''''. . -.'' .'''''''' .'''''''. ''. -''' ''''''' .'''''' ''' -.' ........... ... .'. - .... ''''''''. .''. - '''''. ''''''''. .''''' - '''''. .'''''. .'''''. - ..''. . .''.. - .''''''' - ...... +${c1} `.::///+:/-. --///+//-:`` + `+oooooooooooo: `+oooooooooooo: + /oooo++//ooooo: ooooo+//+ooooo. + `+ooooooo:-:oo- +o+::/ooooooo: + `:oooooooo+`` `.oooooooo+- + `:++ooo/. :+ooo+/.` + ${c2}...` `.----.` ``.. + .::::-``:::::::::.`-:::-` + -:::-` .:::::::-` `-:::- + `::. `.--.` `` `.---.``.::` + .::::::::` -::::::::` ` + .::` .:::::::::- `::::::::::``::. +-:::` ::::::::::. ::::::::::.`:::- +:::: -::::::::. `-:::::::: :::: +-::- .-:::-.``....``.-::-. -::- + .. `` .::::::::. `..`.. + -:::-` -::::::::::` .:::::` + :::::::` -::::::::::` :::::::. + .::::::: -::::::::. :::::::: + `-:::::` ..--.` ::::::. + `...` `...--..` `...` + .:::::::::: + `.-::::-` diff --git a/ascii/distro/refracta b/ascii/distro/refracta new file mode 100644 index 00000000..396474b5 --- /dev/null +++ b/ascii/distro/refracta @@ -0,0 +1,19 @@ +${c2} A + VW + VVW\\ + .yWWW\\ + ,;,,u,;yy;;v;uyyyyyyy ,WWWWW^ + *WWWWWWWWWWWWWWWW/ $VWWWWw , + ^*%WWWWWWVWWX $WWWW** ,yy + , "**WWW/' **' ,yy/WWW*` + &WWWWwy `*` <,ywWW%VWWW* + yWWWWWWWWWW* ., "**WW%W + ,&WWWWWM*"` ,y/ &WWWww ^* + XWWX*^ ,yWWWW09 .WWWWWWWWwy, + *` &WWWWWM WWWWWWWWWWWWWww, + (WWWWW` /#####WWW*********** + ^WWWW + VWW + Wh. + V/ + diff --git a/ascii/distro/sabotage b/ascii/distro/sabotage new file mode 100644 index 00000000..d4490fc8 --- /dev/null +++ b/ascii/distro/sabotage @@ -0,0 +1,12 @@ + +${c2} .|'''.| | '||''|. ..|''|| + ||.. ' ||| || || .|' || + ''|||. | || ||'''|. || || +. '|| .''''|. || || '|. || +|'....|' .|. .||. .||...|' ''|...|' + +|''||''| | ..|'''.| '||''''| + || ||| .|' ' || . + || | || || .... ||''| + || .''''|. '|. || || + .||. .|. .||. ''|...'| .||.....| diff --git a/ascii/distro/salentos b/ascii/distro/salentos new file mode 100644 index 00000000..f41ee747 --- /dev/null +++ b/ascii/distro/salentos @@ -0,0 +1,20 @@ +${c1} ``..`` + .-:+oshdNMMMMMMNdhyo+:-.` + -oydmMMMMMMMMMMMMMMMMMMMMMMMMMMNdhs/ +${c4} +hdddm${c1}NMMMMMMMMMMMMMMMMMMMMMMMMN${c4}mdddh+` +${c2}`MMMMMN${c4}mdddddm${c1}MMMMMMMMMMMM${c4}mdddddm${c3}NMMMMM- +${c2} mMMMMMMMMMMMN${c4}ddddhyyhhddd${c3}NMMMMMMMMMMMM` +${c2} dMMMMMMMMMMMMMMMMM${c4}oo${c3}MMMMMMMMMMMMMMMMMN` +${c2} yMMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMMd +${c2} +MMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMMy +${c2} :MMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMMo +${c2} .MMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMM/ +${c2} `NMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMM- +${c2} mMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMN` +${c2} hMMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMm +${c2} /MMMMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMMMMy +${c2} .+hMMMMMMMMMMMMM${c4}hh${c3}MMMMMMMMMMMMMms: +${c2} `:smMMMMMMMMM${c4}hh${c3}MMMMMMMMMNh+. +${c2} .+hMMMMMM${c4}hh${c3}MMMMMMdo: +${c2} `:smMM${c4}yy${c3}MMNy/` + ${c2}.- ${c4}`${c3}:. diff --git a/ascii/distro/siduction b/ascii/distro/siduction new file mode 100644 index 00000000..c9720a60 --- /dev/null +++ b/ascii/distro/siduction @@ -0,0 +1,21 @@ +${c1} _aass, + jQh: =$w + QWmwawQW + )$QQQQ@( .. + _a_a. ~??^ syDY?Sa, + _mW>-<$c jWmi imm. + ]QQwayQE 4QQmgwmQQ` + ?WWQWP' -9QQQQQ@'._aas, + _a%is. .adYYs,. -"?!` aQB*~^3$c +_Qh;.nm .QWc. {QL ]QQp;..vmQ/ +"QQmmQ@ -QQQggmQP ]QQWmggmQQ( + -???" "$WQQQY` __, ?QQQQQQW! + _yZ!?q, - .yWY!!Sw, "???^ + .QQa_=qQ mQm>..vmm + $QQWQQP $QQQgmQQ@ + "???" _aa, -9WWQQWY` + _mB>~)$a -~~ + mQms_vmQ. + ]WQQQQQP + -?T??" + diff --git a/ascii/distro/slitaz b/ascii/distro/slitaz new file mode 100644 index 00000000..5ee52706 --- /dev/null +++ b/ascii/distro/slitaz @@ -0,0 +1,17 @@ +${c1} @ @( @ + @@ @@ @ @/ + @@ @@ @@ @@ + @@ %@@ @@ @@ + @@ %@@@ @@@@@. @@@@ @@ + @@@ @@@@ @@@@@@@ &@@@ @@@ + @@@@@@@ %@@@@@@@@@@@@ &@@@% @@@@@@@/ + ,@@@@@@@@@@@@@@@@@@@@@@@@@ + .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ +@@@@@@. @@@@@@@@@@@@@@@@@@@@@ /@@@@@@ +@@ @@@@@ @@@@@@@@@@@@, @@@@@ @@@ +@@ @@@@. @@@@@@@@@@@@@% #@@@@ @@. +@@ ,@@ @@@@@@@@@@@@@ @@@ @@ +@ @@. @@@@@@@@@@@@@ @@@ *@ +@ @@ @@@@@@@@@@@@ @@ @ + @ @@@@@@@@@. #@ + @ ,@@@@@ @ diff --git a/ascii/distro/smartos b/ascii/distro/smartos new file mode 100644 index 00000000..59cea693 --- /dev/null +++ b/ascii/distro/smartos @@ -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 diff --git a/ascii/distro/source_mage b/ascii/distro/source_mage new file mode 100644 index 00000000..39a440e8 --- /dev/null +++ b/ascii/distro/source_mage @@ -0,0 +1,21 @@ +${c2} :ymNMNho. +.+sdmNMMMMMMMMMMy` +.-::/yMMMMMMMMMMMm- + sMMMMMMMMMMMm/ + /NMMMMMMMMMMMMMm: + .MMMMMMMMMMMMMMMMM: + `MMMMMMMMMMMMMMMMMN. + NMMMMMMMMMMMMMMMMMd + mMMMMMMMMMMMMMMMMMMo + hhMMMMMMMMMMMMMMMMMM. + .`/MMMMMMMMMMMMMMMMMs + :mMMMMMMMMMMMMMMMN` + `sMMMMMMMMMMMMMMM+ + /NMMMMMMMMMMMMMN` + oMMMMMMMMMMMMM+ + ./sd.-hMMMMMMMMmmN` + ./+oyyyh- `MMMMMMMMMmNh + sMMMMMMMMMmmo + `NMMMMMMMMMd: + -dMMMMMMMMMo + -shmNMMms. diff --git a/ascii/distro/swagarch b/ascii/distro/swagarch new file mode 100644 index 00000000..e3884f15 --- /dev/null +++ b/ascii/distro/swagarch @@ -0,0 +1,15 @@ +${c2} .;ldkOKXXNNNNXXK0Oxoc,. + ,lkXMMNK0OkkxkkOKWMMMMMMMMMM; + 'K0xo ..,;:c:. `'lKMMMMM0 + .lONMMMMMM' `lNMk' +${c2} ;WMMMMMMMMMO. ${c1}....::... +${c2} OMMMMMMMMMMMMKl. ${c1}.,;;;;;ccccccc, +${c2} `0MMMMMMMMMMMMMM0: ${c1}.. .ccccccc. +${c2} 'kWMMMMMMMMMMMMMNo. ${c1}.,:' .ccccccc. +${c2} `c0MMMMMMMMMMMMMN,${c1},:c; :cccccc: +${c2} ckl. `lXMMMMMMMMMX${c1}occcc:.. ;ccccccc. +${c2}dMMMMXd, `OMMMMMMWk${c1}ccc;:''` ,ccccccc: +${c2}XMMMMMMMWKkxxOWMMMMMNo${c1}ccc; .cccccccc. +${c2} `':ldxO0KXXXXXK0Okdo${c1}cccc. :cccccccc. + :ccc:' `cccccccc:, + '' 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/ascii/distro/trueos b/ascii/distro/trueos new file mode 100644 index 00000000..84bc618a --- /dev/null +++ b/ascii/distro/trueos @@ -0,0 +1,27 @@ +${c1} .. + s. + +y + yN + -MN `. + :NMs `m + .yMMm` `No + `-/+++sdMMMNs+-`+Ms + `:oo+-` .yMMMMy` `-+oNMh + -oo- +NMMMM/ oMMh- + .s+` ` oMMMMM/ - oMMMhy. + +s`- :: :MMMMMd -o `mMMMy`s+ + y+ h .Ny+oNMMMMMN/ sh+NMMMMo +y + s+ .ds -NMMMMMMMMMMNdhdNMMMMMMh` +s +-h .NM` `hMMMMMMMMMMMMMMNMMNy: h- +y- hMN` hMMmMMMMMMMMMNsdMNs. -y +m` mMMy` oMMNoNMMMMMMo` sMMMo `m +m` :NMMMdyydMMMMo+MdMMMs sMMMd` `m +h- `+ymMMMMMMMM--M+hMMN/ +MMMMy -h +:y `.sMMMMM/ oMM+.yMMNddNMMMMMm y: + y: `s dMMN- .MMMM/ :MMMMMMMMMMh :y + `h: `mdmMMM/ yMMMMs sMMMMMMMMN- :h` + so -NMMMN /mmd+ `dMMMMMMMm- os + :y: `yMMM` `+NMMMMMMNo`:y: + /s+`.omy /NMMMMMNh/.+s: + .+oo:-. /mdhs+::oo+. + -/o+++++++++++/- diff --git a/ascii/distro/ubuntu b/ascii/distro/ubuntu index c96f6282..db5df090 100644 --- a/ascii/distro/ubuntu +++ b/ascii/distro/ubuntu @@ -1,18 +1,20 @@ -${c1} ./+o+- -${c2} yyyyy- ${c1}-yyyyyy+ -${c2} ${c2}://+//////${c1}-yyyyyyo -${c3} .++ ${c2}.:/++++++/-${c1}.+sss/` -${c3} .:++o: ${c2}/++++++++/:--:/- -${c3} o:+o+:++.${c2}`..```.-/oo+++++/ -${c3} .:+o:+o/.${c2} `+sssoo+/ -${c2} .++/+:${c3}+oo+o:`${c2} /sssooo. -${c2}/+++//+:${c3}`oo+o${c2} /::--:. -${c2}+/+o+++${c3}`o++o${c1} ++////. -${c2} .++.o+${c3}++oo+:`${c1} /dddhhh. -${c3} .+.o+oo:.${c1} `oddhhhh+ -${c3} +.++o+o`${c1}`-````.:ohdhhhhh+ -${c3} `:o+++ ${c1}`ohhhhhhhhyo++os: -${c3} .o:${c1}`.syhhhhhhh/${c3}.oo++o` -${c1} /osyyyyyyo${c3}++ooo+++/ -${c1} ````` ${c3}+oo+++o: -${c3} `oo++. +${c1} .-/+oossssoo+/-. + `:+ssssssssssssssssss+:` + -+ssssssssssssssssssyyssss+- + .ossssssssssssssssss${c2}dMMMNy${c1}sssso. + /sssssssssss${c2}hdmmNNmmyNMMMMh${c1}ssssss/ + +sssssssss${c2}hm${c1}yd${c2}MMMMMMMNddddy${c1}ssssssss+ + /ssssssss${c2}hNMMM${c1}yh${c2}hyyyyhmNMMMNh${c1}ssssssss/ +.ssssssss${c2}dMMMNh${c1}ssssssssss${c2}hNMMMd${c1}ssssssss. ++ssss${c2}hhhyNMMNy${c1}ssssssssssss${c2}yNMMMy${c1}sssssss+ +oss${c2}yNMMMNyMMh${c1}ssssssssssssss${c2}hmmmh${c1}ssssssso +oss${c2}yNMMMNyMMh${c1}sssssssssssssshmmmh${c1}ssssssso ++ssss${c2}hhhyNMMNy${c1}ssssssssssss${c2}yNMMMy${c1}sssssss+ +.ssssssss${c2}dMMMNh${c1}ssssssssss${c2}hNMMMd${c1}ssssssss. + /ssssssss${c2}hNMMM${c1}yh${c2}hyyyyhdNMMMNh${c1}ssssssss/ + +sssssssss${c2}dm${c1}yd${c2}MMMMMMMMddddy${c1}ssssssss+ + /sssssssssss${c2}hdmNNNNmyNMMMMh${c1}ssssss/ + .ossssssssssssssssss${c2}dMMMNy${c1}sssso. + -+sssssssssssssssss${c2}yyy${c1}ssss+- + `:+ssssssssssssssssss+:` + .-/+oossssoo+/-. diff --git a/ascii/distro/ubuntu-budgie b/ascii/distro/ubuntu-budgie new file mode 100644 index 00000000..1faec715 --- /dev/null +++ b/ascii/distro/ubuntu-budgie @@ -0,0 +1,20 @@ +${c2} ./oydmMMMMMMmdyo/. + :smMMMMMMMMMMMhs+:++yhs: + `omMMMMMMMMMMMN+` `odo` + /NMMMMMMMMMMMMN- `sN/ + `hMMMMmhhmMMMMMMh sMh` + .mMmo- /yMMMMm` `MMm. + mN/ yMMMMMMMd- MMMm +oN- oMMMMMMMMMms+//+o+: :MMMMo +m/ +NMMMMMMMMMMMMMMMMm. :NMMMMm +M` .NMMMMMMMMMMMMMMMNodMMMMMMM +M- sMMMMMMMMMMMMMMMMMMMMMMMMM +mm` mMMMMMMMMMNdhhdNMMMMMMMMMm +oMm/ .dMMMMMMMMh: :dMMMMMMMo + mMMNyo/:/sdMMMMMMMMM+ sMMMMMm + .mMMMMMMMMMMMMMMMMMs `NMMMm. + `hMMMMMMMMMMM.oo+. `MMMh` + /NMMMMMMMMMo sMN/ + `omMMMMMMMMy. :dmo` + :smMMMMMMMh+-` `.:ohs: + ./oydmMMMMMMdhyo/. diff --git a/ascii/distro/ubuntu-mate b/ascii/distro/ubuntu-mate new file mode 100644 index 00000000..893389fe --- /dev/null +++ b/ascii/distro/ubuntu-mate @@ -0,0 +1,20 @@ +${c1} `:+shmNNMMNNmhs+:` + .odMMMMMMMMMMMMMMMMMMdo. + /dMMMMMMMMMMMMMMMmMMMMMMMMd/ + :mMMMMMMMMMMMMNNNNM/`/yNMMMMMMm: + `yMMMMMMMMMms:..-::oM: -omMMMMMy` + `dMMMMMMMMy-.odNMMMMMM: -odMMMMMMd` + hMMMMMMMm-.hMMy/....+M:`/yNm+mMMMMMMMh +/MMMMNmMN-:NMy`-yNMMMMMmNyyMN:`dMMMMMMM/ +hMMMMm -odMMh`sMMMMMMMMMMs sMN..MMMMMMMh +NMMMMm `/yNMMMMMMMMMMMM: MM+ mMMMMMMN +NMMMMm `/yNMMMMMMMMMMMM: MM+ mMMMMMMN +hMMMMm -odMMh sMMMMMMMMMMs oMN..MMMMMMMh +/MMMMNNMN-:NMy`-yNMMMMMNNsyMN:`dMMMMMMM/ + hMMMMMMMm-.hMMy/....+M:.+hNd+mMMMMMMMh + `dMMMMMMMMy-.odNMMMMMM: :smMMMMMMd` + yMMMMMMMMMms/..-::oM: .+dMMMMMy + :mMMMMMMMMMMMMNNNNM: :smMMMMMMm: + /dMMMMMMMMMMMMMMMdNMMMMMMMd/ + .odMMMMMMMMMMMMMMMMMMdo. + `:+shmNNMMNNmhs+:` diff --git a/ascii/distro/ubuntu-studio b/ascii/distro/ubuntu-studio new file mode 100644 index 00000000..2deb270e --- /dev/null +++ b/ascii/distro/ubuntu-studio @@ -0,0 +1,20 @@ +${c1} ..-::::::-.` + `.:+++++++++++${c2}ooo${c1}++:.` + ./+++++++++++++${c2}sMMMNdyo${c1}+/. + .++++++++++++++++${c2}oyhmMMMMms${c1}++. + `/+++++++++${c2}osyhddddhys${c1}+${c2}osdMMMh${c1}++/` + `+++++++++${c2}ydMMMMNNNMMMMNds${c1}+${c2}oyyo${c1}++++` + +++++++++${c2}dMMNhso${c1}++++${c2}oydNMMmo${c1}++++++++` + :+${c2}odmy${c1}+++${c2}ooysoohmNMMNmyoohMMNs${c1}+++++++: + ++${c2}dMMm${c1}+${c2}oNMd${c1}++${c2}yMMMmhhmMMNs+yMMNo${c1}+++++++ +`++${c2}NMMy${c1}+${c2}hMMd${c1}+${c2}oMMMs${c1}++++${c2}sMMN${c1}++${c2}NMMs${c1}+++++++. +`++${c2}NMMy${c1}+${c2}hMMd${c1}+${c2}oMMMo${c1}++++${c2}sMMN${c1}++${c2}mMMs${c1}+++++++. + ++${c2}dMMd${c1}+${c2}oNMm${c1}++${c2}yMMNdhhdMMMs${c1}+y${c2}MMNo${c1}+++++++ + :+${c2}odmy${c1}++${c2}oo${c1}+${c2}ss${c1}+${c2}ohNMMMMmho${c1}+${c2}yMMMs${c1}+++++++: + +++++++++${c2}hMMmhs+ooo+oshNMMms${c1}++++++++ + `++++++++${c2}oymMMMMNmmNMMMMmy+oys${c1}+++++` + `/+++++++++${c2}oyhdmmmmdhso+sdMMMs${c1}++/ + ./+++++++++++++++${c2}oyhdNMMMms${c1}++. + ./+++++++++++++${c2}hMMMNdyo${c1}+/. + `.:+++++++++++${c2}sso${c1}++:. + ..-::::::-.. diff --git a/ascii/distro/ubuntu_old b/ascii/distro/ubuntu_old new file mode 100644 index 00000000..4e3664b6 --- /dev/null +++ b/ascii/distro/ubuntu_old @@ -0,0 +1,19 @@ + +${c1} ./+o+- +${c2} yyyyy- ${c1}-yyyyyy+ +${c2} ${c2}://+//////${c1}-yyyyyyo +${c3} .++ ${c2}.:/++++++/-${c1}.+sss/` +${c3} .:++o: ${c2}/++++++++/:--:/- +${c3} o:+o+:++.${c2}`..```.-/oo+++++/ +${c3} .:+o:+o/.${c2} `+sssoo+/ +${c2} .++/+:${c3}+oo+o:`${c2} /sssooo. +${c2}/+++//+:${c3}`oo+o${c2} /::--:. +${c2}+/+o+++${c3}`o++o${c1} ++////. +${c2} .++.o+${c3}++oo+:`${c1} /dddhhh. +${c3} .+.o+oo:.${c1} `oddhhhh+ +${c3} +.++o+o`${c1}`-````.:ohdhhhhh+ +${c3} `:o+++ ${c1}`ohhhhhhhhyo++os: +${c3} .o:${c1}`.syhhhhhhh/${c3}.oo++o` +${c1} /osyyyyyyo${c3}++ooo+++/ +${c1} ````` ${c3}+oo+++o: +${c3} `oo++. diff --git a/ascii/distro/void_small b/ascii/distro/void_small new file mode 100644 index 00000000..adfae49b --- /dev/null +++ b/ascii/distro/void_small @@ -0,0 +1,7 @@ +${c1} _______ + _ \______ - +| \ ___ \ | +| | / \ | | +| | \___/ | | +| \______ \_| + -_______\ diff --git a/config/config b/config/config.conf similarity index 66% rename from config/config rename to config/config.conf index 022e9f7d..f0d7cdb9 100644 --- a/config/config +++ b/config/config.conf @@ -1,11 +1,6 @@ -#!/usr/bin/env bash -# # Neofetch config file # https://github.com/dylanaraps/neofetch -# Speed up script by not using unicode -export LC_ALL=C -export LANG=C # See this wiki page for more info: # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info @@ -14,7 +9,7 @@ print_info() { info underline info "OS" distro - info "Model" model + info "Host" model info "Kernel" kernel info "Uptime" uptime info "Packages" packages @@ -31,6 +26,7 @@ print_info() { info "GPU" gpu info "Memory" memory + # info "GPU Driver" gpu_driver # Linux/macOS only # info "CPU Usage" cpu_usage # info "Disk" disk # info "Battery" battery @@ -39,7 +35,8 @@ print_info() { # info "Local IP" local_ip # info "Public IP" public_ip # info "Users" users - # info "Birthday" birthday + # info "Install Date" install_date + # info "Locale" locale # This only works on glibc systems. info line_break info cols @@ -92,7 +89,7 @@ os_arch="on" # Shorten the output of the uptime function # -# Default: 'off' +# Default: 'on' # Values: 'on', 'off', 'tiny' # Flag: --uptime_shorthand # @@ -100,7 +97,7 @@ os_arch="on" # on: '2 days, 10 hours, 3 mins' # off: '2 days, 10 hours, 3 minutes' # tiny: '2d 10h 3m' -uptime_shorthand="off" +uptime_shorthand="on" # Shell @@ -134,27 +131,35 @@ shell_version="on" # CPU speed type # -# Default: 'max' -# Values: 'current', 'min', 'max', 'bios', -# 'scaling_current', 'scaling_min', -# 'scaling_max' +# Default: 'bios_limit' +# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. # Flag: --speed_type # Supports: Linux with 'cpufreq' -speed_type="current" +# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. +speed_type="bios_limit" -# Shorten the output of the CPU function +# CPU speed shorthand # # Default: 'off' -# Values: 'on', 'off', 'tiny', 'name', 'speed' -# Flag: --cpu_shorthand +# Values: 'on', 'off'. +# Flag: --speed_shorthand. +# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz # # Example: # on: 'i7-6500U (4) @ 3.1GHz' -# off: 'Intel i7-6500U (4) @ 3.1GHz' -# tiny: 'i7-6500U (4)' -# name: 'Intel i7-6500U (4)' -# speed: '3.1GHz' -cpu_shorthand="off" +# off: 'i7-6500U (4) @ 3.100GHz' +speed_shorthand="off" + +# Enable/Disable CPU brand in output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_brand +# +# Example: +# on: 'Intel i7-6500U' +# off: 'i7-6500U (4)' +cpu_brand="on" # CPU Speed # Hide/Show CPU speed. @@ -184,11 +189,19 @@ cpu_cores="logical" # CPU Temperature # Hide/Show CPU temperature. +# Note the temperature is added to the regular CPU function. # # Default: 'off' -# Values: 'on', 'off' +# Values: 'C', 'F', 'off' # Flag: --cpu_temp -# Supports: Linux +# Supports: Linux, BSD +# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable +# coretemp kernel module. This only supports newer Intel processors. +# +# Example: +# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' +# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' +# off: 'Intel i7-6500U (4) @ 3.1GHz' cpu_temp="off" @@ -206,6 +219,25 @@ cpu_temp="off" # off: 'HD 7950' gpu_brand="on" +# Which GPU to display +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +# Supports: Linux +# +# Example: +# all: +# GPU1: AMD HD 7950 +# GPU2: Intel Integrated Graphics +# +# dedicated: +# GPU1: AMD HD 7950 +# +# integrated: +# GPU1: Intel Integrated Graphics +gpu_type="all" + # Resolution @@ -271,10 +303,52 @@ gtk3="on" public_ip_host="http://ident.me" +# Disk + + +# Which disks to display. +# The values can be any /dev/sdXX, mount point or directory. +# NOTE: By default we only show the disk info for '/'. +# +# Default: '/' +# Values: '/', '/dev/sdXX', '/path/to/drive'. +# Flag: --disk_show +# +# Example: +# disk_show=('/' '/dev/sdb1'): +# 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 823G / 893G (93%)' +# +# disk_show=('/'): +# 'Disk (/): 74G / 118G (66%)' +# +disk_show=('/') + +# Disk subtitle. +# What to append to the Disk subtitle. +# +# Default: 'mount' +# Values: 'mount', 'name', 'dir' +# Flag: --disk_subtitle +# +# Example: +# name: 'Disk (/dev/sda1): 74G / 118G (66%)' +# 'Disk (/dev/sdb2): 74G / 118G (66%)' +# +# mount: 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 74G / 118G (66%)' +# +# dir: 'Disk (/): 74G / 118G (66%)' +# 'Disk (Local Disk): 74G / 118G (66%)' +# 'Disk (Videos): 74G / 118G (66%)' +disk_subtitle="mount" + + # Song -# Print the Artist and Title on seperate lines +# Print the Artist and Title on separate lines # # Default: 'off' # Values: 'on', 'off' @@ -288,38 +362,30 @@ public_ip_host="http://ident.me" song_shorthand="off" -# Birthday +# Install Date -# Shorten the output of the Birthday functon. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --birthday_shorthand -# Supports: 'off' doesn't work on OpenBSD and NetBSD. -# -# Example: -# on: 'Thu 14 Apr 2016 11:50 PM' -# off: '2016-04-14 23:50:55' -birthday_shorthand="off" - # Whether to show the time in the output # # Default: 'on' # Values: 'on', 'off' -# Flag: --birthday_time +# Flag: --install_time # # Example: # on: 'Thu 14 Apr 2016 11:50 PM' # off: 'Thu 14 Apr 2016' -birthday_time="on" +install_time="on" -# Date format to use when printing birthday +# Set time format in the output # -# Default: '+%a %d %b %Y %l:%M %p' -# Values: 'date format' -# Flag: --birthday_format -birthday_format="+%a %d %b %Y %l:%M %p" +# Default: '24h' +# Values: '12h', '24h' +# Flag: --install_time_format +# +# Example: +# 12h: 'Thu 14 Apr 2016 11:50 PM' +# 24h: 'Thu 14 Apr 2016 23:50' +install_time_format="12h" # Text Colors @@ -369,8 +435,7 @@ underline_char="-" # Color block range -# Start/End refer to the range of colors -# to print in the blocks. +# The range of colors to print. # # Default: '0', '7' # Values: 'num' @@ -378,13 +443,12 @@ underline_char="-" # # Example: # -# Display colors 0-7 in the blocks. +# Display colors 0-7 in the blocks. (8 colors) # neofetch --block_range 0 7 # -# Display colors 0-15 in the blocks. +# Display colors 0-15 in the blocks. (16 colors) # neofetch --block_range 0 15 -start=0 -end=7 +block_range=(0 7) # Toggle color blocks # @@ -473,15 +537,79 @@ battery_display="off" disk_display="off" -# Image Options +# Backend Settings +# Image backend. +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', 'tycat', 'w3m' +# Flag: --backend +image_backend="ascii" + # Image Source # -# Default: 'wallpaper' -# Values: 'wallpaper', '/path/to/img', '/path/to/dir/', 'off' -# Flag: --image -image_source="wallpaper" +# Which image or ascii file to display. +# +# Default: 'auto' +# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' +# Flag: --source +# +# NOTE: 'auto' will pick the best image source for whatever image backend is used. +# In ascii mode, distro ascii art will be used and in an image mode, your +# wallpaper will be used. +image_source="auto" + + +# Ascii Options + + +# Ascii distro +# Which distro's ascii art to display. +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# +# NOTE: Arch and Ubuntu have 'old' logo variants. +# Change this to 'arch_old' or 'ubuntu_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors. +# NOTE: Arch, Crux and Gentoo have a smaller logo variant. +# Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos. +ascii_distro="auto" + +# Ascii Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --ascii_colors +# +# Example: +# ascii_colors=(distro) - Ascii is colored based on Distro colors. +# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. +ascii_colors=(distro) + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --ascii_bold +ascii_bold="on" + + +# Image Options + + +# Image loop +# Setting this to on will make neofetch redraw the image constantly until +# Ctrl+C is pressed. This fixes display issues in some terminal emulators. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" # Thumbnail directory # @@ -489,22 +617,6 @@ image_source="wallpaper" # Values: 'dir' thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" -# w3m-img path -# Only works with the w3m backend. -# -# NOTE: Only change this if "neofetch -v" says that it "couldn't find w3m-img". -# Neofetch has a function that automatically finds w3m-img for you. It looks -# in the following directories: -# /usr/lib/w3m/w3mimgdisplay -# /usr/libexec/w3m/w3mimgdisplay -# /usr/lib64/w3m/w3mimgdisplay -# /usr/libexec64/w3m/w3mimgdisplay -# If w3m-img is installed elsewhere on your system, open an issue on the repo -# and I'll add it to the function inside the script. If w3m-img is installed -# in a non-standard way (in your home folder, etc) then change the variable -# below to the custom location. Otherwise, don't touch this. -w3m_img_path="/usr/lib/w3m/w3mimgdisplay" - # Crop mode # # Default: 'normal' @@ -559,56 +671,6 @@ xoffset=0 background_color= -# Ascii Options - - -# Default ascii image to use -# When this is set to distro it will use your -# distro's logo as the ascii. -# -# Default: 'distro' -# Values: 'distro', '/path/to/ascii_file' -# Flag: --ascii -ascii="distro" - -# Ascii distro -# Which distro's ascii art to display. -# -# Default: 'auto' -# Values: 'auto', 'distro_name' -# Flag: --ascii_distro -ascii_distro="auto" - -# Ascii Colors -# -# Default: 'distro' -# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' -# Flag: --ascii_colors -# -# Example: -# ascii_colors=(distro) - Ascii is colored based on Distro colors. -# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. -ascii_colors=(distro) - -# Logo size -# Arch, Crux and Gentoo have a smaller logo -# variant. Changing the value below to small -# will make neofetch use the small logo. -# -# Default: 'normal' -# Values: 'normal', 'small' -# Flag: --ascii_logo_size -ascii_logo_size="normal" - -# Bold ascii logo -# Whether or not to bold the ascii logo. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --ascii_bold -ascii_bold="on" - - # Scrot Options @@ -621,26 +683,20 @@ ascii_bold="on" # -s scrot="off" -# Screenshot program to launch -# If you're not using 'scrot' change this to your screenshot -# program. +# Screenshot Program +# Neofetch will automatically use whatever screenshot tool +# is installed on your system. # -# Default: 'scrot -c -d 3' -# Values: 'cmd -flags' +# If 'neofetch -v' says that it couldn't find a screenshot +# tool or you're using a custom tool then you can change +# the option below to a custom command. +# +# Default: 'auto' +# Values: 'auto' 'cmd -flags' # Flag: --scrot_cmd -scrot_cmd="scrot -c -d 3" +scrot_cmd="auto" -# Scrot dir -# Where to save the screenshots -# -# Default: '~/Pictures/' -# Values: 'dir' -# Flag: --scrot_dir -# -# Note: Neofetch won't create the directory if it doesn't exist. -scrot_dir="$HOME/Pictures/" - -# Scrot filename +# Screenshot Filename # What to name the screenshots # # Default: 'neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png' @@ -651,34 +707,26 @@ scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png" # Image upload host # Where to upload the image. # -# Default: 'imgur' +# Default: 'teknik' # Values: 'imgur', 'teknik' # Flag: --image_host -image_host="imgur" - - -# Config Options - - -# Enable/Disable config file # -# Default: 'on' -# Values: 'on', 'off' -# Flag: --config -# --config off, none -# -# Note: This option is only used when neofetch sources this config -# as a default config and NOT as a user config. Changing this in -# your user config won't actually do anything. -config="on" +# NOTE: If you'd like another image host to be added to Neofetch. +# Open an issue on github. +image_host="teknik" -# Path to custom config file location + +# Misc Options + +# Stdout mode +# Turn off all colors and disables image backend (ASCII/Image). +# Useful for piping into another command. +# Default: 'off' +# Values: 'on', 'off' +stdout="off" + +# Config version. # -# Default: '${XDG_CONFIG_HOME:-${HOME}/.config}/neofetch/config' -# Values: '/path/to/config' -# Flag: --config_file -# -# Note: This option is only used when neofetch sources this config -# as a default config and NOT as a user config. Changing this in -# your user config won't actually do anything. -config_file="${XDG_CONFIG_HOME:-${HOME}/.config}/neofetch/config" +# NOTE: Don't change this value, neofetch reads this to determine +# how to handle backwards compatibility. +config_version="3.3.1-git" diff --git a/config/travis b/config/travis.conf similarity index 80% rename from config/travis rename to config/travis.conf index 583ae1cd..0dada093 100644 --- a/config/travis +++ b/config/travis.conf @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Neofetch config file for travis.ci # https://github.com/dylanaraps/neofetch @@ -7,8 +5,8 @@ print_info() { info title info underline - info "Model" model info "OS" distro + info "Host" model info "Kernel" kernel info "Uptime" uptime info "Packages" packages @@ -23,6 +21,7 @@ print_info() { info "Terminal Font" term_font info "CPU" cpu info "GPU" gpu + info "GPU Driver" gpu_driver info "Memory" memory info "CPU Usage" cpu_usage @@ -33,11 +32,19 @@ print_info() { info "Local IP" local_ip info "Public IP" public_ip info "Users" users - info "Birthday" birthday + info "Install Date" install_date info line_break info cols info line_break + + # Testing. + prin "prin" + prin "prin" "prin" + + # Testing no subtitles. + info uptime + info disk } refresh_rate="on" @@ -45,4 +52,4 @@ shell_version="on" cpu_display="infobar" memory_display="infobar" disk_display="infobar" -cpu_temp="on" +cpu_temp="C" diff --git a/neofetch b/neofetch index 4971f285..9e66c4bc 100755 --- a/neofetch +++ b/neofetch @@ -8,34 +8,47 @@ # Created by Dylan Araps # https://github.com/dylanaraps/ +# Neofetch version. +version="3.3.1-git" + bash_version="${BASH_VERSION/.*}" sys_locale="${LANG:-C}" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}" +old_ifs="$IFS" -# Speed up script by not using unicode +# Speed up script by not using unicode. export LC_ALL=C export LANG=C +# Add more paths to $PATH. +export PATH="/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec:${PATH}" + # Set no case match. shopt -s nocasematch -# Reset colors/bold +# Reset colors and bold. reset="\033[0m" # DETECT INFORMATION get_os() { # $kernel_name is set in a function called cache_uname and is - # just the output of 'uname -s'. + # just the output of "uname -s". case "$kernel_name" in - "Linux") os="Linux" ;; - "Darwin") os="$(sw_vers -productName)" ;; + "Linux" | "GNU"*) os="Linux" ;; + "Darwin") os="$(sw_vers -productName)" ;; *"BSD" | "DragonFly" | "Bitrig") os="BSD" ;; - "CYGWIN"*) os="Windows" ;; + "CYGWIN"* | "MSYS"* | "MINGW"*) os="Windows" ;; "SunOS") os="Solaris" ;; "Haiku") os="Haiku" ;; - "GNU"*) os="GNU" ;; - *) printf "%s\n" "Unknown OS detected: $kernel_name"; exit 1 ;; + "MINIX") os="MINIX" ;; + "AIX") os="AIX" ;; + "IRIX64") os="IRIX" ;; + *) + printf "%s\n" "Unknown OS detected: '$kernel_name', aborting..." >&2 + printf "%s\n" "Open an issue on GitHub to add support for your OS." >&2 + exit 1 + ;; esac } @@ -43,25 +56,53 @@ get_distro() { [[ "$distro" ]] && return case "$os" in - "Linux" | "GNU") - if grep -q -F 'Microsoft' /proc/version || \ - grep -q -F 'Microsoft' /proc/sys/kernel/osrelease; then + "Linux" | "BSD" | "MINIX") + if [[ "$(< /proc/version)" == *"Microsoft"* || + "$kernel_version" == *"Microsoft"* ]]; then case "$distro_shorthand" in "on") distro="$(lsb_release -sir) [Windows 10]" ;; "tiny") distro="Windows 10" ;; *) distro="$(lsb_release -sd) on Windows 10" ;; esac - ascii_distro="Windows 10" - # TODO: Install Red Star OS and check if this is really needed. + elif [[ "$(< /proc/version)" == *"chrome-bot"* || -f "/dev/cros_ec" ]]; then + case "$distro_shorthand" in + "on") distro="$(lsb_release -sir) [Chrome OS]" ;; + "tiny") distro="Chrome OS" ;; + *) distro="$(lsb_release -sd) on Chrome OS" ;; + esac + elif [[ -f "/etc/redstar-release" ]]; then case "$distro_shorthand" in "on" | "tiny") distro="Red Star OS" ;; *) distro="Red Star OS $(awk -F'[^0-9*]' '$0=$2' /etc/redstar-release)" esac + elif [[ -f "/etc/siduction-version" ]]; then + case "$distro_shorthand" in + "on" | "tiny") distro="Siduction" ;; + *) distro="Siduction ($(lsb_release -sic))" + esac + + elif type -p lsb_release >/dev/null; then + case "$distro_shorthand" in + "on") lsb_flags="-sir" ;; + "tiny") lsb_flags="-si" ;; + *) lsb_flags="-sd" ;; + esac + distro="$(lsb_release $lsb_flags)" + + elif [[ -f "/etc/GoboLinuxVersion" ]]; then + case "$distro_shorthand" in + "on" | "tiny") distro="GoboLinux" ;; + *) distro="GoboLinux $(< /etc/GoboLinuxVersion)" + esac + elif type -p guix >/dev/null; then - distro="GuixSD" + case "$distro_shorthand" in + "on" | "tiny") distro="GuixSD" ;; + *) distro="GuixSD $(guix system -V | awk 'NR==1{printf $5}')" + esac elif type -p crux >/dev/null; then distro="$(crux)" @@ -70,16 +111,24 @@ get_distro() { "tiny") distro="${distro//version*}" ;; esac + elif type -p tazpkg >/dev/null; then + distro="SliTaz $(< /etc/slitaz-release)" + + elif type -p kpm > /dev/null; then + distro="KSLinux" + elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then distro="Android $(getprop ro.build.version.release)" - else + elif [[ -f "/etc/os-release" || -f "/usr/lib/os-release" ]]; then + files=("/etc/os-release" "/usr/lib/os-release") + # Source the os-release file - for file in /etc/os-release /usr/lib/os-release /etc/*release /usr/lib/*release; do + for file in "${files[@]}"; do source "$file" && break done - # The 3rd line down matches the fold marker syntax. {{{ + # Format the distro name. case "$distro_shorthand" in "on") distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;; "tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;; @@ -87,10 +136,31 @@ get_distro() { esac # 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 -F'=' '{print $2; exit}' /etc/*ease /usr/lib/*ease)" + [[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}')" "${files[@]}" + [[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}')" "${files[@]}" + + 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" + + # /etc/pacbsd-release is an empty file + [[ -f "/etc/pacbsd-release" ]] && distro="PacBSD" + fi fi distro="$(trim_quotes "$distro")" + distro="${distro/'NAME='}" ;; "Mac OS X") @@ -98,16 +168,17 @@ get_distro() { osx_build="$(sw_vers -buildVersion)" case "$osx_version" in - "10.4"*) codename="Mac OS X Tiger" ;; - "10.5"*) codename="Mac OS X Leopard" ;; - "10.6"*) codename="Mac OS X Snow Leopard" ;; - "10.7"*) codename="Mac OS X Lion" ;; - "10.8"*) codename="OS X Mountain Lion" ;; - "10.9"*) codename="OS X Mavericks" ;; + "10.4"*) codename="Mac OS X Tiger" ;; + "10.5"*) codename="Mac OS X Leopard" ;; + "10.6"*) codename="Mac OS X Snow Leopard" ;; + "10.7"*) codename="Mac OS X Lion" ;; + "10.8"*) codename="OS X Mountain Lion" ;; + "10.9"*) codename="OS X Mavericks" ;; "10.10"*) codename="OS X Yosemite" ;; "10.11"*) codename="OS X El Capitan" ;; "10.12"*) codename="macOS Sierra" ;; - *) codename="macOS" ;; + "10.13"*) codename="macOS High Sierra" ;; + *) codename="macOS" ;; esac distro="$codename $osx_version $osx_build" @@ -117,7 +188,7 @@ get_distro() { case "$osx_version" in "10."[4-7]*) distro="${distro/${codename}/Mac OS X}" ;; "10."[8-9]* | "10.1"[0-1]*) distro="${distro/${codename}/OS X}" ;; - "10.12"*) distro="${distro/${codename}/macOS}" ;; + "10.1"[2-3]*) distro="${distro/${codename}/macOS}" ;; esac distro="${distro/ ${osx_build}}" ;; @@ -131,24 +202,11 @@ get_distro() { os_arch="off" ;; - "BSD") - 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/pacbsd-release" ]] && distro="PacBSD" - ;; - "Windows") - distro="$(wmic os get Caption /value)" + distro="$(wmic os get Caption)" - # Strip crap from the output of wmic - distro="${distro/Caption'='}" + # Strip crap from the output of wmic. + distro="${distro/Caption}" distro="${distro/Microsoft }" ;; @@ -163,13 +221,29 @@ get_distro() { "Haiku") distro="$(uname -sv | awk '{print $1 " " $2}')" ;; + + "AIX") + distro="AIX $(oslevel)" + ;; + + "IRIX") + distro="IRIX ${kernel_version}" + ;; esac + distro="${distro//Enterprise Server}" + [[ -z "$distro" ]] && distro="$os (Unknown)" - # Get architecture - [[ "$os_arch" == "on" ]] && \ + # Get OS architecture. + case "$os" in + "Solaris" | "AIX" | "Haiku" | "IRIX") machine_arch="$(uname -p)" ;; + *) machine_arch="$(uname -m)" ;; + + esac + if [[ "$os_arch" == "on" ]]; then distro+=" ${machine_arch}" + fi [[ "${ascii_distro:-auto}" == "auto" ]] && \ ascii_distro="$(trim "$distro")" @@ -192,25 +266,29 @@ get_model() { elif [[ -f /tmp/sysinfo/model ]]; then model="$(< /tmp/sysinfo/model)" fi - - model="${model//To Be Filled*}" - model="${model//OEM*}" - model="${model//Not Applicable}" - model="${model//System Product Name}" - model="${model//System Version}" ;; - "Mac OS X") model="$(sysctl -n hw.model)" ;; + "Mac OS X") + if [[ "$(kextstat | grep "FakeSMC")" != "" ]]; then + model="Hackintosh (SMBIOS: $(sysctl -n hw.model))" + else + model="$(sysctl -n hw.model)" + fi + ;; + "iPhone OS") case "$machine_arch" in "iPad1,1") model="iPad" ;; - "iPad2,"[1-4]) model="iPad2" ;; - "iPad3,"[1-3]) model="iPad3" ;; - "iPad3,"[4-6]) model="iPad4" ;; + "iPad2,"[1-4]) model="iPad 2" ;; + "iPad3,"[1-3]) model="iPad 3" ;; + "iPad3,"[4-6]) model="iPad 4" ;; + "iPad6,11" | "iPad 6,12") model="iPad 5" ;; "iPad4,"[1-3]) model="iPad Air" ;; "iPad5,"[3-4]) model="iPad Air 2" ;; "iPad6,"[7-8]) model="iPad Pro (12.9 Inch)" ;; "iPad6,"[3-4]) model="iPad Pro (9.7 Inch)" ;; + "iPad7,"[1-2]) model="iPad Pro 2 (12.9 Inch)" ;; + "iPad7,"[3-4]) model="iPad Pro (10.5 Inch)" ;; "iPad2,"[5-7]) model="iPad mini" ;; "iPad4,"[4-6]) model="iPad mini 2" ;; "iPad4,"[7-9]) model="iPad mini 3" ;; @@ -221,7 +299,7 @@ get_model() { "iPhone2,1") model="iPhone 3GS" ;; "iPhone3,"[1-3]) model="iPhone 4" ;; "iPhone4,1") model="iPhone 4S" ;; - "iPhone5,"[1-2]) model="iPhone 4" ;; + "iPhone5,"[1-2]) model="iPhone 5" ;; "iPhone5,"[3-4]) model="iPhone 5c" ;; "iPhone6,"[1-2]) model="iPhone 5s" ;; "iPhone7,2") model="iPhone 6" ;; @@ -231,6 +309,9 @@ get_model() { "iPhone8,4") model="iPhone SE" ;; "iPhone9,1" | "iPhone9,3") model="iPhone 7" ;; "iPhone9,2" | "iPhone9,4") model="iPhone 7 Plus" ;; + "iPhone10,1" | "iPhone10,4") model="iPhone 8" ;; + "iPhone10,2" | "iPhone10,5") model="iPhone 8 Plus" ;; + "iPhone10,3" | "iPhone10,6") model="iPhone X" ;; "iPod1,1") model="iPod touch" ;; "ipod2,1") model="iPod touch 2G" ;; @@ -241,35 +322,61 @@ get_model() { esac ;; - "BSD") + "BSD" | "MINIX") model="$(sysctl -n hw.vendor hw.product)" ;; "Windows") - model="$(wmic computersystem get manufacturer,model /value)" - model="${model/Manufacturer'='}" - model="${model/Model'='}" - model="${model//*To Be Filled*}" + model="$(wmic computersystem get manufacturer,model)" + model="${model/Manufacturer}" + model="${model/Model}" ;; "Solaris") model="$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')" ;; + + "AIX") + model="$(/usr/bin/uname -M)" + ;; + esac + + # Remove dummy OEM info. + model="${model//To be filled by O.E.M.}" + model="${model//To Be Filled*}" + model="${model//OEM*}" + model="${model//Not Applicable}" + model="${model//System Product Name}" + model="${model//System Version}" + model="${model//Undefined}" + model="${model//Default string}" + model="${model//Not Specified}" + model="${model//Type1ProductConfigId}" + model="${model//INVALID}" + + case "$model" in + "Standard PC"*) model="KVM/QEMU (${model})" ;; esac } get_title() { - title="${USER:-$(whoami || printf "%s" "${HOME/*\/}")}@${HOSTNAME:-$(hostname)}" + user="${USER:-$(whoami || printf "%s" "${HOME/*\/}")}" + hostname="${HOSTNAME:-$(hostname)}" + title="${title_color}${bold}${user}${at_color}@${title_color}${bold}${hostname}" + length="$((${#user} + ${#hostname} + 1))" } get_kernel() { + # Since these OS are integrated systems, it's better to skip this function altogether + [[ "$os" =~ (AIX|IRIX) ]] && return + case "$kernel_shorthand" in "on") kernel="$kernel_version" ;; "off") kernel="$kernel_name $kernel_version" ;; esac - # Hardcode kernel settings in BSDs - if [[ "$os" == "BSD" && ! "$distro" =~ (PacBSD|PCBSD) ]]; then + # Hide kernel info if it's identical to the distro info. + if [[ "$os" =~ (BSD|MINIX) && "$distro" == *"$kernel_name"* ]]; then case "$distro_shorthand" in "on" | "tiny") kernel="$kernel_version" ;; *) unset kernel ;; @@ -279,7 +386,7 @@ get_kernel() { get_uptime() { # Since Haiku's uptime cannot be fetched in seconds, a case outside - # the usual case is needed + # the usual case is needed. case "$os" in "Haiku") uptime="$(uptime -u)" @@ -287,9 +394,9 @@ get_uptime() { ;; *) - # Get uptime in seconds + # Get uptime in seconds. case "$os" in - "Linux" | "Windows" | "GNU") + "Linux" | "Windows" | "MINIX") seconds="$(< /proc/uptime)" seconds="${seconds/.*}" ;; @@ -299,7 +406,7 @@ get_uptime() { boot="${boot/'{ sec = '}" boot="${boot/,*}" - # Get current date in seconds + # Get current date in seconds. now="$(date +%s)" seconds="$((now - boot))" ;; @@ -308,28 +415,35 @@ get_uptime() { seconds="$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')" seconds="${seconds/.*}" ;; + + "AIX" | "IRIX") + t="$(LC_ALL=POSIX ps -o etime= -p 1)" + d="0" h="0" + case "$t" in *"-"*) d="${t%%-*}"; t="${t#*-}";; esac + case "$t" in *":"*":"*) h="${t%%:*}"; t="${t#*:}";; esac + h="${h#0}" t="${t#0}" + seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))" + ;; esac days="$((seconds / 60 / 60 / 24)) days" hours="$((seconds / 60 / 60 % 24)) hours" - minutes="$((seconds / 60 % 60)) minutes" + mins="$((seconds / 60 % 60)) minutes" - case "$days" in - "0 days") unset days ;; - "1 days") days="${days/s}" ;; - esac + # Format the days, hours and minutes. + strip_date() { + case "$1" in + "0 "*) unset "${1/* }" ;; + "1 "*) printf "%s" "${1/s}" ;; + *) printf "%s" "$1" ;; + esac + } - case "$hours" in - "0 hours") unset hours ;; - "1 hours") hours="${hours/s}" ;; - esac + days="$(strip_date "$days")" + hours="$(strip_date "$hours")" + mins="$(strip_date "$mins")" - case "$minutes" in - "0 minutes") unset minutes ;; - "1 minutes") minutes="${minutes/s}" ;; - esac - - uptime="${days:+$days, }${hours:+$hours, }${minutes}" + uptime="${days:+$days, }${hours:+$hours, }${mins}" uptime="${uptime%', '}" uptime="${uptime:-${seconds} seconds}" ;; @@ -358,22 +472,24 @@ get_uptime() { get_packages() { # Remove /usr/games from $PATH. - # This solves issues with neofetch opening the - # 'pacman' game. + # This solves issues with neofetch opening the "pacman" game. local PATH=":${PATH}:" local PATH="${PATH/':/usr/games:'/:}" local PATH="${PATH%:}" local PATH="${PATH#:}" case "$os" in - "Linux" | "iPhone OS" | "Solaris" | "GNU") + "Linux" | "BSD" | "iPhone OS" | "Solaris") type -p pacman >/dev/null && \ packages="$(pacman -Qq --color never | wc -l)" type -p dpkg >/dev/null && \ packages="$((packages+=$(dpkg --get-selections | grep -cv deinstall$)))" - type -p /sbin/pkgtool >/dev/null && \ + type -p kpm >/dev/null && \ + packages="$((packages+=$(kpm --get-selections | grep -cv deinstall$)))" + + type -p pkgtool >/dev/null && \ packages="$((packages+=$(ls -1 /var/log/packages | wc -l)))" type -p rpm >/dev/null && \ @@ -403,31 +519,49 @@ get_packages() { type -p pacman-g2 >/dev/null && \ packages="$((packages+=$(pacman-g2 -Q | wc -l)))" - type -p cave >/dev/null && \ - packages="$((packages+=$(ls -d -1 /var/db/paludis/repositories/cross-installed/*/data/* /var/db/paludis/repositories/installed/data/* | wc -l)))" - type -p lvu >/dev/null && \ packages="$((packages+=$(lvu installed | wc -l)))" type -p tce-status >/dev/null && \ packages="$((packages+=$(tce-status -i | wc -l)))" - # pisi is sometimes unavailable in Solus(?). This uses eopkg - # instead if pisi isn't found. - if type -p pisi >/dev/null; then - packages="$((packages+=$(pisi list-installed | wc -l)))" + type -p Compile >/dev/null && \ + packages="$((packages+=$(ls -d -1 /Programs/*/ | wc -l)))" - elif type -p eopkg >/dev/null; then - packages="$((packages+=$(eopkg list-installed | wc -l)))" + type -p eopkg >/dev/null && \ + packages="$((packages+=$(ls -1 /var/lib/eopkg/package | wc -l)))" + + type -p pkg_info >/dev/null && \ + packages="$((packages+=$(pkg_info | wc -l)))" + + type -p crew >/dev/null && \ + packages="$((packages+=$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)))" + + type -p tazpkg >/dev/null && \ + packages="$((packages+=$(tazpkg list | wc -l) - 6))" + + type -p sorcery >/dev/null && \ + packages="$((packages+=$(gaze installed | wc -l)))" + + type -p alps >/dev/null && \ + packages="$((packages+=$(alps showinstalled | wc -l)))" + + if type -p cave >/dev/null; then + package_dir=(/var/db/paludis/repositories/{cross-installed,installed}/*/data/*) + packages="$((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l)))" fi if type -p pkg >/dev/null; then - packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))" - (("$packages" == "0")) && packages="$((packages+=$(pkg list | wc -l)))" + case "$kernel_name" in + "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 ;; - "Mac OS X") + "Mac OS X" | "MINIX") [[ -d "/usr/local/bin" ]] && \ packages="$(($(ls -l /usr/local/bin/ | grep -cv "\(../Cellar/\|brew\)") - 1))" @@ -441,25 +575,13 @@ get_packages() { 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") - packages="$(cygcheck -cd | wc -l)" + case "$kernel_name" in + "CYGWIN"*) packages="$(cygcheck -cd | wc -l)" ;; + "MSYS"*) packages="$(pacman -Qq --color never | wc -l)" + esac - # Count chocolatey packages + # Count chocolatey packages. [[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \ packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))" ;; @@ -467,49 +589,55 @@ get_packages() { "Haiku") packages="$(ls -1 /boot/system/package-links | wc -l)" ;; + + "AIX") + packages="$(lslpp -J -l -q | grep -cv '^#')" + packages="$((packages+=$(rpm -qa | wc -l)))" + ;; + + "IRIX") + packages="$(($(versions -b | wc -l)-3))" + ;; esac - (("$packages" == "0")) && unset packages + ((packages == 0)) && unset packages } get_shell() { case "$shell_path" in - "on") shell="$SHELL" ;; - "off") shell="${SHELL##*/}" ;; + "on") shell="$SHELL " ;; + "off") shell="${SHELL##*/} " ;; esac if [[ "$shell_version" == "on" ]]; then - shell+=" " - case "${SHELL##*/}" in - "bash") - shell+=" ${BASH_VERSION/-*}" - ;; - - "zsh") - shell+="$(zsh --version)" - shell="${shell/ zsh}" - ;; + case "${shell_name:=${SHELL##*/}}" in + "bash") shell+="${BASH_VERSION/-*}" ;; + "sh" | "ash" | "dash") ;; "mksh" | "ksh") shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')" shell="${shell/ * KSH}" + shell="${shell/version}" ;; - "tcsh" | "csh") - shell+="$("$SHELL" --version)" - shell="${shell/tcsh}" - shell="${shell/\(*}" - ;; - - "fish") - shell+="$(fish -c 'printf "%s" "$FISH_VERSION"')" + *) + shell+="$("$SHELL" --version 2>&1)" + shell="${shell/ "${shell_name}"}" ;; esac + + # Remove unwanted info. + shell="${shell/, version}" + shell="${shell/xonsh\//xonsh }" + shell="${shell/options*}" shell="${shell/\(*\)}" fi } get_de() { + # If function was run, stop here. + ((de_run == 1)) && return + case "$os" in "Mac OS X") de="Aqua" ;; "Windows") @@ -520,56 +648,111 @@ get_de() { ;; *) - de="${XDG_CURRENT_DESKTOP/i3}" - de="${de/'X-'}" - de="${de/Budgie:GNOME/Budgie}" + ((wm_run != 1)) && get_wm + + if [[ "$XDG_CURRENT_DESKTOP" ]]; then + de="${XDG_CURRENT_DESKTOP/'X-'}" + de="${de/Budgie:GNOME/Budgie}" + + elif [[ "$DESKTOP_SESSION" ]]; then + de="${DESKTOP_SESSION##*/}" + + elif [[ "$GNOME_DESKTOP_SESSION_ID" ]]; then + de="GNOME" + + elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then + de="MATE" + fi + + # When a window manager is started from a display manager + # the desktop variables are sometimes also set to the + # window manager name. This checks to see if WM == DE + # and dicards the DE value. + [[ "$wm" && "$de" =~ ^$wm$ ]] && { unset -v de; return; } ;; esac - if [[ -n "$DISPLAY" && -z "$de" ]]; then + # Fallback to using xprop. + [[ -n "$DISPLAY" && -z "$de" ]] && \ de="$(xprop -root | awk '/KDE_SESSION_VERSION|^_MUFFIN|xfce4|xfce5/')" - case "$de" in - "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; - *"TDE_FULL_SESSION"*) de="Trinity" ;; - *"MUFFIN"*) de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;; - *"xfce4"*) de="XFCE4" ;; - *"xfce5"*) de="XFCE5" ;; - esac - fi + # Format strings. + case "$de" in + "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; + *"TDE_FULL_SESSION"*) de="Trinity" ;; + *"MUFFIN"* | "Cinnamon") de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;; + *"xfce4"*) de="Xfce4" ;; + *"xfce5"*) de="Xfce5" ;; + *"xfce"*) de="Xfce" ;; + *"mate"*) de="MATE" ;; + esac + + # Log that the function was run. + de_run=1 } get_wm() { + # If function was run, stop here. + ((wm_run == 1)) && return + if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then - id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" - wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)" + id="$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)" + id="${id##* }" + wm="$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)" wm="${wm/*_NET_WM_NAME = }" wm="${wm/\"}" wm="${wm/\"*}" - # Fallback for Wayland wms + # Window Maker does not set _NET_WM_NAME + [[ "$wm" =~ "WINDOWMAKER" ]] && wm="wmaker" + + # Fallback for Wayland wms. [[ "$wm" == "xwlc" ]] && \ wm="$(ps -e | grep -m 1 -o -F -e "sway" -e "orbment" -e "velox" -e "orbital")" else case "$os" in - "Mac OS X") wm="Quartz Compositor" ;; + "Mac OS X") + ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm\|[c]hun[k]wm')" + + case "$ps_line" in + *"chunkwm"*) wm="chunkwm" ;; + *"kwm"*) wm="Kwm" ;; + *"Amethyst"*) wm="Amethyst" ;; + *"Spectacle"*) wm="Spectacle" ;; + *) wm="Quartz Compositor" ;; + esac + ;; + "Windows") - wm="$(tasklist | grep -m 1 -o -F -e "bugn" -e "Windawesome" -e "blackbox" -e "emerge" -e "litestep")" + wm="$(tasklist | grep -m 1 -o -F -e "bugn" \ + -e "Windawesome" \ + -e "blackbox" \ + -e "emerge" \ + -e "litestep")" [[ "$wm" == "blackbox" ]] && wm="bbLean (Blackbox)" wm="${wm:+$wm, }Explorer" ;; esac fi + + # Log that the function was run. + wm_run=1 } get_wm_theme() { - [[ -z "$wm" ]] && get_wm - [[ -z "$de" ]] && get_de + ((wm_run != 1)) && get_wm + ((de_run != 1)) && get_de case "$wm" in - "E16") wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "$HOME/.e16/e_config--0.0.cfg")";; - "Sawfish") wm_theme="$(awk -F ")" '/\(quote default-frame-style/ {print $2}' "$HOME/.sawfish/custom")" ;; + "E16") + wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")" + ;; + + "Sawfish") + wm_theme="$(awk -F ")" '/\(quote default-frame-style/ {print $2}' \ + "${HOME}/.sawfish/custom")" + ;; "Cinnamon" | "Muffin" | "Mutter (Muffin)") detheme="$(gsettings get org.cinnamon.theme name)" @@ -593,6 +776,9 @@ get_wm_theme() { if [[ "$de" == "Deepin" ]]; then wm_theme="$(gsettings get com.deepin.wrap.gnome.desktop.wm.preferences theme)" + elif [[ "$de" == "MATE" ]]; then + wm_theme="$(gsettings get org.mate.Marco.general theme)" + else wm_theme="$(gconftool-2 -g /apps/metacity/general/theme)" fi @@ -600,20 +786,21 @@ get_wm_theme() { "E17" | "Enlightenment") if type -p eet >/dev/null; then - wm_theme="$(eet -d "$HOME/.e/e/config/standard/e.cfg" config | awk '/value \"file\" string.*.edj/ {print $4}')" + wm_theme="$(eet -d "${HOME}/.e/e/config/standard/e.cfg" config |\ + awk '/value \"file\" string.*.edj/ {print $4}')" wm_theme="${wm_theme##*/}" wm_theme="${wm_theme%.*}" fi ;; "Fluxbox") - [[ -f "$HOME/.fluxbox/init" ]] && \ - wm_theme="$(awk -F "/" '/styleFile/ {print $NF}' "$HOME/.fluxbox/init")" + [[ -f "${HOME}/.fluxbox/init" ]] && \ + wm_theme="$(awk -F "/" '/styleFile/ {print $NF}' "${HOME}/.fluxbox/init")" ;; "IceWM"*) - [[ -f "$HOME/.icewm/theme" ]] && \ - wm_theme="$(awk -F "[\",/]" '!/#/ {print $2}' "$HOME/.icewm/theme")" + [[ -f "${HOME}/.icewm/theme" ]] && \ + wm_theme="$(awk -F "[\",/]" '!/#/ {print $2}' "${HOME}/.icewm/theme")" ;; "Openbox") @@ -624,12 +811,13 @@ get_wm_theme() { ob_file="rc" fi - wm_theme="$(awk -F "[<,>]" '/]" '/ 1)) && gpu_num=1 - else - # Find the currently used GPU by its BDF - gpu="$(PATH="/sbin:$PATH" lspci -mm | awk -v bdf_number="$bdf_number" -F '\\"|\\" \\"' '$0 ~ bdf_number {print $3 " " $4}')" - fi + for gpu in "${gpus[@]}"; do + # GPU shorthand tests. + [[ "$gpu_type" == "dedicated" && "$gpu" =~ (i|I)ntel ]] ||\ + [[ "$gpu_type" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \ + { unset -v gpu; continue; } case "$gpu" in - "intel"*) gpu="Intel Integrated Graphics" ;; - - "advanced"*) + *"advanced"*) gpu="${gpu/'[AMD/ATI]' }" gpu="${gpu/'[AMD]' }" + gpu="${gpu/OEM }" + gpu="${gpu/Advanced Micro Devices, Inc.}" + gpu="${gpu/ \/ *}" gpu="${gpu/*\[}" gpu="${gpu/\]*}" gpu="AMD $gpu" ;; - "nvidia"*) + *"nvidia"*) gpu="${gpu/*\[}" gpu="${gpu/\]*}" gpu="NVIDIA $gpu" ;; + *"intel"*) + gpu="$(glxinfo | grep "Device:.*Intel")" + gpu="${gpu/*Intel/Intel}" + gpu="${gpu/'(R)'}" + gpu="${gpu/ \(*}" + + [[ -z "$(trim "$gpu")" ]] && gpu="Intel Integrated Graphics" + ;; + *"virtualbox"*) gpu="VirtualBox Graphics Adapter" ;; esac - cache "gpu" "$gpu" "/tmp" - fi + + if [[ "$gpu_brand" == "off" ]]; then + gpu="${gpu/AMD }" + gpu="${gpu/NVIDIA }" + gpu="${gpu/Intel }" + fi + + prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu" + ((++gpu_num)) + done + + return ;; "Mac OS X") - # Use cache if it exists - if [[ -f "/Library/Caches/neofetch/gpu" ]]; then - source "/Library/Caches/neofetch/gpu" + if [[ -f "${cache_dir}/neofetch/gpu" ]]; then + source "${cache_dir}/neofetch/gpu" + else - gpu="$(system_profiler SPDisplaysDataType | awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')" + gpu="$(system_profiler SPDisplaysDataType |\ + awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')" gpu="${gpu//'/ $'}" gpu="${gpu%,*}" - cache "gpu" "$gpu" "/Library/Caches/" + + cache "gpu" "$gpu" fi ;; @@ -1007,9 +1281,19 @@ get_gpu() { esac ;; - "BSD" | "Solaris") - case "$distro" in - "FreeBSD"* | "DragonFlyBSD"* | "PacBSD"*) + "Windows") + gpu="$(wmic path Win32_VideoController get caption)" + gpu="${gpu//Caption}" + ;; + + "Haiku") + gpu="$(listdev | grep -A2 -F 'device Display controller' |\ + awk -F':' '/device beef/ {print $2}')" + ;; + + *) + case "$kernel_name" in + "FreeBSD"* | "DragonFly"*) gpu="$(pciconf -lv | grep -B 4 -F "VGA" | grep -F "device")" gpu="${gpu/*device*= }" gpu="$(trim_quotes "$gpu")" @@ -1021,15 +1305,6 @@ get_gpu() { ;; esac ;; - - "Windows") - gpu="$(wmic path Win32_VideoController get caption /value)" - gpu="${gpu//Caption'='}" - ;; - - "Haiku") - gpu="$(listdev | grep -A2 -F 'device Display controller' | awk -F':' '/device beef/ {print $2}')" - ;; esac if [[ "$gpu_brand" == "off" ]]; then @@ -1041,14 +1316,16 @@ get_gpu() { get_memory() { case "$os" in - "Linux" | "Windows" | "GNU") + "Linux" | "Windows") # MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable # Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716 while IFS=":" read -r a b; do case "$a" in "MemTotal") mem_used="$((mem_used+=${b/kB}))"; mem_total="${b/kB}" ;; "Shmem") mem_used="$((mem_used+=${b/kB}))" ;; - "MemFree" | "Buffers" | "Cached" | "SReclaimable") mem_used="$((mem_used-=${b/kB}))" ;; + "MemFree" | "Buffers" | "Cached" | "SReclaimable") + mem_used="$((mem_used-=${b/kB}))" + ;; esac done < /proc/meminfo @@ -1064,29 +1341,47 @@ get_memory() { mem_used="$(((${mem_wired//.} + ${mem_active//.} + ${mem_compressed//.}) * 4 / 1024))" ;; - "BSD") - case "$distro" in - "NetBSD"*) - memfree="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))" - mem_total="$(($(sysctl -n hw.physmem64) / 1024 / 1024))" - ;; - - *) - memfree="$(($(vmstat | awk 'END{printf $5}') / 1024))" - mem_total="$(($(sysctl -n hw.physmem) / 1024 / 1024))" - ;; + "BSD" | "MINIX") + # Mem total. + case "$kernel_name" in + "NetBSD"*) mem_total="$(($(sysctl -n hw.physmem64) / 1024 / 1024))" ;; + *) mem_total="$(($(sysctl -n hw.physmem) / 1024 / 1024))" ;; esac - case "$distro" in - "OpenBSD"*) mem_used="$(($(vmstat | awk 'END {printf $4}') / 1024))" ;; - *) mem_used="$((mem_total - memfree))" ;; + # Mem free. + case "$kernel_name" in + "NetBSD"*) + mem_free="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))" + ;; + + "FreeBSD"* | "DragonFly"*) + hw_pagesize="$(sysctl -n hw.pagesize)" + mem_inactive="$(($(sysctl -n vm.stats.vm.v_inactive_count) * hw_pagesize))" + mem_unused="$(($(sysctl -n vm.stats.vm.v_free_count) * hw_pagesize))" + mem_cache="$(($(sysctl -n vm.stats.vm.v_cache_count) * hw_pagesize))" + mem_free="$(((mem_inactive + mem_unused + mem_cache) / 1024 / 1024))" + ;; + + "MINIX") + mem_free="$(top -d 1 | awk -F ',' '/^Memory:/ {print $2}')" + mem_free="${mem_free/M Free}" + ;; + + "OpenBSD"*) ;; + *) mem_free="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;; + esac + + # Mem used. + case "$kernel_name" in + "OpenBSD"*) mem_used="$(($(vmstat | awk 'END{printf $4}') / 1024))" ;; + *) mem_used="$((mem_total - mem_free))" ;; esac ;; "Solaris") mem_total="$(prtconf | awk '/Memory/ {print $3}')" - memfree="$(($(sar -r 1 1 | awk 'NR==5 {print $2}') / 1024))" - mem_used="$((mem_total - memfree))" + mem_free="$(($(vmstat | awk 'NR==3{printf $5}') / 1024))" + mem_used="$((mem_total - mem_free))" ;; "Haiku") @@ -1094,159 +1389,141 @@ get_memory() { mem_used="$(sysinfo -mem | awk -F '\\/|)' '{print $2; exit}')" mem_used="$((${mem_used/max} / 1024 / 1024))" ;; - esac - memory="${mem_used}MB / ${mem_total}MB" - # Bars + "AIX") + mem_stat=($(svmon -G -O unit=MB)) + mem_total="${mem_stat[11]/.*}" + mem_free="${mem_stat[16]/.*}" + mem_used="$((mem_total - mem_free))" + mem_label="MB" + ;; + + "IRIX") + mem_stat=($(pmem | head -1)) + mem_total="$((mem_stat[3] / 1024))" + mem_free="$((mem_stat[5] / 1024))" + mem_used="$((mem_total - mem_free))" + ;; + esac + memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB}" + + # Bars. case "$memory_display" in "bar") memory="$(bar "${mem_used}" "${mem_total}")" ;; "infobar") memory="${memory} $(bar "${mem_used}" "${mem_total}")" ;; - "barinfo") memory="$(bar "${mem_used}" "${mem_total}") ${memory}" ;; + "barinfo") memory="$(bar "${mem_used}" "${mem_total}")${info_color} ${memory}" ;; esac } get_song() { - # This is absurdly long. - player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|gnome-music|lollypop|clementine|pragha/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/ awk|Helper|Cache|ibus|indicator/) && /mpd|mopidy|cmus|mocp|spotify|\ +Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|\ +xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|\ +guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo|elisa/ {printf $5 " " $6; exit}')" + + get_song_dbus() { + # Multiple players use an almost identical dbus command to get the information. + # This function saves us using the same command throughout the function. + song="$(\ + dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${1}" /org/mpris/MediaPlayer2 \ + org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \ + string:'Metadata' |\ + awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ + awk -F '"' '/artist/ {a=$2} /title/ {t=$2} END{print a " - " t}' + )" + } case "${player/*\/}" in - "mpd"*) - song="$(mpc current)" - state="$(mpc | awk -F '\\[|\\]' '/\[/ {printf $2}')" + "mpd"* | "mopidy"*) song="$(mpc current)" ;; + "mocp"*) song="$(mocp -Q "%artist - %song")" ;; + "google play"*) song="$(gpmdp-remote current)" ;; + "rhythmbox"*) song="$(rhythmbox-client --print-playing)" ;; + "deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% - %title%')" ;; + "xmms2d"*) song="$(xmms2 current -f '${artist} - ${title}')" ;; + "qmmp"*) song="$(qmmp --nowplaying '%p - %t')" ;; + "gnome-music"*) get_song_dbus "GnomeMusic" ;; + "lollypop"*) get_song_dbus "Lollypop" ;; + "clementine"*) get_song_dbus "clementine" ;; + "juk"*) get_song_dbus "juk" ;; + "bluemindo"*) get_song_dbus "Bluemindo" ;; + "guayadeque"*) get_song_dbus "guayadeque" ;; + "yarock"*) get_song_dbus "yarock" ;; + "deepin-music"*) get_song_dbus "deepinmusic" ;; + "tomahawk"*) get_song_dbus "tomahawk" ;; + "elisa"*) get_song_dbus "elisa" ;; + + "audacious"*) + song="$(audtool current-song)" + + # Remove Album from 'Artist - Album - Title' + song="${song/-* -/-}" + + [[ -z "$song" ]] && get_song_dbus "audacious" ;; "cmus"*) - IFS=$'\n' - song=($(cmus-remote -Q | grep -F -e "tag artist" -e "tag title" -e "status" | sort)) - state="${song[0]/status }" - artist="${song[1]/tag artist }" - title="${song[2]/tag title }" - song="${artist/tag title } - ${title/tag artist }" - ;; - - "mocp"*) - song="$(mocp -Q "%artist - %song")" - state="$(mocp -Q "%state")" + song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "}\ + /tag title/ {$1=$2=""; print}')" ;; "spotify"*) case "$os" in - "Linux") - # Thanks dbus - song="$(\ - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 \ - org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ - awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ - awk -F '"' '/artist|title/ {printf $2 " - "}' - )" - song="${song% - }" - song="${song/'('*}" - song="${song//'['*}" - ;; + "Linux") get_song_dbus "spotify" ;; "Mac OS X") - song="$(osascript -e 'tell application "Spotify" to artist of current track as string & " - " & name of current track as string')" - state="$(osascript -e 'tell application "Spotify" to player state as string')" + song="$(osascript -e 'tell application "Spotify" to artist of current track as \ + string & " - " & name of current track as string')" ;; esac ;; - "google play"*) - song="$(gpmdp-remote current)" - state="$(gpmdp-remote status)" - ;; - "itunes"*) - song="$(osascript -e 'tell application "iTunes" to artist of current track as string & " - " & name of current track as string')" - state="$(osascript -e 'tell application "iTunes" to player state as string')" - ;; - - "rhythmbox"*) - song="$(rhythmbox-client --print-playing)" - # Thanks dbus - state="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 \ - org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string: 'PlayBackStatus' |\ - awk -F 'string "' '{printf $2}')" - state="$(trim_quotes "$state")" + song="$(osascript -e 'tell application "iTunes" to artist of current track as \ + string & " - " & name of current track as string')" ;; "banshee"*) - artist="$(banshee --query-artist | awk -F':' '{print $2}')" - title="$(banshee --query-title | awk -F':' '{print $2}')" - song="$artist - $title" - state="$(banshee --query-current-state | awk -F':' '{print $2}')" + song="$(banshee --query-artist --query-title |\ + awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "amarok"*) - artist="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {print $2}')" - title="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/title/ {print $2}')" - song="$artist - $title" - ;; - - "deadbeef"*) - song="$(deadbeef --nowplaying '%a - %t')" - ;; - - "audacious"*) - song="$(audtool current-song)" - ;; - - "gnome-music"*) - # Hello dbus my old friend. - song="$(\ - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.GnomeMusic /org/mpris/MediaPlayer2 \ - org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ - awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ - awk -F '"' '/artist|title/ {printf $2 " - "}' - )" - song="${song% - }" - ;; - - "lollypop"*) - # Hello dbus my old friend. - song="$(\ - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 \ - org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ - awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ - awk -F '"' '/artist|title/ {printf $2 " - "}' - )" - song="${song% - }" - ;; - - "clementine"*) - # dbus - song="$( - dbus-send --print-reply --dest=org.mpris.clementine /org/mpris/MediaPlayer2 \ - org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ - awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ - awk -F '"' '/artist|title/ {printf $2 " - "}' - )" - song="${song% - }" + song="$(qdbus org.kde.amarok /Player GetMetadata |\ + awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "pragha"*) - artist="$(pragha -c | awk -F':' '/artist/ {print $2}')" - title="$(pragha -c | awk -F':' '/title/ {print $2}')" - song="$artist - $title" + song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; - *) song="Not Playing" ;; + "exaile"*) + song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \ + org.exaile.Exaile.Query | awk -F':|,' '{if ($6 && $4) printf $6 " -" $4}')" + ;; + + "quodlibet"*) + song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet \ + /net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\ + awk -F'"' '/artist/ {getline; a=$2} \ + /title/ {getline; t=$2} END{print a " - " t}')" + ;; + + "pogo"*) + song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player \ + org.freedesktop.MediaPlayer.GetMetadata | + awk -F'"' '/string "artist"/ {getline; a=$2} /string "title"/ {getline; t=$2} \ + END{print a " - " t}')" + ;; + + *) mpc >/dev/null 2>&1 && song="$(mpc current)" ;; esac - case "$state" in - "paused" | "PAUSE" | "Paused") - song="Paused" - ;; + [[ "$(trim "$song")" == "-" ]] && unset -v song - "stopped" | "STOP" | "Stopped") - song="Stopped" - ;; - esac - - # Display Artist and Title on seperate lines. - if [[ "$song_shorthand" == "on" ]]; then + # Display Artist and Title on separate lines. + if [[ "$song_shorthand" == "on" && "$song" ]]; then artist="${song/ -*}" - song="${song/$artist - }" + song="${song/*-}" if [[ "$song" != "$artist" ]]; then prin "Artist" "$artist" @@ -1254,42 +1531,33 @@ get_song() { else prin "$subtitle" "$song" fi - unset song fi } get_resolution() { case "$os" in - "Linux" | "BSD" | "Solaris" | "GNU") - if type -p xrandr >/dev/null; then - case "$refresh_rate" in - "on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;; - "off") resolution="$(xrandr --nograb --current | awk '/\*/ {printf $1 ", "}')" ;; - esac - resolution="${resolution//\*}" - resolution="${resolution//\.[0-9][0-9]}" - - elif type -p xdpyinfo >/dev/null; then - resolution="$(xdpyinfo | awk '/dimensions:/ {printf $2}')" - fi - ;; - "Mac OS X") if type -p screenresolution >/dev/null; then - resolution="$(screenresolution get | awk '/Display/ {printf $6 "Hz, "}')" + resolution="$(screenresolution get 2>&1 | awk '/Display/ {printf $6 "Hz, "}')" resolution="${resolution//x??@/ @ }" else - resolution="$(system_profiler SPDisplaysDataType | awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')" + resolution="$(system_profiler SPDisplaysDataType |\ + awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')" fi - scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)" + if [[ -e "/Library/Preferences/com.apple.windowserver.plist" ]]; then + scale_factor="$(PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" \ + /Library/Preferences/com.apple.windowserver.plist)" + else + scale_factor="" + fi # If no refresh rate is empty. - [[ "$resolution" =~ "@ Hz" ]] && \ + [[ "$resolution" == *"@ Hz"* ]] && \ resolution="${resolution//@ Hz}" - (("${scale_factor%.*}" == 2)) && \ + [[ "${scale_factor%.*}" == 2 ]] && \ resolution="${resolution// @/@2x @}" if [[ "$refresh_rate" == "off" ]]; then @@ -1297,18 +1565,20 @@ get_resolution() { resolution="${resolution// @ [0-9][0-9][0-9]Hz}" fi - [[ "$resolution" =~ "0Hz" ]] && \ + [[ "$resolution" == *"0Hz"* ]] && \ resolution="${resolution// @ 0Hz}" ;; "Windows") - width="$(wmic path Win32_VideoController get CurrentHorizontalResolution /value)" - width="${width//CurrentHorizontalResolution'='/}" + local width="" + width="$(wmic path Win32_VideoController get CurrentHorizontalResolution)" + width="${width//CurrentHorizontalResolution/}" - height="$(wmic path Win32_VideoController get CurrentVerticalResolution /value)" - height="${height//CurrentVerticalResolution'='/}" + local height="" + height="$(wmic path Win32_VideoController get CurrentVerticalResolution)" + height="${height//CurrentVerticalResolution/}" - [[ "$width" ]] && resolution="${width}x${height}" + [[ "$(trim "$width")" ]] && resolution="${width//[[:space:]]}x${height//[[:space:]]}" ;; "Haiku") @@ -1316,38 +1586,64 @@ get_resolution() { [[ "$refresh_rate" == "off" ]] && resolution="${resolution/ @*}" ;; + + *) + if type -p xrandr >/dev/null; then + case "$refresh_rate" in + "on") + resolution="$(xrandr --nograb --current |\ + awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ "\ + substr($0,RSTART,RLENGTH) "Hz, "}')" + ;; + + "off") + resolution="$(xrandr --nograb --current |\ + awk -F 'connected |\\+|\\(' \ + '/ connected/ && $2 {printf $2 ", "}')" + resolution="${resolution/primary }" + ;; + esac + resolution="${resolution//\*}" + + elif type -p xdpyinfo >/dev/null; then + resolution="$(xdpyinfo | awk '/dimensions:/ {printf $2}')" + fi + ;; esac resolution="${resolution%,*}" } get_style() { - # Fix weird output when the function - # is run multiple times. + # Fix weird output when the function is run multiple times. unset gtk2_theme gtk3_theme theme path if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then # Get DE if user has disabled the function. - [[ -z "$de" ]] && get_de + ((de_run != 1)) && get_de # Check for DE Theme. case "$de" in "KDE"*) kde_config_dir - if [[ -f "${kde_config_dir}/share/config/kdeglobals" ]]; then - kde_config_file="${kde_config_dir}/share/config/kdeglobals" + if [[ -f "${kde_config_dir}/kdeglobals" ]]; then + kde_config_file="${kde_config_dir}/kdeglobals" - theme="$(grep "^[^#]*$kde" "$kde_config_file")" - theme="${theme/${kde}*=}" - theme="$(uppercase "$theme")" - - gtk_shorthand="on" - return + kde_theme="$(grep "^${kde}" "$kde_config_file")" + kde_theme="${kde_theme/*=}" + if [[ "$kde" == "font" ]]; then + kde_font_size="${kde_theme#*,}" + kde_font_size="${kde_font_size/,*}" + kde_theme="${kde_theme/,*} ${kde_theme/*,} ${kde_font_size}" + fi + kde_theme="$(uppercase "$kde_theme") [KDE], " + else + err "Theme: KDE config files not found, skipping." fi ;; - *"Cinnamon") + *"Cinnamon"*) if type -p gsettings >/dev/null; then gtk3_theme="$(gsettings get org.cinnamon.desktop.interface "$gsettings")" gtk2_theme="$gtk3_theme" @@ -1375,10 +1671,10 @@ get_style() { ;; esac - # Check for general GTK2 Theme + # Check for general GTK2 Theme. if [[ -z "$gtk2_theme" ]]; then - if [[ -f "${GTK2_RC_FILES:-$HOME/.gtkrc-2.0}" ]]; then - gtk2_theme="$(grep "^[^#]*${name}" "${GTK2_RC_FILES:-$HOME/.gtkrc-2.0}")" + if [[ -f "${GTK2_RC_FILES:-${HOME}/.gtkrc-2.0}" ]]; then + gtk2_theme="$(grep "^[^#]*${name}" "${GTK2_RC_FILES:-${HOME}/.gtkrc-2.0}")" elif [[ -f "/usr/share/gtk-2.0/gtkrc" ]]; then gtk2_theme="$(grep "^[^#]*${name}" /usr/share/gtk-2.0/gtkrc)" @@ -1390,10 +1686,10 @@ get_style() { gtk2_theme="${gtk2_theme/${name}*=}" fi - # Check for general GTK3 Theme + # Check for general GTK3 Theme. if [[ -z "$gtk3_theme" ]]; then - if [[ -f "$XDG_CONFIG_HOME/gtk-3.0/settings.ini" ]]; then - gtk3_theme="$(grep "^[^#]*$name" "$XDG_CONFIG_HOME/gtk-3.0/settings.ini")" + if [[ -f "${XDG_CONFIG_HOME}/gtk-3.0/settings.ini" ]]; then + gtk3_theme="$(grep "^[^#]*$name" "${XDG_CONFIG_HOME}/gtk-3.0/settings.ini")" elif type -p gsettings >/dev/null; then gtk3_theme="$(gsettings get org.gnome.desktop.interface "$gsettings")" @@ -1408,24 +1704,24 @@ get_style() { gtk3_theme="${gtk3_theme/${name}*=}" fi - # Trim whitespace + # Trim whitespace. gtk2_theme="$(trim "$gtk2_theme")" gtk3_theme="$(trim "$gtk3_theme")" - # Remove quotes + # Remove quotes. gtk2_theme="$(trim_quotes "$gtk2_theme")" gtk3_theme="$(trim_quotes "$gtk3_theme")" - # Uppercase the first letter of each gtk theme + # Uppercase the first letter of each GTK theme. gtk2_theme="$(uppercase "$gtk2_theme")" gtk3_theme="$(uppercase "$gtk3_theme")" - # Toggle visibility of gtk themes. + # Toggle visibility of GTK themes. [[ "$gtk2" == "off" ]] && unset gtk2_theme [[ "$gtk3" == "off" ]] && unset gtk3_theme - # Format the string based on which themes exist - if [[ "$gtk2_theme" && "$gtk2_theme" == "$gtk3_theme" ]]; then + # Format the string based on which themes exist. + if [[ "$gtk2_theme" && "$gtk2_theme" == "$gtk3_theme" ]]; then gtk3_theme+=" [GTK2/3]" unset gtk2_theme @@ -1438,13 +1734,15 @@ get_style() { [[ "$gtk3_theme" ]] && gtk3_theme+=" [GTK3] " fi - # Final string - theme="${gtk2_theme}${gtk3_theme}" + # Final string. + theme="${kde_theme}${gtk2_theme}${gtk3_theme}" + theme="${theme%, }" - # Make the output shorter by removing "[GTKX]" from the string + # Make the output shorter by removing "[GTKX]" from the string. if [[ "$gtk_shorthand" == "on" ]]; then theme="${theme// '[GTK'[0-9]']'}" theme="${theme/ '[GTK2/3]'}" + theme="${theme/ '[KDE]'}" fi fi } @@ -1454,7 +1752,7 @@ get_theme() { gsettings="gtk-theme" gconf="gtk_theme" xfconf="/Net/ThemeName" - kde="widgetStyle" + kde="Name" get_style } @@ -1482,59 +1780,224 @@ get_font() { } get_term() { + # If function was run, stop here. + ((term_run == 1)) && return + + # Workaround for macOS systems that + # don't support the block below. + case "$TERM_PROGRAM" in + "iTerm.app") term="iTerm2" ;; + "Terminal.app") term="Apple Terminal" ;; + "Hyper") term="HyperTerm" ;; + *) term="${TERM_PROGRAM/\.app}" ;; + esac + # Check $PPID for terminal emulator. - case "$os" in - "Mac OS X") - # Workaround for macOS systems that - # don't support the block below. - case "$TERM_PROGRAM" in - "iTerm.app") term="iTerm2" ;; - "Terminal.app") term="Apple Terminal" ;; - "Hyper") term="HyperTerm" ;; - *) term="${TERM_PROGRAM/\.app}" ;; + while [[ -z "$term" ]]; do + if [[ "$SSH_CONNECTION" ]]; then + term="$SSH_TTY"; break + else + parent="$(get_ppid "$parent")" + [[ -z "$parent" ]] && break + name="$(get_process_name "$parent")" + case "${name// }" in + "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; + "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; + "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"* | "kdeinit"*) + break + ;; + "gnome-terminal-") term="gnome-terminal" ;; + *"nvim") term="Neovim Terminal" ;; + *"NeoVimServer"*) term="VimR Terminal" ;; + *) term="${name##*/}" ;; esac - return - ;; + fi + done - "Windows") - parent="$(ps -p "${1:-$PPID}" | awk '{printf $2}')" - parent="${parent/'PPID'}" - - name="$(ps -p "$parent" | awk '{printf $8}')" - name="${name/'COMMAND'}" - name="${name/*\/}" - ;; - - "Linux") - parent="$(grep -i -F "PPid:" "/proc/${1:-$PPID}/status")" - name="$(< "/proc/$(trim "${parent/PPid:}")/comm")" - ;; - - *) - parent="$(ps -p "${1:-$PPID}" -o ppid=)" - name="$(ps -p "$parent" -o comm=)" - ;; - esac - - case "${name// }" in - "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su") get_term "$parent" ;; - "login"* | *"Login"* | "init") term="$(tty)" ;; - "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) unset term ;; - "gnome-terminal-") term="gnome-terminal" ;; - *) term="${name##*/}" ;; - esac + # Log that the function was run. + term_run=1 } get_term_font() { - [[ -z "$term" ]] && get_term + ((term_run != 1)) && get_term case "$term" in - "urxvt" | "urxvtd" | "xterm") - term_font="$(grep -i -F "${term/d}*font" < <(xrdb -query))" - term_font="${term_font/*font:}" + "alacritty"*) + term_font="$(awk -F ':|#' '/normal:/ {getline; print}' \ + "${XDG_CONFIG_HOME}/alacritty/alacritty.yml")" + term_font="${term_font/*family:}" + term_font="${term_font/$'\n'*}" + term_font="${term_font/\#*}" + ;; + + "Apple_Terminal") + term_font="$(osascript -e 'tell application "Terminal" to \ + font name of window frontmost')" + ;; + + "iTerm2") + # Unfortunately the profile name is not unique, but it seems to be the only thing + # that identifies an active profile. There is the "id of current session of current win- + # dow" though, but that does not match to a guid in the plist. + # So, be warned, collisions may occur! + # See: https://groups.google.com/forum/#!topic/iterm2-discuss/0tO3xZ4Zlwg + local current_profile_name profiles_count profile_name diff_font none_ascii + + current_profile_name="$(osascript -e 'tell application "iTerm2" to profile name \ + of current session of current window')" + + # Warning: Dynamic profiles are not taken into account here! + # https://www.iterm2.com/documentation-dynamic-profiles.html + font_file="${HOME}/Library/Preferences/com.googlecode.iterm2.plist" + + # Count Guids in "New Bookmarks"; they should be unique + profiles_count="$(PlistBuddy -c "Print :New\ Bookmarks:" "$font_file" | grep -c "Guid")" + + for ((i=0; i<=profiles_count; i++)); do + profile_name="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Name:" "$font_file")" + + if [[ "$profile_name" == "$current_profile_name" ]]; then + # "Normal Font" + term_font="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Normal\ Font:" \ + "$font_file")" + + # Font for non-ascii characters + # Only check for a different non-ascii font, if the user checked + # the "use a different font for non-ascii text" switch. + diff_font="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Use\ Non-ASCII\ Font:" \ + "$font_file")" + + if [[ "$diff_font" == "true" ]]; then + non_ascii="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Non\ Ascii\ Font:" \ + "$font_file")" + + [[ "$term_font" != "$non_ascii" ]] && \ + term_font="$term_font (normal) / $non_ascii (non-ascii)" + fi + fi + done + ;; + + "deepin-terminal"*) + term_font="$(awk -F '=' '/font=/ {a=$2} /font_size/ {b=$2} END{print a " " b}' \ + "${XDG_CONFIG_HOME}/deepin/deepin-terminal/config.conf")" + ;; + + "GNUstep_Terminal") + term_font="$(awk -F '>|<' '/>TerminalFontTerminalFontSize/dev/null 2>&1 ||\ + { err "Disk requires 'df' to function. Install 'df' to get disk info."; return; } - case "$distro" in - "OpenWRT"*) df_flags="-h"; df_dir="rootfs" ;; - "Android"*) return ;; - esac - ;; - - "Mac OS X" | "BSD" | "Haiku") - case "$distro" in - "FreeBSD"* | *"OS X"* | "Mac"* ) - df_flags="-l -H /" - df_dir="/" - ;; - - *) return ;; - esac + # Get "df" version. + df_version="$(df --version 2>&1)" + case "$df_version" in + *"blocks"*) # Haiku + err "Your version of df cannot be used due to the non-standard flags" + return ;; + *"IMitv"*) df_flags=(-P -g) ;; # AIX + *"befhikm"*) df_flags=(-P -k) ;; # IRIX + *) df_flags=(-P -h) ;; esac - # Get the disk info - disk="$(df $df_flags | awk -v dir="$df_dir" '$0 ~ dir {print $2 ":" $3 ":" $5}')" + # Create an array called 'disks' where each element is a separate line from + # df's output. We then unset the first element which removes the column titles. + IFS=$'\n' + disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}")) + unset 'disks[0]' + IFS="$old_ifs" - # Format the output - disk_used="${disk#*:}" - disk_used="${disk_used%%:*}" - disk_total="${disk%%:*}" - disk_total_per="${disk#*:*:}" - - # Put it all together - disk="${disk_used} / ${disk_total} (${disk_total_per})" - - # Add info bar - disk_used="${disk_used/G}" - disk_total="${disk_total/G}" - - # Convert Terabytes to Gigabytes. - if [[ "$disk_display" != "off" ]]; then - disk_used="${disk_used/\.}" - disk_total="${disk_total/\.}" - - [[ "${disk_used: -1}" == "T" ]] && \ - disk_used="$((${disk_used/T} * 100))" - - [[ "${disk_total: -1}" == "T" ]] && \ - disk_total="$((${disk_total/T} * 100))" + # Stop here if 'df' fails to print disk info. + if [[ -z "${disks[*]}" ]]; then + err "Disk: df failed to print the disks, make sure the disk_show array is set properly." + return fi - case "$disk_display" in - "bar") disk="$(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;; - "infobar") disk+=" $(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;; - "barinfo") disk="$(bar "${disk_used/'.'*}" "${disk_total/'.'*}") $disk" ;; - "perc") disk="$disk_total_per $(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;; - esac + for disk in "${disks[@]}"; do + # Create a second array and make each element split at whitespace this time. + disk_info=($disk) + disk_perc="${disk_info[4]/'%'}" + + case "$df_version" in + *"befhikm"*) + disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)" + ;; + *) disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)" ;; + esac + + # Subtitle. + case "$disk_subtitle" in + "name") disk_sub="${disk_info[0]}" ;; + "dir") + disk_sub="${disk_info[5]/*\/}" + [[ -z "$disk_sub" ]] && disk_sub="${disk_info[5]}" + ;; + *) disk_sub="${disk_info[5]}" ;; + esac + + # Bar. + case "$disk_display" in + "bar") disk="$(bar "$disk_perc" "100")" ;; + "infobar") disk+=" $(bar "$disk_perc" "100")" ;; + "barinfo") disk="$(bar "$disk_perc" "100")${info_color} $disk" ;; + "perc") disk="${disk_perc}% $(bar "$disk_perc" "100")" ;; + esac + + # Append '(disk mount point)' to the subtitle. + if [[ -z "$subtitle" ]]; then + prin "${disk_sub}" "$disk" + else + prin "${subtitle} (${disk_sub})" "$disk" + fi + done } get_battery() { case "$os" in "Linux") - # We use 'prin' here and exit the function early so that we can - # do multi battery support with a single battery per line. - for bat in "/sys/class/power_supply/BAT"*; do + # We use 'prin' here so that we can do multi battery support + # with a single battery per line. + for bat in "/sys/class/power_supply/"{BAT,axp288_fuel_gauge,CMB}*; do capacity="$(< "${bat}/capacity")" status="$(< "${bat}/status")" - # Fix for bash on Windows 10 which includes /proc files - # for battery usage despite there not being a battery - # installed. - [[ -z "$capacity" ]] && return + if [[ "$capacity" ]]; then + battery="${capacity}% [${status}]" - battery="${capacity}% [${status}]" + case "$battery_display" in + "bar") battery="$(bar "$capacity" 100)" ;; + "infobar") battery+=" $(bar "$capacity" 100)" ;; + "barinfo") battery="$(bar "$capacity" 100)${info_color} ${battery}" ;; + esac - case "$battery_display" in - "bar") battery="$(bar "$capacity" 100)" ;; - "infobar") battery+=" $(bar "$capacity" 100)" ;; - "barinfo") battery="$(bar "$capacity" 100) ${battery}" ;; - esac - - prin "${subtitle}${bat: -1}" "$battery" + bat="${bat/*axp288_fuel_gauge}" + prin "${subtitle:+${subtitle}${bat: -1}}" "$battery" + fi done - - unset battery return ;; "BSD") - case "$distro" in + case "$kernel_name" in "FreeBSD"* | "DragonFly"*) battery="$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')" battery_state="$(acpiconf -i 0 | awk -F ':\t\t\t' '/State/ {print $2}')" @@ -1693,13 +2144,14 @@ get_battery() { "Mac OS X") battery="$(pmset -g batt | grep -o '[0-9]*%')" - battery_state="$(pmset -g batt | awk 'NR==2 {print $3}')" + state="$(pmset -g batt | awk '/;/ {print $4}')" + [[ "$state" == "charging;" ]] && battery_state="charging" ;; "Windows") - battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining /value)" - battery="${battery/EstimatedChargeRemaining'='}" - [[ "$battery" ]] && battery+="%" + battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining)" + battery="${battery/EstimatedChargeRemaining}" + [[ "$(trim "$battery")" ]] && battery="%" ;; "Haiku") @@ -1714,14 +2166,20 @@ get_battery() { case "$battery_display" in "bar") battery="$(bar "${battery/'%'*}" 100)" ;; "infobar") battery="${battery} $(bar "${battery/'%'*}" 100)" ;; - "barinfo") battery="$(bar "${battery/'%'*}" 100) ${battery}" ;; + "barinfo") battery="$(bar "${battery/'%'*}" 100)${info_color} ${battery}" ;; esac } get_local_ip() { case "$os" in - "Linux") - local_ip="$(ip route get 1 | awk '{print $NF;exit}')" + "Linux" | "BSD" | "Solaris" | "AIX" | "IRIX") + local_ip="$(ip route get 1 | awk -F'src' '{print $2; exit}')" + local_ip="${local_ip/uid*}" + [[ -z "$local_ip" ]] && local_ip="$(ifconfig -a | awk '/broadcast/ {print $2; exit}')" + ;; + + "MINIX") + local_ip="$(ifconfig | awk '{printf $3; exit}')" ;; "Mac OS X" | "iPhone OS") @@ -1729,12 +2187,9 @@ get_local_ip() { [[ -z "$local_ip" ]] && local_ip="$(ipconfig getifaddr en1)" ;; - "BSD" | "Solaris") - local_ip="$(ifconfig | awk '/broadcast/ {print $2}')" - ;; - "Windows") - local_ip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')" + local_ip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2 ", "}')" + local_ip="${local_ip%\,*}" ;; "Haiku") @@ -1747,7 +2202,7 @@ get_local_ip() { get_public_ip() { if type -p dig >/dev/null; then public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)" - [[ "$public_ip" =~ ^\; ]] && unset public_ip + [[ "$public_ip" =~ ^\; ]] && unset public_ip fi if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then @@ -1764,216 +2219,220 @@ get_users() { users="${users%\,*}" } -get_birthday() { +get_install_date() { case "$os" in - "Linux" | "GNU" | "iPhone OS") - birthday="$(ls -alct --full-time / | awk '/lost\+found|private/ {printf $6 " " $7}')" - date_cmd="$(date -d"$birthday" "$birthday_format")" - ;; - - "Mac OS X") - birthday="$(ls -lUT /var/log/install.log | awk '{printf $6 " " $7 " " $9 " " $8}')" - - # Split the string into Date + time - time="${birthday/*???? }" - birthday="${birthday/$time}" - - case "${time/:*}" in - 0? | 10 | 11) time+=" AM" ;; - *) time+=" PM" ;; - esac - birthday+="$time" - birthday_shorthand="on" - ;; - - "BSD") - case "$distro" in - "OpenBSD"* | "Bitrig"*) - birthday="$(ls -alctT / | awk '/lost\+found/ {printf $6 " " $7 " " $9 " " $8}')" - birthday_shorthand="on" - ;; - - "FreeBSD"*) - birthday="$(ls -alctT /etc/hostid | awk '{printf $6 " " $7 " " $9 " " $8}')" - date_cmd="$(date -j -f "%b %d %Y" "$birthday" "$birthday_format")" - ;; - - "NetBSD"* | "DragonFly"*) - birthday="$(ls -alctT /etc/defaults/rc.conf | awk '{printf $6 " " $7 " " $9 " " $8}')" - birthday_shorthand="on" - ;; - esac - ;; - + "Linux" | "iPhone OS") install_file="/lost+found" ;; + "Mac OS X") install_file="/var/log/install.log" ;; + "Solaris") install_file="/var/sadm/system/logs/install_log" ;; "Windows") - birthday="$(ls -alct --full-time /cygdrive/c/Windows/explorer.exe | awk '{printf $8 " " $9}')" - date_cmd="$(date -d"$birthday" "$birthday_format")" + case "$kernel_name" in + "CYGWIN"*) install_file="/cygdrive/c/Windows/explorer.exe" ;; + "MSYS"* | "MINGW"*) install_file="/c/Windows/explorer.exe" ;; + esac + ;; + "Haiku") install_file="/boot" ;; + "BSD" | "MINIX" | "IRIX") + case "$kernel_name" in + "FreeBSD") install_file="/etc/hostid" ;; + "NetBSD" | "DragonFly"*) install_file="/etc/defaults/rc.conf" ;; + *) install_file="/" ;; + esac + ;; + "AIX") install_file="/var/adm/ras/bosinstlog" ;; + esac + + ls_prog="$(ls --version 2>&1)" + case "$ls_prog" in + *"BusyBox"*) + install_date="$(ls -tdce "$install_file" | awk '{printf $10 " " $7 " " $8 " " $9}')" ;; - "Solaris") - birthday="$(ls -alct --full-time /var/sadm/system/logs/install_log | awk '{printf $6 " " $7}')" - date_cmd="$(date -d"$birthday" "$birthday_format")" + *"crtime"*) # xpg4 (Solaris) + install_date="$(ls -tdcE "$install_file" | awk '{printf $6 " " $7}')" ;; - "Haiku") - birthday="$(ls -alctd --full-time /boot | awk '{printf $6 " " $7}')" - date_cmd="$(date -d"$birthday" "$birthday_format")" + *"ACFHLRSZ"*) # Toybox + install_date="$(ls -dl "$install_file" | awk '{printf $6 " " $7}')" + ;; + + *"GNU coreutils"*) + install_date="$(ls -tcd --full-time "$install_file" | awk '{printf $6 " " $7}')" + ;; + + *"ACFHLNRS"* | *"RadC1xmnlog"*) # AIX ls / IRIX ls + err "Install Date doesn't work because your 'ls' doesn't support full date/time." + return + ;; + + *"HLOPRSTUWabc"*) # macOS ls + install_date="$(ls -dlctUT "$install_file" | awk '{printf $9 " " $6 " "$7 " " $8}')" + ;; + + *) + install_date="$(ls -dlctT "$install_file" | awk '{printf $9 " " $6 " " $7 " " $8}')" ;; esac - # Strip seconds from time output - birthday="${birthday/:?? / }" + install_date="${install_date//-/ }" + install_date="${install_date%:*}" + install_date=($install_date) + install_date="$(convert_time "${install_date[@]}")" +} - # Pretty output - [[ "$birthday_shorthand" == "off" ]] && \ - birthday="${date_cmd//+( )/ }" +get_locale() { + locale="$sys_locale" +} - # Toggle showing the time - [[ "$birthday_time" == "off" ]] && \ - birthday="${birthday/??:??*}" +get_gpu_driver() { + case "$os" in + "Linux") + gpu_driver="$(lspci -nnk | awk -F ': ' \ + '/Display|3D|VGA/{nr[NR+2]}; NR in nr {printf $2 ", "}')" + gpu_driver="${gpu_driver%, }" + ;; + "Mac OS X") + if [[ "$(kextstat | grep "GeForceWeb")" != "" ]]; then + gpu_driver="Nvidia Web Driver" + else + gpu_driver="macOS Default Graphics Driver" + fi + ;; + esac } get_cols() { if [[ "$color_blocks" == "on" ]]; then # Convert the width to space chars. - block_width="$(printf "%${block_width}s")" - block_width="${block_width// /█}" + printf -v block_width "%${block_width}s" + + # Set variables. + start="${block_range[0]}" + end="${block_range[1]}" # Generate the string. - for ((start; start<=end; i++)); do + for ((start; start<=end; start++)); do case "$start" in [0-6]) blocks+="${reset}\033[3${start}m\033[4${start}m${block_width}" ;; 7) blocks+="${reset}\033[3${start}m\033[4${start}m${block_width}" ;; *) blocks2+="\033[38;5;${start}m\033[48;5;${start}m${block_width}" ;; esac - start="$((start+=1))" done # Convert height into spaces. - spaces="$(printf "%${block_height}s")" + printf -v block_spaces "%${block_height}s" # Convert the spaces into rows of blocks. - [[ "$blocks" ]] && cols+="${spaces// /${blocks}${reset}nl}" - [[ "$blocks2" ]] && cols+="${spaces// /${blocks2}${reset}nl}" + [[ "$blocks" ]] && cols+="${block_spaces// /${blocks}${reset}nl}" + [[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}${reset}nl}" # Add newlines to the string. cols="${cols%%'nl'}" cols="${cols//nl/\\n\\033[${text_padding}C${zws}}" + + # Add block height to info height. + info_height="$((info_height+=block_height+2))" + + printf "%b\n" "\033[${text_padding}C${zws}${cols}" fi - unset blocks blocks2 + unset -v blocks blocks2 cols + + # Tell info() that we printed manually. + prin=1 } # IMAGES -get_image_backend() { - # This function determines which image backend to use - # by checking for programs and etc. +image_backend() { + if [[ ! "$image_backend" =~ ^(off|ascii)$ ]]; then + if ! type -p convert >/dev/null 2>&1; then + image_backend="ascii" + err "Image: Imagemagick not found, falling back to ascii mode." + fi + fi - # Automatically find w3m-img - get_w3m_img_path + case "${image_backend:-off}" in + "ascii") get_ascii ;; + "off") image_backend="off" ;; - # Fallback to ascii mode if imagemagick isn't installed. - type -p convert >/dev/null 2>&1 || image_backend="ascii" + "caca" | "catimg" | "jp2a" | "iterm2" | "termpix" | "tycat" | "w3m" | "sixel") + get_image_source - case "${image_backend:=image}" in - "image") - case "$image_source" in - "wall"*) get_wallpaper 2>/dev/null ;; - "off") image_backend="off"; return ;; - *) - if [[ -d "$image_source" ]]; then - files=("${image_source%/}"/*.{png,jpg,jpeg}) - image="$(printf "%s" "${files[RANDOM % (${#files[@]} - 1)]}")" - else - image="$image_source" - fi - ;; - esac - - # Fallback to ascii mode if image isn't a file. if [[ ! -f "$image" ]]; then - to_ascii "Image: '$image' doesn't exist, falling back to ascii mode." + to_ascii "Image: '$image_source' doesn't exist, falling back to ascii mode." return fi - get_image_program get_term_size - # Fallback to ascii mode if terminal size wasn't found. - if [[ -z "$term_width" ]] && ((term_width == 0)); then - to_ascii "Image: Failed to find terminal window size" + if [[ "$term_width" ]] && ((term_width >= 1)); then + clear + else + to_ascii "Image: Failed to find terminal window size." + err "Image: Check the 'Images in the terminal' wiki page for more info," return fi get_image_size make_thumbnail - - # If the backend is still set to 'image' after - # make_thumbnail(), then display the image. - [[ "$image_backend" == "image" ]] && display_image + display_image ;; - "ascii") get_ascii 2>/dev/null ;; + *) + err "Image: Unknown image backend specified '$image_backend'." + err "Image: Valid backends are: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', + 'off', 'sixel', 'termpix', 'tycat', 'w3m')" + err "Image: Falling back to ascii mode." + get_ascii + ;; esac + + # Set cursor position next image/ascii. + [[ "$image_backend" != "off" ]] && printf "%b" "\033[${lines:-0}A\033[9999999D" } get_ascii() { - if [[ ! -f "$ascii" || "$ascii" == "distro" ]]; then - # Error message - [[ "$ascii" != "distro" ]] && [[ ! -f "$ascii" ]] && \ + if [[ ! -f "$image_source" || + "$image_source" =~ ^(auto|ascii)$ || + "$image_source" =~ \.(png|jpg|jpe|jpeg|gif)$ ]]; then + + # Fallback to distro ascii mode if custom ascii isn't found. + [[ ! "$image_source" =~ ^(auto|ascii)$ ]] && \ err "Ascii: Ascii file not found, using distro ascii." - # Lowercase the distro name - if (("$bash_version" <= 3)); then - ascii="$(tr '[:upper:]' '[:lower:]' <<< "$ascii_distro")" + # Fallback to distro ascii mode if source is an image. + [[ "$image_source" =~ \.(png|jpg|jpe|jpeg|gif)$ ]] && \ + err "Image: Source is image file but ascii backend was selected. Using distro ascii." + + if [[ -d "ASCIIDIR" ]]; then + ascii_dir="ASCIIDIR" else - ascii="${ascii_distro,,}" + [[ -z "$script_dir" ]] && script_dir="$(get_full_path "$0")" + ascii_dir="${script_dir%/*}/ascii/distro" fi - if [[ "$ascii_logo_size" == "small" ]]; then - ascii="${ascii/ *}_small" - prompt_loc="3" - fi + image_source="${ascii_dir}/${ascii_file}" - if [[ -f "/usr/share/neofetch/ascii/distro/${ascii/ *}" ]]; then - ascii="/usr/share/neofetch/ascii/distro/${ascii/ *}" - - 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/ *}" - - else - get_script_dir 2>/dev/null - - # 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 - fi + # Fallback to no ascii mode if distro ascii isn't found. + [[ ! -f "$image_source" ]] && \ + { to_off "Ascii: Failed to find distro ascii, falling back to no ascii mode."; return; } fi - # Set locale to get correct padding + # Set locale to get correct padding. export LC_ALL="$sys_locale" - # Turn file into variable - while IFS=$'\n' read -r line 2>/dev/null; do + # Turn file into variable. + while IFS=$'\n' read -r line; do print+="$line \n" # Calculate size of ascii file in line length / line count. line="${line//\$\{??\}}" line="${line//\\\\/\\}" - (("${#line}" > "${ascii_length:-0}")) && ascii_length="${#line}" - lines="$((lines+=1))" - done < "$ascii" + ((${#line} > ascii_length)) && ascii_length="${#line}" + ((++lines)) + done < "$image_source" - # Colors + # Colors. print="${print//'${c1}'/$c1}" print="${print//'${c2}'/$c2}" print="${print//'${c3}'/$c3}" @@ -1989,23 +2448,99 @@ get_ascii() { export LC_ALL=C } -get_image_program() { - if [[ -n "$ITERM_PROFILE" ]]; then - image_program="iterm2" +get_image_source() { + case "$image_source" in + "auto" | "wall" | "wallpaper") + get_wallpaper + ;; - elif [[ "$(tycat 2>/dev/null)" ]]; then - image_program="tycat" + *) + # Get the absolute path. + image_source="$(get_full_path "$image_source")" - else - image_program="w3m" - fi + if [[ -d "$image_source" ]]; then + shopt -s nullglob + files=("${image_source%/}"/*.{png,jpg,jpeg,jpe,gif,svg}) + shopt -u nullglob + image="${files[RANDOM % ${#files[@]}]}" + + else + image="$image_source" + fi + ;; + esac + + err "Image: Using image '$image'" +} + +get_wallpaper() { + case "$os" in + "Mac OS X") + image="$(osascript -e 'tell application "System Events" to picture of current desktop')" + ;; + + "Windows") + case "$distro" in + "Windows XP") + case "$kernel_name" in + "CYGWIN"*) image="/cygdrive/c/Documents and Settings/${USER}" ;; + "MSYS2"* | "MINGW*") image="/c/Documents and Settings/${USER}" ;; + esac + image+="/Local Settings/Application Data/Microsoft" + image+="/Wallpaper1.bmp" + ;; + + "Windows"*) + image="$APPDATA/Microsoft/Windows/Themes" + image+="/TranscodedWallpaper.jpg" + ;; + esac + ;; + + *) + # Get DE if user has disabled the function. + ((de_run != 1)) && get_de + + case "$de" in + "MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;; + "Xfce"*) + image="$(xfconf-query -c xfce4-desktop -p \ + "/backdrop/screen0/monitor0/workspace0/last-image")" + ;; + + "Cinnamon"*) + image="$(gsettings get org.cinnamon.desktop.background picture-uri)" + image="$(decode_url "$image")" + ;; + + *) + if type -p feh >/dev/null && [[ -f "${HOME}/.fehbg" ]]; then + image="$(awk -F\' '/feh/ {printf $(NF-1)}' "${HOME}/.fehbg")" + + elif type -p nitrogen >/dev/null; then + image="$(awk -F'=' '/file/ {printf $2;exit;}' \ + "${XDG_CONFIG_HOME}/nitrogen/bg-saved.cfg")" + + else + image="$(gsettings get org.gnome.desktop.background picture-uri)" + image="$(decode_url "$image")" + fi + ;; + esac + + # Strip un-needed info from the path. + image="${image/'file://'}" + image="$(trim_quotes "$image")" + ;; + esac + + # If image is an xml file, don't use it. + [[ "${image/*\./}" == "xml" ]] && image="" } get_w3m_img_path() { - if [[ -x "$w3m_img_path" ]]; then - return - - elif [[ -x "/usr/lib/w3m/w3mimgdisplay" ]]; then + # Find w3m-img path. + if [[ -x "/usr/lib/w3m/w3mimgdisplay" ]]; then w3m_img_path="/usr/lib/w3m/w3mimgdisplay" elif [[ -x "/usr/libexec/w3m/w3mimgdisplay" ]]; then @@ -2017,68 +2552,24 @@ get_w3m_img_path() { elif [[ -x "/usr/libexec64/w3m/w3mimgdisplay" ]]; then w3m_img_path="/usr/libexec64/w3m/w3mimgdisplay" + elif [[ -x "/usr/local/libexec/w3m/w3mimgdisplay" ]]; then + w3m_img_path="/usr/local/libexec/w3m/w3mimgdisplay" + + elif [[ -x "$HOME/.nix-profile/libexec/w3m/w3mimgdisplay" ]]; then + w3m_img_path="$HOME/.nix-profile/libexec/w3m/w3mimgdisplay" + else - image_backend="ascii" - err "Image: w3m-img wasn't found on your system, falling back to ascii mode." + err "Image: w3m-img wasn't found on your system" fi } -get_wallpaper() { - case "$os" in - "Linux" | "BSD") - if type -p feh >/dev/null && [[ -f "$HOME/.fehbg" ]]; then - image="$(awk -F\' '/feh/ {printf $2}' "$HOME/.fehbg")" - - elif type -p nitrogen >/dev/null; then - image="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")" - - elif type -p gsettings >/dev/null; then - # Get DE if user has disabled the function. - [[ -z "$de" ]] && get_de - - case "$de" in - "MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;; - *) image="$(gsettings get org.gnome.desktop.background picture-uri)" ;; - esac - - # Strip quotes etc from the path. - image="${image/'file://'}" - image="$(trim_quotes "$image")" - image="${image//\%20/ }" - fi - ;; - - "Mac OS X") - image="$(osascript -e 'tell application "System Events" to picture of current desktop')" - ;; - - "Windows") - case "$distro" in - "Windows XP") - image="/cygdrive/c/Documents and Settings/${USER}" - image+="/Local Settings/Application Data/Microsoft" - image+="/Wallpaper1.bmp" - ;; - - "Windows"*) - image="$APPDATA/Microsoft/Windows/Themes" - image+="/TranscodedWallpaper.jpg" - ;; - esac - ;; - esac - - # If image is an xml file, don't use it. - [[ "${image/*\./}" == "xml" ]] && image="" -} - get_term_size() { # This functions gets the current window size in # pixels. # - # We first try to use the escape sequence '\044[14t' + # We first try to use the escape sequence "\044[14t" # to get the terminal window size in pixels. If this - # fails we then fallback to using 'xdotool' or other + # fails we then fallback to using "xdotool" or other # programs. # Tmux has a special way of reading escape sequences @@ -2086,38 +2577,33 @@ get_term_size() { # get the terminal size. if [[ -n "$TMUX" ]]; then printf "%b" "\033Ptmux;\033\033[14t\033\033[c\033\\" - read_flags="-d c" + read_flags=(-d c) - elif [[ "$image_program" == "tycat" ]]; then + elif [[ "$image_backend" == "tycat" ]]; then printf "%b" "\033}qs\000" else printf "%b" "\033[14t\033[c" - read_flags="-d c" + read_flags=(-d c) fi # The escape codes above print the desired output as # user input so we have to use read to store the out # -put as a variable. - builtin read -s -t 1 ${read_flags} -r term_size + IFS=";" read -s -t 1 "${read_flags[@]}" -r -a term_size # Split the string into height/width. - if [[ "$image_program" == "tycat" ]]; then - term_size=(${term_size//;/ }) + if [[ "$image_backend" == "tycat" ]]; then term_width="$((term_size[2] * term_size[0]))" term_height="$((term_size[3] * term_size[1]))" else - term_size="${term_size//'['}" - term_size="${term_size/';'}" - term_size="${term_size/$'\E4'}" - term_size="${term_size/t*}" - term_height="${term_size/';'*}" - term_width="${term_size/*';'}" + term_height="${term_size[1]}" + term_width="${term_size[2]/t*}" fi - # Get terminal width and height if \033[14t is unsupported. - if (("${#term_size}" <= 5)) && [[ "$image_program" == "w3m" ]]; then + # Get terminal width/height if \033[14t is unsupported. + if [[ -z "$term_width" ]] || (( "$term_width" < 50 )); then if type -p xdotool >/dev/null 2>&1; then current_window="$(xdotool getactivewindow)" source <(xdotool getwindowgeometry --shell "$current_window") @@ -2127,41 +2613,38 @@ get_term_size() { elif type -p xwininfo >/dev/null 2>&1; then # Get the focused window's ID. if type -p xdpyinfo >/dev/null 2>&1; then - current_window="$(xdpyinfo | grep -F "focus" | grep -E -o "0x[0-9a-f]+")" + current_window="$(xdpyinfo | grep -E -o "focus:.*0x[0-9a-f]+")" + current_window="${current_window/*window }" elif type -p xprop >/dev/null 2>&1; then - current_window="$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" + current_window="$(xprop -root _NET_ACTIVE_WINDOW)" + current_window="${current_window##* }" fi # If the ID was found get the window size. if [[ "$current_window" ]]; then - term_size="$(xwininfo -id "$current_window" | awk -F ': ' '/Width|Height/ {printf $2 " "}')" + term_size="$(xwininfo -id "$current_window" |\ + awk -F ': ' '/Width|Height/ {printf $2 " "}')" term_width="${term_size/ *}" term_height="${term_size/${term_width}}" else - term_width="0" + term_width=0 fi else - term_width="0" + term_width=0 fi fi - - # If the terminal size was found correctly - if [[ "$term_width" ]] && ((term_width > 0)); then - clear - zws="​ " - fi } get_image_size() { # This functions determines the size to make # the thumbnail image. - # Get terminal lines and columns + # Get terminal lines and columns. term_blocks="$(stty size)" columns="${term_blocks/* }" lines="${term_blocks/ *}" - # Calculate font size + # Calculate font size. font_width="$((term_width / columns))" font_height="$((term_height / lines))" @@ -2170,7 +2653,7 @@ get_image_size() { image_size="$((columns * font_width / 2))" term_height="$((term_height - term_height / 4))" - (("$term_height" < "$image_size")) && \ + ((term_height < image_size)) && \ image_size="$term_height" ;; @@ -2178,12 +2661,12 @@ get_image_size() { percent="${image_size/\%}" image_size="$((percent * term_width / 100))" - (("$((percent * term_height / 50))" < "$image_size")) && \ + (((percent * term_height / 50) < image_size)) && \ image_size="$((percent * term_height / 100))" ;; "none") - # Get image size so that we can do a better crop + # Get image size so that we can do a better crop. size="$(identify -format "%w %h" "$image")" width="${size%% *}" height="${size##* }" @@ -2202,13 +2685,13 @@ get_image_size() { make_thumbnail() { # Name the thumbnail using variables so we can # use it later. - image_name="$crop_mode-$crop_offset-$width-$height" + image_name="$crop_mode-$crop_offset-$width-$height-${image//'/'/_}" - # Check to see if the image has a file extension, - # if it doesn't then add one. - case "${image##*/}" in - *"."*) image_name="${image_name}-${image##*/}" ;; - *) image_name="${image_name}-${image##*/}.jpg" ;; + # Handle file extensions. + case "${image##*.}" in + "eps"|"pdf"|"svg"|"gif"|"png") + image_name+=".png" ;; + *) image_name+=".jpg" ;; esac # Create the thumbnail dir if it doesn't exist. @@ -2216,16 +2699,16 @@ make_thumbnail() { # Check to see if the thumbnail exists before we do any cropping. if [[ ! -f "$thumbnail_dir/$image_name" ]]; then - # Get image size so that we can do a better crop + # Get image size so that we can do a better crop. if [[ -z "$size" ]]; then size="$(identify -format "%w %h" "$image")" og_width="${size%% *}" og_height="${size##* }" - # This checks to see if height is geater than width + # This checks to see if height is greater than width # so we can do a better crop of portrait images. size="$og_height" - (("$og_height" > "$og_width")) && size="$og_width" + ((og_height > og_width)) && size="$og_width" fi case "$crop_mode" in @@ -2235,6 +2718,7 @@ make_thumbnail() { -format "%[pixel:p{0,0}]" info:)" convert \ + -background none \ "$image" \ -trim +repage \ -gravity south \ @@ -2246,6 +2730,7 @@ make_thumbnail() { "fill") convert \ + -background none \ "$image" \ -trim +repage \ -scale "$width"x"$height"^ \ @@ -2256,6 +2741,7 @@ make_thumbnail() { "none") cp "$image" "$thumbnail_dir/$image_name" ;; *) convert \ + -background none \ "$image" \ -gravity "$crop_offset" \ -crop "$size"x"$size"+0+0 \ @@ -2266,52 +2752,95 @@ make_thumbnail() { esac fi - # The final image + # The final image. image="$thumbnail_dir/$image_name" } display_image() { - case "$image_program" in + case "$image_backend" in + "caca") + img2txt -W "$((width / font_width)))" \ + -H "$((height / font_height))" \ + --gamma=0.6 "$image" ||\ + to_off "Image: libcaca failed to display the image." + ;; + + "catimg") + catimg -w "$((width * 2 / font_width))" -r 0 "$image" ||\ + to_off "Image: catimg failed to display the image." + ;; + + "jp2a") + jp2a --width="$((width / font_width))" --colors "$image" ||\ + to_off "Image: jp2a failed to display the image." + ;; + + "sixel") + img2sixel -w "$width" "$image" || to_off "Image: libsixel failed to display the image." + ;; + + "termpix") + termpix --width "$((width / font_width))" "$image" ||\ + to_off "Image: termpix failed to display the image." + ;; + + "iterm2") + image="$(base64 < "$image")" + iterm_cmd="\033]1337;File=width=${width}px;height=${height}px;inline=1:${image}" + + # Tmux requires an additional escape sequence for this to work. + [[ -n "$TMUX" ]] && iterm_cmd="\033Ptmux;\033${iterm_cmd}\033\\" + + printf "%b\a\n" "$iterm_cmd" + ;; + + "tycat") + tycat "$image" ||\ + to_off "Image: tycat failed to display the image." + ;; + "w3m") + get_w3m_img_path + # Add a tiny delay to fix issues with images not # appearing in specific terminal emulators. sleep 0.05 printf "%b\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$image\n4;\n3;" |\ - "$w3m_img_path" -bg "$background_color" >/dev/null & 2>&1 || to_off "Images: w3m-img failed to display the image." - ;; + "${w3m_img_path:-false}" -bg "$background_color" >/dev/null 2>&1 ||\ + to_off "Image: w3m-img failed to display the image." - "iterm2") - printf "%b\a\n" "\033]1337;File=width=${width}px;height=${height}px;inline=1:$(base64 < "$image")" - ;; - - "tycat") - tycat "$image" || to_off "Images: tycat failed to display the image." + zws="\xE2\x80\x8B\x20" ;; esac } to_ascii() { + # Log the error. + err "$1" + # This function makes neofetch fallback to ascii mode. image_backend="ascii" - get_ascii 2>/dev/null - err "$1" + + # Print the ascii art. + get_ascii + + # Set cursor position next image/ascii. + printf "%b" "\033[${lines:-0}A\033[9999999D" } to_off() { # This function makes neofetch fallback to off mode. - text_padding="0" - image_backend="off" err "$1" + image_backend="off" + text_padding= } # SCREENSHOT take_scrot() { - if [[ -d "$scrot_dir" ]]; then - $scrot_cmd "${scrot_dir}${scrot_name}" - else - printf "%s\n" "Screenshot: $scrot_dir doesn't exist. Edit the config file or create the directory to take screenshots." - fi + scrot_program "${scrot_dir}${scrot_name}" + + err "Scrot: Saved screenshot as: ${scrot_dir}${scrot_name}" [[ "$scrot_upload" == "on" ]] && scrot_upload } @@ -2323,16 +2852,27 @@ scrot_upload() { fi image_file="${scrot_dir}${scrot_name}" - printf "%s\n" "Uploading image..." + + # Print a message letting the user know we're uploading + # the screenshot. + printf "%s\r" "Uploading scrot" + sleep .2 + printf "%s\r" "Uploading scrot." + sleep .2 + printf "%s\r" "Uploading scrot.." + sleep .2 + printf "%s\r" "Uploading scrot..." case "$image_host" in "teknik") - image_url="$(curl -sf -F file="@${image_file}" "https://api.teknik.io/v1/Upload")" + image_url="$(curl -sf -F file="@${image_file};type=image/png" \ + "https://api.teknik.io/v1/Upload")" image_url="$(awk -F 'url:|,' '{printf $2}' <<< "${image_url//\"}")" ;; "imgur") - image_url="$(curl -sH "Authorization: Client-ID 0e8b44d15e9fc95" -F image="@${image_file}" "https://api.imgur.com/3/upload")" + image_url="$(curl -sH "Authorization: Client-ID 0e8b44d15e9fc95" \ + -F image="@${image_file}" "https://api.imgur.com/3/upload")" image_url="$(awk -F 'id:|,' '{printf $2}' <<< "${image_url//\"}")" [[ "$image_url" ]] && image_url="https://i.imgur.com/${image_url}.png" ;; @@ -2343,109 +2883,150 @@ scrot_upload() { scrot_args() { scrot="on" - case "$2" in - "-"* | "") ;; - *) - scrot_name="${2##*/}" - scrot_dir="${2/$scrot_name}" - ;; - esac + + if [[ "$2" =~ \.(png|jpg|jpe|jpeg|gif)$ ]]; then + scrot_name="${2##*/}" + scrot_dir="${2/$scrot_name}" + + elif [[ -d "$2" ]]; then + scrot_dir="$2" + else + scrot_dir="${PWD:+${PWD}/}" + fi +} + +scrot_program() { + # Detect screenshot program. + # + # We first check to see if an X server is running before + # falling back to OS specific screenshot tools. + if [[ -n "$DISPLAY" ]]; then + if [[ "$scrot_cmd" != "auto" ]] && type -p "${scrot_cmd%% *}" >/dev/null; then + scrot_program=($scrot_cmd) + + elif type -p maim >/dev/null; then + scrot_program=(maim) + + elif type -p scrot >/dev/null; then + scrot_program=(scrot) + + elif type -p import >/dev/null && [[ "$os" != "Mac OS X" ]]; then + scrot_program=(import -window root) + + elif type -p imlib2_grab >/dev/null; then + scrot_program=(imlib2_grab) + + elif type -p gnome-screenshot >/dev/null; then + scrot_program=(gnome-screenshot -f) + + else + err "Scrot: No screen capture tool found." + return + fi + else + case "$os" in + "Mac OS X") scrot_program=(screencapture -S) ;; + "Haiku") scrot_program=(screenshot -s) ;; + esac + fi + + # Print a message letting the user know we're taking + # a screenshot. + printf "%s\r" "Taking scrot" + sleep .2 + printf "%s\r" "Taking scrot." + sleep .2 + printf "%s\r" "Taking scrot.." + sleep .2 + printf "%s\r" "Taking scrot..." + + # Take the scrot. + "${scrot_program[@]}" "$1" + + err "Scrot: Screen captured using ${scrot_program[0]}" } # TEXT FORMATTING info() { - # $1 is the subtitle - subtitle="$1" + # Save subtitle value. + [[ "$2" ]] && subtitle="$1" - # Call the function and update variable - "get_${2:-$1}" 2>/dev/null - output="${2:-$1}" + # Make sure that $prin is unset. + unset -v prin - # Trim whitespace - output="$(trim "${!output}")" + # Call the function. + "get_${2:-$1}" - # If prin was used in the function, stop here. - [[ "$prin" ]] && \ - unset prin && return + # If the get_func function called 'prin' directly, stop here. + [[ "$prin" ]] && return - # If the output is empty, don't print anything. - [[ -z "${output// }" ]] && \ - err "Info: Couldn't detect $subtitle." && return + # Update the variable. + output="$(trim "${!2:-${!1}}")" - case "$1" in - "title") - string="${title_color}${bold}${output}" - string="${string/@/${at_color}@${title_color}${bold}}" - length="${#output}" - ;; + if [[ "$2" && "${output// }" ]]; then + prin "$1" "$output" - "underline") string="${underline_color}${output}" ;; + elif [[ "${output// }" ]]; then + prin "$output" - *) - string="${subtitle_color}${bold}${subtitle}${reset}" - string+="${colon_color}: ${info_color}${output}" - length="$((${#subtitle} + ${#output} + 2))" - ;; - esac + else + err "Info: Couldn't detect ${1}." + fi - # If there's no subtitle don't print one - [[ -z "$2" ]] && string="${string/*: }" - - # Print the string - printf "%b\n" "\033[${text_padding}C${zws}${string}${reset} " - - # Calculate info height - info_height="$((info_height+=1))" - - # Fix rendering issues with w3m and lines that - # wrap to the next line by adding a max line - # length. - [[ "$image_backend" == "image" ]] && \ - string="$(printf "%.$((columns - text_padding - gap))s" "$string")" + unset -v subtitle } prin() { - string="${1//$'\033[0m'}${2:+: $2}" + # If $2 doesn't exist we format $1 as info. + if [[ "$(trim "$1")" && "$2" ]]; then + string="${1}${2:+: $2}" + else + string="${2:-$1}" + local subtitle_color="$info_color" + fi + string="$(trim "${string//$'\033[0m'}")" - # If $2 doesn't exist we format $1 as info - [[ -z "$2" ]] && local subtitle_color="$info_color" + # Log length if it doesn't exist. + if [[ -z "$length" ]]; then + length="$(strip_sequences "$string")" + length="${#length}" + fi - # Format the output + # Format the output. string="${string/:/${reset}${colon_color}:${info_color}}" string="${subtitle_color}${bold}${string}" - # Trim whitespace - string="$(trim "$string")" + # Print the info. + printf "%b\n" "${text_padding:+\033[${text_padding}C}${zws}${string}${reset}" - # Print the info - printf "%b\n" "\033[${text_padding}C${zws}${string}${reset} " + # Calculate info height. + ((++info_height)) - # Calculate info height - info_height="$((info_height+=1))" - - # Fix rendering issues with w3m and lines that - # wrap to the next line by adding a max line - # length. - [[ "$image_backend" == "image" ]] && \ - string="$(printf "%.$((columns - text_padding - gap))s" "$string")" - - # Tell info() that prin() was used. + # Log that prin was used. prin=1 } get_underline() { if [[ "$underline_enabled" == "on" ]]; then - underline="$(printf %"$length"s)" - underline="${underline// /$underline_char}" + printf -v underline "%${length}s" + printf "%b%b\n" "${text_padding:+\033[${text_padding}C}${zws}${underline_color}" \ + "${underline// /$underline_char}${reset}" + unset -v length fi + prin=1 } get_line_break() { - line_break="​ " + # Print it directly. + printf "%b\n" "${zws}" - # Calculate info height - info_height="$((info_height+=1))" + # Calculate info height. + ((++info_height)) + line_breaks+="\n" + + # Tell info() that we printed manually. + prin=1 } get_bold() { @@ -2461,17 +3042,18 @@ get_bold() { } trim() { - # When a string is passed to 'echo' all trailing and leading + # When a string is passed to "echo" all trailing and leading # whitespace is removed and inside the string multiple spaces are # condensed into single spaces. # - # The 'set -f/+f' is here so that 'echo' doesn't cause any expansion + # The "set -f/+f" is here so that "echo" doesn't cause any expansion # of special characters. # # The whitespace trim doesn't work with multiline strings so we use - # '${1//[[:space:]]/ }' to remove newlines beofre we trim the whitespace. + # "${1//[[:space:]]/ }" to remove newlines before we trim the whitespace. set -f + # shellcheck disable=2086 builtin echo -E ${1//[[:space:]]/ } set +f } @@ -2482,8 +3064,17 @@ trim_quotes() { printf "%s" "$trim_output" } +strip_sequences() { + strip="${1//$'\033['3[0-9]m}" + strip="${strip//$'\033['38\;5\;[0-9]m}" + strip="${strip//$'\033['38\;5\;[0-9][0-9]m}" + strip="${strip//$'\033['38\;5\;[0-9][0-9][0-9]m}" + + printf "%s\n" "$strip" +} + uppercase() { - (("$bash_version" >= 4)) && printf "%s" "${1^}" + ((bash_version >= 4)) && printf "%s" "${1^}" } # COLORS @@ -2492,151 +3083,715 @@ get_distro_colors() { # This function sets the text colors according # to your OS/Distro's logo colors. # - # $ascii_distro is the same as $distro + # $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"*) - set_colors 4 7 1 + "AIX"*) + set_colors 2 7 + ascii_file="aix" ;; - "CentOS"*) - set_colors 3 2 4 5 7 + "alpine_small") + set_colors 4 7 + ascii_file="alpine_small" ;; - "CRUX"* | "Chakra"* | "gNewSense"* | "SailfishOS"* | "Alpine"* | "Ubuntu-GNOME"* | "Qubes"*) + "Alpine"*) set_colors 4 5 7 6 + ascii_file="alpine" ;; - "Chrom"*) - set_colors 2 1 3 4 7 - ascii_distro="chrome" - ;; - - "Raspbian"*) - set_colors 2 1 - ;; - - "Debian"* | "Ubuntu"* | "DragonFly"* | "PacBSD"* | "Oracle" | "BlankOn"* | "DracOS"* | "Peppermint"*) - set_colors 1 7 3 - ;; - - "FreeBSD"* | "PCBSD"*) - set_colors 1 7 3 - ascii_distro="freebsd" - ;; - - "Red Star"* | "Redstar") - set_colors 1 7 3 - ascii_distro="redstar" - ;; - - "Red"*) - set_colors 1 7 3 - ascii_distro="redhat" - ;; - - "Kali"*) - set_colors 4 8 - ;; - - "BunsenLabs"*) - set_colors fg 7 - ;; - - *"OS X"* | *"iOS"* | "Mac" | *"macOS"*) - set_colors 2 3 1 1 5 4 - ascii_distro="mac" - ;; - - "OpenMandriva"*) - set_colors 4 3 - ;; - - "NetBSD"* | "Parabola"* | "Tails"* | "BLAG"* | "Gentoo"* | "Funtoo"* | "SteamOS"* | "Devuan"*) - set_colors 5 7 - ;; - - "OpenBSD"* | "GuixSD"* | "Pardus"*) - set_colors 3 7 6 1 8 - ;; - - *"SUSE"* | "Manjaro"* | "Deepin"* |"LMDE"* | "Chapeau"* | "Bitrig"*) - set_colors 2 7 - ;; - - "KDE"*) - set_colors 2 7 - ascii_distro="kde" + "Amazon"*) + set_colors 3 7 + ascii_file="amazon" ;; "Android"*) set_colors 2 7 - ascii_length_force="19" + ascii_file="android" + 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"*) + "Antergos"*) set_colors 4 6 + ascii_file="antergos" ;; - "Travis") - set_colors 1 2 3 4 5 6 + "antiX"*) + set_colors 1 7 3 + ascii_file="antix" ;; - "Void"* | "Haiku"*) + "AOSC"*) + set_colors 4 7 1 + ascii_file="aosc" + ;; + + "Apricity"*) + set_colors 4 7 1 + ascii_file="apricity" + ;; + + "arch_small") + set_colors 6 7 1 + ascii_file="arch_small" + ;; + + "arch_old") + set_colors 6 7 1 + ascii_file="arch_old" + ;; + + "ArchBox"*) + set_colors 2 7 1 + ascii_file="archbox" + ;; + + "ARCHlabs"*) + set_colors 6 6 7 1 + ascii_file="archlabs" + ;; + + *"XFerience"*) + set_colors 6 6 7 1 + ascii_file="arch_xferience" + ;; + + "Arch"*) + set_colors 6 6 7 1 + ascii_file="arch" + ;; + + "Artix"*) + set_colors 6 4 2 7 + ascii_file="artix" + ;; + + "Arya"*) + set_colors 2 1 + ascii_file="arya" + ;; + + "Bitrig"*) + set_colors 2 7 + ascii_file="bitrig" + ;; + + "BLAG"*) + set_colors 5 7 + ascii_file="blag" + ;; + + "BlankOn"*) + set_colors 1 7 3 + ascii_file="blankon" + ;; + + "BSD") + set_colors 1 7 4 3 6 + ascii_file="bsd" + ;; + + "BunsenLabs"*) + set_colors fg 7 + ascii_file="bunsenlabs" + ;; + + "CentOS"*) + set_colors 3 2 4 5 7 + ascii_file="centos" + ;; + + "Chakra"*) + set_colors 4 5 7 6 + ascii_file="chakra" + ;; + + "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" + ;; + + "Clover"*) + set_colors 2 6 + ascii_file="cloveros" + ;; + + "Container Linux by CoreOS"*) + set_colors 4 7 1 + ascii_file="coreos" + ;; + + "crux_small") + set_colors 4 5 7 6 + ascii_file="crux_small" + ;; + + "CRUX"*) + set_colors 4 5 7 6 + ascii_file="crux" + ;; + + "debian_small") + set_colors 1 7 3 + ascii_file="debian_small" + ;; + + "Debian"*) + set_colors 1 7 3 + ascii_file="debian" + ;; + + "Deepin"*) + set_colors 2 7 + ascii_file="deepin" + ;; + + "DesaOS") + set_colors 2 7 + ascii_file="desaos" + ;; + + "Devuan"*) + set_colors 5 7 + ascii_file="devuan" + ;; + + "DracOS"*) + set_colors 1 7 3 + ascii_file="dracos" + ;; + + "DragonFly"*) + set_colors 1 7 3 + ascii_file="dragonflybsd" + ;; + + "Elementary"*) + set_colors 4 7 1 + ascii_file="elementary" + ;; + + "Endless"*) + set_colors 1 7 + ascii_file="endless" + ;; + + "Exherbo"*) + set_colors 4 7 1 + ascii_file="exherbo" + ;; + + "Fedora"* | "RFRemix"*) + set_colors 4 7 1 + ascii_file="fedora" + ;; + + "freebsd_small") + set_colors 1 7 3 + ascii_file="freebsd_small" + ;; + + "FreeBSD"*) + set_colors 1 7 3 + 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" + ;; + + "GNU") + set_colors fg 7 + ascii_file="gnu" + ;; + + "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" ;; - "Mageia"* | "Porteus"*) - set_colors 6 7 + "Kali"*) + set_colors 4 8 + ascii_file="kali" ;; - "Windows 8"* | "Windows 10"*) - set_colors 6 7 - ascii_distro="windows10" + "KaOS"*) + set_colors 4 7 1 + ascii_file="kaos" ;; - "Windows"*) - set_colors 1 2 4 3 + "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" + ;; + + "KSLinux"*) + set_colors 4 7 1 + ascii_file="kslinux" + ;; + + "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" + ;; + + "Lunar"*) + set_colors 4 7 3 + ascii_file="lunar" + ;; + + "mac"*"_small") + set_colors 2 3 1 5 4 + ascii_file="mac_small" + ;; + + "mac" | "Darwin") + set_colors 2 3 1 1 5 4 + ascii_file="mac" + ;; + + "Mageia"*) + set_colors 6 7 + ascii_file="mageia" + ;; + + "Manjaro"*) + set_colors 2 7 + ascii_file="manjaro" + ;; + + "Maui"*) + set_colors 6 7 + ascii_file="maui" + ;; + + "Mer"*) + set_colors 4 7 1 + ascii_file="mer" + ;; + + "Minix"*) + set_colors 1 7 3 + ascii_file="minix" + ;; + + "Linux Mint"* | "LinuxMint"*) + 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" + ;; + + "Nitrux"*) + set_colors 4 + ascii_file="nitrux" + ;; + + "nixos_small") + set_colors 4 6 + ascii_file="nixos_small" + ;; + + "NixOS"*) + set_colors 4 6 + ascii_file="nixos" + ;; + + "Nurunner"*) + set_colors 4 + ascii_file="nurunner" + ;; + + "OBRevenge"*) + set_colors 1 7 3 + ascii_file="obrevenge" + ;; + + "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="openmandriva" + ;; + + "OpenWrt"*) + set_colors 4 7 1 + ascii_file="openwrt" + ;; + + "Open Source Media Center"* | "osmc") + set_colors 4 7 1 + ascii_file="osmc" + ;; + + "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" + ;; + + "Parsix"*) + set_colors 3 1 7 8 + ascii_file="parsix" + ;; + + "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" + ;; + + "Redhat"* | "Red Hat"* | "rhel"*) + set_colors 1 7 3 + ascii_file="redhat" + ;; + + "Refracted Devuan"*) + set_colors 8 7 + ascii_file="refracta" + ;; + + "Rosa"*) + set_colors 4 7 1 + ascii_file="rosa" + ;; + + "sabotage"*) + set_colors 4 7 1 + ascii_file="sabotage" + ;; + + "Sabayon"*) + set_colors 4 7 1 + ascii_file="sabayon" + ;; + + "SailfishOS"*) + set_colors 4 5 7 6 + ascii_file="sailfishos" + ;; + + "SalentOS"*) + set_colors 2 1 3 7 + ascii_file="salentos" + ;; + + "Scientific"*) + set_colors 4 7 1 + ascii_file="scientific" + ;; + + "Siduction"*) + set_colors 4 4 + ascii_file="siduction" + ;; + + "Slackware"*) + set_colors 4 7 1 + ascii_file="slackware" + ;; + + "SliTaz"*) + set_colors 3 3 + ascii_file="slitaz" + ;; + + "SmartOS"*) + set_colors 6 7 + ascii_file="smartos" + ;; + + "Solus"*) + set_colors 4 7 1 + ascii_file="solus" + ;; + + "Source Mage"*) + set_colors 4 7 1 + ascii_file="source_mage" + ;; + + "Sparky"*) + set_colors 1 7 + ascii_file="sparky" + ;; + + "SteamOS"*) + set_colors 5 7 + ascii_file="steamos" + ;; + + "SunOS" | "Solaris") + set_colors 3 7 + ascii_file="solaris" + ;; + + "openSUSE"* | "open SUSE"* | "SUSE"*) + set_colors 2 7 + ascii_file="suse" + ;; + + "SwagArch"*) + set_colors 4 7 1 + ascii_file="swagarch" + ;; + + "Tails"*) + set_colors 5 7 + ascii_file="tails" + ;; + + "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-MATE"*) + set_colors 2 7 + ascii_file="ubuntu-mate" + ;; + + "ubuntu_old") + set_colors 1 7 3 + ascii_file="ubuntu_old" + ;; + + "Ubuntu-Studio") + set_colors 6 7 + ascii_file="ubuntu-studio" + ;; + + "Ubuntu"*) + set_colors 1 7 3 + ascii_file="ubuntu" + ;; + + "void_small") + set_colors 2 8 + ascii_file="void_small" + ;; + + "Void"*) + set_colors 2 8 + ascii_file="void" + ;; + + *"[Windows 10]"* | *"on Windows 10"* | "Windows 8"* |\ + "Windows 10"* | "windows10" | "windows8" ) + set_colors 6 7 + ascii_file="windows10" + ;; + + "Windows"*) + set_colors 1 2 4 3 + ascii_file="windows" + ;; + + "Xubuntu"*) + set_colors 4 7 1 + ascii_file="xubuntu" + ;; + + "Zorin"*) + set_colors 4 6 + ascii_file="zorin" ;; *) - case "$os" in - "Linux") - ascii_distro="linux" - set_colors fg 8 3 - ;; - - "BSD") - ascii_distro="bsd" + case "$kernel_name" in + *"BSD") set_colors 1 7 4 3 6 + ascii_file="bsd" ;; - "GNU") - ascii_distro="gnu" - set_colors fg + "Darwin") + set_colors 2 3 1 1 5 4 + ascii_file="mac" ;; - "Solaris") - ascii_distro="solaris" - set_colors 3 + "GNU"*) + set_colors fg 7 + ascii_file="gnu" + ;; + + "Linux") + set_colors fg 8 3 + ascii_file="linux" + ;; + + "SunOS") + set_colors 3 7 + ascii_file="solaris" + ;; + + "IRIX"*) + set_colors 4 7 + ascii_file="irix" ;; esac ;; @@ -2644,12 +3799,13 @@ get_distro_colors() { # Overwrite distro colors if '$ascii_colors' doesn't # equal 'distro'. - [[ "${ascii_colors[0]}" != "distro" ]] && \ - set_colors ${ascii_colors[@]} + if [[ "${ascii_colors[0]}" != "distro" ]]; then + color_text="off" + set_colors "${ascii_colors[@]}" + fi } set_colors() { - # Ascii colors c1="$(color "$1")${ascii_bold}" c2="$(color "$2")${ascii_bold}" c3="$(color "$3")${ascii_bold}" @@ -2657,7 +3813,10 @@ set_colors() { c5="$(color "$5")${ascii_bold}" c6="$(color "$6")${ascii_bold}" - # Text colors + [[ "$color_text" != "off" ]] && set_text_colors "$@" +} + +set_text_colors() { if [[ "${colors[0]}" == "distro" ]]; then title_color="$(color "$1")" at_color="$reset" @@ -2667,12 +3826,12 @@ set_colors() { info_color="$reset" # If the ascii art uses 8 as a color, make the text the fg. - (("$1" == 8)) && title_color="$reset" - (("$2" == 8)) && subtitle_color="$reset" + ((${1:-1} == 8)) && title_color="$reset" + ((${2:-7} == 8)) && subtitle_color="$reset" # If the second color is white use the first for the subtitle. - (("$2" == 7)) && subtitle_color="$(color "$1")" - (("$1" == 7)) && title_color="$reset" + ((${2:-7} == 7)) && subtitle_color="$(color "$1")" + ((${1:-1} == 7)) && title_color="$reset" else title_color="$(color "${colors[0]}")" at_color="$(color "${colors[1]}")" @@ -2682,7 +3841,7 @@ set_colors() { info_color="$(color "${colors[5]}")" fi - # Bar colors + # Bar colors. if [[ "$bar_color_elapsed" == "distro" ]]; then bar_color_elapsed="$(color fg)" else @@ -2690,8 +3849,8 @@ set_colors() { fi case "$bar_color_total $1" in - "distro "[736]) bar_color_total="$c2" ;; - "distro "[0-9]) bar_color_total="$c1" ;; + "distro "[736]) bar_color_total="$(color "$1")" ;; + "distro "[0-9]) bar_color_total="$(color "$2")" ;; *) bar_color_total="$(color "$bar_color_total")" ;; esac } @@ -2699,119 +3858,142 @@ set_colors() { color() { case "$1" in [0-6]) printf "%b" "${reset}\033[3${1}m" ;; - 7 | "fg") printf "%b" "$reset" ;; + 7 | "fg") printf "%b" "\033[37m${reset}" ;; *) printf "%b" "\033[38;5;${1}m" ;; esac } # OTHER -err() { - err+="$(color 1)[!]\033[0m $1 -" +stdout() { + image_backend="off" + unset subtitle_color + unset colon_color + unset info_color + unset underline_color + unset bold + unset title_color + unset at_color + unset text_padding + unset zws + unset reset + unset color_blocks + unset get_line_break } -get_script_dir() { - [[ "$script_dir" ]] && return +err() { + err+="$(color 1)[!]\033[0m $1\n" +} - # Use $0 to get the script's physical path. - cd "${0%/*}" || exit - script_dir="${0##*/}" +get_full_path() { + # This function finds the absolute path from a relative one. + # For example "Pictures/Wallpapers" --> "/home/dylan/Pictures/Wallpapers" + + # If the file exists in the current directory, stop here. + [[ -f "${PWD}/${1/*\/}" ]] && { printf "%s\n" "${PWD}/${1/*\/}"; return; } + + if ! cd "${1%/*}"; then + err "Error: Directory '${1%/*}' doesn't exist or is inaccessible" + err " Check that the directory exists or try another directory." + exit 1 + fi + + local full_dir="${1##*/}" # Iterate down a (possible) chain of symlinks. - while [[ -L "$script_dir" ]]; do - script_dir="$(readlink "$script_dir")" - cd "${script_dir%/*}" || exit - script_dir="${script_dir##*/}" + while [[ -L "$full_dir" ]]; do + full_dir="$(readlink "$full_dir")" + cd "${full_dir%/*}" || exit + full_dir="${full_dir##*/}" done - # Final directory - script_dir="$(pwd -P)" + # Final directory. + full_dir="$(pwd -P)/${1/*\/}" + + [[ -e "$full_dir" ]] && printf "%s\n" "$full_dir" } get_default_config() { - if [[ -f "/usr/share/neofetch/config" ]]; then - default_config="/usr/share/neofetch/config" - - elif [[ -f "/usr/local/share/neofetch/config" ]]; then - default_config="/usr/local/share/neofetch/config" - - elif [[ -f "/data/data/com.termux/files/usr/share/neofetch/config" ]]; then - default_config="/data/data/com.termux/files/usr/share/neofetch/config" + if [[ -f "CONFDIR/config.conf" ]]; then + default_config="CONFDIR/config.conf" else - get_script_dir - default_config="${script_dir}/config/config" - travis_config="${script_dir}/config/travis" + [[ -z "$script_dir" ]] && script_dir="$(get_full_path "$0")" + default_config="${script_dir%/*}/config/config.conf" fi if source "$default_config"; then - err "Config: Sourced default config. ($default_config)" + err "Config: Sourced default config. (${default_config})" else err "Config: Default config not found, continuing..." fi } get_user_config() { - # Check $config_file + # Check $config_file. if [[ -f "$config_file" ]]; then source "$config_file" - err "Config: Sourced user config. ($config_file)" - return - - elif [[ "$config_file" == "travis" ]]; then - source "$travis_config" - err "Config: Sourced user config. ($travis_config)" + err "Config: Sourced user config. (${config_file})" + old_options return fi - mkdir -p "$XDG_CONFIG_HOME/neofetch/" + mkdir -p "${XDG_CONFIG_HOME}/neofetch/" - # Check $XDG_CONFIG_HOME/neofetch and create the + # Check ${XDG_CONFIG_HOME}/neofetch and create the # dir/files if they don't exist. - if [[ -f "$XDG_CONFIG_HOME/neofetch/config" ]]; then - config_file="$XDG_CONFIG_HOME/neofetch/config" + if [[ -f "${XDG_CONFIG_HOME}/neofetch/config" ]]; then + config_file="${XDG_CONFIG_HOME}/neofetch/config" - elif [[ -f "/usr/share/neofetch/config" ]]; then - cp "/usr/share/neofetch/config" "$XDG_CONFIG_HOME/neofetch" - config_file="$XDG_CONFIG_HOME/neofetch/config" + elif [[ -f "${XDG_CONFIG_HOME}/neofetch/config.conf" ]]; then + config_file="${XDG_CONFIG_HOME}/neofetch/config.conf" - elif [[ -f "/usr/local/share/neofetch/config" ]]; then - cp "/usr/local/share/neofetch/config" "$XDG_CONFIG_HOME/neofetch" - config_file="$XDG_CONFIG_HOME/neofetch/config" + elif [[ -f "CONFDIR/config.conf" ]]; then + cp "CONFDIR/config.conf" "${XDG_CONFIG_HOME}/neofetch" + config_file="${XDG_CONFIG_HOME}/neofetch/config.conf" else - get_script_dir + [[ -z "$script_dir" ]] && script_dir="$(get_full_path "$0")" - cp "$script_dir/config/config" "$XDG_CONFIG_HOME/neofetch" - config_file="$XDG_CONFIG_HOME/neofetch/config" + cp "${script_dir%/*}/config/config.conf" "${XDG_CONFIG_HOME}/neofetch" + config_file="${XDG_CONFIG_HOME}/neofetch/config.conf" fi source "$config_file" - err "Config: Sourced user config. ($config_file)" + err "Config: Sourced user config. (${config_file})" + old_options } bar() { - # Get the values + # Get the values. elapsed="$(($1 * bar_length / $2))" - # Create the bar with spaces - prog="$(printf %"$elapsed"s)" - total="$(printf %"$((bar_length - elapsed))"s)" + # Create the bar with spaces. + printf -v prog "%${elapsed}s" + printf -v total "%$((bar_length - elapsed))s" - # Set the colors and swap the spaces for $bar_char_ - bar+="${bar_color_elapsed}${prog// /$bar_char_elapsed}" - bar+="${bar_color_total}${total// /$bar_char_total}" + # Set the colors and swap the spaces for $bar_char_. + bar+="${bar_color_elapsed}${prog// /${bar_char_elapsed}}" + bar+="${bar_color_total}${total// /${bar_char_total}}" - # Borders + # Borders. [[ "$bar_border" == "on" ]] && \ bar="$(color fg)[${bar}$(color fg)]" - printf "%b\n" "${bar}${info_color}" + printf "%b" "${bar}${info_color}" } cache() { - mkdir -p "$3/neofetch" - printf "%s" "${1/*-}=\"$2\"" > "$3/neofetch/${1/*-}" + if [[ "$2" ]]; then + mkdir -p "${cache_dir}/neofetch" + printf "%s" "${1/*-}=\"$2\"" > "${cache_dir}/neofetch/${1/*-}" + fi +} + +get_cache_dir() { + case "$os" in + "Mac OS X") cache_dir="/Library/Caches" ;; + *) cache_dir="/tmp" ;; + esac } kde_config_dir() { @@ -2820,22 +4002,27 @@ kde_config_dir() { if [[ "$kde_config_dir" ]]; then return - elif [[ -n "$KDE_CONFIG_DIR" ]]; then - kde_config_dir="$KDE_CONFIG_DIR" - - elif type -p kde5-config >/dev/null 2>&1; then - kde_config_dir="$(kde5-config --localprefix)" + elif type -p kf5-config >/dev/null 2>&1; then + kde_config_dir="$(kf5-config --path config)" elif type -p kde4-config >/dev/null 2>&1; then - kde_config_dir="$(kde4-config --localprefix)" + kde_config_dir="$(kde4-config --path config)" elif type -p kde-config >/dev/null 2>&1; then - kde_config_dir="$(kde-config --localprefix)" + kde_config_dir="$(kde-config --path config)" + + elif [[ -d "${HOME}/.kde4" ]]; then + kde_config_dir="${HOME}/.kde4/share/config" + + elif [[ -d "${HOME}/.kde3" ]]; then + kde_config_dir="${HOME}/.kde3/share/config" fi + + kde_config_dir="${kde_config_dir/$'/:'*}" } get_term_padding() { - # Terminal info + # Terminal info. # # Parse terminal config files to get # info about padding. Due to how w3m-img @@ -2845,46 +4032,42 @@ get_term_padding() { # # Note: This issue only seems to affect # URxvt. - [[ -z "$term" ]] && get_term + ((term_run != 1)) && get_term case "$term" in "URxvt"*) - border="$(xrdb -query | grep -i "\(URxvt\|\*\)\.InternalBorder")" - border="${border/*:}" + border="$(xrdb -query | awk -F ':' '/^(URxvt|\*).internalBorder/ {printf $2; exit}')" ;; esac } dynamic_prompt() { - if [[ "$image_backend" == "image" ]]; then - get_term_padding 2>/dev/null - - # Calculate image height in terminal cells. - lines="$(((height + (${border:-0} * 2) + ${yoffset:-0}) / font_height))" - fi + case "$image_backend" in + "ascii") printf "\n" ;; + "off") return ;; + *) + get_term_padding + lines="$(((border + height + yoffset) / font_height))" + image_prompt="on" + ;; + esac # If the info is higher than the ascii/image place the prompt # based on the info height instead of the ascii/image height. - if (("${lines:-0}" < "${info_height:-0}")); then - printf "\n" + if ((lines < info_height)); then + [[ "$image_prompt" ]] && printf "\n" return else + [[ "$image_prompt" ]] && printf "%b\n" "$line_breaks" lines="$((lines - info_height))" fi - # Set the prompt location - if (("$lines" < 0)); then - printf "%b" "\033[${lines/-}A" - else - printf "%b" "\033[${lines}B" - fi - - # Add some padding - printf "\n\n\n\n" + # Set the prompt location. + ((lines > 0)) && printf "%b" "\033[${lines}B" } old_functions() { - # Deprecated functions + # Deprecated functions. # Neofetch 2.0 changed the names of a few variables. # This function adds backwards compatibility for the # old variable names. @@ -2896,95 +4079,295 @@ old_functions() { get_publicip() { get_public_ip; publicip="$public_ip"; } get_linebreak() { get_line_break; linebreak="$line_break"; } fi + + get_birthday() { get_install_date; birthday="$install_date"; } } -old_flags() { - [[ -n "$osx_buildversion" ]] && err "Config: \$osx_buildversion is deprecated, use \$distro_shorthand instead." - [[ -n "$osx_codename" ]] && err "Config: \$osx_codename is deprecated, use \$distro_shorthand instead." - [[ "$cpu_cores" == "on" ]] && err "Config: \$cpu_cores='on' is deprecated, use \$cpu_cores='logical|physical|off' instead." - [[ -n "$image" ]] && { err "Config: \$image is deprecated, use \$image_source instead."; image_source="$image"; } +old_options() { + [[ -n "$osx_buildversion" ]] && \ + err "Config: \$osx_buildversion is deprecated, use \$distro_shorthand instead." + [[ -n "$osx_codename" ]] && \ + err "Config: \$osx_codename is deprecated, use \$distro_shorthand instead." + [[ "$cpu_cores" == "on" ]] && \ + err "Config: cpu_cores='on' is deprecated, use cpu_cores='logical|physical|off' instead." + [[ -n "$image" ]] && \ + { err "Config: \$image is deprecated, use \$image_source instead."; image_source="$image"; } - # All progress_ variables were changed to bar_ - [[ -n "$progress_char" ]] && err "Config: \$progress_char is deprecated, use \$bar_char_elapsed and \$bar_char_total instead." - [[ -n "$progress_border" ]] && err "Config: \$progress_border is deprecated, use \$bar_border instead." - [[ -n "$progress_length" ]] && err "Config: \$progress_length is deprecated, use \$bar_length instead." - [[ -n "$progress_color_elapsed" ]] && err "Config: \$progress_color_elapsed is deprecated, use \$bar_color_elapsed instead." - [[ -n "$progress_color_total" ]] && err "Config: \$progress_color_total is deprecated, use \$bar_color_total instead." + # All progress_ variables were changed to bar_. + [[ -n "$progress_char" ]] && \ + err "Config: \$progress_char is deprecated, use \$bar_char_{elapsed,total} instead." + [[ -n "$progress_border" ]] && \ + { err "Config: \$progress_border is deprecated, use \$bar_border instead."; \ + bar_border="$progress_border"; } + [[ -n "$progress_length" ]] && \ + { err "Config: \$progress_length is deprecated, use \$bar_length instead."; \ + bar_length="$progress_length"; } + [[ -n "$progress_color_elapsed" ]] && \ + { err "Config: \$progress_color_elapsed is deprecated, use \$bar_color_elapsed instead."; \ + bar_color_elapsed="$progress_color_elapsed"; } + [[ -n "$progress_color_total" ]] && \ + { err "Config: \$progress_color_total is deprecated, use \$bar_color_total instead."; \ + bar_color_total="$progress_color_total"; } + + # All cpufreq values were changed in 3.0. + [[ "$speed_type" == "current" ]] && \ + err "Config: speed_type='current' is deprecated, use speed_type='scaling_cur_freq' instead." + [[ "$speed_type" == "min" ]] && \ + err "Config: speed_type='min' is deprecated, use speed_type='scaling_min_freq' instead." + [[ "$speed_type" == "max" ]] && \ + err "Config: speed_type='max' is deprecated, use speed_type='scaling_max_freq' instead." + [[ "$speed_type" == "bios" ]] && \ + err "Config: speed_type='bios' is deprecated, use speed_type='bios_limit' instead." + + # Ascii_logo_size was removed in 3.0. + [[ "$ascii_logo_size" ]] && \ + err "Config: ascii_logo_size is deprecated, use ascii_distro='{distro}_small' instead." + + # $start and $end were replaced with ${block_range[@]} in 3.0. + [[ "$start" && "$end" ]] && \ + { err "Config: \$start and \$end are deprecated, use block_range=(0 7) instead."; \ + block_range=("$start" "$end"); } + + # Fahrenheit support was added to CPU so the options were changed. + [[ "$cpu_temp" == "on" ]] && \ + { err "Config: cpu_temp='on' is deprecated, use cpu_temp='C' or 'F' instead."; + cpu_temp="C"; } + + # Birthday was renamed to Install Date in 3.0 + [[ -n "$birthday_time" ]] && \ + { err "Config: \$birthday_time is deprecated, use \3install_time instead."; \ + install_time="$birthday_time"; } + + # Scrot dir was removed in 3.1.0. + [[ -n "$scrot_dir" ]] && scrot_dir= + + # cpu_shorthand was deprecated in 3.3.0 + [[ -n "$cpu_shorthand" ]] && \ + { err "Config: \$cpu_shorthand is deprecated, use \$cpu_brand, \$cpu_cores, and + \$cpu_speed instead."; } } cache_uname() { # Cache the output of uname so we don't # have to spawn it multiple times. - uname=($(uname -srm)) + uname=($(uname -sr)) kernel_name="${uname[0]}" kernel_version="${uname[1]}" - machine_arch="${uname[2]}" +} + +convert_time() { + # Convert ls timestamp to 'Tue 06 Dec 2016 4:58 PM' format. + year="$1" + day="${3#0}" + + # Split time into hours/minutes. + hour="${4/:*}" + min="${4/${hour}}" + + # Get month. (Month code is used for day of week) + # Due to different versions of 'ls', the month can be 1, 01 or Jan. + case "$2" in + 1 | 01 | "Jan") month="Jan"; month_code=0 ;; + 2 | 02 | "Feb") month="Feb"; month_code=3 ;; + 3 | 03 | "Mar") month="Mar"; month_code=3 ;; + 4 | 04 | "Apr") month="Apr"; month_code=6 ;; + 5 | 05 | "May") month="May"; month_code=1 ;; + 6 | 06 | "Jun") month="Jun"; month_code=4 ;; + 7 | 07 | "Jul") month="Jul"; month_code=6 ;; + 8 | 08 | "Aug") month="Aug"; month_code=2 ;; + 9 | 09 | "Sep") month="Sep"; month_code=5 ;; + 10 | "Oct") month="Oct"; month_code=0 ;; + 11 | "Nov") month="Nov"; month_code=3 ;; + 12 | "Dec") month="Dec"; month_code=5 ;; + esac + + # Get leap year. + # Source: http://stackoverflow.com/questions/725098/leap-year-calculation + [[ "$((year % 4))" == 0 && "$((year % 100))" != 0 || "$((year % 400))" == 0 ]] && \ + [[ "$month" =~ (Jan|Feb) ]] && \ + leap_code=1 + + # Calculate day of week. + # Source: http://blog.artofmemory.com/how-to-calculate-the-day-of-the-week-4203.html + year_code="$((${year/??} + (${year/??} / 4) % 7))" + week_day="$(((year_code + month_code + 6 + day - leap_code) % 7))" + + case "$week_day" in + 0) week_day="Sun" ;; + 1) week_day="Mon" ;; + 2) week_day="Tue" ;; + 3) week_day="Wed" ;; + 4) week_day="Thu" ;; + 5) week_day="Fri" ;; + 6) week_day="Sat" ;; + esac + + # Convert 24 hour time to 12 hour time + AM/PM. + case "$install_time_format" in + "12h") + case "$hour" in + [0-9] | 0[0-9] | 1[0-1]) time="${hour/00/12}${min} AM" ;; + *) time="$((hour - 12))${min} PM" ;; + esac + ;; + *) time="$4" ;; + esac + + # Toggle showing the time. + [[ "$install_time" == "off" ]] && unset time + + # Print the install date. + printf "%s" "$week_day $day $month $year $time" +} + +get_ppid() { + # Get parent process ID of PID. + case "$os" in + "Windows") + ppid="$(ps -p "${1:-$PPID}" | awk '{printf $2}')" + ppid="${ppid/'PPID'}" + ;; + + "Linux") + ppid="$(grep -i -F "PPid:" "/proc/${1:-$PPID}/status")" + ppid="$(trim "${ppid/PPid:}")" + ;; + + *) + ppid="$(ps -p "${1:-$PPID}" -o ppid=)" + ;; + esac + + printf "%s" "$ppid" +} + +get_process_name() { + # Get PID name. + case "$os" in + "Windows") + name="$(ps -p "${1:-$PPID}" | awk '{printf $8}')" + name="${name/'COMMAND'}" + name="${name/*\/}" + ;; + + "Linux") + name="$(< "/proc/${1:-$PPID}/comm")" + ;; + + *) + name="$(ps -p "${1:-$PPID}" -o comm=)" + ;; + esac + + printf "%s" "$name" +} + +decode_url() { + decode="${1//+/ }" + printf "%b" "${decode//%/\\x}" } # FINISH UP -usage() { printf "%s" " - NEOFETCH +usage() { printf "%s" "\ +Usage: neofetch --option \"value\" --option \"value\" - USAGE: neofetch --option \"value\" --option \"value\" +Neofetch is a CLI system information tool written in BASH. Neofetch +displays information about your system next to an image, your OS logo, +or any ASCII file of your choice. - NOTE: There's also a config option for each flag below. +NOTE: Every launch flag has a config option. - Info: +Options: + +INFO: --disable infoname Allows you to disable an info line from appearing in the output. - NOTE: You can supply multiple args. eg. - 'neofetch --disable cpu gpu disk shell' - NOTE: The arguments must all be lowercase. + + NOTE: You can supply multiple args. eg. 'neofetch --disable cpu gpu' + --os_arch on/off Hide/Show OS architecture. --speed_type type Change the type of cpu speed to display. Possible values: current, min, max, bios, scaling_current, scaling_min, scaling_max - NOTE: This only support Linux with cpufreq. - --cpu_shorthand type Shorten the output of CPU - Possible values: name, speed, tiny, on, off + + NOTE: This only supports Linux with cpufreq. + + --speed_shorthand on/off Whether or not to show decimals in CPU speed. + + NOTE: This flag is not supported in systems with CPU speed less than + 1 GHz. + + --cpu_brand on/off Enable/Disable CPU brand in output. --cpu_cores type Whether or not to display the number of CPU cores - Takes: logical, physical, off + Possible values: logical, physical, off + NOTE: 'physical' doesn't work on BSD. + --cpu_speed on/off Hide/Show cpu speed. - --cpu_temp on/off Hide/Show cpu temperature. + --cpu_temp C/F/off Hide/Show cpu temperature. + NOTE: This only works on Linux and BSD. - NOTE: For FreeBSD-based systems, you need to enable coretemp - kernel module. + + NOTE: For FreeBSD and NetBSD-based systems, you need to enable + coretemp kernel module. This only supports newer Intel processors. + --distro_shorthand on/off Shorten the output of distro (tiny, on, off) + NOTE: This option won't work in Windows (Cygwin) + --kernel_shorthand on/off Shorten the output of kernel + NOTE: This option won't work in BSDs (except PacBSD and PC-BSD) + --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --refresh_rate on/off Whether to display the refresh rate of each monitor Unsupported on Windows --gpu_brand on/off Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel) + --gpu_type type Which GPU to display. (all, dedicated, integrated) + + NOTE: This only supports Linux. + --gtk_shorthand on/off Shorten output of gtk theme/icons - --gtk2 on/off Enable/Disable gtk2 theme/icons output - --gtk3 on/off Enable/Disable gtk3 theme/icons output + --gtk2 on/off Enable/Disable gtk2 theme/font/icons output + --gtk3 on/off Enable/Disable gtk3 theme/font/icons output --shell_path on/off Enable/Disable showing \$SHELL path --shell_version on/off Enable/Disable showing \$SHELL version - --ip_host url Url to query for public IP - --song_shorthand on/off Print the Artist/Title on seperate lines - --birthday_shorthand on/off Shorten the output of birthday - --birthday_time on/off Enable/Disable showing the time in birthday output - --birthday_format format Format the birthday output. (Uses 'date' cmd format) + --disk_show value Which disks to display. + Possible values: '/', '/dev/sdXX', '/path/to/mount point' - Text Formatting: + NOTE: Multiple values can be given. (--disk_show '/' '/dev/sdc1') + + --disk_subtitle type What information to append to the Disk subtitle. + Takes: name, mount, dir + + 'name' shows the disk's name (sda1, sda2, etc) + + 'mount' shows the disk's mount point (/, /mnt/Local Disk, etc) + + 'dir' shows the basename of the disks's path. (/, Local Disk, etc) + + --ip_host url URL to query for public IP + --song_shorthand on/off Print the Artist/Title on separate lines + --install_time on/off Enable/Disable showing the time in Install Date output. + --install_time_format 12h/24h + Set time format in Install Date to be 12 hour or 24 hour. + +TEXT FORMATTING: --colors x x x x x x Changes the text colors in this order: title, @, underline, subtitle, colon, info --underline on/off Enable/Disable the underline. --underline_char char Character to use when underlining title --bold on/off Enable/Disable bold text - Color Blocks: +COLOR BLOCKS: --color_blocks on/off Enable/Disable the color blocks --block_width num Width of color blocks in spaces --block_height num Height of color blocks in lines - --block_range start end 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' Characters to use when drawing bars. --bar_border on/off Whether or not to surround the bar with '[]' @@ -2992,18 +4375,61 @@ usage() { printf "%s" " --bar_colors num num Colors to make the bar. Set in this order: elapsed, total --cpu_display mode Bar mode. - Takes: bar, infobar, barinfo, off + Possible values: bar, infobar, barinfo, off --memory_display mode Bar mode. - Takes: bar, infobar, barinfo, off + Possible values: bar, infobar, barinfo, off --battery_display mode Bar mode. - Takes: bar, infobar, barinfo, off + Possible values: bar, infobar, barinfo, off --disk_display mode Bar mode. - Takes: bar, infobar, barinfo, off + Possible values: bar, infobar, barinfo, off - Image: - --image type Image source. Where and what image we display. - Possible values: wall, ascii, - /path/to/img, /path/to/dir/, off +IMAGE BACKEND: + --backend backend Which image backend to use. + Possible values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', + 'sixel', 'tycat', 'w3m' + --source source Which image or ascii file to use. + Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img', + '/path/to/ascii', '/path/to/dir/' + --ascii source Shortcut to use 'ascii' backend. + --caca source Shortcut to use 'caca' backend. + --catimg source Shortcut to use 'catimg' backend. + --iterm2 source Shortcut to use 'iterm2' backend. + --jp2a source Shortcut to use 'jp2a' backend. + --sixel source Shortcut to use 'sixel' backend. + --termpix source Shortcut to use 'termpix' backend. + --tycat source Shortcut to use 'tycat' backend. + --w3m source Shortcut to use 'w3m' backend. + --off Shortcut to use 'off' backend. + + NOTE: 'source; can be any of the following: 'auto', 'ascii', 'wallpaper', '/path/to/img', + '/path/to/ascii', '/path/to/dir/' + +ASCII: + --ascii_colors x x x x x x Colors to print the ascii art + --ascii_distro distro Which Distro's ascii art to print + + NOTE: Arch and Ubuntu have 'old' logo variants. + + NOTE: Use 'arch_old' or 'ubuntu_old' to use the old logos. + + NOTE: Ubuntu has flavor variants. + + NOTE: Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME', + 'Ubuntu-Studio' or 'Ubuntu-Budgie' to use the flavors. + + NOTE: Alpine, Arch, CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, + OpenBSD, and Void have a smaller logo variant. + + NOTE: Use '{distro name}_small' to use the small variants. + + --ascii_bold on/off Whether or not to bold the ascii logo. + -L, --logo Hide the info text and only show the ascii logo. + + Possible values: bar, infobar, barinfo, off + +IMAGE: + --loop Redraw the image constantly until Ctrl+C is used. This fixes issues + in some terminals emulators when using image mode. --size 00px | --size 00% How to size the image. Possible values: auto, 00px, 00%, none --crop_mode mode Which crop mode to use @@ -3019,51 +4445,72 @@ usage() { printf "%s" " --bg_color color Background color to display behind transparent image. This only works with w3m. --gap num Gap between image and text. - NOTE: --gap can take a negative value which will - move the text closer to the left side. + + NOTE: --gap can take a negative value which will move the text + closer to the left side. + --clean Delete cached files and thumbnails. - Ascii: - --ascii value Where to get the ascii from, Possible values: - distro, /path/to/ascii - --ascii_colors x x x x x x Colors to print the ascii art - --ascii_distro distro Which Distro's ascii art to print - --ascii_logo_size Size of ascii logo. - Supported distros: Arch, Gentoo, Crux, OpenBSD. - --ascii_bold on/off Whether or not to bold the ascii logo. - --logo | -L Hide the info text and only show the ascii logo. - - Screenshot: - --scrot | -s /path/to/img Take a screenshot, if path is left empty the screen- +SCREENSHOT: + -s, --scrot /path/to/img Take a screenshot, if path is left empty the screen- shot function will use \$scrot_dir and \$scrot_name. - --upload | -su /pth/t/img Same as --scrot but uploads the scrot to a website. - --image_host Website to upload scrots to. Takes: imgur, teknik + -su, --upload /path/to/img Same as --scrot but uploads the scrot to a website. + --image_host imgur/teknik Website to upload scrots to. --scrot_cmd cmd Screenshot program to launch - Other: +OTHER: --config /path/to/config Specify a path to a custom config file --config none Launch the script without a config file + --stdout Turn off all colors and disables any ASCII/image backend. --help Print this text and exit --version Show neofetch version -v Display error messages. -vv Display a verbose log for error reporting. + +DEVELOPER: + --gen-man Generate a manpage for Neofetch in your PWD. (Requires GNU help2man) + + +Report bugs to https://github.com/dylanaraps/neofetch/issues + +" +exit 1 +} + +version() { printf "%s" "\ +Neofetch $version + +Copyright (c) 2016-2017 Dylan Araps + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the 'Software'), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Written by Dylan Araps with help from the following people: + +https://github.com/dylanaraps/neofetch/contributors + " exit 1 } get_args() { - # Check the commandline flags early for '--config none/off' - case "$@" in - *"--config off"* | *'--config "off"'* | *"--config 'off'"* | \ - *"--config none"* | *'--config "none"'* | *"--config 'none'"*) - config="off" - ;; - - *"--config -"*) ;; - *"--config"*) config="off" ;; - esac - - [[ "${config:-on}" == "on" ]] && get_user_config 2>/dev/null + # Check the commandline flags early for '--config'. + [[ "$*" != *--config* ]] && get_user_config while [[ "$1" ]]; do case "$1" in @@ -3071,13 +4518,14 @@ get_args() { "--os_arch") os_arch="$2" ;; "--cpu_cores") cpu_cores="$2" ;; "--cpu_speed") cpu_speed="$2" ;; - "--cpu_temp") cpu_temp="$2" ;; "--speed_type") speed_type="$2" ;; + "--speed_shorthand") speed_shorthand="$2" ;; "--distro_shorthand") distro_shorthand="$2" ;; "--kernel_shorthand") kernel_shorthand="$2" ;; "--uptime_shorthand") uptime_shorthand="$2" ;; - "--cpu_shorthand") cpu_shorthand="$2" ;; + "--cpu_brand") cpu_brand="$2" ;; "--gpu_brand") gpu_brand="$2" ;; + "--gpu_type") gpu_type="$2" ;; "--refresh_rate") refresh_rate="$2" ;; "--gtk_shorthand") gtk_shorthand="$2" ;; "--gtk2") gtk2="$2" ;; @@ -3086,16 +4534,32 @@ get_args() { "--shell_version") shell_version="$2" ;; "--ip_host") public_ip_host="$2" ;; "--song_shorthand") song_shorthand="$2" ;; - "--birthday_shorthand") birthday_shorthand="$2" ;; - "--birthday_time") birthday_time="$2" ;; - "--birthday_format") birthday_format="$2" ;; + "--install_time") install_time="$2" ;; + "--install_time_format") install_time_format="$2" ;; + "--cpu_temp") + cpu_temp="$2" + [[ "$cpu_temp" == "on" ]] && cpu_temp="C" + ;; + + "--disk_subtitle") disk_subtitle="$2" ;; + "--disk_show") + unset disk_show + for arg in "$@"; do + case "$arg" in + "--disk_show") ;; + "-"*) break ;; + *) disk_show+=($arg) + esac + done + ;; + "--disable") for func in "$@"; do case "$func" in "--disable") continue ;; "-"*) break ;; *) - (("$bash_version" >= 4)) && func="${func,,}" + ((bash_version >= 4)) && func="${func,,}" unset -f "get_$func" ;; esac @@ -3121,7 +4585,7 @@ get_args() { # Color Blocks "--color_blocks") color_blocks="$2" ;; - "--block_range") start="$2"; end="$3" ;; + "--block_range") block_range=("$2" "$3") ;; "--block_width") block_width="$2" ;; "--block_height") block_height="$2" ;; @@ -3143,12 +4607,20 @@ get_args() { "--battery_display") battery_display="$2" ;; "--disk_display") disk_display="$2" ;; - # Image - "--image") - image_source="$2" - case "$2" in "-"* | "") image_backend="ascii" ;; esac + # Image backend + "--backend") image_backend="$2" ;; + "--source") image_source="$2" ;; + "--ascii" | "--caca" | "--catimg" | "--jp2a" | "--iterm2" | "--off" | "--sixel" |\ + "--termpix" | "--tycat" | "--w3m") + image_backend="${1/--}" + case "$2" in + "-"* | "") ;; + *) image_source="$2" ;; + esac ;; + # Image options + "--loop") image_loop="on" ;; "--image_size" | "--size") image_size="$2" ;; "--crop_mode") crop_mode="$2" ;; "--crop_offset") crop_offset="$2" ;; @@ -3163,13 +4635,6 @@ get_args() { exit ;; - # Ascii - "--ascii") - image_backend="ascii" - ascii="$2" - case "$2" in "-"* | "") ascii="distro" ;; esac - ;; - "--ascii_colors") unset ascii_colors for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do @@ -3187,14 +4652,12 @@ get_args() { case "$2" in "-"* | "") ascii_distro="$distro" ;; esac ;; - "--ascii_logo_size") ascii_logo_size="$2" ;; "--ascii_bold") ascii_bold="$2" ;; "--logo" | "-L") image_backend="ascii" print_info() { info line_break; } ;; - # Screenshot "--scrot" | "-s") scrot_args "$@" @@ -3210,14 +4673,23 @@ get_args() { # Other "--config") case "$2" in - "none" | "off") config="off" ;; - *) config_file="$2"; config="on"; get_user_config 2>/dev/null ;; + "none" | "off" | "") ;; + *) + config_file="$(get_full_path "$2")" + get_user_config + ;; esac ;; + "--stdout") stdout="on" ;; "-v") verbose="on" ;; "-vv") set -x; verbose="on" ;; "--help") usage ;; - "--version") printf "%s\n" "Neofetch 2.0"; exit ;; + "--version") version ;; + "--gen-man") + help2man -n "A fast, highly customizable system info script" \ + -N ./neofetch -o neofetch.1 + exit 1 + ;; esac shift @@ -3227,52 +4699,41 @@ get_args() { main() { cache_uname get_os - get_default_config 2>/dev/null + get_default_config get_args "$@" - old_flags + [[ "$verbose" != "on" ]] && exec 2>/dev/null get_distro get_bold get_distro_colors + [[ "$stdout" == "on" ]] && stdout - # Restore cursor and clear screen on ctrl+c - trap 'printf "\033[?25h"; clear; exit' 2 + # Minix doesn't support these sequences. + if [[ "$TERM" != "minix" && "$stdout" != "on" ]]; then + # If the script exits for any reason, unhide the cursor. + trap 'printf "\033[?25h\033[?7h"' EXIT - # If the script exits for any reason, unhide the cursor. - trap 'printf "\033[?25h"' EXIT - - # Hide the cursor and disable line wrap - printf "\033[?25l\033[?7l" - - get_image_backend - - if [[ "$image_backend" != "off" ]]; then - # Set cursor position next to ascii art - printf "%b" "\033[$((${lines:-0} - ${prompt_loc:-0}))A" - - # Reset horizontal cursor position - printf "\033[9999999D" + # Hide the cursor and disable line wrap. + printf "\033[?25l\033[?7l" fi - # Print the info + image_backend old_functions - print_info 2>/dev/null + get_cache_dir + print_info + dynamic_prompt - # Prompt calculation - if [[ "$image_backend" != "off" ]]; then - dynamic_prompt - - # w3m-img: Draw the image a second time to fix - # rendering issues in specific terminal emulators. - [[ "$image_backend" == "image" && "$image_program" == "w3m" ]] && display_image - fi - - # Re-enable line wrap - printf "%b" "\033[?7h" + # w3m-img: Draw the image a second time to fix + # rendering issues in specific terminal emulators. + [[ "$image_backend" == *w3m* ]] && display_image + # Take a screenshot. [[ "$scrot" == "on" ]] && take_scrot - # Show error messages - [[ "$verbose" == "on" ]] && printf "%b" "$err" + # Show error messages. + [[ "$verbose" == "on" ]] && printf "%b" "$err" >&2 + + # If `--loop` was used, constantly redraw the image. + while [[ "$image_loop" == "on" && "$image_backend" == "w3m" ]]; do display_image; sleep 1s; done return 0 } diff --git a/neofetch.1 b/neofetch.1 index b6c9edb2..160b9905 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -1,309 +1,359 @@ -.TH NEOFETCH "1" "November 2016" "2.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. +.TH NEOFETCH "1" "September 2017" "Neofetch 3.3.0" "User Commands" .SH NAME -neofetch \- simple system information script - +Neofetch \- A fast, highly customizable system info script .SH SYNOPSIS -.B neofetch \fR[Optional Flags] - +.B neofetch +\fI\,--option "value" --option "value"\/\fR .SH DESCRIPTION -neofetch is a script that gathers information about your system and prints -it to the terminal next to an image, a distro's logo or any ASCII art of -your choice. - +Neofetch is a CLI system information tool written in BASH. Neofetch +displays information about your system next to an image, your OS logo, +or any ASCII file of your choice. +.PP +NOTE: Every launch flag has a config option. .SH OPTIONS +.SS "INFO:" .TP -.B \--disable 'infoname' -Allows you to disable an info line from appearing in the output. -.br -NOTE: You can supply multiple args. eg. -.br -\'neofetch --disable cpu gpu disk shell\' -.br -NOTE: The arguments must all be lowercase. +\fB\-\-disable\fR infoname +Allows you to disable an info line from appearing +in the output. +.IP +NOTE: You can supply multiple args. eg. 'neofetch \fB\-\-disable\fR cpu gpu' .TP -.B \--os_arch 'on/off' +\fB\-\-os_arch\fR on/off Hide/Show OS architecture. .TP -.B \--speed_type 'type' +\fB\-\-speed_type\fR type Change the type of cpu speed to display. -.br Possible values: current, min, max, bios, scaling_current, scaling_min, scaling_max -.br -NOTE: This only support Linux with cpufreq. +.IP +NOTE: This only supports Linux with cpufreq. .TP -.B \--cpu_shorthand 'type' -Shorten the output of CPU -.br -Possible values: name, speed, tiny, on, off +\fB\-\-speed_shorthand\fR on/off +Whether or not to show decimals in CPU speed. .TP -.B \--cpu_cores 'logical/physical/off' +NOTE: This flag is not supported in systems with CPU speed less than +1 GHz. +.TP +\fB\-\-cpu_brand\fR on/off +Enable/Disable CPU brand in output. +.TP +\fB\-\-cpu_cores\fR type Whether or not to display the number of CPU cores -.br -Note: 'physical' doesn't work on BSD. +Possible values: logical, physical, off +.IP +NOTE: 'physical' doesn't work on BSD. .TP -.B \--cpu_speed 'on/off' +\fB\-\-cpu_speed\fR on/off Hide/Show cpu speed. .TP -.B \--cpu_temp 'on/off' +\fB\-\-cpu_temp\fR C/F/off Hide/Show cpu temperature. -.br +.IP NOTE: This only works on Linux and BSD. -.br -NOTE: For FreeBSD-based systems, you need to enable coretemp kernel module. .TP -.B \--distro_shorthand 'on/off' +NOTE: For FreeBSD and NetBSD\-based systems, you need to enable +coretemp kernel module. This only supports newer Intel processors. +.TP +\fB\-\-distro_shorthand\fR on/off Shorten the output of distro (tiny, on, off) -.br +.IP NOTE: This option won't work in Windows (Cygwin) .TP -.B \--kernel_shorthand 'on/off' +\fB\-\-kernel_shorthand\fR on/off Shorten the output of kernel -.br -NOTE: This option won't work in BSDs (except PacBSD and PC-BSD) +.IP +NOTE: This option won't work in BSDs (except PacBSD and PC\-BSD) .TP -.B \--uptime_shorthand 'on/off' +\fB\-\-uptime_shorthand\fR on/off Shorten the output of uptime (tiny, on, off) .TP -.B \--refresh_rate 'on/off' +\fB\-\-refresh_rate\fR on/off Whether to display the refresh rate of each monitor -.br -Note: Unsupported on Windows +Unsupported on Windows .TP -.B \--gpu_brand on/off +\fB\-\-gpu_brand\fR on/off Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel) .TP -.B \--gtk_shorthand 'on/off' +\fB\-\-gpu_type\fR type +Which GPU to display. (all, dedicated, integrated) +.IP +NOTE: This only supports Linux. +.TP +\fB\-\-gtk_shorthand\fR on/off Shorten output of gtk theme/icons .TP -.B \--gtk2 'on/off' -Enable/Disable GTK2 theme/icons output +\fB\-\-gtk2\fR on/off +Enable/Disable gtk2 theme/font/icons output .TP -.B \--gtk3 'on/off' -Enable/Disable gtk3 theme/icons output +\fB\-\-gtk3\fR on/off +Enable/Disable gtk3 theme/font/icons output .TP -.B \--shell_path 'on/off' +\fB\-\-shell_path\fR on/off Enable/Disable showing $SHELL path .TP -.B \--shell_version 'on/off' +\fB\-\-shell_version\fR on/off Enable/Disable showing $SHELL version .TP -.B \--ip_host 'url' +\fB\-\-disk_show\fR value +Which disks to display. +Possible values: '/', '/dev/sdXX', '/path/to/mount point' +.IP +NOTE: Multiple values can be given. (\fB\-\-disk_show\fR '/' '/dev/sdc1') +.TP +\fB\-\-disk_subtitle\fR type +What information to append to the Disk subtitle. +Takes: name, mount, dir +.IP +\&'name' shows the disk's name (sda1, sda2, etc) +.IP +\&'mount' shows the disk's mount point (/, \fI\,/mnt/Local\/\fP Disk, etc) +.IP +\&'dir' shows the basename of the disks's path. (/, Local Disk, etc) +.TP +\fB\-\-ip_host\fR url URL to query for public IP .TP -.B \--song_shorthand 'on/off' -Print the Artist/Title on seperate lines +\fB\-\-song_shorthand\fR on/off +Print the Artist/Title on separate lines .TP -.B \--birthday_shorthand 'on/off' -Shorten the output of birthday +\fB\-\-install_time\fR on/off +Enable/Disable showing the time in Install Date output. .TP -.B \--birthday_time 'on/off' -Enable/Disable showing the time in birthday output +\fB\-\-install_time_format\fR 12h/24h +Set time format in Install Date to be 12 hour or 24 hour. +.SS "TEXT FORMATTING:" .TP -.B \--birthday_format 'format' -Format the birthday output. (Uses 'date' cmd format) - -.SH TEXT FORMATTING -.TP -.B \--colors x x x x x x +\fB\-\-colors\fR x x x x x x Changes the text colors in this order: title, @, underline, subtitle, colon, info .TP -.B \--underline on/off -enable/disable the underline. +\fB\-\-underline\fR on/off +Enable/Disable the underline. .TP -.B \--underline_char 'char' +\fB\-\-underline_char\fR char Character to use when underlining title .TP -.B \--bold 'on/off' +\fB\-\-bold\fR on/off Enable/Disable bold text +.SS "COLOR BLOCKS:" .TP -.B \--prompt_height 'num' -Set this to your prompt height to fix issues -with the text going off screen at the top - -.SH COLOR BLOCKS -.TP -.B \--color_blocks 'on/off' +\fB\-\-color_blocks\fR on/off Enable/Disable the color blocks .TP -.B \--block_width 'num' +\fB\-\-block_width\fR num Width of color blocks in spaces .TP -.B \--block_height 'num' +\fB\-\-block_height\fR num Height of color blocks in lines .TP -.B \--block_range 'start' 'end' +\fB\-\-block_range\fR num num Range of colors to print as blocks - -.SH BARS +.SS "BARS:" .TP -.B \--bar_char 'elapsed char' 'total char' +\fB\-\-bar_char\fR 'elapsed char' 'total char' Characters to use when drawing bars. .TP -.B \--bar_border on/off +\fB\-\-bar_border\fR on/off Whether or not to surround the bar with '[]' .TP -.B \--bar_length 'num' +\fB\-\-bar_length\fR num Length in spaces to make the bars. .TP -.B \--bar_colors 'num' 'num' +\fB\-\-bar_colors\fR num num Colors to make the bar. -.br Set in this order: elapsed, total .TP -.B \--cpu_display 'mode' +\fB\-\-cpu_display\fR mode Bar mode. -.br -Takes: bar, infobar, barinfo, off +Possible values: bar, infobar, barinfo, off .TP -.B \--memory_display 'mode' +\fB\-\-memory_display\fR mode Bar mode. -.br -Takes: bar, infobar, barinfo, off +Possible values: bar, infobar, barinfo, off .TP -.B \--battery_display 'mode' +\fB\-\-battery_display\fR mode Bar mode. -.br -Takes: bar, infobar, barinfo, off +Possible values: bar, infobar, barinfo, off .TP -.B \--disk_display 'mode' +\fB\-\-disk_display\fR mode Bar mode. -.br -Takes: bar, infobar, barinfo, off - -.SH IMAGE +Possible values: bar, infobar, barinfo, off +.SS "IMAGE BACKEND:" .TP -.B \--image 'type' -Image source. Where and what image we display. -.br -Possible values: wall, ascii, /path/to/img, /path/to/dir/, off +\fB\-\-backend\fR backend +Which image backend to use. +Possible values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', +\&'sixel', 'tycat', 'w3m' .TP -.B \--size 'size' +\fB\-\-source\fR source +Which image or ascii file to use. +Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img', +\&'/path/to/ascii', '/path/to/dir/' +.TP +\fB\-\-ascii\fR source +Shortcut to use 'ascii' backend. +.TP +\fB\-\-caca\fR source +Shortcut to use 'caca' backend. +.TP +\fB\-\-catimg\fR source +Shortcut to use 'catimg' backend. +.TP +\fB\-\-iterm2\fR source +Shortcut to use 'iterm2' backend. +.TP +\fB\-\-jp2a\fR source +Shortcut to use 'jp2a' backend. +.TP +\fB\-\-sixel\fR source +Shortcut to use 'sixel' backend. +.TP +\fB\-\-termpix\fR source +Shortcut to use 'termpix' backend. +.TP +\fB\-\-tycat\fR source +Shortcut to use 'tycat' backend. +.TP +\fB\-\-w3m\fR source +Shortcut to use 'w3m' backend. +.TP +\fB\-\-off\fR +Shortcut to use 'off' backend. +.IP +NOTE: 'source; can be any of the following: 'auto', 'ascii', 'wallpaper', '/path/to/img', +\&'/path/to/ascii', '/path/to/dir/' +.SS "ASCII:" +.TP +\fB\-\-ascii_colors\fR x x x x x x +Colors to print the ascii art +.TP +\fB\-\-ascii_distro\fR distro +Which Distro's ascii art to print +.IP +NOTE: Arch and Ubuntu have 'old' logo variants. +.IP +NOTE: Use 'arch_old' or 'ubuntu_old' to use the old logos. +.IP +NOTE: Ubuntu has flavor variants. +.TP +NOTE: Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu\-GNOME', +\&'Ubuntu\-Studio' or 'Ubuntu\-Budgie' to use the flavors. +.TP +NOTE: Alpine, Arch, CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, +OpenBSD, and Void have a smaller logo variant. +.IP +NOTE: Use '{distro name}_small' to use the small variants. +.TP +\fB\-\-ascii_bold\fR on/off +Whether or not to bold the ascii logo. +.TP +\fB\-L\fR, \fB\-\-logo\fR +Hide the info text and only show the ascii logo. +.IP +Possible values: bar, infobar, barinfo, off +.SS "IMAGE:" +.TP +\fB\-\-loop\fR +Redraw the image constantly until Ctrl+C is used. This fixes issues +in some terminals emulators when using image mode. +.TP +\fB\-\-size\fR 00px | \fB\-\-size\fR 00% How to size the image. -.br Possible values: auto, 00px, 00%, none .TP -.B \--crop_mode 'mode' +\fB\-\-crop_mode\fR mode Which crop mode to use -.br Takes the values: normal, fit, fill .TP -.B \--crop_offset 'value' +\fB\-\-crop_offset\fR value Change the crop offset for normal mode. -.br Possible values: northwest, north, northeast, west, center, east, southwest, south, southeast .TP -.B \--xoffset 'value' +\fB\-\-xoffset\fR px How close the image will be to the left edge of the -window in pixel. This only works with w3m. +window. This only works with w3m. .TP -.B \--yoffset 'value' -How close the image will be to the top edge -of the window. This only works with w3m. +\fB\-\-yoffset\fR px +How close the image will be to the top edge of the +window. This only works with w3m. .TP -.B \--bg_color 'color' +\fB\-\-bg_color\fR color Background color to display behind transparent image. This only works with w3m. .TP -.B \--gap 'num' +\fB\-\-gap\fR num Gap between image and text. -.br -NOTE: --gap can take a negative value which -will move the text closer to the left side. .TP -.B \--clean +NOTE: \fB\-\-gap\fR can take a negative value which will move the text +closer to the left side. +.TP +\fB\-\-clean\fR Delete cached files and thumbnails. - -.SH ASCII +.SS "SCREENSHOT:" .TP -.B \--ascii 'value' -Where to get the ASCII from -.br -Possible values: distro, /path/to/ascii +\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. .TP -.B \--ascii_colors x x x x x x -Colors to print the ASCII art +\fB\-su\fR, \fB\-\-upload\fR \fI\,/path/to/img\/\fP +Same as \fB\-\-scrot\fR but uploads the scrot to a website. .TP -.B \--ascii_distro 'distro' -Which Distro\'s ASCII art to print +\fB\-\-image_host\fR imgur/teknik +Website to upload scrots to. .TP -.B \--ascii_logo_size 'size' -Size of ascii logo. -Supported distros: Arch, Gentoo, Crux, OpenBSD. -Possible values: small, normal -.TP -.B \--ascii_bold 'on/off' -Whether or not to bold the ascii logo. -.TP -.B \--logo | -L -Hide the info text and only show the ascii logo. - -.SH SCREENSHOT -.TP -.B \--scrot 'path' -Take a screenshot, if path is left empty the screenshot -function will use $scrot_dir and $scrot_name. -.TP -.B \--upload | -su 'path' -Same as --scrot but uploads the scrot to a website. -.TP -.B \--image_host 'host' -Website to upload scrots to. Takes: imgur, teknik -.TP -.B \--scrot_cmd 'cmd' +\fB\-\-scrot_cmd\fR cmd Screenshot program to launch - -.SH OTHER +.SS "OTHER:" .TP -.B \--config 'path' +\fB\-\-config\fR \fI\,/path/to/config\/\fP Specify a path to a custom config file .TP -.B \--config none +\fB\-\-config\fR none Launch the script without a config file .TP -.B \--help +\fB\-\-stdout\fR +Turn off all colors and disables any ASCII/image backend. .TP -.B \--test -Launch the script with all functions / options enabled. -This should only be used for testing purposes, ie Travis.CI. +\fB\-\-help\fR +Print this text and exit .TP -.B \--version -Show neofetch version. +\fB\-\-version\fR +Show neofetch version .TP -.B \-v +\fB\-v\fR Display error messages. .TP -.B \-vv +\fB\-vv\fR Display a verbose log for error reporting. - -.SH "SEE ALSO" -http://github.com/dylanaraps/neofetch - -.SH BUGS -Report bugs to - -.SH LICENSE - -The MIT License (MIT) - -Copyright (c) 2016 Dylan Araps - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - +.SS "DEVELOPER:" +.TP +\fB\-\-gen\-man\fR +Generate a manpage for Neofetch in your PWD. (Requires GNU help2man) .SH AUTHOR -Created by Dylan Araps. +Written by Dylan Araps with help from the following people: +.PP +https://github.com/dylanaraps/neofetch/contributors +.SH "REPORTING BUGS" +Report bugs to https://github.com/dylanaraps/neofetch/issues +.SH COPYRIGHT +Copyright \(co 2016\-2017 Dylan Araps +.PP +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the 'Software'), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +.PP +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +.PP +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.