mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 09:08:38 +00:00
Compare commits
63 Commits
3.4.0
...
img_simple
Author | SHA1 | Date | |
---|---|---|---|
|
905e6bfe47 | ||
|
eca9a6c32e | ||
|
b3b7dce035 | ||
|
1b71699353 | ||
|
2606e4b1d6 | ||
|
38e929967f | ||
|
745f568a94 | ||
|
6fc44ec473 | ||
|
c32ccb7fcf | ||
|
4528ecd47c | ||
|
74cec3b30f | ||
|
9870c90a98 | ||
|
8fcc19c4d4 | ||
|
970c4dfc29 | ||
|
6d1ae8fe23 | ||
|
3c3e17ad2b | ||
|
305d9556ec | ||
|
ef0056e57d | ||
|
ac06c87de0 | ||
|
cbe998b135 | ||
|
edea757f47 | ||
|
4dedae1fe4 | ||
|
fed5b870b7 | ||
|
29311f9e23 | ||
|
edeac1c369 | ||
|
6cd5d3c4c4 | ||
|
dc4199f96b | ||
|
93d4315215 | ||
|
fb5afb1188 | ||
|
787d272faa | ||
|
226cbbf0d8 | ||
|
039a9a81a9 | ||
|
7c464938b9 | ||
|
4212e83fe0 | ||
|
d7172fa89b | ||
|
41fd2df411 | ||
|
82cc8ebb6e | ||
|
cef3202ea5 | ||
|
aa8c6c55f6 | ||
|
e91648ad67 | ||
|
2e8e69a120 | ||
|
16b5157d22 | ||
|
9d6e8d2c8c | ||
|
55de3a4201 | ||
|
91f8ba7a1f | ||
|
67873db798 | ||
|
0bc4a5bd30 | ||
|
8253bd7e9a | ||
|
f7cf1073c6 | ||
|
c80ace7684 | ||
|
4b0a430585 | ||
|
ab76a50739 | ||
|
0302d8eb9b | ||
|
425cd77644 | ||
|
7f722a1b0f | ||
|
8fc70c9801 | ||
|
07cf1bd739 | ||
|
eea18cf68c | ||
|
ee815f9c66 | ||
|
9d4a127f72 | ||
|
59e0ac82a7 | ||
|
4083770a6b | ||
|
f25b76a0a5 |
@@ -1,13 +1,6 @@
|
||||
language: bash
|
||||
sudo: required
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- debian-sid
|
||||
packages:
|
||||
- shellcheck
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
@@ -20,7 +13,7 @@ script:
|
||||
- time ./neofetch --ascii --config config/travis.conf -v
|
||||
# See this wiki page for why we're disabling these errors.
|
||||
# https://github.com/dylanaraps/neofetch/wiki/Shellcheck-Exclusions
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck neofetch -e SC1090,SC2009,SC2012,SC2016,SC2034,SC2128,SC2153,SC2154,SC2178,SC2010,SC1004; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck neofetch -e SC1090,SC2009,SC2012,SC2016,SC2034,SC2128,SC2153,SC2154,SC2178,SC2010,SC1004,SC1117; fi
|
||||
# The if statement is here to invert the exit code from grep.
|
||||
# grep normally errors if no match is found but we want the opposite.
|
||||
# We invert it so grep fails if a match is found.
|
||||
|
148
CHANGELOG.md
148
CHANGELOG.md
@@ -1,150 +1,40 @@
|
||||
## Contributors
|
||||
|
||||
- [**@yslgirl**](https://github.com/yslgirl)
|
||||
- [**@iandrewt**](https://github.com/iandrewt)
|
||||
- [**@chrisweeksnz**](https://github.com/chrisweeksnz)
|
||||
- [**@dawidd6**](https://github.com/dawidd6)
|
||||
- [**@MitchWeaver**](https://github.com/MitchWeaver)
|
||||
- [**@StarryTony**](https://github.com/StarryTony)
|
||||
- [**@rage311**](https://github.com/rage311)
|
||||
- [**@matoro**](https://github.com/matoro)
|
||||
- [**@szfcbr**](https://github.com/szfcbr)
|
||||
- [**@ArmstrongJ**](https://github.com/ArmstrongJ)
|
||||
- [**@robertwolter**](https://github.com/robertwolter)
|
||||
- [**@JadeMatrix**](https://github.com/JadeMatrix)
|
||||
- [**@MindTooth**](https://github.com/MindTooth)
|
||||
- [**@aidanharris**](https://github.com/aidanharris)
|
||||
- [**@khoacao96**](https://github.com/khoacao96)
|
||||
|
||||
|
||||
## OS
|
||||
|
||||
- Added support for ArchMerge.
|
||||
- Added support for MagpieOS.
|
||||
- Added support for PostMarketOS.
|
||||
- Added support for Hyperbola GNU/Linux-libre [**@mstraube**](https://github.com/mstraube)
|
||||
- Added support for macOS High Sierra. [**@yslgirl**](https://github.com/yslgirl)
|
||||
- Added support for Container Linux by CoreOS. [**@chrisweeksnz**](https://github.com/chrisweeksnz)
|
||||
- Added support for 2017 iOS devices. [**@iandrewt**](https://github.com/iandrewt)
|
||||
- Added support for LEDE. [**@dawidd6**](https://github.com/dawidd6)
|
||||
- Added support for Pop!\_OS. [**@jliles**](https://github.com/jliles)
|
||||
- Added support for Lunar Linux.
|
||||
- Added support for 32-bit IRIX. [**@szfcbr**](https://github.com/szfcbr)
|
||||
- Added support for FreeMINT. [**@ArmstrongJ**](https://github.com/ArmstrongJ)
|
||||
- Added support for Anarchy Linux. [**@robertwolter**](https://github.com/robertwolter)
|
||||
- Added support for Calculate Linux. [**@robertwolter**](https://github.com/robertwolter)
|
||||
- Added support for NuTyX. [**@robertwolter**](https://github.com/robertwolter)
|
||||
- Added suport for openSUSE Tumbleweed. [**@robertwolter**](http://github.com/robertwolter)
|
||||
- Fixed detection bug with Gentoo.
|
||||
- Fixed detection bug with OpenWRT. [**@dawidd6**](https://github.com/dawidd6)
|
||||
- Fixed detection bug with LEDE. [**@dawidd6**](https://github.com/dawidd6)
|
||||
- Fixed detection bug with TrueOS. [**@dawidd6**](https://github.com/dawidd6)
|
||||
- Fixed detection bug with Windows Subsystem for Linux and Crouton when an OS without lsb_release is installed.
|
||||
- Fixed ChromeOS detection.
|
||||
- [**@DanySpin97**](https://github.com/DanySpin97)
|
||||
- [**@SolitudeSF**](https://github.com/SolitudeSF)
|
||||
|
||||
|
||||
## General
|
||||
|
||||
- Added more info to verbose mode for debugging.
|
||||
- Fixed bug in prompt location calculation.
|
||||
- Fixed prompt bug in OpenBSD.
|
||||
- Fixed broken AppleScript blocks. [**@JadeMatrix**](https://github.com/JadeMatrix)
|
||||
- Fixed function not working in bash 3. [**@JadeMatrix**](https://github.com/JadeMatrix)
|
||||
- Swapped sequences from `\033` to `\e`.
|
||||
- Fixed Pacman name conflict with the game. [**@MitchWeaver**](https://github.com/MitchWeaver)
|
||||
- Removed the last `echo` in the script.
|
||||
- Fixed typo. [**@khoacao96**](https://github.com/khoacao96)
|
||||
|
||||
|
||||
## Ascii
|
||||
|
||||
- Added color updates for Kubuntu logo. **Maulik Mistry**
|
||||
- Added new DragonflyBSD log. [**@MitchWeaver**](https://github.com/MitchWeaver)
|
||||
- Simplified `--version` output.
|
||||
- Fixed theme issues by setting `GIO_EXTRA_MODULES`.
|
||||
|
||||
|
||||
## Images
|
||||
|
||||
- [MacOS/iTerm2] Fixed thumbnail not appearing. [**@StarryTony**](https://github.com/StarryTony)
|
||||
- Fixed bug with getting wallpaper from feh.
|
||||
- Added `pixterm` backend.
|
||||
- Don't force resolution in `catimg`.
|
||||
- Added `wal`/`pywal` support to get the current wallpaper.
|
||||
- Added `kitty` image backend. [**@SolitudeSF**](https://github.com/SolitudeSF)
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
**Desktop Environment**
|
||||
**Title**
|
||||
|
||||
- Added GNOME version.
|
||||
- Added support for TDE.
|
||||
|
||||
**Window Manager**
|
||||
|
||||
- Added support for most (*if not all*) current Wayland compositors/window manager's.
|
||||
- Added support for some non-EWMH window managers.
|
||||
- [macOS] Fixed `chunkwm` being detected as `Kwm`. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Window Manager Theme**
|
||||
|
||||
- Fixed `sawfish` detection.
|
||||
- [macOS] Now detects Light/Dark theme. [**@JadeMatrix**](https://github.com/JadeMatrix)
|
||||
|
||||
**Install Date**
|
||||
|
||||
- [macOS] Fixed Install Date. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Theme**
|
||||
|
||||
- Fixed KDE font issue. [**@mstraube**](https://github.com/mstraube)
|
||||
|
||||
**CPU**
|
||||
|
||||
- [linux] Detect the correct temperature file to use.
|
||||
- [windows] Removed `$temp` usage as it's an envar.
|
||||
- [OpenBSD] Fixed CPU temperature that fails to appear in some systems. [**@rage311**](https://github.com/rage311)
|
||||
- Fixed unexpected backslash being inserted on some systems.
|
||||
|
||||
**GPU**
|
||||
|
||||
- [linux] Added driver version to NVIDIA output.
|
||||
- [linux] Added driver version to Intel output.
|
||||
- [macOS] Added NVIDIA support. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Memory**
|
||||
|
||||
- [OpenBSD] Fixed memory usage values. [**@rage311**](https://github.com/rage311)
|
||||
|
||||
**Package Manager**
|
||||
|
||||
- Added detection for Sabotage Linux's `butch` [**@MitchWeaver**](https://github.com/MitchWeaver)
|
||||
- Changed `pacman` detection to fix issues in other distros. [**@MitchWeaver**](https://github.com/MitchWeaver)
|
||||
|
||||
**Resolution**
|
||||
|
||||
- [macOS] Fixed errors on non-retina screens. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Song**
|
||||
|
||||
- Added option to manually specify the player to use.
|
||||
- Added support for Elisa. [**@mstraube**](https://github.com/mstraube)
|
||||
- macOS detection is now more reliable. [**@JadeMatrix**](https://github.com/JadeMatrix)
|
||||
|
||||
**Model**
|
||||
|
||||
- Remove more unneeded outputs. [**@konimex**](https://github.com/konimex)
|
||||
|
||||
**Disk**
|
||||
|
||||
- Update Haiku's detection. [**@dawidd6**](https://github.com/dawidd6)
|
||||
|
||||
**Battery**
|
||||
|
||||
- Fixed Windows detection. [**@matoro**](https://github.com/matoro)
|
||||
|
||||
**Shell**
|
||||
|
||||
- Added support for `tcsh`. [**@szfcbr**](https://github.com/szfcbr)
|
||||
- Fixed duplicate Intel GPUs.
|
||||
|
||||
**Terminal Font**
|
||||
|
||||
- Added more paths for Alacritty.
|
||||
- Added font support for Kitty. [**@MindTooth**](https://github.com/MindTooth)
|
||||
- Fixed Kitty `font_size` regex. [**@aidanharris**](https://github.com/aidanharris)
|
||||
- Added support for `XTerm.vt11.facename`. [**@aidanharris**](https://github.com/aidanharris)
|
||||
- Added support for `st`. [**@aidanharris**](https://github.com/aidanharris)
|
||||
|
||||
**Packages**
|
||||
|
||||
- Fixed package count in Exherbo. [**@DanySpin97**](https://github.com/DanySpin97)
|
||||
|
||||
**Window Manager**
|
||||
|
||||
- Added support for detecting `dwm`.
|
||||
|
96
README.md
96
README.md
@@ -1,100 +1,56 @@
|
||||
# Neofetch
|
||||
|
||||
<a href="https://repology.org/metapackage/neofetch">
|
||||
<img src="https://repology.org/badge/vertical-allrepos/neofetch.svg" alt="Packaging status" align="right" height="400px">
|
||||
<img src="https://repology.org/badge/vertical-allrepos/neofetch.svg" alt="Packaging status" align="right" width="150px" height="730px">
|
||||
</a>
|
||||
|
||||
[](https://gitter.im/dylanaraps/fetch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](https://travis-ci.org/dylanaraps/neofetch)
|
||||
[](https://github.com/dylanaraps/neofetch)
|
||||
[](./LICENSE.md)
|
||||
[](https://github.com/dylanaraps/neofetch/releases)
|
||||
[](https://www.patreon.com/dyla)
|
||||
|
||||
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.
|
||||
|
||||
Neofetch is a CLI system information tool written in BASH. Neofetch displays information about your system next to an image, your OS logo, or any ASCII file of your choice. The main purpose of Neofetch is to be used in screenshots to show other users what OS/Distro you're running, what Theme/Icons you're using etc.
|
||||
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.
|
||||
|
||||
Neofetch is highly customizable through the use of command line flags or the user config file. There are over 50 config options to mess around with and there's the `print_info()` function and friends which let you add your own custom info.
|
||||
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.
|
||||
|
||||
Neofetch can be used on any OS that has BASH 3.2+, it's just a matter of adding support. If your OS/Distro isn't in the list below, feel free to open an issue on the repo and I'll gladly add support. Neofetch currently supports `Linux`, `MacOS`, `iOS`, `BSD`, `Solaris`, `Android`, `Haiku`, `GNU Hurd`, `MINIX`, `AIX`, `IRIX`, `FreeMint`, and `Windows (Cygwin/MSYS2/MinGW/Windows 10 Linux subsystem)`.
|
||||
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.
|
||||
|
||||
For more information:
|
||||
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.<br>
|
||||
|
||||
**https://github.com/dylanaraps/neofetch/wiki**
|
||||
### For more information: \[[Dependencies](https://github.com/dylanaraps/neofetch/wiki/Dependencies)\] \[[Installation](https://github.com/dylanaraps/neofetch/wiki/Installation)\] \[[Wiki](https://github.com/dylanaraps/neofetch/wiki)\]
|
||||
|
||||
<img src="https://i.imgur.com/lUrkQBN.png" alt="neofetch" align="right" width="434px">
|
||||
<img src="https://i.imgur.com/GFmC5Ad.png" alt="neofetch" width="434px">
|
||||
<img src="https://i.imgur.com/lUrkQBN.png" alt="neofetch" align="right" width="349px">
|
||||
<img src="https://i.imgur.com/GFmC5Ad.png" alt="neofetch" width="349px">
|
||||
|
||||
## Articles
|
||||
|
||||
## Dependencies
|
||||
|
||||
https://github.com/dylanaraps/neofetch/wiki/Dependencies
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
https://github.com/dylanaraps/neofetch/wiki/Installation
|
||||
|
||||
|
||||
## Post Install
|
||||
|
||||
|
||||
### Using the config file
|
||||
|
||||
Neofetch will by default create a config file at `$HOME/.config/neofetch/config` and this file contains all of the script's options/settings. The config file allows you to keep your customizations between script versions and allows you to easily share your customizations with other people.
|
||||
|
||||
You can launch the script without a config file by using the flag `--config none` and you can specify a custom config location using `--config path/to/config`.
|
||||
|
||||
See this wiki page for the default config: https://github.com/dylanaraps/neofetch/wiki/Config-File
|
||||
|
||||
|
||||
### Customizing what info gets displayed
|
||||
|
||||
https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
|
||||
|
||||
|
||||
### Customizing the script using a custom alias
|
||||
|
||||
If you don't want to use the config file you can customize almost everything using launch flags.
|
||||
|
||||
Here's an example neofetch alias:
|
||||
|
||||
```sh
|
||||
alias neofetch2="neofetch \
|
||||
--config off \
|
||||
--block_range 1 8 \
|
||||
--bold off \
|
||||
--uptime_shorthand on \
|
||||
--gtk_shorthand on \
|
||||
--colors 4 1 8 8 8 7 \
|
||||
"
|
||||
```
|
||||
- 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/
|
||||
|
||||
|
||||
## Thanks
|
||||
|
||||
Thanks to:
|
||||
|
||||
- [Contributors](https://github.com/dylanaraps/neofetch/contributors)
|
||||
- Thanks for making Neofetch better, I really appreciate it.
|
||||
- [Packagers](https://github.com/dylanaraps/neofetch/issues/115)
|
||||
- Thanks for maintaining Neofetch packages.
|
||||
- Users
|
||||
- Thanks for using Neofetch!
|
||||
- [Screenfetch](https://github.com/KittyKatt/screenFetch):
|
||||
- We've used some snippets as a base for a few functions in this script.
|
||||
- Some of the ASCII logos.
|
||||
- [ufetch](https://github.com/jschx/ufetch):
|
||||
- Tiny ASCII logos
|
||||
|
||||
- [Screenfetch](https://github.com/KittyKatt/screenFetch)
|
||||
- [ufetch](https://github.com/jschx/ufetch)
|
||||
|
||||
|
||||
## Donate
|
||||
|
||||
Donations will allow me to spend more time working on `neofetch`.
|
||||
|
||||
If you like `neofetch` and want to give back in some way you can donate here:
|
||||
|
||||
**https://patreon.com/dyla**
|
||||
|
||||
|
||||
<sup><sub>hey rtexel</sub></sup>
|
||||
If you like `neofetch` and want to give back in some way you can donate here: **https://patreon.com/dyla**
|
||||
|
@@ -768,4 +768,4 @@ stdout="off"
|
||||
#
|
||||
# NOTE: Don't change this value, neofetch reads this to determine
|
||||
# how to handle backwards compatibility.
|
||||
config_version="3.4.0"
|
||||
config_version="3.4.1-git"
|
||||
|
355
neofetch
355
neofetch
@@ -9,12 +9,11 @@
|
||||
# https://github.com/dylanaraps/
|
||||
|
||||
# Neofetch version.
|
||||
version="3.4.0"
|
||||
version="3.4.1-git"
|
||||
|
||||
bash_version="${BASH_VERSION/.*}"
|
||||
sys_locale="${LANG:-C}"
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||
old_ifs="$IFS"
|
||||
|
||||
# Speed up script by not using unicode.
|
||||
export LC_ALL=C
|
||||
@@ -23,11 +22,14 @@ export LANG=C
|
||||
# Add more paths to $PATH.
|
||||
export PATH="/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec:${PATH}"
|
||||
|
||||
# Fix issues with gsettings.
|
||||
export GIO_EXTRA_MODULES="/usr/lib/x86_64-linux-gnu/gio/modules/"
|
||||
|
||||
# Set no case match.
|
||||
shopt -s nocasematch
|
||||
|
||||
# Reset colors and bold.
|
||||
reset="\\e[0m"
|
||||
reset="\e[0m"
|
||||
|
||||
# DETECT INFORMATION
|
||||
|
||||
@@ -562,7 +564,7 @@ get_packages() {
|
||||
packages="$((packages+=$(kpm --get-selections | grep -cv deinstall$)))"
|
||||
|
||||
if type -p cave >/dev/null; then
|
||||
package_dir=(/var/db/paludis/repositories/{cross-installed,installed}/*/data/*)
|
||||
package_dir=(/var/db/paludis/repositories/{cross-installed/*,installed}/data/*)
|
||||
packages="$((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l)))"
|
||||
fi
|
||||
|
||||
@@ -745,21 +747,29 @@ get_wm() {
|
||||
|
||||
if [[ "$WAYLAND_DISPLAY" ]]; then
|
||||
wm="$(ps -e | grep -m 1 -o -F \
|
||||
-e "arcan" \
|
||||
-e "asc" \
|
||||
-e "clayland" \
|
||||
-e "dwc" \
|
||||
-e "fireplace" \
|
||||
-e "greenfield" \
|
||||
-e "grefsen" \
|
||||
-e "mazecompositor" \
|
||||
-e "lipstick" \
|
||||
-e "maynard" \
|
||||
-e "mazecompositor" \
|
||||
-e "motorcar" \
|
||||
-e "orbment" \
|
||||
-e "orbital" \
|
||||
-e "orbment" \
|
||||
-e "perceptia" \
|
||||
-e "rustland" \
|
||||
-e "sway" \
|
||||
-e "ulubis" \
|
||||
-e "velox" \
|
||||
-e "wavy" \
|
||||
-e "wayhouse" \
|
||||
-e "way-cooler" \
|
||||
-e "wayfire" \
|
||||
-e "wayhouse" \
|
||||
-e "westeros" \
|
||||
-e "westford" \
|
||||
-e "weston")"
|
||||
|
||||
@@ -778,6 +788,7 @@ get_wm() {
|
||||
[[ -z "$wm" ]] && \
|
||||
wm="$(ps -e | grep -m 1 -o -F \
|
||||
-e "catwm" \
|
||||
-e "dwm" \
|
||||
-e "monsterwm" \
|
||||
-e "tinywm")"
|
||||
|
||||
@@ -1278,19 +1289,26 @@ get_gpu() {
|
||||
case "$os" in
|
||||
"Linux")
|
||||
# Read GPUs into array.
|
||||
IFS=$'\n'
|
||||
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
|
||||
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a)
|
||||
{if(!seen[a[i]]++) print a[i]}}'))
|
||||
IFS="$old_ifs"
|
||||
gpu_cmd="$(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
|
||||
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a)
|
||||
{if(!seen[a[i]]++) print a[i]}}')"
|
||||
IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd"
|
||||
|
||||
# Number the GPUs if more than one exists.
|
||||
((${#gpus[@]} > 1)) && gpu_num=1
|
||||
# Remove duplicate Intel Graphics outputs.
|
||||
# This fixes cases where the outputs are both
|
||||
# Intel but not entirely identical.
|
||||
#
|
||||
# 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]"
|
||||
|
||||
for gpu in "${gpus[@]}"; do
|
||||
# GPU shorthand tests.
|
||||
[[ "$gpu_type" == "dedicated" && "$gpu" =~ (i|I)ntel ]] ||\
|
||||
[[ "$gpu_type" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \
|
||||
[[ "$gpu_type" == "dedicated" && "$gpu" == *Intel* ]] || \
|
||||
[[ "$gpu_type" == "integrated" && ! "$gpu" == *Intel* ]] && \
|
||||
{ unset -v gpu; continue; }
|
||||
|
||||
case "$gpu" in
|
||||
@@ -1336,7 +1354,6 @@ get_gpu() {
|
||||
fi
|
||||
|
||||
prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu"
|
||||
((++gpu_num))
|
||||
done
|
||||
|
||||
return
|
||||
@@ -1502,7 +1519,8 @@ get_memory() {
|
||||
;;
|
||||
|
||||
"AIX")
|
||||
mem_stat=($(svmon -G -O unit=MB))
|
||||
IFS=$'\n'"| " read -d "" -ra mem_stat <<< "$(svmon -G -O unit=MB)"
|
||||
|
||||
mem_total="${mem_stat[11]/.*}"
|
||||
mem_free="${mem_stat[16]/.*}"
|
||||
mem_used="$((mem_total - mem_free))"
|
||||
@@ -1510,7 +1528,9 @@ get_memory() {
|
||||
;;
|
||||
|
||||
"IRIX")
|
||||
mem_stat=($(pmem | head -1))
|
||||
IFS=$'\n' read -d "" -ra mem_cmd <<< "$(pmem)"
|
||||
IFS=" " read -ra mem_stat <<< "${mem_cmd[0]}"
|
||||
|
||||
mem_total="$((mem_stat[3] / 1024))"
|
||||
mem_free="$((mem_stat[5] / 1024))"
|
||||
mem_used="$((mem_total - mem_free))"
|
||||
@@ -2178,6 +2198,35 @@ END
|
||||
"${XDG_CONFIG_HOME}/sakura/sakura.conf")"
|
||||
;;
|
||||
|
||||
"st")
|
||||
term_font="$(ps -o command= -p "$parent" | grep -F -- "-f")"
|
||||
|
||||
if [[ "$term_font" ]]; then
|
||||
term_font="${term_font/*-f/}"
|
||||
term_font="${term_font/ -*/}"
|
||||
|
||||
else
|
||||
# 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)"
|
||||
|
||||
# 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.
|
||||
# Technically "Font Name" is a valid font. As it doesn't specify any font options
|
||||
# though it is hard to match it correctly amongst the rest of the noise.
|
||||
[[ -n "$binary" ]] && \
|
||||
term_font="$(strings "$binary" | grep -F -m 1 \
|
||||
-e "pixelsize=" \
|
||||
-e "size=" \
|
||||
-e "antialias=" \
|
||||
-e "autohint=")"
|
||||
fi
|
||||
|
||||
term_font="${term_font/xft:}"
|
||||
term_font="${term_font/:*}"
|
||||
;;
|
||||
|
||||
"terminology")
|
||||
term_font="$(strings "${XDG_CONFIG_HOME}/terminology/config/standard/base.cfg" |\
|
||||
awk '/^font\.name$/{print a}{a=$0}')"
|
||||
@@ -2257,10 +2306,8 @@ get_disk() {
|
||||
|
||||
# Create an array called 'disks' where each element is a separate line from
|
||||
# df's output. We then unset the first element which removes the column titles.
|
||||
IFS=$'\n'
|
||||
disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}"))
|
||||
unset 'disks[0]'
|
||||
IFS="$old_ifs"
|
||||
IFS=$'\n' read -d "" -ra disks <<< "$(df "${df_flags[@]}" "${disk_show[@]:-/}")"
|
||||
unset "disks[0]"
|
||||
|
||||
# Stop here if 'df' fails to print disk info.
|
||||
if [[ -z "${disks[*]}" ]]; then
|
||||
@@ -2270,7 +2317,7 @@ get_disk() {
|
||||
|
||||
for disk in "${disks[@]}"; do
|
||||
# Create a second array and make each element split at whitespace this time.
|
||||
disk_info=($disk)
|
||||
IFS=" " read -ra disk_info <<< "$disk"
|
||||
disk_perc="${disk_info[4]/'%'}"
|
||||
|
||||
case "$df_version" in
|
||||
@@ -2490,7 +2537,7 @@ get_install_date() {
|
||||
|
||||
install_date="${install_date//-/ }"
|
||||
install_date="${install_date%:*}"
|
||||
install_date=($install_date)
|
||||
IFS=" " read -ra install_date <<< "$install_date"
|
||||
install_date="$(convert_time "${install_date[@]}")"
|
||||
}
|
||||
|
||||
@@ -2533,9 +2580,9 @@ get_cols() {
|
||||
# Generate the string.
|
||||
for ((start; start<=end; start++)); do
|
||||
case "$start" in
|
||||
[0-6]) blocks+="${reset}\\e[3${start}m\\e[4${start}m${block_width}" ;;
|
||||
7) blocks+="${reset}\\e[3${start}m\\e[4${start}m${block_width}" ;;
|
||||
*) blocks2+="\\e[38;5;${start}m\\e[48;5;${start}m${block_width}" ;;
|
||||
[0-6]) blocks+="${reset}\e[3${start}m\e[4${start}m${block_width}" ;;
|
||||
7) blocks+="${reset}\e[3${start}m\e[4${start}m${block_width}" ;;
|
||||
*) blocks2+="\e[38;5;${start}m\e[48;5;${start}m${block_width}" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -2548,12 +2595,12 @@ get_cols() {
|
||||
|
||||
# Add newlines to the string.
|
||||
cols="${cols%%'nl'}"
|
||||
cols="${cols//nl/\\n\\\e[${text_padding}C${zws}}"
|
||||
cols="${cols//nl/\\n\\e[${text_padding}C${zws}}"
|
||||
|
||||
# Add block height to info height.
|
||||
info_height="$((info_height+=block_height+2))"
|
||||
|
||||
printf "%b\n" "\\e[${text_padding}C${zws}${cols}"
|
||||
printf "%b\n" "\e[${text_padding}C${zws}${cols}"
|
||||
fi
|
||||
|
||||
unset -v blocks blocks2 cols
|
||||
@@ -2561,7 +2608,7 @@ get_cols() {
|
||||
# TosWin2 on FreeMiNT is terrible at this,
|
||||
# so we'll reset colors arbitrarily.
|
||||
[[ "$term" == "TosWin2" ]] && \
|
||||
printf "%b\n" "\\e[30;47m"
|
||||
printf "%b\n" "\e[30;47m"
|
||||
|
||||
# Tell info() that we printed manually.
|
||||
prin=1
|
||||
@@ -2582,7 +2629,7 @@ image_backend() {
|
||||
"off") image_backend="off" ;;
|
||||
|
||||
"caca" | "catimg" | "jp2a" | "iterm2" | "termpix" |\
|
||||
"tycat" | "w3m" | "sixel" | "pixterm")
|
||||
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty")
|
||||
get_image_source
|
||||
|
||||
if [[ ! -f "$image" ]]; then
|
||||
@@ -2601,13 +2648,12 @@ image_backend() {
|
||||
fi
|
||||
|
||||
get_image_size
|
||||
make_thumbnail
|
||||
display_image
|
||||
;;
|
||||
|
||||
*)
|
||||
err "Image: Unknown image backend specified '$image_backend'."
|
||||
err "Image: Valid backends are: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2',
|
||||
err "Image: Valid backends are: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'kitty',
|
||||
'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')"
|
||||
err "Image: Falling back to ascii mode."
|
||||
get_ascii
|
||||
@@ -2615,7 +2661,7 @@ image_backend() {
|
||||
esac
|
||||
|
||||
# Set cursor position next image/ascii.
|
||||
[[ "$image_backend" != "off" ]] && printf "%b" "\\e[${lines:-0}A\\e[9999999D"
|
||||
[[ "$image_backend" != "off" ]] && printf "%b" "\e[${lines:-0}A\e[9999999D"
|
||||
}
|
||||
|
||||
get_ascii() {
|
||||
@@ -2653,6 +2699,9 @@ get_ascii() {
|
||||
print+="$line \n"
|
||||
|
||||
# Calculate size of ascii file in line length / line count.
|
||||
line="${line//[??;?;??m}"
|
||||
line="${line//[??;?;???m}"
|
||||
line="${line//[0m}"
|
||||
line="${line//\$\{??\}}"
|
||||
line="${line//\\\\/\\}"
|
||||
((${#line} > ascii_length)) && ascii_length="${#line}"
|
||||
@@ -2731,6 +2780,11 @@ END
|
||||
# Get DE if user has disabled the function.
|
||||
((de_run != 1)) && get_de
|
||||
|
||||
if type -p wal >/dev/null && [[ -f "${HOME}/.cache/wal/wal" ]]; then
|
||||
image="$(< "${HOME}/.cache/wal/wal")"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$de" in
|
||||
"MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;;
|
||||
"Xfce"*)
|
||||
@@ -2806,14 +2860,14 @@ get_term_size() {
|
||||
# so we have to use a slightly different sequence to
|
||||
# get the terminal size.
|
||||
if [[ -n "$TMUX" ]]; then
|
||||
printf "%b" "\\ePtmux;\\e\\e[14t\\e\\e[c\\e\\"
|
||||
printf "%b" "\ePtmux;\e\e[14t\e\e[c\e\\"
|
||||
read_flags=(-d c)
|
||||
|
||||
elif [[ "$image_backend" == "tycat" ]]; then
|
||||
printf "%b" "\\e}qs\000"
|
||||
printf "%b" "\e}qs\000"
|
||||
|
||||
else
|
||||
printf "%b" "\\e[14t\\e[c"
|
||||
printf "%b" "\e[14t\e[c"
|
||||
read_flags=(-d c)
|
||||
fi
|
||||
|
||||
@@ -2832,7 +2886,7 @@ get_term_size() {
|
||||
term_width="${term_size[2]/t*}"
|
||||
fi
|
||||
|
||||
# Get terminal width/height if \\e[14t is unsupported.
|
||||
# Get terminal width/height if \e[14t is unsupported.
|
||||
if [[ -z "$term_width" ]] || (( "$term_width" < 50 )); then
|
||||
if type -p xdotool >/dev/null 2>&1; then
|
||||
current_window="$(xdotool getactivewindow)"
|
||||
@@ -2866,132 +2920,24 @@ get_term_size() {
|
||||
}
|
||||
|
||||
get_image_size() {
|
||||
# This functions determines the size to make
|
||||
# the thumbnail image.
|
||||
# This functions determines the size to make the images.
|
||||
read -r lines columns <<< "$(stty size)"
|
||||
read -r width height <<< "$(identify -format "%w %h" "$image")"
|
||||
|
||||
# Get terminal lines and columns.
|
||||
term_blocks="$(stty size)"
|
||||
columns="${term_blocks/* }"
|
||||
lines="${term_blocks/ *}"
|
||||
|
||||
# Calculate font size.
|
||||
font_width="$((term_width / columns))"
|
||||
font_height="$((term_height / lines))"
|
||||
|
||||
case "$image_size" in
|
||||
"auto")
|
||||
image_size="$((columns * font_width / 2))"
|
||||
term_height="$((term_height - term_height / 4))"
|
||||
|
||||
((term_height < image_size)) && \
|
||||
image_size="$term_height"
|
||||
;;
|
||||
|
||||
*"%")
|
||||
percent="${image_size/\%}"
|
||||
image_size="$((percent * term_width / 100))"
|
||||
|
||||
(((percent * term_height / 50) < image_size)) && \
|
||||
image_size="$((percent * term_height / 100))"
|
||||
;;
|
||||
|
||||
"none")
|
||||
# Get image size so that we can do a better crop.
|
||||
size="$(identify -format "%w %h" "$image")"
|
||||
width="${size%% *}"
|
||||
height="${size##* }"
|
||||
crop_mode="none"
|
||||
|
||||
while (( "$width" >= ("$term_width" / 2) ||
|
||||
"$height" >= "$term_height" )); do
|
||||
width="$((width / 2))"
|
||||
height="$((height / 2))"
|
||||
done
|
||||
;;
|
||||
|
||||
*) image_size="${image_size/px}" ;;
|
||||
esac
|
||||
|
||||
width="${width:-$image_size}"
|
||||
height="${height:-$image_size}"
|
||||
# Calculate image size based on terminal size.
|
||||
# We multiply the sizes by 10 to do some more precise division.
|
||||
while ((width >= (term_width * 10 / 25) ||
|
||||
height >= (term_height * 10 / 15))); do
|
||||
width="$((width * 10 / 12))"
|
||||
height="$((height * 10 / 12))"
|
||||
done
|
||||
|
||||
text_padding="$((width / font_width + gap + xoffset/font_width))"
|
||||
}
|
||||
|
||||
make_thumbnail() {
|
||||
# Name the thumbnail using variables so we can
|
||||
# use it later.
|
||||
image_name="$crop_mode-$crop_offset-$width-$height-${image##*/}"
|
||||
|
||||
# Handle file extensions.
|
||||
case "${image##*.}" in
|
||||
"eps"|"pdf"|"svg"|"gif"|"png")
|
||||
image_name+=".png" ;;
|
||||
*) image_name+=".jpg" ;;
|
||||
esac
|
||||
|
||||
# Create the thumbnail dir if it doesn't exist.
|
||||
mkdir -p "$thumbnail_dir"
|
||||
|
||||
# Check to see if the thumbnail exists before we do any cropping.
|
||||
if [[ ! -f "$thumbnail_dir/$image_name" ]]; then
|
||||
# Get image size so that we can do a better crop.
|
||||
if [[ -z "$size" ]]; then
|
||||
size="$(identify -format "%w %h" "$image")"
|
||||
og_width="${size%% *}"
|
||||
og_height="${size##* }"
|
||||
|
||||
# This checks to see if height is greater than width
|
||||
# so we can do a better crop of portrait images.
|
||||
size="$og_height"
|
||||
((og_height > og_width)) && size="$og_width"
|
||||
fi
|
||||
|
||||
case "$crop_mode" in
|
||||
"fit")
|
||||
c="$(convert "$image" \
|
||||
-colorspace srgb \
|
||||
-format "%[pixel:p{0,0}]" info:)"
|
||||
|
||||
convert \
|
||||
-background none \
|
||||
"$image" \
|
||||
-trim +repage \
|
||||
-gravity south \
|
||||
-background "$c" \
|
||||
-extent "$size"x"$size" \
|
||||
-scale "$width"x"$height" \
|
||||
"$thumbnail_dir/$image_name"
|
||||
;;
|
||||
|
||||
"fill")
|
||||
convert \
|
||||
-background none \
|
||||
"$image" \
|
||||
-trim +repage \
|
||||
-scale "$width"x"$height"^ \
|
||||
-extent "$width"x"$height" \
|
||||
"$thumbnail_dir/$image_name"
|
||||
;;
|
||||
|
||||
"none") cp "$image" "$thumbnail_dir/$image_name" ;;
|
||||
*)
|
||||
convert \
|
||||
-background none \
|
||||
"$image" \
|
||||
-gravity "$crop_offset" \
|
||||
-crop "$size"x"$size"+0+0 \
|
||||
-quality 95 \
|
||||
-scale "$width"x"$height" \
|
||||
"$thumbnail_dir/$image_name"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# The final image.
|
||||
image="$thumbnail_dir/$image_name"
|
||||
}
|
||||
|
||||
display_image() {
|
||||
case "$image_backend" in
|
||||
"caca")
|
||||
@@ -3011,6 +2957,11 @@ display_image() {
|
||||
to_off "Image: jp2a failed to display the image."
|
||||
;;
|
||||
|
||||
"kitty")
|
||||
kitty icat --align left --place "${width}x${height}@${xoffset}x${yoffset}" "$image" ||\
|
||||
to_off "Image: kitty failed to display the image."
|
||||
;;
|
||||
|
||||
"pixterm")
|
||||
pixterm -tc "$((width / font_width))" \
|
||||
-tr "$((height / font_height))" \
|
||||
@@ -3030,10 +2981,10 @@ display_image() {
|
||||
|
||||
"iterm2")
|
||||
image="$(base64 < "$image")"
|
||||
iterm_cmd="\\e]1337;File=width=${width}px;height=${height}px;inline=1:${image}"
|
||||
iterm_cmd="\e]1337;File=width=${width}px;height=${height}px;inline=1:${image}"
|
||||
|
||||
# Tmux requires an additional escape sequence for this to work.
|
||||
[[ -n "$TMUX" ]] && iterm_cmd="\\ePtmux;\\e${iterm_cmd}\\e\\"
|
||||
[[ -n "$TMUX" ]] && iterm_cmd="\ePtmux;\e${iterm_cmd}\e\\"
|
||||
|
||||
printf "%b\a\n" "$iterm_cmd"
|
||||
;;
|
||||
@@ -3069,7 +3020,7 @@ to_ascii() {
|
||||
get_ascii
|
||||
|
||||
# Set cursor position next image/ascii.
|
||||
printf "%b" "\\e[${lines:-0}A\\e[9999999D"
|
||||
printf "%b" "\e[${lines:-0}A\e[9999999D"
|
||||
}
|
||||
|
||||
to_off() {
|
||||
@@ -3146,7 +3097,7 @@ scrot_program() {
|
||||
# falling back to OS specific screenshot tools.
|
||||
if [[ -n "$DISPLAY" ]]; then
|
||||
if [[ "$scrot_cmd" != "auto" ]] && type -p "${scrot_cmd%% *}" >/dev/null; then
|
||||
scrot_program=($scrot_cmd)
|
||||
IFS=" " read -ra scrot_program <<< "$scrot_cmd"
|
||||
|
||||
elif type -p maim >/dev/null; then
|
||||
scrot_program=(maim)
|
||||
@@ -3229,7 +3180,7 @@ prin() {
|
||||
string="${2:-$1}"
|
||||
local subtitle_color="$info_color"
|
||||
fi
|
||||
string="$(trim "${string//$'\\e[0m'}")"
|
||||
string="$(trim "${string//$'\e[0m'}")"
|
||||
|
||||
# Log length if it doesn't exist.
|
||||
if [[ -z "$length" ]]; then
|
||||
@@ -3242,7 +3193,7 @@ prin() {
|
||||
string="${subtitle_color}${bold}${string}"
|
||||
|
||||
# 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}${reset} "
|
||||
|
||||
# Calculate info height.
|
||||
((++info_height))
|
||||
@@ -3254,7 +3205,7 @@ prin() {
|
||||
get_underline() {
|
||||
if [[ "$underline_enabled" == "on" ]]; then
|
||||
printf -v underline "%${length}s"
|
||||
printf "%b%b\n" "${text_padding:+\\e[${text_padding}C}${zws}${underline_color}" \
|
||||
printf "%b%b\n" "${text_padding:+\e[${text_padding}C}${zws}${underline_color}" \
|
||||
"${underline// /$underline_char}${reset} "
|
||||
unset -v length
|
||||
fi
|
||||
@@ -3275,12 +3226,12 @@ get_line_break() {
|
||||
|
||||
get_bold() {
|
||||
case "$ascii_bold" in
|
||||
"on") ascii_bold="\\e[1m" ;;
|
||||
"on") ascii_bold="\e[1m" ;;
|
||||
"off") ascii_bold="" ;;
|
||||
esac
|
||||
|
||||
case "$bold" in
|
||||
"on") bold="\\e[1m" ;;
|
||||
"on") bold="\e[1m" ;;
|
||||
"off") bold="" ;;
|
||||
esac
|
||||
}
|
||||
@@ -3300,10 +3251,10 @@ trim_quotes() {
|
||||
}
|
||||
|
||||
strip_sequences() {
|
||||
strip="${1//$'\\e['3[0-9]m}"
|
||||
strip="${strip//$'\\e['38\;5\;[0-9]m}"
|
||||
strip="${strip//$'\\e['38\;5\;[0-9][0-9]m}"
|
||||
strip="${strip//$'\\e['38\;5\;[0-9][0-9][0-9]m}"
|
||||
strip="${1//$'\e['3[0-9]m}"
|
||||
strip="${strip//$'\e['38\;5\;[0-9]m}"
|
||||
strip="${strip//$'\e['38\;5\;[0-9][0-9]m}"
|
||||
strip="${strip//$'\e['38\;5\;[0-9][0-9][0-9]m}"
|
||||
|
||||
printf "%s\n" "$strip"
|
||||
}
|
||||
@@ -4162,9 +4113,9 @@ set_text_colors() {
|
||||
|
||||
color() {
|
||||
case "$1" in
|
||||
[0-6]) printf "%b" "${reset}\\e[3${1}m" ;;
|
||||
7 | "fg") printf "%b" "\\e[37m${reset}" ;;
|
||||
*) printf "%b" "\\e[38;5;${1}m" ;;
|
||||
[0-6]) printf "%b" "${reset}\e[3${1}m" ;;
|
||||
7 | "fg") printf "%b" "\e[37m${reset}" ;;
|
||||
*) printf "%b" "\e[38;5;${1}m" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -4187,7 +4138,7 @@ stdout() {
|
||||
}
|
||||
|
||||
err() {
|
||||
err+="$(color 1)[!]\\e[0m $1\n"
|
||||
err+="$(color 1)[!]\e[0m $1\n"
|
||||
}
|
||||
|
||||
get_full_path() {
|
||||
@@ -4371,7 +4322,7 @@ dynamic_prompt() {
|
||||
if ((lines > 1)); then
|
||||
case "$kernel_name" in
|
||||
"OpenBSD") tput cud "$lines" ;;
|
||||
*) printf "%b" "\\e[${lines}B" ;;
|
||||
*) printf "%b" "\e[${lines}B" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
@@ -4460,7 +4411,7 @@ old_options() {
|
||||
cache_uname() {
|
||||
# Cache the output of uname so we don't
|
||||
# have to spawn it multiple times.
|
||||
uname=($(uname -sr))
|
||||
IFS=" " read -ra uname <<< "$(uname -sr)"
|
||||
|
||||
kernel_name="${uname[0]}"
|
||||
kernel_version="${uname[1]}"
|
||||
@@ -4707,6 +4658,7 @@ IMAGE BACKEND:
|
||||
--catimg source Shortcut to use 'catimg' backend.
|
||||
--iterm2 source Shortcut to use 'iterm2' backend.
|
||||
--jp2a source Shortcut to use 'jp2a' backend.
|
||||
--kitty source Shortcut to use 'kitty' backend.
|
||||
--pixterm source Shortcut to use 'pixterm' backend.
|
||||
--sixel source Shortcut to use 'sixel' backend.
|
||||
--termpix source Shortcut to use 'termpix' backend.
|
||||
@@ -4762,7 +4714,7 @@ IMAGE:
|
||||
NOTE: --gap can take a negative value which will move the text
|
||||
closer to the left side.
|
||||
|
||||
--clean Delete cached files and thumbnails.
|
||||
--clean Delete cached files.
|
||||
|
||||
SCREENSHOT:
|
||||
-s, --scrot /path/to/img Take a screenshot, if path is left empty the screen-
|
||||
@@ -4790,37 +4742,6 @@ Report bugs to https://github.com/dylanaraps/neofetch/issues
|
||||
exit 1
|
||||
}
|
||||
|
||||
version() { printf "%s" "\
|
||||
Neofetch $version
|
||||
|
||||
Copyright (c) 2016-2017 Dylan Araps
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the 'Software'), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Written by Dylan Araps with help from the following people:
|
||||
|
||||
https://github.com/dylanaraps/neofetch/contributors
|
||||
|
||||
"
|
||||
exit 1
|
||||
}
|
||||
|
||||
get_args() {
|
||||
# Check the commandline flags early for '--config'.
|
||||
[[ "$*" != *--config* ]] && get_user_config
|
||||
@@ -4862,7 +4783,7 @@ get_args() {
|
||||
case "$arg" in
|
||||
"--disk_show") ;;
|
||||
"-"*) break ;;
|
||||
*) disk_show+=($arg)
|
||||
*) disk_show+=("$arg") ;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
@@ -4886,7 +4807,7 @@ get_args() {
|
||||
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
|
||||
case "$arg" in
|
||||
"-"*) break ;;
|
||||
*) colors+=($arg)
|
||||
*) colors+=("$arg") ;;
|
||||
esac
|
||||
done
|
||||
colors+=(7 7 7 7 7 7)
|
||||
@@ -4925,7 +4846,7 @@ get_args() {
|
||||
"--backend") image_backend="$2" ;;
|
||||
"--source") image_source="$2" ;;
|
||||
"--ascii" | "--caca" | "--catimg" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
|
||||
"--sixel" | "--termpix" | "--tycat" | "--w3m")
|
||||
"--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
|
||||
image_backend="${1/--}"
|
||||
case "$2" in
|
||||
"-"* | "") ;;
|
||||
@@ -4943,7 +4864,6 @@ get_args() {
|
||||
"--background_color" | "--bg_color") background_color="$2" ;;
|
||||
"--gap") gap="$2" ;;
|
||||
"--clean")
|
||||
[[ -d "$thumbnail_dir" ]] && rm -rf "$thumbnail_dir"
|
||||
rm -rf "/Library/Caches/neofetch/"
|
||||
rm -rf "/tmp/neofetch/"
|
||||
exit
|
||||
@@ -4954,7 +4874,7 @@ get_args() {
|
||||
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
|
||||
case "$arg" in
|
||||
"-"*) break ;;
|
||||
*) ascii_colors+=($arg)
|
||||
*) ascii_colors+=("$arg")
|
||||
esac
|
||||
done
|
||||
ascii_colors+=(7 7 7 7 7 7)
|
||||
@@ -4998,7 +4918,10 @@ get_args() {
|
||||
"-v") verbose="on" ;;
|
||||
"-vv") set -x; verbose="on" ;;
|
||||
"--help") usage ;;
|
||||
"--version") version ;;
|
||||
"--version")
|
||||
printf "%s\\n" "Neofetch $version"
|
||||
exit 1
|
||||
;;
|
||||
"--gen-man")
|
||||
help2man -n "A fast, highly customizable system info script" \
|
||||
-N ./neofetch -o neofetch.1
|
||||
@@ -5024,10 +4947,10 @@ main() {
|
||||
# Minix doesn't support these sequences.
|
||||
if [[ "$TERM" != "minix" && "$stdout" != "on" ]]; then
|
||||
# If the script exits for any reason, unhide the cursor.
|
||||
trap 'printf "\\e[?25h\\e[?7h"' EXIT
|
||||
trap 'printf "\e[?25h\e[?7h"' EXIT
|
||||
|
||||
# Hide the cursor and disable line wrap.
|
||||
printf "\\e[?25l\\e[?7l"
|
||||
printf "\e[?25l\e[?7l"
|
||||
fi
|
||||
|
||||
image_backend
|
||||
|
29
neofetch.1
29
neofetch.1
@@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH NEOFETCH "1" "April 2018" "Neofetch 3.4.0" "User Commands"
|
||||
.TH NEOFETCH "1" "April 2018" "Neofetch 3.4.1-git" "User Commands"
|
||||
.SH NAME
|
||||
Neofetch \- A fast, highly customizable system info script
|
||||
.SH SYNOPSIS
|
||||
@@ -211,6 +211,9 @@ Shortcut to use 'iterm2' backend.
|
||||
\fB\-\-jp2a\fR source
|
||||
Shortcut to use 'jp2a' backend.
|
||||
.TP
|
||||
\fB\-\-kitty\fR source
|
||||
Shortcut to use 'kitty' backend.
|
||||
.TP
|
||||
\fB\-\-pixterm\fR source
|
||||
Shortcut to use 'pixterm' backend.
|
||||
.TP
|
||||
@@ -338,29 +341,5 @@ Display a verbose log for error reporting.
|
||||
.TP
|
||||
\fB\-\-gen\-man\fR
|
||||
Generate a manpage for Neofetch in your PWD. (Requires GNU help2man)
|
||||
.SH AUTHOR
|
||||
Written by Dylan Araps with help from the following people:
|
||||
.PP
|
||||
https://github.com/dylanaraps/neofetch/contributors
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to https://github.com/dylanaraps/neofetch/issues
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2016\-2017 Dylan Araps
|
||||
.PP
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the 'Software'), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
.PP
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
.PP
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
Reference in New Issue
Block a user