Compare commits

..

No commits in common. "master" and "0.2" have entirely different histories.
master ... 0.2

11 changed files with 886 additions and 12282 deletions

View file

@ -1,20 +0,0 @@
## Description
If you're suggesting a new feature then just a description will suffice.
- [ ] Does this issue still occur in the master branch? (**Required if issue**)
#### Neofetch version
## Screenshot
## Config file
## Verbose log
1. Run `neofetch -vv 2> neofetchlog`
2. Upload the contents of `neofetchlog` to pastebin, gist or equivalent.

View file

@ -1,10 +0,0 @@
## Description
Only fill in the fields below if relevant.
## Features
## Issues
## TODO

View file

@ -1,16 +0,0 @@
language: bash
sudo: required
os:
- linux
- osx
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install screenresolution; fi
script:
- time ./neofetch --travis -v
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck -e SC2244 -e SC2243 neofetch; fi
# Check for lines longer than 100 chars.
- if grep '.\{102\}' neofetch; then (exit 1); else (exit 0); fi

View file

@ -1,151 +0,0 @@
# How to Contribute
<!-- vim-markdown-toc GFM -->
* [Coding Conventions](#coding-conventions)
* [ShellCheck](#shellcheck)
* [No no's](#no-nos)
* [If Statements](#if-statements)
* [Case Statements](#case-statements)
* [Making changes to Neofetch](#making-changes-to-neofetch)
* [Adding support for a new Operating System / Distribution.](#adding-support-for-a-new-operating-system--distribution)
<!-- vim-markdown-toc -->
## Coding Conventions
- Use `bash` built-ins wherever possible.
- Try not to pipe (`|`) at all.
- Limit usage of external commands `$(cmd)`.
- Indent 4 spaces.
- Use [snake_case](https://en.wikipedia.org/wiki/Snake_case) for function
and variable names.
- Keep lines below `100` characters long.
- Use `[[ ]]` for tests.
- Quote **EVERYTHING**.
### ShellCheck
For your contribution to be accepted, your changes need to pass
ShellCheck.
```sh
shellcheck neofetch
```
**Note**: If you have trouble installing ShellCheck. You can open a pull
request on the repo and our Travis.ci hook will run ShellCheck for you.
### No no's
- Dont use GNU conventions in commands.
- Use POSIX arguments and flags.
- Dont use `cut`.
- Use `bash`'s built-in [parameter expansion](http://wiki.bash-hackers.org/syntax/pe).
- Dont use `echo`.
- Use `printf "%s\n"`
- Dont use `bc`.
- Dont use `sed`.
- Use `bash`'s built-in [parameter expansion](http://wiki.bash-hackers.org/syntax/pe).
- Dont use `cat`.
- Use `bash`'s built-in syntax (`file="$(< /path/to/file.txt)")`).
- Dont use `grep "pattern" | awk '{ printf }'`.
- Use `awk '/pattern/ { printf }'`
- Dont use `wc`.
- Use `${#var}` or `${#arr[@]}`.
### If Statements
If the test only has one command inside of it; use the compact test
syntax. Otherwise the normal `if`/`fi` is just fine.
```sh
# Bad
if [[ "$var" ]]; then
printf "%s\n" "$var"
fi
# Good
[[ "$var" ]] && printf "%s\n" "$var"
# Also good (Use this for longer lines).
[[ "$var" ]] && \
printf "%s\n" "$var"
```
### Case Statements
Case statements need to be formatted in a specific way.
```sh
# Good example (Notice the indentation).
case "$var" in
1) printf "%s\n" 1 ;;
2)
printf "%s\n" "1"
printf "%s\n" "2"
;;
*)
printf "%s\n" "1"
printf "%s\n" "2"
printf "%s\n" "3"
;;
esac
```
## Making changes to Neofetch
### Adding support for a new Operating System / Distribution.
Adding support for a new OS/Distro requires adding the Name, Logo and
Colors of the OS/Distro to the `get_distro_ascii()` function.
The function is located right at the bottom of the script, one function
above `main()`. Inside this function youll find an alphabetical list of
each OS/Distro.
Find the spot in the list your new OS/Distro fits into and start
implementing your changes.
If your OS/Distro requires changes to the actual information gathering
functions then you can make these changes in the `get_*` functions.
**Syntax**:
- You have to escape back-slashes (`\`). (eg `\\`)
- You can use `${c1}` to `${c6}`to color the ascii.
- These are evaluated *after* we read the file.
**Example**:
```sh
"CRUX"*)
set_colors 4 5 7 6
read -rd '' ascii_data <<'EOF'
${c1} odddd
oddxkkkxxdoo
ddcoddxxxdoool
xdclodod olol
xoc xdd olol
xdc ${c2}k00${c1}Okdlol
xxd${c2}kOKKKOkd${c1}ldd
xdco${c2}xOkdlo${c1}dldd
ddc:cl${c2}lll${c1}oooodo
odxxdd${c3}xkO000kx${c1}ooxdo
oxdd${c3}x0NMMMMMMWW0od${c1}kkxo
oooxd${c3}0WMMMMMMMMMW0o${c1}dxkx
docldkXW${c3}MMMMMMMWWN${c1}Odolco
xx${c2}dx${c1}kxxOKN${c3}WMMWN${c1}0xdoxo::c
${c2}xOkkO${c1}0oo${c3}odOW${c2}WW${c1}XkdodOxc:l
${c2}dkkkxkkk${c3}OKX${c2}NNNX0Oxx${c1}xc:cd
${c2} odxxdx${c3}xllod${c2}ddooxx${c1}dc:ldo
${c2} lodd${c1}dolccc${c2}ccox${c1}xoloo
EOF
;;
```

View file

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015-2021 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.

View file

@ -1,16 +0,0 @@
PREFIX = /usr
MANDIR = $(PREFIX)/share/man
all:
@echo Run \'make install\' to install Neofetch.
install:
@mkdir -p $(DESTDIR)$(PREFIX)/bin
@mkdir -p $(DESTDIR)$(MANDIR)/man1
@cp -p neofetch $(DESTDIR)$(PREFIX)/bin/neofetch
@cp -p neofetch.1 $(DESTDIR)$(MANDIR)/man1
@chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch
uninstall:
@rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch
@rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1*

View file

@ -1,25 +0,0 @@
<h3 align="center"><img src="https://i.imgur.com/ZQI2EYz.png" alt="logo" height="100px"></h3>
<p align="center">A command-line system information tool written in bash 3.2+</p>
<p align="center">
<a href="./LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="https://github.com/dylanaraps/neofetch/releases"><img src="https://img.shields.io/github/release/dylanaraps/neofetch.svg"></a>
<a href="https://repology.org/metapackage/neofetch"><img src="https://repology.org/badge/tiny-repos/neofetch.svg" alt="Packaging status"></a>
</p>
<img src="https://i.imgur.com/GFmC5Ad.png" alt="neofetch" align="right" height="240px">
Neofetch is a command-line system information tool written in `bash 3.2+`. Neofetch displays information about your operating system, software and hardware in an aesthetic and visually pleasing way.
The overall purpose of Neofetch is to be used in screen-shots of your system. Neofetch shows the information other people want to see. There are other tools available for proper system statistic/diagnostics.
The information by default is displayed alongside your operating system's logo. You can further configure Neofetch to instead use an image, a custom ASCII file, your wallpaper or nothing at all.
<img src="https://i.imgur.com/lUrkQBN.png" alt="neofetch" align="right" height="240px">
You can further configure Neofetch to display exactly what you want it to. Through the use of command-line flags and the configuration file you can change existing information outputs or add your own custom ones.
Neofetch supports almost 150 different operating systems. From Linux to Windows, all the way to more obscure operating systems like Minix, AIX and Haiku. If your favourite operating system is unsupported: Open up an issue and support will be added.
### More: \[[Dependencies](https://github.com/dylanaraps/neofetch/wiki/Dependencies)\] \[[Installation](https://github.com/dylanaraps/neofetch/wiki/Installation)\] \[[Wiki](https://github.com/dylanaraps/neofetch/wiki)\]

143
Readme.md Normal file
View file

@ -0,0 +1,143 @@
# fetch.sh
This is the home of my fetch script! This script gathers info <br\>
about your system and prints it to the terminal.
If you're having any issues or have any ideas, please open an issue! <br\>
I can't test on many other distros and I want this to work <br\>
for as many people as possible.
![1](https://sr.ht/xL9f.png)
<!-- {{{ -->
## Dependencies
These are the script's required dependencies
- Text formatting, dynamic image size and padding: tput
These are the script's optional dependencies:
- Displaying Images: w3m
- Image Cropping: ImageMagick
- Display Wallpaper: feh
- Current Song: mpc
<!-- }}} -->
<!-- {{{ -->
## Usage
The script now supports dynamic image sizing and padding,
<br\> it's enabled by default and there's a variable you
<br\> need to set for it to work correctly.
You can either change the variable $fontwidth inside of the
<br\> script or launch it with ```--font_width num```.
Once you set the var the script will scale the image and padding
<br\> to fit your terminal window.
Please report any bugs or issues you're having with this as I can't
<br\> test with many configurations.
```
usage: scrot.sh [--colors 1 2 4 5] [--kernel "$(uname -rs)"]
Info:
--title string Change the title at the top
--distro string/cmd Manually set the distro
--kernel string/cmd Manually set the kernel
--uptime string/cmd Manually set the uptime
--packages string/cmd Manually set the package count
--shell string/cmd Manually set the shell
--winman string/cmd Manually set the window manager
--cpu string/cmd Manually set the cpu name
--memory string/cmd Manually set the memory
--speed_type Change the type of cpu speed to get
Possible values: current, min, max
--song string/cmd Manually set the current song
Text Colors:
--colors 1 2 3 4 5 Change the color of text
(title, subtitle, colon, info)
--title_color num Change the color of the title
--subtitle_color num Change the color of the subtitle
--colon_color num Change the color of the colons
--underline_color num Change the color of the underline
--info_color num Change the color of the info
Text Formatting:
--underline on/off Enable/Disable title underline
--underline_char char Character to use when underlineing title
--line_wrap on/off Enable/Disable line wrapping
--bold on/off Enable/Disable bold text
Color Blocks:
--color_blocks on/off Enable/Disable the color blocks
--block_range start end --v
Range of colors to print as blocks
--block_width num Width of color blocks
Image:
--image Image to display with the script
The image gets priority over other
images: (wallpaper, \$img)
--font_width px Used to automatically size the image
--split_size num Width of img/text splits
A value of 2 makes each split half the terminal
width and etc
--crop_mode Which crop mode to use
Takes the values: normal, fit, fill
--crop_offset value Change the crop offset for crop_mode normal.
Possible values: northwest, north, northeast,
west, center, east, southwest, south, southeast
--xoffset px How close the image will be
to the left edge of the window
--yoffset px How close the image will be
to the top edge of the window
--gap num Gap between image and text right side
--images on/off Enable/Disable all images
--wall on/off Enable/Disable the wallpaper function
and fallback to \$img
--clean Remove all cropped images
Other:
--help Print this text and exit
```
<!-- }}} -->
<!-- {{{ -->
## TODO
Here's what's on my todo list
- Add uptime support for OS X
- Add options to bold other text in the script (info, underline, colons)
<!-- }}} -->
### Crop mode comparison
#### Fit
![fit](https://imgur.com/MI0UtSV.png)
#### Fill
![fill](https://imgur.com/LvxYwki.png)

743
fetch.sh Executable file
View file

@ -0,0 +1,743 @@
#!/bin/bash
# Fetch info about your system
#
# Optional Dependencies: (You'll lose these features without them)
# Displaying Images: w3m
# Image Cropping: ImageMagick
# Wallpaper Display: feh
# Current Song: mpc
# Text formatting, dynamic image size and padding: tput
#
# Created by Dylan Araps
# https://github.com/dylanaraps/dotfiles
# Speed up script by not using unicode
export LC_ALL=C
# Config Options {{{
# Info Options {{{
# Info
# What to display and in what order.
# Format is: "Subtitle: function name"
# Additional lines you can use include:
# "underline" "linebreak" "echo: msg here" "title: title here"
# You can also include your own lines by using:
# "echo: subtitlehere: $(custom cmd here)"
info=(
"gettitle"
"underline"
"OS: getos"
"Kernel: getkernel"
"Uptime: getuptime"
"Packages: getpackages"
"Shell: getshell"
"Window Manager: getwindowmanager"
"CPU: getcpu"
"Memory: getmemory"
"Song: getsong"
"linebreak"
"getcols"
"linebreak"
)
# CPU
# CPU speed type
# --speed_type current/min/max
speed_type="max"
# Color Blocks
# Color block range
# --block_range start end
start=0
end=7
# Toggle color blocks
# --color_blocks on/off
color_blocks="on"
# Color block width
# --color_block_width num
blockwidth=3
# }}}
# Text Colors {{{
# --colors 1 2 3 4 5
# --title_color num
title_color=4
# --subtitle_color num
subtitle_color=1
# --colon_color num
colon_color=8
# --underline_color num
underline_color=8
# --info_color num
info_color=6
# }}}
# Text Options {{{
# Toggle line wrapping
# --line_wrap on/off
line_wrap="on"
# Toggle bold text
# --bold on/off
bold="on"
# Toggle title underline
# --underline on/off
underline="on"
# Underline character
# --underline_char char
underline_char="-"
# }}}
# Image Options {{{
# Toggle all images
# --images on/off
images="on"
# Thumbnail directory
imgtempdir="$HOME/.fetchimages"
# Split Size
# Sizing for the img and text splits
# The larger the value the less space fetch will take up.
# The default value of 2 splits the image and text at
# half terminal width each.
# A value of 3 splits them at a third width each and etc.
# --split_size num
split_size=2
# Use current wallpaper as the image
# --wall on/off
wall="on"
# Default image to use if wallpaper use is disabled
# --image img
img="$HOME/Pictures/avatars/gon.png"
# Crop mode
# --crop_mode normal/fit/fill
crop_mode="normal"
# Crop offset
# Only affects normal mode.
# --crop_offset northwest/north/northeast/west/center
# east/southwest/south/southeast
crop_offset="center"
# Font width
# Used when calculating dynamic image size
font_width=5
# Right gap between image and text
# --gap num
gap=4
# Image offsets
# --xoffset px
# --yoffset px
yoffset=0
xoffset=0
# }}}
# }}}
# Gather Info {{{
# Get Operating System
case "$(uname)" in
"Linux")
if type -p crux >/dev/null 2>&1; then
os="CRUX"
else
os="$(awk -F'=' '/^NAME=/ {printf $2; exit}' /etc/*ease)"
os=${os#\"*}
os=${os%*\"}
fi
;;
"Darwin")
os="Mac OS X"
;;
esac
# Get Title
gettitle () {
title="${USER}@$(hostname)"
}
# Get kernel version
getkernel() {
kernel="$(uname -r)"
}
# Get uptime
getuptime () {
case "$os" in
"Mac OS X")
# TODO: Fix uptime for OS X
uptime="Unknown"
;;
*) uptime="$(uptime -p)" ;;
esac
}
# Get package count
getpackages () {
case "$os" in
"Arch Linux"|"Parabola GNU/Linux-libre"|"Manjaro"|"Antergos")
packages="$(pacman -Q | wc -l)"
;;
"void")
packages="$(xbps-query -l | wc -l)"
;;
"Ubuntu"|"Mint"|"Debian"|"Kali Linux"|"Deepin Linux")
packages="$(dpkg --get-selections | grep -v deinstall$ | wc -l)"
;;
"Slackware")
packages="$(ls -1 /var/log/packages | wc -l)"
;;
"Gentoo"|"Funtoo")
packages="$(ls -d /var/db/pkg/*/* | wc -l)"
;;
"Fedora"|"openSUSE"|"Red Hat Enterprise Linux"|"CentOS")
packages="$(rpm -qa | wc -l)"
;;
"CRUX")
packages="$(pkginfo -i | wc -l)"
;;
"Mac OS X")
packages="$(pkgutil --pkgs | wc -l)"
packages=${packages//[[:blank:]]/}
;;
*) packages="Unknown" ;;
esac
}
# Get shell
getshell () {
shell="$SHELL"
}
# Get window manager
getwindowmanager () {
if [ -e "$HOME/.xinitrc" ]; then
xinitrc=$(awk '/^[^#]*exec/ {print $2}' "${HOME}/.xinitrc")
windowmanager="${xinitrc/-session/}"
else
case "$os" in
"Mac OS X")
windowmanager="Quartz Compositor"
;;
*)
windowmanager="Unknown"
;;
esac
fi
}
# Get cpu
getcpu () {
case $os in
"Mac OS X")
cpu="$(sysctl -n machdep.cpu.brand_string)"
;;
*)
cpu="$(awk -F ': ' '/model name/ {printf $2; exit}' /proc/cpuinfo)"
case $speed_type in
current) speed="$(lscpu | awk '/CPU MHz:/ {printf $3}')" ;;
min) speed="$(lscpu | awk '/CPU min MHz:/ {printf $4}')" ;;
max) speed="$(lscpu | awk '/CPU max MHz:/ {printf $4}')" ;;
esac
# Convert mhz to ghz without bc
speed=$((${speed/.*/} / 100))
speed=${speed:0:1}.${speed:1}
cpu="$cpu @ ${speed}GHz"
;;
esac
# Remove uneeded patterns from cpu output
# This is faster than sed/gsub
cpu=${cpu//(tm)/}
cpu=${cpu//(TM)/}
cpu=${cpu//(r)/}
cpu=${cpu//(R)/}
cpu=${cpu// CPU/}
cpu=${cpu// Processor/}
cpu=${cpu// Six-Core/}
}
# Get memory
getmemory () {
case $os in
"Mac OS X")
memtotal=$(printf "$(sysctl -n hw.memsize)"/1024^2 | bc)
memwired=$(vm_stat | awk '/wired/ { print $4 }')
memactive=$(vm_stat | awk '/active / { print $3 }')
memcompressed=$(vm_stat | awk '/occupied/ { print $5 }')
memused=$(((${memwired//.} + ${memactive//.} + ${memcompressed//.}) * 4 / 1024))
memory="${memused}MB / ${memtotal}MB"
;;
*)
mem="$(awk 'NR < 4 {printf $2 " "}' /proc/meminfo)"
# Split the string above into 3 vars
# This is faster than using an array.
set $mem
memtotal=$1
memfree=$2
memavail=$3
memused="$((memtotal - memavail))"
memory="$(( ${memused%% *} / 1024))MB / $(( ${memtotal%% *} / 1024))MB"
;;
esac
}
# Get song
getsong () {
song=$(mpc current 2>/dev/null || printf "%s" "Unknown")
}
getcols () {
if [ "$color_blocks" == "on" ]; then
printf "%s" "${padding}"
while [ $start -le $end ]; do
printf "%s%${blockwidth}s" "$(tput setab $start)"
start=$((start + 1))
# Split the blocks at 8 colors
[ $end -ge 9 ] && [ $start -eq 8 ] && \
printf "\n%s" "${clear}${padding}"
done
# Clear formatting
printf "%s" "$clear"
fi
}
# }}}
# Images {{{
getimage () {
# Check if the directory exists
[ ! -d "$imgtempdir" ] && (mkdir "$imgtempdir" || exit)
# Get columns
columns=$(tput cols)
# Image size is half of the terminal
imgsize=$((columns * font_width / split_size))
# Padding is half the terminal width + gap
padding="$(tput cuf $((columns / split_size + gap)))"
# If wall=on, Get image to display from current wallpaper.
if [ "$wall" == "on" ]; then
img=$(awk '/feh/ {printf $3}' "$HOME/.fehbg")
img=${img#\'*}
img=${img%*\'}
fi
# Get name of image and prefix it with it's crop mode and offset
imgname="$crop_mode-$crop_offset-${img##*/}"
# This check allows you to resize the image at launch
if [ -f "$imgtempdir/$imgname" ]; then
imgheight=$(identify -format "%h" "$imgtempdir/$imgname")
[ $imgheight != $imgsize ] && rm "$imgtempdir/$imgname"
fi
# Check to see if the thumbnail exists before we do any cropping.
if [ ! -f "$imgtempdir/$imgname" ]; then
# Get image size so that we can do a better crop
size=$(identify -format "%w %h" $img)
width=${size%% *}
height=${size##* }
# This checks to see if height is geater than width
# so we can do a better crop of portrait images.
if [ $height -gt $width ]; then
size=$width
else
size=$height
fi
case "$crop_mode" in
fit)
c=$(convert "$img" -colorspace srgb -format "%[pixel:p{0,0}]" info:)
convert \
"$img" \
-trim +repage \
-gravity south \
-background "$c" \
-extent "$size"x"$size" \
-scale "$imgsize"x"$imgsize" \
"$imgtempdir/$imgname"
;;
fill)
c=$(convert "$img" -colorspace srgb -format "%[pixel:p{0,0}]" info:)
convert \
"$img" \
-trim +repage \
-scale "$imgsize"x"$imgsize"^ \
-background "$c" \
-extent "$imgsize"x"$imgsize" \
"$imgtempdir/$imgname"
;;
*)
convert \
"$img" \
-gravity $crop_offset \
-crop "$size"x"$size"+0+0 \
-scale "$imgsize"x"$imgsize" \
"$imgtempdir/$imgname"
;;
esac
fi
# The final image
img="$imgtempdir/$imgname"
}
# }}}
# Text Formatting {{{
underline () {
uline=$(printf %"$length"s)
uline=${uline// /$underline_char}
}
colors () {
title_color="$(tput setaf $title_color)"
subtitle_color="$(tput setaf $subtitle_color)"
colon_color="$(tput setaf $colon_color)"
underline_color="$(tput setaf $underline_color)"
info_color="$(tput setaf $info_color)"
}
bold () {
if [ "$bold" == "on" ]; then
bold="$(tput bold)"
else
bold=""
fi
}
clear="$(tput sgr0)"
# }}}
# Args {{{
# Usage {{{
usage () {
printf "%s\n"
printf "%s\n" "usage: ${0##*/} [--colors 1 2 4 5] [--kernel \"\$(uname -rs)\"]"
printf "%s\n"
printf "%s\n" " Info:"
printf "%s\n" " --title string Change the title at the top"
printf "%s\n" " --distro string/cmd Manually set the distro"
printf "%s\n" " --kernel string/cmd Manually set the kernel"
printf "%s\n" " --uptime string/cmd Manually set the uptime"
printf "%s\n" " --packages string/cmd Manually set the package count"
printf "%s\n" " --shell string/cmd Manually set the shell"
printf "%s\n" " --winman string/cmd Manually set the window manager"
printf "%s\n" " --cpu string/cmd Manually set the cpu name"
printf "%s\n" " --memory string/cmd Manually set the memory"
printf "%s\n" " --speed_type Change the type of cpu speed to get"
printf "%s\n" " Possible values: current, min, max"
printf "%s\n" " --song string/cmd Manually set the current song"
printf "%s\n"
printf "%s\n" " Text Colors:"
printf "%s\n" " --colors 1 2 3 4 5 Change the color of text"
printf "%s\n" " (title, subtitle, colon, underline, info)"
printf "%s\n" " --title_color num Change the color of the title"
printf "%s\n" " --subtitle_color num Change the color of the subtitle"
printf "%s\n" " --colon_color num Change the color of the colons"
printf "%s\n" " --underline_color num Change the color of the underlines"
printf "%s\n" " --info_color num Change the color of the info"
printf "%s\n"
printf "%s\n" " Text Formatting:"
printf "%s\n" " --underline on/off Enable/Disable title underline"
printf "%s\n" " --underline_char char Character to use when underlineing title"
printf "%s\n" " --line_wrap on/off Enable/Disable line wrapping"
printf "%s\n" " --bold on/off Enable/Disable bold text"
printf "%s\n"
printf "%s\n" " Color Blocks:"
printf "%s\n" " --color_blocks on/off Enable/Disable the color blocks"
printf "%s\n" " --block_width num Width of color blocks"
printf "%s\n" " --block_range start end --v "
printf "%s\n" " Range of colors to print as blocks"
printf "%s\n"
printf "%s\n" " Image:"
printf "%s\n" " --image Image to display with the script"
printf "%s\n" " The image gets priority over other"
printf "%s\n" " images: (wallpaper, \$img)"
printf "%s\n" " --font_width px Used to automatically size the image"
printf "%s\n" " --split_size num Width of img/text splits"
printf "%s\n" " A value of 2 makes each split half the terminal"
printf "%s\n" " width and etc"
printf "%s\n" " --crop_mode Which crop mode to use"
printf "%s\n" " Takes the values: normal, fit, fill"
printf "%s\n" " --crop_offset value Change the crop offset for normal mode."
printf "%s\n" " Possible values: northwest, north, northeast,"
printf "%s\n" " west, center, east, southwest, south, southeast"
printf "%s\n"
printf "%s\n" " --xoffset px How close the image will be "
printf "%s\n" " to the left edge of the window"
printf "%s\n" " --yoffset px How close the image will be "
printf "%s\n" " to the top edge of the window"
printf "%s\n" " --gap num Gap between image and text right side"
printf "%s\n" " to the top edge of the window"
printf "%s\n" " --images on/off Enable/Disable all images"
printf "%s\n" " --wall on/off Enable/Disable the wallpaper function"
printf "%s\n" " and fallback to \$img"
printf "%s\n" " --clean Remove all cropped images"
printf "%s\n"
printf "%s\n" " Other:"
printf "%s\n" " --help Print this text and exit"
printf "%s\n"
exit 1
}
# }}}
while [ ! -z $1 ]; do
case $1 in
# Info
--title) title="$2" ;;
--os) os="$2" ;;
--kernel) kernel="$2" ;;
--uptime) uptime="$2" ;;
--packages) packages="$2" ;;
--shell) shell="$2" ;;
--winman) windowmanager="$2" ;;
--cpu) cpu="$2" ;;
--speed_type) speed_type="$2" ;;
--memory) memory="$2" ;;
--song) song="$2" ;;
# Text Colors
--colors) title_color=$2; \
[ ! -z $3 ] && subtitle_color=$3; \
[ ! -z $4 ] && colon_color=$4; \
[ ! -z $4 ] && underline_color=$5; \
[ ! -z $5 ] && info_color=$6 ;;
--title_color) title_color=$2 ;;
--subtitle_color) subtitle_color=$2 ;;
--colon_color) colon_color=$2 ;;
--underline_color) underline_color=$2 ;;
--info_color) info_color=$2 ;;
# Text Formatting
--underline) underline="$2" ;;
--underline_char) underline_char="$2" ;;
--line_wrap) line_wrap="$2" ;;
--bold) bold="$2" ;;
# Color Blocks
--color_blocks) color_blocks="$2" ;;
--block_range) start=$2; end=$3 ;;
--block_width) blockwidth="$2" ;;
# Image
--image) wall="off"; img="$2" ;;
--font_width) font_width="$2" ;;
--split_size) split_size="$2" ;;
--crop_mode) crop_mode="$2" ;;
--crop_offset) crop_offset="$2" ;;
--xoffset) xoffset="$2" ;;
--yoffset) yoffset="$2" ;;
--gap) gap="$2" ;;
--images) images="$2" ;;
--wall) wall="$2" ;;
--clean) rm -rf "$imgtempdir" || exit ;;
# Other
--help) usage ;;
esac
# The check here fixes shift in sh/mksh
[ ! -z "$1" ] && shift
done
# }}}
# Print Info {{{
printinfo () {
for info in "${info[@]}"; do
function=${info#*: }
subtitle=${info%:*}
case "$info" in
echo:*:*)
info=${function#*: }
subtitle=${function%:*}
string="${bold}${subtitle_color}${subtitle}${clear}${colon_color}: ${info_color}${info}"
;;
echo:*)
string="${info_color}${function}"
length=${#function}
;;
title:*)
string="${bold}${title_color}${function}"
length=${#function}
;;
linebreak)
string=""
;;
underline)
if [ "$underline" == "on" ]; then
underline
string="${underline_color}${uline}"
fi
;;
*getos*)
continue
;;
*:*|*)
# Update the var
output=${function/get/}
typeset -n output=$output
# Call the function
# [ -z "$output" ] && echo "$function"; time $function; continue
[ -z "$output" ] && $function
;;&
gettitle)
string="${bold}${title_color}${output}"
length=${#output}
;;
*:*)
string="${bold}${subtitle_color}${subtitle}${clear}${colon_color}: ${info_color}${output}"
length=${#subtitle}
;;
*)
string="$output"
length=${#output}
;;
esac
printf "%s\n" "${padding}${string}${clear}"
done
}
# }}}
# Print The Info {{{
# Get image
[ "$images" == "on" ] && getimage
# Hide the terminal cursor
tput civis
# Clear the terminal
clear
# Disable line wrap
[ $line_wrap == "off" ] && printf '\e[?7l'
# Call functions and display info
colors
bold
printinfo
# Display the image
[ "$images" == "on" ] && printf "0;1;$xoffset;$yoffset;$imgsize;$imgsize;;;;;$img\n4;\n3;" |\
/usr/lib/w3m/w3mimgdisplay
# Enable line wrap again
[ $line_wrap == "off" ] && printf '\e[?7h'
# Move cursor to bottom and redisplay it.
printf "cup $(tput lines) \n cuu1 \n cnorm" | tput -S
# }}}

11592
neofetch

File diff suppressed because it is too large Load diff

View file

@ -1,431 +0,0 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3.
.TH NEOFETCH "1" "April 2021" "Neofetch 7.1.0" "User Commands"
.SH NAME
Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS
.B neofetch
\fI\,func_name --option "value" --option "value"\/\fR
.SH DESCRIPTION
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
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
Allows you to disable an info line from appearing
in the output. 'infoname' is the function name from the
\&'print_info()' function inside the config file.
For example: 'info "Memory" memory' would be '\-\-disable memory'
.IP
NOTE: You can supply multiple args. eg. 'neofetch \fB\-\-disable\fR cpu gpu'
.TP
\fB\-\-title_fqdn\fR on/off
Hide/Show Fully Qualified Domain Name in title.
.TP
\fB\-\-package_managers\fR on/off
Hide/Show Package Manager names . (on, tiny, off)
.TP
\fB\-\-os_arch\fR on/off
Hide/Show OS architecture.
.TP
\fB\-\-speed_type\fR type
Change the type of cpu speed to display.
Possible values: current, min, max, bios,
scaling_current, scaling_min, scaling_max
.IP
NOTE: This only supports Linux with cpufreq.
.TP
\fB\-\-speed_shorthand\fR on/off
Whether or not to show decimals in CPU speed.
.TP
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
Possible values: logical, physical, off
.IP
NOTE: 'physical' doesn't work on BSD.
.TP
\fB\-\-cpu_speed\fR on/off
Hide/Show cpu speed.
.TP
\fB\-\-cpu_temp\fR C/F/off
Hide/Show cpu temperature.
.IP
NOTE: This only works on Linux and BSD.
.TP
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 (on, tiny, off)
.IP
NOTE: This option won't work in Windows (Cygwin)
.TP
\fB\-\-kernel_shorthand\fR on/off
Shorten the output of kernel
.IP
NOTE: This option won't work in BSDs (except PacBSD and PC\-BSD)
.TP
\fB\-\-uptime_shorthand\fR on/off
Shorten the output of uptime (on, tiny, off)
.TP
\fB\-\-refresh_rate\fR on/off
Whether to display the refresh rate of each monitor
Unsupported on Windows
.TP
\fB\-\-gpu_brand\fR on/off
Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel)
.TP
\fB\-\-gpu_type\fR type
Which GPU to display. (all, dedicated, integrated)
.IP
NOTE: This only supports Linux.
.TP
\fB\-\-de_version\fR on/off
Show/Hide Desktop Environment version
.TP
\fB\-\-gtk_shorthand\fR on/off
Shorten output of gtk theme/icons
.TP
\fB\-\-gtk2\fR on/off
Enable/Disable gtk2 theme/font/icons output
.TP
\fB\-\-gtk3\fR on/off
Enable/Disable gtk3 theme/font/icons output
.TP
\fB\-\-shell_path\fR on/off
Enable/Disable showing $SHELL path
.TP
\fB\-\-shell_version\fR on/off
Enable/Disable showing $SHELL version
.TP
\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, none
.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)
.IP
\&'none' shows only 'Disk' or the configured title.
.TP
\fB\-\-disk_percent\fR on/off
Hide/Show disk percent.
.TP
\fB\-\-ip_host\fR url
URL to query for public IP
.TP
\fB\-\-ip_timeout\fR int
Public IP timeout (in seconds).
.TP
\fB\-\-ip_interface\fR value
Interface(s) to use for local IP
.TP
\fB\-\-song_format\fR format
Print the song data in a specific format (see config file).
.TP
\fB\-\-song_shorthand\fR on/off
Print the Artist/Album/Title on separate lines.
.TP
\fB\-\-memory_percent\fR on/off
Display memory percentage.
.TP
\fB\-\-memory_unit\fR kib/mib/gib
Memory output unit.
.TP
\fB\-\-music_player\fR player\-name
Manually specify a player to use.
Available values are listed in the config file
.SS "TEXT FORMATTING:"
.TP
\fB\-\-colors\fR x x x x x x
Changes the text colors in this order:
title, @, underline, subtitle, colon, info
.TP
\fB\-\-underline\fR on/off
Enable/Disable the underline.
.TP
\fB\-\-underline_char\fR char
Character to use when underlining title
.TP
\fB\-\-bold\fR on/off
Enable/Disable bold text
.TP
\fB\-\-separator\fR string
Changes the default ':' separator to the specified string.
.SS "COLOR BLOCKS:"
.TP
\fB\-\-color_blocks\fR on/off
Enable/Disable the color blocks
.TP
\fB\-\-col_offset\fR auto/num
Left\-padding of color blocks
.TP
\fB\-\-block_width\fR num
Width of color blocks in spaces
.TP
\fB\-\-block_height\fR num
Height of color blocks in lines
.TP
\fB\-\-block_range\fR num num
Range of colors to print as blocks
.SS "BARS:"
.TP
\fB\-\-bar_char\fR 'elapsed char' 'total char'
Characters to use when drawing bars.
.TP
\fB\-\-bar_border\fR on/off
Whether or not to surround the bar with '[]'
.TP
\fB\-\-bar_length\fR num
Length in spaces to make the bars.
.TP
\fB\-\-bar_colors\fR num num
Colors to make the bar.
Set in this order: elapsed, total
.TP
\fB\-\-memory_display\fR mode
Bar mode.
Possible values: bar, infobar, barinfo, off
.TP
\fB\-\-battery_display\fR mode
Bar mode.
Possible values: bar, infobar, barinfo, off
.TP
\fB\-\-disk_display\fR mode
Bar mode.
Possible values: bar, infobar, barinfo, off
.SS "IMAGE BACKEND:"
.TP
\fB\-\-backend\fR backend
Which image backend to use.
Possible values: 'ascii', 'caca', 'catimg', 'chafa', 'jp2a',
\&'iterm2', 'off', 'sixel', 'tycat', 'w3m', 'kitty', 'viu'
.TP
\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/', 'command output' [ascii]
.TP
\fB\-\-ascii\fR source
Shortcut to use 'ascii' backend.
.IP
NEW: neofetch \fB\-\-ascii\fR "$(fortune | cowsay \fB\-W\fR 30)"
.TP
\fB\-\-caca\fR source
Shortcut to use 'caca' backend.
.TP
\fB\-\-catimg\fR source
Shortcut to use 'catimg' backend.
.TP
\fB\-\-chafa\fR source
Shortcut to use 'chafa' backend.
.TP
\fB\-\-iterm2\fR source
Shortcut to use 'iterm2' backend.
.TP
\fB\-\-jp2a\fR source
Shortcut to use 'jp2a' backend.
.TP
\fB\-\-kitty\fR source
Shortcut to use 'kitty' backend.
.TP
\fB\-\-pot\fR source
Shortcut to use 'pot' backend.
.TP
\fB\-\-pixterm\fR source
Shortcut to use 'pixterm' 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\-\-ueberzug\fR source
Shortcut to use 'ueberzug' backend
.TP
\fB\-\-viu\fR source
Shortcut to use 'viu' backend
.TP
\fB\-\-off\fR
Shortcut to use 'off' backend (Disable ascii art).
.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
.TP
NOTE: AIX, Hash, Alpine, AlterLinux, Amazon, Anarchy, Android, instantOS,
Antergos, antiX, "AOSC OS", "AOSC OS/Retro", Apricity, ArchCraft,
ArcoLinux, ArchBox, ARCHlabs, ArchStrike, XFerience, ArchMerge, Arch,
Artix, Arya, Bedrock, Bitrig, BlackArch, BLAG, BlankOn, BlueLight,
bonsai, BSD, BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS,
Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, Condres,
Container_Linux, CRUX, Cucumber, dahlia, Debian, Deepin, DesaOS,
Devuan, DracOS, DarkOs, Itc, DragonFly, Drauger, Elementary,
EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD,
FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo,
gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, HydroOS,
Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, Korora,
KSLinux, Kubuntu, LEDE, LaxerOS, LibreELEC, LFS, Linux_Lite, LMDE,
Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, Manjaro, TeArch, Maui,
Mer, Minix, LinuxMint, Live_Raizo, MX_Linux, Namib, Neptune, NetBSD,
Netrunner, Nitrux, NixOS, Nurunner, NuTyX, OBRevenge, OpenBSD,
openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage, OpenWrt,
osmc, Oracle, OS Elbrus, PacBSD, Parabola, Pardus, Parrot, Parsix,
TrueOS, PCLinuxOS, Pengwin, Peppermint, Pisi, popos, Porteus, PostMarketOS,
Proxmox, Puppy, PureOS, Qubes, Quibian, Radix, Raspbian, Reborn_OS,
Redstar, Redcore, Redhat, Refracted_Devuan, Regata, Regolith, Rosa,
sabotage, Sabayon, Sailfish, SalentOS, Scientific, Septor,
SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, SmartOS,
Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, openSUSE_Leap,
t2, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, Trisquel,
Ubuntu\-Cinnamon, Ubuntu\-Budgie, Ubuntu\-GNOME, Ubuntu\-MATE,
Ubuntu\-Studio, Ubuntu, Univention, Venom, Void, VNux, semc, Obarun,
windows10, Windows7, Xubuntu, Zorin, and IRIX have ascii logos.
.IP
NOTE: Arch, Ubuntu, Redhat, Fedora and Dragonfly have 'old' logo variants.
.IP
NOTE: Use '{distro name}_old' to use the old logos.
.IP
NOTE: Ubuntu has flavor variants.
.TP
NOTE: Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu\-GNOME,
Ubuntu\-Studio, Ubuntu\-Mate or Ubuntu\-Budgie to use the flavors.
.TP
NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu,
CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android,
Artix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola,
Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS,
Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian,
postmarketOS, 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.
.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.
Possible values: auto, 00px, 00%, none
.TP
\fB\-\-catimg_size\fR 1/2
Change the resolution of catimg.
.TP
\fB\-\-crop_mode\fR mode
Which crop mode to use
Takes the values: normal, fit, fill
.TP
\fB\-\-crop_offset\fR value
Change the crop offset for normal mode.
Possible values: northwest, north, northeast,
west, center, east, southwest, south, southeast
.TP
\fB\-\-xoffset\fR px
How close the image will be to the left edge of the
window. This only works with w3m.
.TP
\fB\-\-yoffset\fR px
How close the image will be to the top edge of the
window. This only works with w3m.
.TP
\fB\-\-bg_color\fR color
Background color to display behind transparent image.
This only works with w3m.
.TP
\fB\-\-gap\fR num
Gap between image and text.
.TP
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.
.SS "OTHER:"
.TP
\fB\-\-config\fR \fI\,/path/to/config\/\fP
Specify a path to a custom config file
.TP
\fB\-\-config\fR none
Launch the script without a config file
.TP
\fB\-\-no_config\fR
Don't create the user config file.
.TP
\fB\-\-print_config\fR
Print the default config file to stdout.
.TP
\fB\-\-stdout\fR
Turn off all colors and disables any ASCII/image backend.
.TP
\fB\-\-help\fR
Print this text and exit
.TP
\fB\-\-version\fR
Show neofetch version
.TP
\fB\-v\fR
Display error messages.
.TP
\fB\-vv\fR
Display a verbose log for error reporting.
.SS "DEVELOPER:"
.TP
\fB\-\-gen\-man\fR
Generate a manpage for Neofetch in your PWD. (Requires GNU help2man)
.SH "REPORTING BUGS"
Report bugs to https://github.com/dylanaraps/neofetch/issues