Compare commits

...

66 Commits

Author SHA1 Message Date
Dylan Araps
c9d6ef5c40 version: bump 2019-01-08 18:32:04 +02:00
Dylan Araps
c6bd0461a0 image: Added support for Chafa. 2019-01-08 18:23:38 +02:00
Dylan Araps
c1da5eb09a ascii: Fixed void linux ascii bug 2019-01-08 18:00:54 +02:00
Dylan Araps
12d9f93750 ascii: Fixed debian linux ascii bug 2019-01-08 17:55:22 +02:00
Dylan Araps
32a44b4d62 ascii: Fixed gobo linux ascii bug 2019-01-08 17:54:42 +02:00
Dylan Araps
e2e98a6c7c general: Fixed bug with line_break alternative. Closes #1157 2019-01-08 17:36:27 +02:00
Dylan Araps
c76c122650 image: Added support for Chafa. 2019-01-08 17:27:23 +02:00
Dylan Araps
eaa59da1e9 ascii: Fix bedrock colors. Closes #1156 2019-01-08 17:13:32 +02:00
Dylan Araps
056a99bfa2 resolution: If resolution is empty don't print it. 2019-01-08 16:26:28 +02:00
Dylan Araps
074323f0ed version: bump 2019-01-08 16:14:24 +02:00
Dylan Araps
f24fed6df3 version: bump 2019-01-08 15:53:08 +02:00
Dylan Araps
86372fe6a8 distro: Remove broken distro lines 2019-01-08 15:52:12 +02:00
Dylan Araps
4f89361e50 color_blocks: Fix cursor bug 2019-01-08 15:34:08 +02:00
Dylan Araps
653712c06a image: fix various bugs 2019-01-08 15:00:45 +02:00
Dylan Araps
de5a260f6b public_ip: Added configurable timeout 2019-01-08 12:12:11 +02:00
Dylan Araps
617769059b memory: Added option to display memory percentage. 2019-01-08 11:09:42 +02:00
Dylan Araps
4d6a4fb425 cursor: Fix issues in urxvt with padding 2019-01-08 10:57:33 +02:00
Dylan Araps
85a1bd0af7 color_blocks: Fix newlines when disabled. 2019-01-08 10:48:32 +02:00
Dylan Araps
5316b568e7 docs: CHANGELOG 2019-01-08 10:15:01 +02:00
Dylan Araps
7677cd2b4b image: higher quality thumbs. Closes #1079 2019-01-08 10:14:43 +02:00
Dylan Araps
3a0e2ec68c docs: CHANGELOG 2019-01-08 09:09:02 +02:00
Dylan Araps
62ada359fc docs: CHANGELOG 2019-01-08 09:04:09 +02:00
Dylan Araps
ad2727620c docs: CHANGELOG 2019-01-08 08:49:52 +02:00
Dylan Araps
ccabbbe678 docs: CHANGELOG 2019-01-08 08:37:19 +02:00
Dylan Araps
1f8b18d7ca Merge branch 'master' of github.com:dylanaraps/neofetch 2019-01-08 08:27:45 +02:00
Dylan Araps
804f88aa7a packages: revert pkginfo change 2019-01-08 08:27:33 +02:00
Dylan Araps
041a1459b6 Merge pull request #1154 from dylanaraps/bedrock2
Bedrock Linux support
2019-01-08 08:15:58 +02:00
Dylan Araps
594e1fa10d cleanup 2019-01-07 22:53:51 +02:00
Dylan Araps
fbb69625a7 cleanup 2019-01-07 22:49:46 +02:00
Dylan Araps
a450fc88c5 terminal font [kitty]: Use kitty command instead of parsing config files. Closes #1150 2019-01-07 21:18:33 +02:00
Dylan Araps
d36ee68f2c os: Initial support for Bedrock Linux 2019-01-07 20:56:38 +02:00
Dylan Araps
e155df7a72 os: Initial support for Bedrock Linux 2019-01-07 20:42:49 +02:00
Dylan Araps
679aa306fb Merge branch 'master' of github.com:dylanaraps/neofetch 2019-01-07 20:23:23 +02:00
Dylan Araps
04420479dc image: store thumbnail with path name 2019-01-07 20:22:59 +02:00
Dylan Araps
8aab756a15 packages: Don't run pkginfo on linux 2019-01-07 19:48:05 +02:00
Dylan Araps
af6230f0ca Merge pull request #1152 from dylanaraps/simple
Added new simple mode for script usage
2019-01-07 19:46:20 +02:00
Dylan Araps
7e96b42860 simple mode: expose window size and terminal size 2019-01-07 19:40:37 +02:00
Dylan Araps
ea44816a3c simple mode: expose window size and terminal size 2019-01-07 19:36:14 +02:00
Dylan Araps
981b2da634 general: Fix issues when printing ascii 2019-01-07 18:56:09 +02:00
Dylan Araps
1b67413d49 Merge pull request #1153 from dylanaraps/ascii_enhance
ascii: Added support for command output
2019-01-07 18:47:43 +02:00
Dylan Araps
c99b864590 ascii: Fixed bug when long line is input 2019-01-07 18:34:20 +02:00
Dylan Araps
b399f49077 ascii: Fixed bug when files named auto or ascii were found. 2019-01-07 18:17:56 +02:00
Dylan Araps
defee48d14 ascii: Added support for command output 2019-01-07 18:09:55 +02:00
Dylan Araps
4fb30c040a ascii: Added support for command output 2019-01-07 18:09:10 +02:00
Dylan Araps
1b356da175 ascii: Added support for command output 2019-01-07 18:04:25 +02:00
Dylan Araps
a52115b364 ascii: Added support for Pentoo. Closes #1069 2019-01-07 17:33:46 +02:00
Dylan Araps
e213ee7e58 Merge pull request #1151 from dylanaraps/song_fix5
song: Fix various issues
2019-01-07 17:14:57 +02:00
Dylan Araps
ee30f29da9 song: Added config option to display music player 2019-01-07 17:16:18 +02:00
Dylan Araps
763f3a9af5 song: Add netease to comment. 2019-01-07 17:09:29 +02:00
Dylan Araps
bbb06ad4a9 song: Remove gpmdp-remote support as tool is unmaintained. 2019-01-07 16:40:55 +02:00
Dylan Araps
faae04f0ee song: Remove gpmdp-remote support as tool is unmaintained. 2019-01-07 16:39:56 +02:00
Dylan Araps
186093ddc0 song: Fix qmmp 2019-01-07 16:28:36 +02:00
Dylan Araps
ae2384dca8 song: Fix deadbeef 2019-01-07 16:25:44 +02:00
Dylan Araps
9b2796e168 general: Added new simple mode for script usage 2019-01-07 16:13:59 +02:00
Dylan Araps
c29ecc3fae general: Added new simple mode for script usage 2019-01-07 16:11:00 +02:00
Dylan Araps
6f6b67f387 general: Added new simple mode for script usage 2019-01-07 16:10:53 +02:00
Dylan Araps
c47826225e song: Added support for netease cloud music 2019-01-07 15:17:05 +02:00
Dylan Araps
17a56081a5 ascii: Added support for Huayra Linux. Closes #1138 2019-01-07 09:18:35 +02:00
Dylan Araps
27258fb93c ascii: Added support for Huayra Linux. Closes #1138 2019-01-07 09:17:40 +02:00
Dylan Araps
86711645a0 song: Fix issues with broken newlines 2019-01-07 09:07:24 +02:00
Dylan Araps
8a96fd545d song: Fix issues with non-english tags 2019-01-07 09:03:24 +02:00
Dylan Araps
6c966b05ae Merge branch 'master' of github.com:dylanaraps/neofetch 2019-01-04 21:22:48 +02:00
Dylan Araps
45d632d1f6 docs: update 2019-01-04 21:22:41 +02:00
Dylan Araps
cc1be73077 docs: update 2019-01-04 21:21:59 +02:00
Dylan Araps
c8a32768b7 Merge pull request #1132 from Phuurl/master
Adds scoop package manager support
2019-01-04 20:51:17 +02:00
Phuurl
acdd6828f8 Adds scoop package manager support 2018-12-06 22:58:29 +00:00
4 changed files with 392 additions and 130 deletions

View File

@@ -18,6 +18,6 @@ install:
script: script:
- time ./neofetch --travis -v - time ./neofetch --travis -v
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck neofetch; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck -e SC2244 -e SC2243 neofetch; fi
# Check for lines longer than 100 chars. # Check for lines longer than 100 chars.
- if grep '.\{102\}' neofetch; then (exit 1); else (exit 0); fi - if grep '.\{102\}' neofetch; then (exit 1); else (exit 0); fi

View File

@@ -7,37 +7,106 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased] ## [Unreleased]
<img src="https://i.imgur.com/ZQI2EYz.png" alt="logo" height="100px">
**Contributors** **Contributors**
- [**@nero**](https://github.com/nero) [**@konimex**](https://github.com/konimex), [**@iandrewt**](https://github.com/iandrewt), [**@arisinfenix**](https://github.com/arisinfenix), [**@xPMo**](https://github.com/xPMo), [**@nero**](https://github.com/nero), [**@alyssais**](https://github.com/alyssais), [**@plgruener**](https://github.com/plgruener), [**@StarryTony**](https://github.com/StarryTony), [**@julianaito**](https://github.com/julianaito), [**@HolyStephano**](https://github.com/HolyStephano), [**@nikitenich**](https://github.com/nikitenich), [**@Appadeia**](https://github.com/Appadeia), [**@marlonn**](https://github.com/marlonn), [**@Snuggle**](https://github.com/dylanaraps/neofetch/commits?author=Snuggle), [**@Phuurl**](https://github.com/Phuurl), [**@erikdubois**](https://github.com/erikdubois)
- [**@alyssais**](https://github.com/alyssais)
- [**@plgruener**](https://github.com/plgruener) **OS**
- [**@StarryTony**](https://github.com/StarryTony)
- [**@julianaito**](https://github.com/julianaito) - Added support for Bedrock Linux. [**@paradigm**](https://github.com/paradigm)
- [**@HolyStephano**](https://github.com/HolyStephano) - Added support for Namib GNU/Linux. [**@arisinfenix**](https://github.com/arisinfenix)
- [**@nikitenich**](https://github.com/nikitenich) - Added support for Reborn OS. [**@iandrewt**](https://github.com/iandrewt)
- Added support for OpenMandriva Lx. [**@konimex**](https://github.com/konimex)
- Added support for Star. [**@arisinfenix**](https://github.com/arisinfenix)
- Added support for BlueLight OS.
- Added support for Huayra Linux.
- Added support for Pentoo.
**Highlights**
- [ASCII] Added support for command output. You can now use whatever terminal commands you like as the ASCII art.
```sh
# Use fortune and cowsay as ascii art.
neofetch --ascii "$(fortune|cowsay -W 30)"
# use figlet as ascii art.
neofetch --ascii "$(figlet -w 30 hello world)"
```
<img src="https://i.imgur.com/ozoXAvz.jpg" alt="scrot" height="400px">
- Added a new "simple" mode. You can now use neofetch for scripting by getting it to output individual info functions in plain text.
```sh
# Example:
neofetch uptime --uptime_shorthand tiny
> uptime: 32m
# Example:
neofetch uptime disk wm memory
> uptime: 33 mins
> disk (/): 212G / 235G (96%)
> wm: Openbox
> memory: 1215MiB / 7881MiB
# This can be used in bars and scripts like so:
memory="$(neofetch memory)"; memory="${memory##*: }"
# For multiple outputs at once (each line of info in an array):
# Much faster than running neofetch multiple times.
IFS=$'\n' read -d "" -ra info < <(neofetch memory uptime wm)
info=("${info[@]##*: }")
```
**Info** **Info**
- **Song**: Added snippet to display music player.
- `[[ $player ]] && prin "Music Player" "$player"`
- NOTE: Must have `info "Song" song` enabled.
- **Song**: Added support for Netease Cloud.
- **Song**: Fixed issues in various players. [**@arisinfenix**](https://github.com/arisinfenix) [**@xPMo**](https://github.com/xPMo)
- **Song**: Fixed issues with non-English tags.
- **Song**: Fixed issues with broken newlines.
- **Song**: Fixed issues with Deadbeef.
- **Song**: Fixed issues with `qmmp`.
- **Song**: Removed `gpmdp-remote` support (unmaintained/no longer works).
- **Shell**: Fixed output for mksh [**@nero**](https://github.com/nero) - **Shell**: Fixed output for mksh [**@nero**](https://github.com/nero)
- **Packages**: Added support for `scoop`. [**@Phuurl**](https://github.com/Phuurl)
- **Packages**: Added support for `puyo`. [**@Appadeia**](https://github.com/Appadeia)
- **Packages**: Added support for `spm`. [**@Appadeia**](https://github.com/author=Appadeia)
- **Packages** [macOS]: Added detection of Nix [**@alyssais**](https://github.com/alyssais) - **Packages** [macOS]: Added detection of Nix [**@alyssais**](https://github.com/alyssais)
- **Packages**: Fixed packages from pkginfo (pkgutils) not appearing in CRUX/Janus Linux. - **Packages**: Fixed packages from pkginfo (pkgutils) not appearing in CRUX/Janus Linux.
- **Terminal Font**: Added support for Yakuake [**@plgruener**](https://github.com/plgruener) - **Terminal Font**: Added support for Yakuake [**@plgruener**](https://github.com/plgruener)
- **Terminal Font** [Kitty]: Use `kitty --debug-config` to get font information.
- **Memory** [Solaris]: Updated memory detection to use pages. [**@konimex**](https://github.com/konimex)
- **Model** [OpenBSD]: Added vmm (OpenBSD hypervisor) support [**@julianaito**](https://github.com/julianaito) - **Model** [OpenBSD]: Added vmm (OpenBSD hypervisor) support [**@julianaito**](https://github.com/julianaito)
- **Model** [macOS]: Added VirtualSMC as a new FakeSMC alternative for Hackintosh. [**@nikitenich**](https://github.com/nikitenich) - **Model** [macOS]: Added VirtualSMC as a new FakeSMC alternative for Hackintosh. [**@nikitenich**](https://github.com/nikitenich)
- **WM**: Added detection for FVWM. [**@julianaito**](https://github.com/julianaito) - **WM**: Added detection for FVWM. [**@julianaito**](https://github.com/julianaito)
- **WM** [OpenBSD]: Added a new `ps_flags` to correctly detect non-EWMH WMs. [**@julianaito**](https://github.com/julianaito) - **WM** [OpenBSD]: Added a new `ps_flags` to correctly detect non-EWMH WMs. [**@julianaito**](https://github.com/julianaito)
- **Disk** [OpenBSD]: Added a separate disk array creation using `awk` since one cannot directly use `/dev/...` unless being root or in the `operator` group. [**@julianaito**](https://github.com/julianaito) - **Disk** [OpenBSD]: Added a separate disk array creation using `awk` since one cannot directly use `/dev/...` unless being root or in the `operator` group. [**@julianaito**](https://github.com/julianaito)
- **Battery** [OpenBSD]: Improve charge `%` and add status. **Charlène**
- **GPU** [AMD]: Remove unnecessary check.
**ASCII** **ASCII**
- Added support for command output.
- `neofetch --ascii "$(fortune|cowsay -W 30)"`
- `neofetch --ascii "$(figlet -w 30 hello world)"`
- Added small ArcoLinux logo. [**@erikdubois**](https://github.com/erikdubois)
- Added new Lubuntu logo. [**@marlonn**](https://github.com/marlonn)
- Fixed a bug where ASCII logo changes the terminal foreground color. [**@plgruener**](https://github.com/plgruener) - Fixed a bug where ASCII logo changes the terminal foreground color. [**@plgruener**](https://github.com/plgruener)
- Fixed a bug when files named `auto` or `ascii` exist.
- Do not parse file as ASCII if the source is an image file. - Do not parse file as ASCII if the source is an image file.
**Image** **Image**
- **macOS**: Unset IFS to get window size. [**@StarryTony**](https://github.com/StarryTony) - **macOS**: Unset IFS to get window size. [**@StarryTony**](https://github.com/StarryTony)
- **Kitty**: Use `kitty +kitten icat` instead of the deprecated `kitty icat`. [**@HolyStephano**](https://github.com/HolyStephano) - **Kitty**: Use `kitty +kitten icat` instead of the deprecated `kitty icat`. [**@HolyStephano**](https://github.com/HolyStephano)
- **Kitty**: Update docs. [**@Snuggle**](https://github.com/dylanaraps/neofetch/commits?author=Snuggle)
- Cached thumbnails are now stored with PATH to prevent collision issues.
## [5.0.0] - 2018-06-18 ## [5.0.0] - 2018-06-18

396
neofetch
View File

@@ -28,7 +28,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
version="5.0.1" version="6.0.0"
bash_version="${BASH_VERSION/.*}" bash_version="${BASH_VERSION/.*}"
sys_locale="${LANG:-C}" sys_locale="${LANG:-C}"
@@ -76,14 +76,13 @@ print_info() {
# info "Battery" battery # info "Battery" battery
# info "Font" font # info "Font" font
# info "Song" song # info "Song" song
# [[ $player ]] && prin "Music Player" "$player"
# info "Local IP" local_ip # info "Local IP" local_ip
# info "Public IP" public_ip # info "Public IP" public_ip
# info "Users" users # info "Users" users
# info "Locale" locale # This only works on glibc systems. # info "Locale" locale # This only works on glibc systems.
info line_break
info cols info cols
info line_break
} }
@@ -143,6 +142,21 @@ os_arch="on"
uptime_shorthand="on" uptime_shorthand="on"
# Memory
# Show memory pecentage in output.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --memory_percent
#
# Example:
# on: '1801MiB / 7881MiB (22%)'
# off: '1801MiB / 7881MiB'
memory_percent="off"
# Packages # Packages
@@ -361,6 +375,12 @@ gtk3="on"
# Flag: --ip_host # Flag: --ip_host
public_ip_host="http://ident.me" public_ip_host="http://ident.me"
# Public IP timeout.
#
# Default: '2'
# Values: 'int'
# Flag: --ip_timeout
public_ip_timeout=2
# Disk # Disk
@@ -429,7 +449,6 @@ disk_subtitle="mount"
# exaile # exaile
# gnome-music # gnome-music
# gmusicbrowser # gmusicbrowser
# Google Play
# guayadeque # guayadeque
# iTunes # iTunes
# juk # juk
@@ -437,6 +456,7 @@ disk_subtitle="mount"
# mocp # mocp
# mopidy # mopidy
# mpd # mpd
# netease-cloud-music
# pogo # pogo
# pragha # pragha
# qmmp # qmmp
@@ -649,7 +669,8 @@ disk_display="off"
# Image backend. # Image backend.
# #
# Default: 'ascii' # Default: 'ascii'
# Values: 'ascii', 'caca', 'jp2a', 'iterm2', 'off', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend # Flag: --backend
image_backend="ascii" image_backend="ascii"
@@ -659,6 +680,7 @@ image_backend="ascii"
# #
# Default: 'auto' # Default: 'auto'
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")'
# Flag: --source # Flag: --source
# #
# NOTE: 'auto' will pick the best image source for whatever image backend is used. # NOTE: 'auto' will pick the best image source for whatever image backend is used.
@@ -827,7 +849,12 @@ get_distro() {
case "$os" in case "$os" in
"Linux" | "BSD" | "MINIX") "Linux" | "BSD" | "MINIX")
if [[ -f "/etc/redstar-release" ]]; then if [[ -f /bedrock/etc/bedrock-release && $PATH == */bedrock/cross/* ]]; then
case "$distro_shorthand" in
"on" | "tiny") distro="Bedrock Linux" ;;
*) distro="$(< /bedrock/etc/bedrock-release)"
esac
elif [[ -f "/etc/redstar-release" ]]; then
case "$distro_shorthand" in case "$distro_shorthand" in
"on" | "tiny") distro="Red Star OS" ;; "on" | "tiny") distro="Red Star OS" ;;
*) distro="Red Star OS $(awk -F'[^0-9*]' '$0=$2' /etc/redstar-release)" *) distro="Red Star OS $(awk -F'[^0-9*]' '$0=$2' /etc/redstar-release)"
@@ -898,11 +925,6 @@ get_distro() {
"tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;; "tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;;
"off") distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;; "off") distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;;
esac esac
# Workarounds for distros that go against the os-release standard.
[[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}')" "${files[@]}"
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}')" "${files[@]}"
else else
for release_file in /etc/*-release; do for release_file in /etc/*-release; do
distro+="$(< "$release_file")" distro+="$(< "$release_file")"
@@ -1270,6 +1292,16 @@ get_packages() {
pac() { (($1 > 0)) && { managers+=("$1 (${manager})"); manager_string+="${manager}, "; }; } pac() { (($1 > 0)) && { managers+=("$1 (${manager})"); manager_string+="${manager}, "; }; }
tot() { IFS=$'\n' read -d "" -ra pkgs < <("$@");((packages+="${#pkgs[@]}"));pac "${#pkgs[@]}"; } tot() { IFS=$'\n' read -d "" -ra pkgs < <("$@");((packages+="${#pkgs[@]}"));pac "${#pkgs[@]}"; }
# Redefine tot() for Bedrock Linux.
[[ -f /bedrock/etc/bedrock-release && $PATH == */bedrock/cross/* ]] && {
tot() {
IFS=$'\n' read -d "" -ra pkgs < <(for s in $(brl list); do strat -r "$s" "$@"; done)
((packages+="${#pkgs[@]}"))
pac "${#pkgs[@]}"
}
br_prefix="/bedrock/strata/*"
}
case "$os" in case "$os" in
"Linux" | "BSD" | "iPhone OS" | "Solaris") "Linux" | "BSD" | "iPhone OS" | "Solaris")
# Package Manager Programs. # Package Manager Programs.
@@ -1287,22 +1319,30 @@ get_packages() {
has "sorcery" && tot gaze installed has "sorcery" && tot gaze installed
has "alps" && tot alps showinstalled has "alps" && tot alps showinstalled
has "butch" && tot butch list has "butch" && tot butch list
has "pkginfo" && tot pkginfo -i
# Counting files/dirs. # Counting files/dirs.
has "emerge" && dir /var/db/pkg/*/*/ # Variables need to be unquoted here. Only Bedrock Linux is affected.
has "nix-env" && dir /nix/store/*/ # $br_prefix is fixed and won't change based on user input so this is safe either way.
has "guix" && dir /gnu/store/*/ # shellcheck disable=SC2086
has "Compile" && dir /Programs/*/ {
has "eopkg" && dir /var/lib/eopkg/package/* has "emerge" && dir ${br_prefix}/var/db/pkg/*/*/
has "crew" && dir /usr/local/etc/crew/meta/*.filelist has "nix-env" && dir ${br_prefix}/nix/store/*/
has "pkgtool" && dir /var/log/packages/* has "guix" && dir ${br_prefix}/gnu/store/*/
has "cave" && dir /var/db/paludis/repositories/cross-installed/*/data/*/ \ has "Compile" && dir ${br_prefix}/Programs/*/
/var/db/paludis/repositories/installed/data/*/ has "eopkg" && dir ${br_prefix}/var/lib/eopkg/package/*
has "crew" && dir ${br_prefix}/usr/local/etc/crew/meta/*.filelist
has "pkgtool" && dir ${br_prefix}/var/log/packages/*
has "cave" && dir ${br_prefix}/var/db/paludis/repositories/cross-installed/*/data/*/ \
${br_prefix}/var/db/paludis/repositories/installed/data/*/
}
# Other (Needs complex command) # Other (Needs complex command)
has "kpm-pkg" && ((packages+="$(kpm --get-selections | grep -cv deinstall$)")) has "kpm-pkg" && ((packages+="$(kpm --get-selections | grep -cv deinstall$)"))
# pkginfo is also the name of a python package manager which is painfully slow.
# TODO: Fix this somehow.
has pkginfo && tot pkginfo -i
case "$kernel_name" in case "$kernel_name" in
"FreeBSD") has "pkg" && tot pkg info ;; "FreeBSD") has "pkg" && tot pkg info ;;
*) *)
@@ -1341,6 +1381,9 @@ get_packages() {
"MSYS"*) has "pacman" && tot pacman -Qq --color never ;; "MSYS"*) has "pacman" && tot pacman -Qq --color never ;;
esac esac
# Scoop environment throws errors if `tot scoop list` is used
has "scoop" && dir ~/scoop/apps/* && ((packages-=1))
# Count chocolatey packages. # Count chocolatey packages.
[[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \ [[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \
dir /cygdrive/c/ProgramData/chocolatey/lib/* dir /cygdrive/c/ProgramData/chocolatey/lib/*
@@ -2270,8 +2313,8 @@ get_memory() {
"Solaris") "Solaris")
hw_pagesize="$(pagesize)" hw_pagesize="$(pagesize)"
pages_total=$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}') pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
pages_free=$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}') pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
mem_total="$((pages_total * hw_pagesize / 1024 / 1024))" mem_total="$((pages_total * hw_pagesize / 1024 / 1024))"
mem_free="$((pages_free * hw_pagesize / 1024 / 1024))" mem_free="$((pages_free * hw_pagesize / 1024 / 1024))"
mem_used="$((mem_total - mem_free))" mem_used="$((mem_total - mem_free))"
@@ -2311,7 +2354,10 @@ get_memory() {
;; ;;
esac esac
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB}"
[[ $memory_percent == on ]] && ((mem_perc=mem_used * 100 / mem_total))
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB} ${mem_perc:+(${mem_perc}%)}"
# Bars. # Bars.
case "$memory_display" in case "$memory_display" in
@@ -2336,7 +2382,6 @@ get_song() {
"exaile" "exaile"
"gnome-music" "gnome-music"
"gmusicbrowser" "gmusicbrowser"
"Google Play"
"guayadeque" "guayadeque"
"iTunes" "iTunes"
"juk" "juk"
@@ -2344,6 +2389,7 @@ get_song() {
"mocp" "mocp"
"mopidy" "mopidy"
"mpd" "mpd"
"netease-cloud-music"
"pogo" "pogo"
"pragha" "pragha"
"qmmp" "qmmp"
@@ -2381,10 +2427,9 @@ get_song() {
case "${player/*\/}" in case "${player/*\/}" in
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;; "mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
"mocp"*) song="$(mocp -Q '%artist\n%album\n%song')" ;; "mocp"*) song="$(mocp -Q '%artist\n%album\n%song')" ;;
"google play"*) song="$(gpmdp-remote current)" ;; "deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\\n%album%\\n%title%')" ;;
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\n%album%\n%title%')" ;;
"xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;; "xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p\n%a\n%t')" ;; "qmmp"*) song="$(qmmp --nowplaying '%p\\n%a\\n%t')" ;;
"gnome-music"*) get_song_dbus "GnomeMusic" ;; "gnome-music"*) get_song_dbus "GnomeMusic" ;;
"lollypop"*) get_song_dbus "Lollypop" ;; "lollypop"*) get_song_dbus "Lollypop" ;;
"clementine"*) get_song_dbus "clementine" ;; "clementine"*) get_song_dbus "clementine" ;;
@@ -2404,6 +2449,7 @@ get_song() {
"dragon"*) get_song_dbus "dragonplayer" ;; "dragon"*) get_song_dbus "dragonplayer" ;;
"smplayer"*) get_song_dbus "smplayer" ;; "smplayer"*) get_song_dbus "smplayer" ;;
"rhythmbox"*) get_song_dbus "rhythmbox" ;; "rhythmbox"*) get_song_dbus "rhythmbox" ;;
"netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;;
"cmus"*) "cmus"*)
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "}; song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
@@ -2464,22 +2510,28 @@ get_song() {
/"title"/ {t=$4} END {print a "\n" b "\n" t}')" /"title"/ {t=$4} END {print a "\n" b "\n" t}')"
;; ;;
*) mpc &>/dev/null && song="$(mpc -f '%artist%\n%album%\n%title%' current)" ;; *) mpc &>/dev/null && song="$(mpc -f '%artist%\n%album%\n%title%' current)" || return ;;
esac esac
[[ "$song" != *[a-z]* ]] && { unset -v song; return; } IFS=$'\n' read -d "" -r artist album title <<< "${song//'\n'/$'\n'}"
IFS=$'\n' read -d "" -r artist album title <<< "$song" # Make sure empty tags are truly empty.
artist="$(trim "$artist")"
album="$(trim "$album")"
title="$(trim "$title")"
# Set default values if no tags were found.
: "${artist:=Unknown Artist}" "${album:=Unknown Album}" "${title:=Unknown Song}"
# Display Artist, Album and Title on separate lines. # Display Artist, Album and Title on separate lines.
if [[ "$song_shorthand" == "on" ]]; then if [[ "$song_shorthand" == "on" ]]; then
[[ "$(trim "$artist")" ]] && prin "Artist" "$artist" prin "Artist" "$artist"
[[ "$(trim "$album")" ]] && prin "Album" "$album" prin "Album" "$album"
[[ "$(trim "$song")" ]] && prin "Song" "$title" prin "Song" "$title"
else else
song="${song_format/\%artist\%/${artist}}" song="${song_format/\%artist\%/$artist}"
song="${song/\%album\%/${album}}" song="${song/\%album\%/$album}"
song="${song/\%title\%/${title}}" song="${song/\%title\%/$title}"
fi fi
} }
@@ -2566,6 +2618,7 @@ get_resolution() {
esac esac
resolution="${resolution%,*}" resolution="${resolution%,*}"
[[ -z ${resolution/x} ]] && resolution=
} }
get_style() { get_style() {
@@ -2867,21 +2920,11 @@ END
;; ;;
"kitty"*) "kitty"*)
shopt -s nullglob kitty_config="$(kitty --debug-config)"
confs=({$KITTY_CONFIG_DIRECTORY,$XDG_CONFIG_HOME,~/Library/Preferences}/kitty/kitty.con?) term_font_size="${kitty_config/*font_size}"
shopt -u nullglob term_font_size="${term_font_size/$'\n'*}"
term_font="${kitty_config/*font_family}"
[[ -f "${confs[0]}" ]] || return term_font="${term_font/$'\n'*} $term_font_size"
term_font="$(awk '/^([[:space:]]*|[^#_])font_family[[:space:]]+/ {
$1 = "";
gsub(/^[[:space:]]/, "");
font = $0
}
/^([[:space:]]*|[^#_])font_size[[:space:]]+/ {
size = $2
}
END {print font,size}' "${confs[0]}")"
;; ;;
"konsole" | "yakuake") "konsole" | "yakuake")
@@ -3272,11 +3315,11 @@ get_public_ip() {
fi fi
if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then
public_ip="$(curl --max-time 10 -w '\n' "$public_ip_host")" public_ip="$(curl --max-time "$public_ip_timeout" -w '\n' "$public_ip_host")"
fi fi
if [[ -z "$public_ip" ]] && type -p wget >/dev/null; then if [[ -z "$public_ip" ]] && type -p wget >/dev/null; then
public_ip="$(wget -T 10 -qO- "$public_ip_host")" public_ip="$(wget -T "$public_ip_timeout" -qO- "$public_ip_host")"
fi fi
} }
@@ -3302,6 +3345,7 @@ get_gpu_driver() {
gpu_driver="NVIDIA ${gpu_driver/ *}" gpu_driver="NVIDIA ${gpu_driver/ *}"
fi fi
;; ;;
"Mac OS X") "Mac OS X")
if [[ "$(kextstat | grep "GeForceWeb")" != "" ]]; then if [[ "$(kextstat | grep "GeForceWeb")" != "" ]]; then
gpu_driver="NVIDIA Web Driver" gpu_driver="NVIDIA Web Driver"
@@ -3344,9 +3388,9 @@ get_cols() {
cols="${cols//nl/\\n\\e[${text_padding}C${zws}}" cols="${cols//nl/\\n\\e[${text_padding}C${zws}}"
# Add block height to info height. # Add block height to info height.
((info_height+=block_height-1)) ((info_height+=block_range[1]>7?block_height+3:block_height+2))
printf '\e[%bC%b' "$text_padding" "${zws}${cols}" printf '\n\e[%bC%b\n\n' "$text_padding" "${zws}${cols}"
fi fi
unset -v blocks blocks2 cols unset -v blocks blocks2 cols
@@ -3369,7 +3413,7 @@ image_backend() {
"ascii") get_ascii ;; "ascii") get_ascii ;;
"off") image_backend="off" ;; "off") image_backend="off" ;;
"caca" | "jp2a" | "iterm2" | "termpix" |\ "caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty") "tycat" | "w3m" | "sixel" | "pixterm" | "kitty")
get_image_source get_image_source
@@ -3394,7 +3438,7 @@ image_backend() {
*) *)
err "Image: Unknown image backend specified '$image_backend'." err "Image: Unknown image backend specified '$image_backend'."
err "Image: Valid backends are: 'ascii', 'caca', 'jp2a', 'iterm2', 'kitty', err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty',
'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')" 'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')"
err "Image: Falling back to ascii mode." err "Image: Falling back to ascii mode."
get_ascii get_ascii
@@ -3406,20 +3450,25 @@ image_backend() {
} }
get_ascii() { get_ascii() {
if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then [[ ! "$image_source" =~ (ascii|auto) ]] &&
ascii_data="$(< "$image_source")" if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then
else ascii_data="$(< "$image_source")"
err "Ascii: Ascii file not found, using distro ascii." else
fi ascii_data="$image_source"
fi
# Set locale to get correct padding. # Set locale to get correct padding.
LC_ALL="$sys_locale" LC_ALL="$sys_locale"
# Calculate size of ascii file in line length / line count. # Calculate size of ascii file in line length / line count.
while IFS=$'\n' read -r line; do while IFS=$'\n' read -r line; do
((++lines,${#line}>ascii_length)) && ascii_length="${#line}" line="${line//\\\\/\\}"
((++lines,${#line}>ascii_len)) && ascii_len="${#line}"
done <<< "${ascii_data//\$\{??\}}" done <<< "${ascii_data//\$\{??\}}"
# Fallback if file not found.
((lines==1)) && { lines=; ascii_len=; image_source="auto"; get_distro_ascii; get_ascii; return; }
# Colors. # Colors.
ascii_data="${ascii_data//\$\{c1\}/$c1}" ascii_data="${ascii_data//\$\{c1\}/$c1}"
ascii_data="${ascii_data//\$\{c2\}/$c2}" ascii_data="${ascii_data//\$\{c2\}/$c2}"
@@ -3428,7 +3477,7 @@ get_ascii() {
ascii_data="${ascii_data//\$\{c5\}/$c5}" ascii_data="${ascii_data//\$\{c5\}/$c5}"
ascii_data="${ascii_data//\$\{c6\}/$c6}" ascii_data="${ascii_data//\$\{c6\}/$c6}"
((text_padding=ascii_length+gap)) ((text_padding=ascii_len+gap))
printf '%b\n' "$ascii_data${reset}" printf '%b\n' "$ascii_data${reset}"
LC_ALL=C LC_ALL=C
} }
@@ -3677,15 +3726,18 @@ get_image_size() {
*) image_size="${image_size/px}" ;; *) image_size="${image_size/px}" ;;
esac esac
# Check for terminal padding.
[[ $image_backend == w3m ]] && term_padding
width="${width:-$image_size}" width="${width:-$image_size}"
height="${height:-$image_size}" height="${height:-$image_size}"
text_padding="$((width / font_width + gap + xoffset/font_width))" text_padding="$(((width + padding + xoffset) / font_width + gap))"
} }
make_thumbnail() { make_thumbnail() {
# Name the thumbnail using variables so we can # Name the thumbnail using variables so we can
# use it later. # use it later.
image_name="${crop_mode}-${crop_offset}-${width}-${height}-${image##*/}" image_name="${crop_mode}-${crop_offset}-${width}-${height}-${image//\/}"
# Handle file extensions. # Handle file extensions.
case "${image##*.}" in case "${image##*.}" in
@@ -3740,11 +3792,9 @@ make_thumbnail() {
-background none \ -background none \
"$image" \ "$image" \
-strip \ -strip \
-define "jpeg:size=100x100" \
-gravity "$crop_offset" \ -gravity "$crop_offset" \
-crop "${size}x${size}+0+0" \ -crop "${size}x${size}+0+0" \
-quality 40 \ -scale "${width}x${height}" \
-sample "${width}x${height}" \
"${thumbnail_dir}/${image_name}" "${thumbnail_dir}/${image_name}"
;; ;;
esac esac
@@ -3758,17 +3808,21 @@ display_image() {
case "$image_backend" in case "$image_backend" in
"caca") "caca")
img2txt \ img2txt \
-W "$((width / font_width)))" \ -W "$((width / font_width))" \
-H "$((height / font_height))" \ -H "$((height / font_height))" \
--gamma=0.6 \ --gamma=0.6 \
"$image" "$image"
;; ;;
"chafa")
chafa --size="$((width / font_width))x$((height / font_height))" "$image"
;;
"jp2a") "jp2a")
jp2a \ jp2a \
--colors \
--width="$((width / font_width))" \ --width="$((width / font_width))" \
--height="$((height / font_height))" \ --height="$((height / font_height))" \
--colors \
"$image" "$image"
;; ;;
@@ -3822,7 +3876,7 @@ display_image() {
# Add a tiny delay to fix issues with images not # Add a tiny delay to fix issues with images not
# appearing in specific terminal emulators. # appearing in specific terminal emulators.
sleep 0.05 ((BASH_VERSINFO[0]>3)) && sleep 0.05
printf '%b\n%s;\n%s\n' "0;1;$xoffset;$yoffset;$width;$height;;;;;$image" 3 4 |\ printf '%b\n%s;\n%s\n' "0;1;$xoffset;$yoffset;$width;$height;;;;;$image" 3 4 |\
"${w3m_img_path:-false}" -bg "$background_color" &>/dev/null "${w3m_img_path:-false}" -bg "$background_color" &>/dev/null
;; ;;
@@ -3899,7 +3953,7 @@ prin() {
string="${subtitle_color}${bold}${string}" string="${subtitle_color}${bold}${string}"
# Print the info. # Print the info.
printf '%b\n' "${text_padding:+\e[${text_padding}C}${zws}${string}${reset} " printf '%b\n' "${text_padding:+\e[${text_padding}C}${zws}${string//\\n}${reset} "
# Calculate info height. # Calculate info height.
((++info_height)) ((++info_height))
@@ -3920,17 +3974,6 @@ get_underline() {
prin=1 prin=1
} }
get_line_break() {
# Print it directly.
printf '%b\n' "$zws"
# Calculate info height.
((++info_height))
# Tell info() that we printed manually.
prin=1
}
get_bold() { get_bold() {
case "$ascii_bold" in case "$ascii_bold" in
"on") ascii_bold='\e[1m' ;; "on") ascii_bold='\e[1m' ;;
@@ -4030,18 +4073,9 @@ color() {
stdout() { stdout() {
image_backend="off" image_backend="off"
unset subtitle_color unset subtitle_color colon_color info_color underline_color bold title_color at_color \
unset colon_color text_padding zws reset color_blocks bar_color_elapsed bar_color_total \
unset info_color c1 c2 c3 c4 c5 c6 c7 c8
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
} }
err() { err() {
@@ -4160,9 +4194,23 @@ kde_config_dir() {
kde_config_dir="${kde_config_dir/$'/:'*}" kde_config_dir="${kde_config_dir/$'/:'*}"
} }
term_padding() {
# Get terminal padding to properly align cursor.
[[ -z $term ]] && get_term
case "$term" in
urxvt*|"rxvt-unicode")
[[ -z "$xrdb" ]] && xrdb="$(xrdb -query)"
padding="${xrdb/*.internalBorder:}"
((padding=${padding/$'\n'*}))
;;
esac
}
dynamic_prompt() { dynamic_prompt() {
[[ "$image_backend" == "off" ]] && { printf '\n'; return; } [[ $image_backend == off ]] && { printf '\n'; return; }
[[ "$image_backend" != "ascii" ]] && lines="$(((height + yoffset) / font_height + 1))" [[ $image_backend != ascii ]] && ((lines=(height + yoffset) / font_height + 1))
[[ $image_backend == w3m ]] && ((lines=lines + padding / font_height + 1))
# If the ascii art is taller than the info. # If the ascii art is taller than the info.
((lines=lines>info_height?lines-info_height+1:1)) ((lines=lines>info_height?lines-info_height+1:1))
@@ -4239,7 +4287,7 @@ decode_url() {
# FINISH UP # FINISH UP
usage() { printf "%s" "\ usage() { printf "%s" "\
Usage: neofetch --option \"value\" --option \"value\" Usage: neofetch func_name --option \"value\" --option \"value\"
Neofetch is a CLI system information tool written in BASH. Neofetch Neofetch is a CLI system information tool written in BASH. Neofetch
displays information about your system next to an image, your OS logo, displays information about your system next to an image, your OS logo,
@@ -4250,6 +4298,23 @@ NOTE: Every launch flag has a config option.
Options: Options:
INFO: INFO:
func_name Specify a function name (second part of info() from config) to
quickly display only that function's information.
Example: neofetch uptime --uptime_shorthand tiny
Example: neofetch uptime disk wm memory
This can be used in bars and scripts like so:
memory=\"\$(neofetch memory)\"; memory=\"\${memory##*: }\"
For multiple outputs at once (each line of info in an array):
IFS=\$'\\n' read -d \"\" -ra info < <(neofetch memory uptime wm)
info=(\"\${info[@]##*: }\")
--disable infoname Allows you to disable an info line from appearing --disable infoname Allows you to disable an info line from appearing
in the output. 'infoname' is the function name from the in the output. 'infoname' is the function name from the
'print_info()' function inside the config file. 'print_info()' function inside the config file.
@@ -4320,8 +4385,10 @@ INFO:
'dir' shows the basename of the disks's path. (/, Local Disk, etc) 'dir' shows the basename of the disks's path. (/, Local Disk, etc)
--ip_host url URL to query for public IP --ip_host url URL to query for public IP
--ip_timeout int Public IP timeout (in seconds).
--song_format format Print the song data in a specific format (see config file). --song_format format Print the song data in a specific format (see config file).
--song_shorthand on/off Print the Artist/Album/Title on separate lines. --song_shorthand on/off Print the Artist/Album/Title on separate lines.
--memory_percent on/off Display memory percentage.
--music_player player-name Manually specify a player to use. --music_player player-name Manually specify a player to use.
Available values are listed in the config file Available values are listed in the config file
@@ -4357,13 +4424,18 @@ BARS:
IMAGE BACKEND: IMAGE BACKEND:
--backend backend Which image backend to use. --backend backend Which image backend to use.
Possible values: 'ascii', 'caca', 'jp2a', 'iterm2', 'off', Possible values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2',
'sixel', 'tycat', 'w3m' 'off', 'sixel', 'tycat', 'w3m'
--source source Which image or ascii file to use. --source source Which image or ascii file to use.
Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img', Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img',
'/path/to/ascii', '/path/to/dir/' '/path/to/ascii', '/path/to/dir/', 'command output' [ascii]
--ascii source Shortcut to use 'ascii' backend. --ascii source Shortcut to use 'ascii' backend.
NEW: neofetch --ascii \"\$(fortune | cowsay -W 30)\"
--caca source Shortcut to use 'caca' backend. --caca source Shortcut to use 'caca' backend.
--chafa source Shortcut to use 'chafa' backend.
--iterm2 source Shortcut to use 'iterm2' backend. --iterm2 source Shortcut to use 'iterm2' backend.
--jp2a source Shortcut to use 'jp2a' backend. --jp2a source Shortcut to use 'jp2a' backend.
--kitty source Shortcut to use 'kitty' backend. --kitty source Shortcut to use 'kitty' backend.
@@ -4468,9 +4540,11 @@ get_args() {
"--shell_path") shell_path="$2" ;; "--shell_path") shell_path="$2" ;;
"--shell_version") shell_version="$2" ;; "--shell_version") shell_version="$2" ;;
"--ip_host") public_ip_host="$2" ;; "--ip_host") public_ip_host="$2" ;;
"--ip_timeout") public_ip_timeout="$2" ;;
"--song_format") song_format="$2" ;; "--song_format") song_format="$2" ;;
"--song_shorthand") song_shorthand="$2" ;; "--song_shorthand") song_shorthand="$2" ;;
"--music_player") music_player="$2" ;; "--music_player") music_player="$2" ;;
"--memory_percent") memory_percent="$2" ;;
"--cpu_temp") "--cpu_temp")
cpu_temp="$2" cpu_temp="$2"
[[ "$cpu_temp" == "on" ]] && cpu_temp="C" [[ "$cpu_temp" == "on" ]] && cpu_temp="C"
@@ -4546,7 +4620,7 @@ get_args() {
# Image backend # Image backend
"--backend") image_backend="$2" ;; "--backend") image_backend="$2" ;;
"--source") image_source="$2" ;; "--source") image_source="$2" ;;
"--ascii" | "--caca" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\ "--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
"--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty") "--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
image_backend="${1/--}" image_backend="${1/--}"
case "$2" in case "$2" in
@@ -4585,13 +4659,12 @@ get_args() {
"--ascii_distro") "--ascii_distro")
image_backend="ascii" image_backend="ascii"
ascii_distro="$2" ascii_distro="$2"
case "$2" in "-"* | "") ascii_distro="$distro" ;; esac
;; ;;
"--ascii_bold") ascii_bold="$2" ;; "--ascii_bold") ascii_bold="$2" ;;
"--logo" | "-L") "--logo" | "-L")
image_backend="ascii" image_backend="ascii"
print_info() { info line_break; } print_info() { printf '\n'; }
;; ;;
# Other # Other
@@ -4621,7 +4694,7 @@ get_args() {
"--json") "--json")
json="on" json="on"
unset -f get_title get_cols get_line_break get_underline unset -f get_title get_cols get_underline
printf '{\n' printf '{\n'
print_info 2>/dev/null print_info 2>/dev/null
@@ -4663,9 +4736,7 @@ get_args() {
info "Public IP" public_ip info "Public IP" public_ip
info "Users" users info "Users" users
info line_break
info cols info cols
info line_break
# Testing. # Testing.
prin "prin" prin "prin"
@@ -4693,6 +4764,24 @@ get_args() {
done done
} }
get_simple() {
while [[ "$1" ]]; do
[[ $(type -t "get_$1") == function ]] && {
get_distro
stdout
simple=1
info "$1" "$1"
}
shift
done
((simple)) && exit
}
old_functions() {
# Removed functions for backwards compatability.
get_line_break() { :; }
}
get_distro_ascii() { get_distro_ascii() {
# This function gets the distro ascii art and colors. # This function gets the distro ascii art and colors.
# #
@@ -5191,6 +5280,29 @@ ${c1}:syyyyyy/ :yyyyyy/${c2}-yyo.:syyyyyyyyyyy
EOF EOF
;; ;;
"Bedrock"*)
set_colors 8 7
read -rd '' ascii_data <<'EOF'
${c1}--------------------------------------
--------------------------------------
--------------------------------------
---${c2}\\\\\\\\\\\\\\\\\\\\\\\\${c1}-----------------------
----${c2}\\\\\\ \\\\\\${c1}----------------------
-----${c2}\\\\\\ \\\\\\${c1}---------------------
------${c2}\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\${c1}------
-------${c2}\\\\\\ \\\\\\${c1}-----
--------${c2}\\\\\\ \\\\\\${c1}----
---------${c2}\\\\\\ ______ \\\\\\${c1}---
----------${c2}\\\\\\ ///${c1}---
-----------${c2}\\\\\\ ///${c1}----
------------${c2}\\\\\\ ///${c1}-----
-------------${c2}\\\\\\////////////////${c1}------
--------------------------------------
--------------------------------------
--------------------------------------
EOF
;;
"Bitrig"*) "Bitrig"*)
set_colors 2 7 set_colors 2 7
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
@@ -5626,7 +5738,7 @@ EOF
"debian_small") "debian_small")
set_colors 1 7 3 set_colors 1 7 3
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1}_____ ${c1} _____
/ __ \\ / __ \\
| / | | / |
| \\___- | \\___-
@@ -6062,6 +6174,33 @@ yM${c2}MNNNNNNNmmmmmNNMmhs+/${c1}-`
EOF EOF
;; ;;
"Pentoo"*)
set_colors 5 7
read -rd '' ascii_data <<'EOF'
${c2} `:oydNNMMMMNNdyo:`
:yNMMMMMMMMMMMMMMMMNy:
:dMMMMMMMMMMMMMMMMMMMMMMd:
oMMMMMMMho/-....-/ohMMMMMMMo
oMMMMMMy. .yMMMMMMo
.MMMMMMo oMMMMMM.
+MMMMMm mMMMMM+
oMMMMMh hMMMMMo
//hMMMMMm//${c1}`${c2} ${c1}`${c2}////mMMMMMh//
MMMMMMMMMMM${c1}/${c2} ${c1}/o/`${c2} ${c1}.${c2}smMMMMMMMMMMM
MMMMMMMMMMm ${c1}`NMN:${c2} ${c1}.${c2}yMMMMMMMMMM
MMMMMMMMMMMh${c1}:.${c2} dMMMMMMMMM
MMMMMMMMMMMMMy${c1}.${c2} ${c1}-${c2}NMMMMMMMMM
MMMMMMMMMMMd:${c1}`${c2} ${c1}-${c2}yNMMMMMMMMMM
MMMMMMMMMMh${c1}`${c2} ${c1}./${c2}hNMMMMMMMMMMMM
MMMMMMMMMM${c1}s${c2} ${c1}.:${c2}ymMMMMMMMMMMMMMMM
MMMMMMMMMMN${c1}s:..-/${c2}ohNMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
EOF
;;
"gNewSense"*) "gNewSense"*)
set_colors 4 5 7 6 set_colors 4 5 7 6
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
@@ -6107,8 +6246,8 @@ EOF
"GoboLinux"*) "GoboLinux"*)
set_colors 5 4 6 2 set_colors 5 4 6 2
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1}_____ _ ${c1} _____ _
/ ____| | | / ____| | |
| | __ ___ | |__ ___ | | __ ___ | |__ ___
| | |_ |/ _ \| '_ \ / _ \ | | |_ |/ _ \| '_ \ / _ \
| |__| | (_) | |_) | (_) | | |__| | (_) | |_) | (_) |
@@ -6179,6 +6318,29 @@ ${c2} :dc'
EOF EOF
;; ;;
"Huayra"*)
set_colors 4 7
read -rd '' ascii_data <<'EOF'
${c2} `
. . `
`` - . .
`.` -` `. - `` .`
..`-`-` + - / .` ```
.--.+--`+:- :/.` .-``.`
-+/so::h:.d-`./:`.`
:hNhyMomy:os-...-. ````
.dhsshNmNhoo+:-``.```
${c1}`ohy:-${c2}NMds+::-.``
````${c1}.hNN+`${c2}mMNho/:-....````
````` `../dmNhoo+/:..``
```` .dh++o/:....`
.+s/` `/s-.-.:.`` ````
::` `::`..`
.` `..
``
EOF
;;
"Hyperbola"*) "Hyperbola"*)
set_colors 8 set_colors 8
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
@@ -8360,12 +8522,12 @@ EOF
set_colors 2 8 set_colors 2 8
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1} _______ ${c1} _______
_ \______ - _ \\______ -
| \ ___ \ | | \\ ___ \\ |
| | / \ | | | | / \ | |
| | \___/ | | | | \___/ | |
| \______ \_| | \\______ \\_|
-_______\ -_______\\
EOF EOF
;; ;;
@@ -8640,6 +8802,7 @@ main() {
eval "$config" eval "$config"
get_args "$@" get_args "$@"
get_simple "$@"
[[ "$verbose" != "on" ]] && exec 2>/dev/null [[ "$verbose" != "on" ]] && exec 2>/dev/null
get_distro get_distro
get_bold get_bold
@@ -8657,6 +8820,7 @@ main() {
image_backend image_backend
get_cache_dir get_cache_dir
old_functions
print_info print_info
dynamic_prompt dynamic_prompt

View File

@@ -1,10 +1,10 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.7. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH NEOFETCH "1" "October 2018" "Neofetch 5.0.1" "User Commands" .TH NEOFETCH "1" "January 2019" "Neofetch 6.0.0" "User Commands"
.SH NAME .SH NAME
Neofetch \- A fast, highly customizable system info script Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS .SH SYNOPSIS
.B neofetch .B neofetch
\fI\,--option "value" --option "value"\/\fR \fI\,func_name --option "value" --option "value"\/\fR
.SH DESCRIPTION .SH DESCRIPTION
Neofetch is a CLI system information tool written in BASH. Neofetch Neofetch is a CLI system information tool written in BASH. Neofetch
displays information about your system next to an image, your OS logo, displays information about your system next to an image, your OS logo,
@@ -14,6 +14,24 @@ NOTE: Every launch flag has a config option.
.SH OPTIONS .SH OPTIONS
.SS "INFO:" .SS "INFO:"
.TP .TP
func_name
Specify a function name (second part of info() from config) to
quickly display only that function's information.
.IP
Example: neofetch uptime \fB\-\-uptime_shorthand\fR tiny
.IP
Example: neofetch uptime disk wm memory
.IP
This can be used in bars and scripts like so:
.IP
memory="$(neofetch memory)"; memory="${memory##*: }"
.IP
For multiple outputs at once (each line of info in an array):
.IP
IFS=$'\en' read \fB\-d\fR "" \fB\-ra\fR info < <(neofetch memory uptime wm)
.IP
info=("${info[@]##*: }")
.TP
\fB\-\-disable\fR infoname \fB\-\-disable\fR infoname
Allows you to disable an info line from appearing Allows you to disable an info line from appearing
in the output. 'infoname' is the function name from the in the output. 'infoname' is the function name from the
@@ -120,12 +138,18 @@ Takes: name, mount, dir
\fB\-\-ip_host\fR url \fB\-\-ip_host\fR url
URL to query for public IP URL to query for public IP
.TP .TP
\fB\-\-ip_timeout\fR int
Public IP timeout (in seconds).
.TP
\fB\-\-song_format\fR format \fB\-\-song_format\fR format
Print the song data in a specific format (see config file). Print the song data in a specific format (see config file).
.TP .TP
\fB\-\-song_shorthand\fR on/off \fB\-\-song_shorthand\fR on/off
Print the Artist/Album/Title on separate lines. Print the Artist/Album/Title on separate lines.
.TP .TP
\fB\-\-memory_percent\fR on/off
Display memory percentage.
.TP
\fB\-\-music_player\fR player\-name \fB\-\-music_player\fR player\-name
Manually specify a player to use. Manually specify a player to use.
Available values are listed in the config file Available values are listed in the config file
@@ -193,20 +217,25 @@ Possible values: bar, infobar, barinfo, off
.TP .TP
\fB\-\-backend\fR backend \fB\-\-backend\fR backend
Which image backend to use. Which image backend to use.
Possible values: 'ascii', 'caca', 'jp2a', 'iterm2', 'off', Possible values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2',
\&'sixel', 'tycat', 'w3m' \&'off', 'sixel', 'tycat', 'w3m'
.TP .TP
\fB\-\-source\fR source \fB\-\-source\fR source
Which image or ascii file to use. Which image or ascii file to use.
Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img', Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img',
\&'/path/to/ascii', '/path/to/dir/' \&'/path/to/ascii', '/path/to/dir/', 'command output' [ascii]
.TP .TP
\fB\-\-ascii\fR source \fB\-\-ascii\fR source
Shortcut to use 'ascii' backend. Shortcut to use 'ascii' backend.
.IP
NEW: neofetch \fB\-\-ascii\fR "$(fortune | cowsay \fB\-W\fR 30)"
.TP .TP
\fB\-\-caca\fR source \fB\-\-caca\fR source
Shortcut to use 'caca' backend. Shortcut to use 'caca' backend.
.TP .TP
\fB\-\-chafa\fR source
Shortcut to use 'chafa' backend.
.TP
\fB\-\-iterm2\fR source \fB\-\-iterm2\fR source
Shortcut to use 'iterm2' backend. Shortcut to use 'iterm2' backend.
.TP .TP