mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 11:39:53 +00:00
Compare commits
18 Commits
6.0.0
...
vte_img_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b301c773b | ||
|
|
68645339d3 | ||
|
|
415ef5d4ae | ||
|
|
acc8103dde | ||
|
|
78e0fa3212 | ||
|
|
64188697b8 | ||
|
|
9431a593f6 | ||
|
|
23fc5aff3d | ||
|
|
7df1d0e3ef | ||
|
|
228fb778cb | ||
|
|
3c07884032 | ||
|
|
766113a0c2 | ||
|
|
661d003be2 | ||
|
|
2ecd8102d0 | ||
|
|
b6b320a75a | ||
|
|
b49ecb68f8 | ||
|
|
ca9d161bc9 | ||
|
|
7a64ce22a8 |
58
CHANGELOG.md
58
CHANGELOG.md
@@ -5,13 +5,40 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [6.0.1] - N/A
|
||||
|
||||
- **ascii**: Fixed bug causing files to not work.
|
||||
- **ascii**: Fixed bug causing files named `ascii` to not load.
|
||||
- **term_font** [kitty]: Fixed bug with empty config.
|
||||
- **get_cols**: Variables are now local. [**@asantam**](https://github.com/asantam)
|
||||
- **man_page**: More consistent arg documentation. [**@xPMo**](https://github.com/xPMo)
|
||||
|
||||
|
||||
## [6.0.0] - 2019-01-08
|
||||
|
||||
<img src="https://i.imgur.com/ZQI2EYz.png" alt="logo" height="100px">
|
||||
|
||||
This release fixes a wide range of bugs and adds some neat new features.
|
||||
Scroll down to "highlights" to see the bigger changes from this release.
|
||||
A big thank you to @konimex, @iandrewt and the contributors below who
|
||||
kept development going during my absence.
|
||||
|
||||
Expect a minor bug fix release sometime this week as I'm sure new bugs
|
||||
will come up. I've done extensive testing but things always slip through.
|
||||
|
||||
**Contributors**
|
||||
|
||||
[**@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)
|
||||
[**@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)
|
||||
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
- **Config**: Removed `get_line_break()`.
|
||||
- Alternative: `prin '\n'`
|
||||
- Rationale: fix a bug that's been lingering for a couple of years now.
|
||||
|
||||
**OS**
|
||||
|
||||
@@ -26,7 +53,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
**Highlights**
|
||||
|
||||
- [ASCII] Added support for command output. You can now use whatever terminal commands you like as the ASCII art.
|
||||
[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.
|
||||
@@ -38,7 +66,8 @@ 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.
|
||||
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:
|
||||
@@ -61,8 +90,20 @@ IFS=$'\n' read -d "" -ra info < <(neofetch memory uptime wm)
|
||||
info=("${info[@]##*: }")
|
||||
```
|
||||
|
||||
Added new image backend [chafa](https://hpjansson.org/chafa/) (`--chafa`)
|
||||
which displays images in the terminal using unicode characters.
|
||||
|
||||
```sh
|
||||
neofetch --chafa ~/Pictures/meow.jpg
|
||||
```
|
||||
|
||||
<img src="https://i.imgur.com/fCOoWlA.jpg" alt="scrot" height="400px">
|
||||
|
||||
|
||||
**Info**
|
||||
|
||||
- **Color Blocks**: Fixed issue where disabling blocks caused an extra newline to appear.
|
||||
- **Color Blocks**: Color blocks now have their padding built in. No more need for `get_line_break()`.
|
||||
- **Song**: Added snippet to display music player.
|
||||
- `[[ $player ]] && prin "Music Player" "$player"`
|
||||
- NOTE: Must have `info "Song" song` enabled.
|
||||
@@ -82,6 +123,7 @@ info=("${info[@]##*: }")
|
||||
- **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)
|
||||
- **Memory**: Added option to show memory percentage (`--memory_percent`).
|
||||
- **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)
|
||||
- **WM**: Added detection for FVWM. [**@julianaito**](https://github.com/julianaito)
|
||||
@@ -89,9 +131,12 @@ info=("${info[@]##*: }")
|
||||
- **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.
|
||||
- **Public IP**: Added configurable timeout to requests.
|
||||
- **Resolution**: If resolution is not found, don't print anything.
|
||||
|
||||
**ASCII**
|
||||
|
||||
- Fixed issues with various ASCII arts (namely the `_small` ones).
|
||||
- Added support for command output.
|
||||
- `neofetch --ascii "$(fortune|cowsay -W 30)"`
|
||||
- `neofetch --ascii "$(figlet -w 30 hello world)"`
|
||||
@@ -103,9 +148,14 @@ info=("${info[@]##*: }")
|
||||
|
||||
**Image**
|
||||
|
||||
- Added new image backend [chafa](https://hpjansson.org/chafa/) (`--chafa`).
|
||||
- **w3m**: Fixed issues with URxvt and internal borders.
|
||||
- **w3m**: Fixed issues with URxvt and cursor position.
|
||||
- **w3m**: Fixed issue with `bash 3`.
|
||||
- **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**: Update docs. [**@Snuggle**](https://github.com/dylanaraps/neofetch/commits?author=Snuggle)
|
||||
- Thumbnails are high quality again.
|
||||
- Cached thumbnails are now stored with PATH to prevent collision issues.
|
||||
|
||||
## [5.0.0] - 2018-06-18
|
||||
|
||||
34
README.md
34
README.md
@@ -26,37 +26,3 @@ Neofetch supports almost 150 different operating systems. From Linux to Windows,
|
||||
|
||||
|
||||
### More: \[[Dependencies](https://github.com/dylanaraps/neofetch/wiki/Dependencies)\] \[[Installation](https://github.com/dylanaraps/neofetch/wiki/Installation)\] \[[Wiki](https://github.com/dylanaraps/neofetch/wiki)\]
|
||||
|
||||
## Articles
|
||||
|
||||
- https://lamiradadelreplicante.com/2016/05/15/la-informacion-de-tu-sistema-en-la-terminal-con-neofetch/
|
||||
- https://linuxconfig.org/how-to-display-system-information-with-neofetch
|
||||
- https://www.2daygeek.com/neofetch-display-linux-systems-information-ascii-distribution-logo-terminal/
|
||||
- https://www.cyberciti.biz/howto/neofetch-awesome-system-info-bash-script-for-linux-unix-macos/
|
||||
- https://www.lffl.org/2016/11/neofetch-le-informazioni-sistema-sul-terminale-stile.html
|
||||
- https://www.maketecheasier.com/display-system-information-neofetch-linux/
|
||||
- https://www.omgubuntu.co.uk/2016/11/neofetch-terminal-system-info-app
|
||||
- https://www.omgubuntu.co.uk/2016/12/cli-system-tool-neofetch-2-0-released
|
||||
- https://www.omgubuntu.co.uk/2017/01/neofetch-3-0-released
|
||||
- https://www.ostechnix.com/neofetch-display-linux-systems-information/
|
||||
- https://www.techrepublic.com/article/how-to-get-all-the-information-you-need-about-your-linux-machine-with-a-single-command/
|
||||
- https://www.tecmint.com/neofetch-shows-linux-system-information-with-logo/
|
||||
- https://www.youtube.com/watch?v=bgepGW858fc
|
||||
- https://www.linuxuprising.com/2018/05/display-system-information-on-linux.html
|
||||
- https://esgeeks.com/neofetch-informacion-sistema-linux/
|
||||
|
||||
|
||||
## Thanks
|
||||
|
||||
- [Contributors](https://github.com/dylanaraps/neofetch/contributors)
|
||||
- [Packagers](https://github.com/dylanaraps/neofetch/issues/115)
|
||||
- [Screenfetch](https://github.com/KittyKatt/screenFetch)
|
||||
- [ufetch](https://github.com/jschx/ufetch)
|
||||
|
||||
|
||||
## Donate
|
||||
|
||||
Donations allow me to spend more time working on `neofetch` and my other Open Source projects. If you like `neofetch` and want to give back in some way you can donate at the links below.
|
||||
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=V7QNJNKS3WYVS"><img src="https://img.shields.io/badge/donate-paypal-yellow.svg"></a> <a href="https://www.patreon.com/dyla"><img src="https://img.shields.io/badge/donate-patreon-yellow.svg"> </a><a href="https://liberapay.com/2211/"><img src="https://img.shields.io/badge/donate-liberapay-yellow.svg"></a>
|
||||
|
||||
|
||||
135
neofetch
135
neofetch
@@ -28,7 +28,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
version="6.0.0"
|
||||
version="6.0.1"
|
||||
|
||||
bash_version="${BASH_VERSION/.*}"
|
||||
sys_locale="${LANG:-C}"
|
||||
@@ -76,7 +76,7 @@ print_info() {
|
||||
# info "Battery" battery
|
||||
# info "Font" font
|
||||
# info "Song" song
|
||||
# [[ $player ]] && prin "Music Player" "$player"
|
||||
# [[ "$player" ]] && prin "Music Player" "$player"
|
||||
# info "Local IP" local_ip
|
||||
# info "Public IP" public_ip
|
||||
# info "Users" users
|
||||
@@ -108,7 +108,7 @@ kernel_shorthand="on"
|
||||
# Shorten the output of the distro function
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off', 'tiny'
|
||||
# Values: 'on', 'tiny', 'off'
|
||||
# Flag: --distro_shorthand
|
||||
# Supports: Everything except Windows and Haiku
|
||||
distro_shorthand="off"
|
||||
@@ -132,13 +132,13 @@ os_arch="on"
|
||||
# Shorten the output of the uptime function
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off', 'tiny'
|
||||
# Values: 'on', 'tiny', 'off'
|
||||
# Flag: --uptime_shorthand
|
||||
#
|
||||
# Example:
|
||||
# on: '2 days, 10 hours, 3 mins'
|
||||
# off: '2 days, 10 hours, 3 minutes'
|
||||
# tiny: '2d 10h 3m'
|
||||
# off: '2 days, 10 hours, 3 minutes'
|
||||
uptime_shorthand="on"
|
||||
|
||||
|
||||
@@ -849,7 +849,7 @@ get_distro() {
|
||||
|
||||
case "$os" in
|
||||
"Linux" | "BSD" | "MINIX")
|
||||
if [[ -f /bedrock/etc/bedrock-release && $PATH == */bedrock/cross/* ]]; 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)"
|
||||
@@ -906,7 +906,7 @@ get_distro() {
|
||||
# Chrome OS doesn't conform to the /etc/*-release standard.
|
||||
# While the file is a series of variables they can't be sourced
|
||||
# by the shell since the values aren't quoted.
|
||||
elif [[ -f /etc/lsb-release && "$(< /etc/lsb-release)" == *CHROMEOS* ]]; then
|
||||
elif [[ -f "/etc/lsb-release" && "$(< /etc/lsb-release)" == *CHROMEOS* ]]; then
|
||||
distro="$(awk -F '=' '/NAME|VERSION/ {printf $2 " "}' /etc/lsb-release)"
|
||||
|
||||
elif [[ -f "/etc/os-release" || \
|
||||
@@ -946,15 +946,14 @@ get_distro() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$(< /proc/version)" == *"Microsoft"* ||
|
||||
"$kernel_version" == *"Microsoft"* ]]; then
|
||||
if [[ "$(< /proc/version)" == *Microsoft* || "$kernel_version" == *Microsoft* ]]; then
|
||||
case "$distro_shorthand" in
|
||||
"on") distro+=" [Windows 10]" ;;
|
||||
"tiny") distro="Windows 10" ;;
|
||||
*) distro+=" on Windows 10" ;;
|
||||
esac
|
||||
|
||||
elif [[ "$(< /proc/version)" == *"chrome-bot"* || -f "/dev/cros_ec" ]]; then
|
||||
elif [[ "$(< /proc/version)" == *chrome-bot* || -f "/dev/cros_ec" ]]; then
|
||||
case "$distro_shorthand" in
|
||||
"on") distro+=" [Chrome OS]" ;;
|
||||
"tiny") distro="Chrome OS" ;;
|
||||
@@ -1059,15 +1058,15 @@ get_model() {
|
||||
if [[ -d "/system/app/" && -d "/system/priv-app" ]]; then
|
||||
model="$(getprop ro.product.brand) $(getprop ro.product.model)"
|
||||
|
||||
elif [[ -f /sys/devices/virtual/dmi/id/product_name ||
|
||||
-f /sys/devices/virtual/dmi/id/product_version ]]; then
|
||||
elif [[ -f "/sys/devices/virtual/dmi/id/product_name" ||
|
||||
-f "/sys/devices/virtual/dmi/id/product_version" ]]; then
|
||||
model="$(< /sys/devices/virtual/dmi/id/product_name)"
|
||||
model+=" $(< /sys/devices/virtual/dmi/id/product_version)"
|
||||
|
||||
elif [[ -f /sys/firmware/devicetree/base/model ]]; then
|
||||
elif [[ -f "/sys/firmware/devicetree/base/model" ]]; then
|
||||
model="$(< /sys/firmware/devicetree/base/model)"
|
||||
|
||||
elif [[ -f /tmp/sysinfo/model ]]; then
|
||||
elif [[ -f "/tmp/sysinfo/model" ]]; then
|
||||
model="$(< /tmp/sysinfo/model)"
|
||||
fi
|
||||
;;
|
||||
@@ -1293,7 +1292,7 @@ get_packages() {
|
||||
tot() { IFS=$'\n' read -d "" -ra pkgs < <("$@");((packages+="${#pkgs[@]}"));pac "${#pkgs[@]}"; }
|
||||
|
||||
# Redefine tot() for Bedrock Linux.
|
||||
[[ -f /bedrock/etc/bedrock-release && $PATH == */bedrock/cross/* ]] && {
|
||||
[[ -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[@]}"))
|
||||
@@ -1839,8 +1838,7 @@ get_cpu() {
|
||||
fi
|
||||
|
||||
# Get CPU temp.
|
||||
[[ -f "$temp_dir" ]] && \
|
||||
deg="$(($(< "$temp_dir") * 100 / 10000))"
|
||||
[[ -f "$temp_dir" ]] && deg="$(($(< "$temp_dir") * 100 / 10000))"
|
||||
|
||||
# Get CPU cores.
|
||||
case "$cpu_cores" in
|
||||
@@ -2103,9 +2101,7 @@ get_gpu() {
|
||||
# Checking the first two array elements should
|
||||
# be safe since there won't be 2 intel outputs if
|
||||
# there's a dedicated GPU in play.
|
||||
[[ "${gpus[0]}" == *Intel* && \
|
||||
"${gpus[1]}" == *Intel* ]] && \
|
||||
unset -v "gpus[0]"
|
||||
[[ "${gpus[0]}" == *Intel* && "${gpus[1]}" == *Intel* ]] && unset -v "gpus[0]"
|
||||
|
||||
for gpu in "${gpus[@]}"; do
|
||||
# GPU shorthand tests.
|
||||
@@ -2355,7 +2351,7 @@ get_memory() {
|
||||
|
||||
esac
|
||||
|
||||
[[ $memory_percent == on ]] && ((mem_perc=mem_used * 100 / mem_total))
|
||||
[[ "$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}%)}"
|
||||
|
||||
@@ -2409,8 +2405,7 @@ get_song() {
|
||||
player="$(ps aux | awk -v pattern="(${players:1})" \
|
||||
'!/ awk / && !/iTunesHelper/ && match($0,pattern){print substr($0,RSTART,RLENGTH); exit}')"
|
||||
|
||||
[[ "$music_player" && "$music_player" != "auto" ]] && \
|
||||
player="$music_player"
|
||||
[[ "$music_player" && "$music_player" != "auto" ]] && player="$music_player"
|
||||
|
||||
get_song_dbus() {
|
||||
# Multiple players use an almost identical dbus command to get the information.
|
||||
@@ -2618,7 +2613,7 @@ get_resolution() {
|
||||
esac
|
||||
|
||||
resolution="${resolution%,*}"
|
||||
[[ -z ${resolution/x} ]] && resolution=
|
||||
[[ -z "${resolution/x}" ]] && resolution=
|
||||
}
|
||||
|
||||
get_style() {
|
||||
@@ -2797,11 +2792,8 @@ get_term() {
|
||||
esac
|
||||
|
||||
# Most likely TosWin2 on FreeMiNT - quick check
|
||||
[[ "$TERM" == "tw52" || "$TERM" == "tw100" ]] && \
|
||||
term="TosWin2"
|
||||
|
||||
[[ "$SSH_CONNECTION" ]] && \
|
||||
term="$SSH_TTY"
|
||||
[[ "$TERM" == "tw52" || "$TERM" == "tw100" ]] && term="TosWin2"
|
||||
[[ "$SSH_CONNECTION" ]] && term="$SSH_TTY"
|
||||
|
||||
# Check $PPID for terminal emulator.
|
||||
while [[ -z "$term" ]]; do
|
||||
@@ -2921,6 +2913,8 @@ END
|
||||
|
||||
"kitty"*)
|
||||
kitty_config="$(kitty --debug-config)"
|
||||
[[ "$kitty_config" != *font_family* ]] && return
|
||||
|
||||
term_font_size="${kitty_config/*font_size}"
|
||||
term_font_size="${term_font_size/$'\n'*}"
|
||||
term_font="${kitty_config/*font_family}"
|
||||
@@ -2965,7 +2959,7 @@ END
|
||||
mateterm_config="/tmp/mateterm.cfg"
|
||||
|
||||
# Ensure /tmp exists and we do not overwrite anything.
|
||||
if [[ -d /tmp && ! -f "$mateterm_config" ]]; then
|
||||
if [[ -d "/tmp" && ! -f "$mateterm_config" ]]; then
|
||||
mate-terminal --save-config="$mateterm_config"
|
||||
|
||||
role="$(xprop -id "${WINDOWID}" WM_WINDOW_ROLE)"
|
||||
@@ -3030,7 +3024,7 @@ END
|
||||
# On Linux we can get the exact path to the running binary through the procfs
|
||||
# (in case `st` is launched from outside of $PATH) on other systems we just
|
||||
# have to guess and assume `st` is invoked from somewhere in the users $PATH
|
||||
[[ -L /proc/$parent/exe ]] && binary="/proc/$parent/exe" || binary="$(type -p st)"
|
||||
[[ -L "/proc/$parent/exe" ]] && binary="/proc/$parent/exe" || binary="$(type -p st)"
|
||||
|
||||
# Grep the output of strings on the `st` binary for anything that looks vaguely
|
||||
# like a font definition. NOTE: There is a slight limitation in this approach.
|
||||
@@ -3083,8 +3077,7 @@ END
|
||||
term_font="$(trim "${term_font/*"faceName:"}")"
|
||||
|
||||
# xft: isn't required at the beginning so we prepend it if it's missing
|
||||
[[ "${term_font:0:1}" != "-" && \
|
||||
"${term_font:0:4}" != "xft:" ]] && \
|
||||
[[ "${term_font:0:1}" != "-" && "${term_font:0:4}" != "xft:" ]] && \
|
||||
term_font="xft:$term_font"
|
||||
|
||||
# Xresources has two different font formats, this checks which
|
||||
@@ -3357,6 +3350,8 @@ get_gpu_driver() {
|
||||
}
|
||||
|
||||
get_cols() {
|
||||
local blocks blocks2 cols
|
||||
|
||||
if [[ "$color_blocks" == "on" ]]; then
|
||||
# Convert the width to space chars.
|
||||
printf -v block_width "%${block_width}s"
|
||||
@@ -3410,7 +3405,7 @@ image_backend() {
|
||||
{ image_backend="ascii"; err "Image: Imagemagick not found, falling back to ascii mode."; }
|
||||
|
||||
case "${image_backend:-off}" in
|
||||
"ascii") get_ascii ;;
|
||||
"ascii") print_ascii ;;
|
||||
"off") image_backend="off" ;;
|
||||
|
||||
"caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\
|
||||
@@ -3441,7 +3436,7 @@ image_backend() {
|
||||
err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty',
|
||||
'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')"
|
||||
err "Image: Falling back to ascii mode."
|
||||
get_ascii
|
||||
print_ascii
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -3449,10 +3444,11 @@ image_backend() {
|
||||
[[ "$image_backend" != "off" ]] && printf '\e[%sA\e[9999999D' "${lines:-0}"
|
||||
}
|
||||
|
||||
get_ascii() {
|
||||
[[ ! "$image_source" =~ (ascii|auto) ]] &&
|
||||
print_ascii() {
|
||||
if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then
|
||||
ascii_data="$(< "$image_source")"
|
||||
elif [[ "$image_source" == "ascii" || $image_source == auto ]]; then
|
||||
:
|
||||
else
|
||||
ascii_data="$image_source"
|
||||
fi
|
||||
@@ -3467,7 +3463,7 @@ get_ascii() {
|
||||
done <<< "${ascii_data//\$\{??\}}"
|
||||
|
||||
# Fallback if file not found.
|
||||
((lines==1)) && { lines=; ascii_len=; image_source="auto"; get_distro_ascii; get_ascii; return; }
|
||||
((lines==1)) && { lines=; ascii_len=; image_source=auto; get_distro_ascii; print_ascii; return; }
|
||||
|
||||
# Colors.
|
||||
ascii_data="${ascii_data//\$\{c1\}/$c1}"
|
||||
@@ -3603,49 +3599,10 @@ get_w3m_img_path() {
|
||||
get_window_size() {
|
||||
# This functions gets the current window size in
|
||||
# pixels.
|
||||
#
|
||||
# We first try to use the escape sequence "\033[14t"
|
||||
# to get the terminal window size in pixels. If this
|
||||
# fails we then fallback to using "xdotool" or other
|
||||
# programs.
|
||||
|
||||
# Tmux has a special way of reading escape sequences
|
||||
# so we have to use a slightly different sequence to
|
||||
# get the terminal size.
|
||||
if [[ "$image_backend" == "tycat" ]]; then
|
||||
printf '%b' '\e}qs\000'
|
||||
|
||||
else
|
||||
case "${TMUX:-null}" in
|
||||
"null") printf '%b' '\e[14t' ;;
|
||||
*) printf '%b' '\ePtmux;\e\e[14t\e\\ ' ;;
|
||||
esac
|
||||
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.
|
||||
# The 1 second timeout is required for older bash
|
||||
case "${BASH_VERSINFO[0]}" in
|
||||
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
|
||||
*) IFS=';t' read -d t -t 1 -sra term_size ;;
|
||||
esac
|
||||
unset IFS
|
||||
|
||||
# Split the string into height/width.
|
||||
if [[ "$image_backend" == "tycat" ]]; then
|
||||
term_width="$((term_size[2] * term_size[0]))"
|
||||
term_height="$((term_size[3] * term_size[1]))"
|
||||
|
||||
else
|
||||
term_height="${term_size[1]}"
|
||||
term_width="${term_size[2]}"
|
||||
fi
|
||||
|
||||
[[ "$image_backend" == "kitty" ]] && \
|
||||
[[ "$image_backend" == "kitty" ]] &&
|
||||
IFS=x read -r term_width term_height < <(kitty +kitten icat --print-window-size)
|
||||
|
||||
# Get terminal width/height if \e[14t is unsupported.
|
||||
# Get terminal width/height.
|
||||
if (( "${term_width:-0}" < 50 )) && [[ "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||
if type -p xdotool &>/dev/null; then
|
||||
IFS=$'\n' read -d "" -ra win < <(xdotool getactivewindow getwindowgeometry --shell %1)
|
||||
@@ -3727,7 +3684,7 @@ get_image_size() {
|
||||
esac
|
||||
|
||||
# Check for terminal padding.
|
||||
[[ $image_backend == w3m ]] && term_padding
|
||||
[[ "$image_backend" == "w3m" ]] && term_padding
|
||||
|
||||
width="${width:-$image_size}"
|
||||
height="${height:-$image_size}"
|
||||
@@ -3886,7 +3843,7 @@ display_image() {
|
||||
to_ascii() {
|
||||
err "$1"
|
||||
image_backend="ascii"
|
||||
get_ascii
|
||||
print_ascii
|
||||
|
||||
# Set cursor position next image/ascii.
|
||||
printf '\e[%sA\e[9999999D' "${lines:-0}"
|
||||
@@ -4196,7 +4153,7 @@ kde_config_dir() {
|
||||
|
||||
term_padding() {
|
||||
# Get terminal padding to properly align cursor.
|
||||
[[ -z $term ]] && get_term
|
||||
[[ -z "$term" ]] && get_term
|
||||
|
||||
case "$term" in
|
||||
urxvt*|"rxvt-unicode")
|
||||
@@ -4208,9 +4165,9 @@ term_padding() {
|
||||
}
|
||||
|
||||
dynamic_prompt() {
|
||||
[[ $image_backend == off ]] && { printf '\n'; return; }
|
||||
[[ $image_backend != ascii ]] && ((lines=(height + yoffset) / font_height + 1))
|
||||
[[ $image_backend == w3m ]] && ((lines=lines + padding / font_height + 1))
|
||||
[[ "$image_backend" == "off" ]] && { printf '\n'; return; }
|
||||
[[ "$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.
|
||||
((lines=lines>info_height?lines-info_height+1:1))
|
||||
@@ -4322,7 +4279,7 @@ INFO:
|
||||
|
||||
NOTE: You can supply multiple args. eg. 'neofetch --disable cpu gpu'
|
||||
|
||||
--package_managers on/off Hide/Show Package Manager names . (tiny, on, off)
|
||||
--package_managers on/off Hide/Show Package Manager names . (on, tiny, off)
|
||||
--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,
|
||||
@@ -4349,7 +4306,7 @@ INFO:
|
||||
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)
|
||||
--distro_shorthand on/off Shorten the output of distro (on, tiny, off)
|
||||
|
||||
NOTE: This option won't work in Windows (Cygwin)
|
||||
|
||||
@@ -4357,7 +4314,7 @@ INFO:
|
||||
|
||||
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)
|
||||
--uptime_shorthand on/off Shorten the output of uptime (on, tiny, 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)
|
||||
@@ -4766,7 +4723,7 @@ get_args() {
|
||||
|
||||
get_simple() {
|
||||
while [[ "$1" ]]; do
|
||||
[[ $(type -t "get_$1") == function ]] && {
|
||||
[[ "$(type -t "get_$1")" == "function" ]] && {
|
||||
get_distro
|
||||
stdout
|
||||
simple=1
|
||||
|
||||
14
neofetch.1
14
neofetch.1
@@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
||||
.TH NEOFETCH "1" "January 2019" "Neofetch 6.0.0" "User Commands"
|
||||
.TH NEOFETCH "1" "January 2019" "Neofetch 6.0.1" "User Commands"
|
||||
.SH NAME
|
||||
Neofetch \- A fast, highly customizable system info script
|
||||
.SH SYNOPSIS
|
||||
@@ -40,8 +40,8 @@ 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\-\-package_managers\fR on/off
|
||||
Hide/Show Package Manager names . (tiny, on, off)
|
||||
\fB\-\-package_managers\fR on/tiny/off
|
||||
Hide/Show Package Manager names . (on, tiny, off)
|
||||
.TP
|
||||
\fB\-\-os_arch\fR on/off
|
||||
Hide/Show OS architecture.
|
||||
@@ -79,8 +79,8 @@ NOTE: This only works on Linux and BSD.
|
||||
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)
|
||||
\fB\-\-distro_shorthand\fR on/tiny/off
|
||||
Shorten the output of distro (on, tiny, off)
|
||||
.IP
|
||||
NOTE: This option won't work in Windows (Cygwin)
|
||||
.TP
|
||||
@@ -89,8 +89,8 @@ 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 (tiny, on, off)
|
||||
\fB\-\-uptime_shorthand\fR on/tiny/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
|
||||
|
||||
Reference in New Issue
Block a user