mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 19:49:54 +00:00
Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb81e21ee2 | ||
|
|
e8ab52de7d | ||
|
|
b4fc29e6f6 | ||
|
|
c64b5c3d8c | ||
|
|
0f0d9aa84f | ||
|
|
6991b71ccb | ||
|
|
de0d342852 | ||
|
|
33d6dd760f | ||
|
|
130b7028ef | ||
|
|
f49919e957 | ||
|
|
5143b20ce1 | ||
|
|
d6d6e6ea63 | ||
|
|
15c2939779 | ||
|
|
5756eb97f2 | ||
|
|
14981205c6 | ||
|
|
dfc8b10ee4 | ||
|
|
38762182e8 | ||
|
|
3ee0980aac | ||
|
|
3f021fbbb6 | ||
|
|
8e99bc6e5f | ||
|
|
dc9334b7f1 | ||
|
|
070651e4f4 | ||
|
|
6aba54154c | ||
|
|
c5188a891f | ||
|
|
6bf7f9452e | ||
|
|
4895ed33b1 | ||
|
|
8ad455a1ce | ||
|
|
aed206b5d7 | ||
|
|
a27382d21d | ||
|
|
0fe972073f | ||
|
|
fc229704c8 | ||
|
|
c4bf54db3d | ||
|
|
7b1b3755a9 | ||
|
|
cb68508be2 | ||
|
|
7a4492c6c3 | ||
|
|
1f678f8020 | ||
|
|
e4c1732c01 | ||
|
|
c9bda1dd09 | ||
|
|
c814f14726 | ||
|
|
992d0b38ae | ||
|
|
c782af6a06 | ||
|
|
80299bd064 | ||
|
|
c69e5ef041 | ||
|
|
19d35b995d | ||
|
|
0e43d765fa | ||
|
|
8b4c858042 | ||
|
|
98252472ce | ||
|
|
6e41d5e0a9 | ||
|
|
b16ff8bc4d | ||
|
|
bad073d78a | ||
|
|
0f7e7b6ee0 | ||
|
|
e398f1ee08 | ||
|
|
0d89e1a400 | ||
|
|
da94f65b8c |
34
CHANGELOG.md
34
CHANGELOG.md
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- [ascii] Fixed a bug causing Windows 7 ASCII art to not display.
|
||||||
|
- [image] Added new option to configure the resolution of `catimg`.
|
||||||
|
- [font] Fix iTerm2 checking for 2 extra profiles that don't exist. [**@iandrewt**](https://github.com/iandrewt")
|
||||||
|
|
||||||
|
## [4.0.2] - 2018-05-19
|
||||||
|
|
||||||
|
- [config] Fixed `/dev/stdin` error.
|
||||||
|
- [config] Added `--print_config` to display the default config file.
|
||||||
|
- [macOS] Fixed xquartz issue.
|
||||||
|
|
||||||
|
|
||||||
|
## [4.0.1] - 2018-05-18
|
||||||
|
|
||||||
|
### Note: This release is only required for those running `bash <3.3`.
|
||||||
|
|
||||||
|
- [config] Fixed issue with default config in bash3.
|
||||||
|
- [packages] Simplified code.
|
||||||
|
- [term] Fixed macOS issue.
|
||||||
|
- [term] Fixed `tmux` issue.
|
||||||
|
|
||||||
|
|
||||||
|
## [4.0.0] - 2018-05-17
|
||||||
|
|
||||||
|
<h1><img src="https://i.imgur.com/JFxwJtU.png" alt="logo" height="100px"></h1>
|
||||||
|
|
||||||
This release bumps the version number up to `4.0.0` as it contains major
|
This release bumps the version number up to `4.0.0` as it contains major
|
||||||
changes to how Neofetch is packaged and installed.
|
changes to how Neofetch is packaged and installed.
|
||||||
|
|
||||||
@@ -24,7 +49,9 @@ it. :+1:
|
|||||||
|
|
||||||
## Discord
|
## Discord
|
||||||
|
|
||||||
Neofetch now has a Discord server. Come and join the discussion! <a
|
Neofetch now has a Discord server. Come and join the discussion!
|
||||||
|
|
||||||
|
<a
|
||||||
href="https://discord.gg/BtnTPFF"><img
|
href="https://discord.gg/BtnTPFF"><img
|
||||||
src="https://img.shields.io/discord/440354555197128704.svg"></a>
|
src="https://img.shields.io/discord/440354555197128704.svg"></a>
|
||||||
|
|
||||||
@@ -2653,7 +2680,10 @@ Changelog:
|
|||||||
Let me know if you're having issues.
|
Let me know if you're having issues.
|
||||||
|
|
||||||
|
|
||||||
[Unreleased]: https://github.com/dylanaraps/neofetch/compare/3.4.0...HEAD
|
[Unreleased]: https://github.com/dylanaraps/neofetch/compare/4.0.2...HEAD
|
||||||
|
[4.0.2]: https://github.com/dylanaraps/neofetch/compare/4.0.1...4.0.2
|
||||||
|
[4.0.1]: https://github.com/dylanaraps/neofetch/compare/4.0.0...4.0.1
|
||||||
|
[4.0.0]: https://github.com/dylanaraps/neofetch/compare/3.4.0...4.0.0
|
||||||
[3.4.0]: https://github.com/dylanaraps/neofetch/compare/3.3.0...3.4.0
|
[3.4.0]: https://github.com/dylanaraps/neofetch/compare/3.3.0...3.4.0
|
||||||
[3.3.0]: https://github.com/dylanaraps/neofetch/compare/3.2.0...3.3.0
|
[3.3.0]: https://github.com/dylanaraps/neofetch/compare/3.2.0...3.3.0
|
||||||
[3.2.0]: https://github.com/dylanaraps/neofetch/compare/3.1.0...3.2.0
|
[3.2.0]: https://github.com/dylanaraps/neofetch/compare/3.1.0...3.2.0
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -1,4 +1,5 @@
|
|||||||
<h1 align="center"><img src="https://i.imgur.com/JFxwJtU.png" alt="logo" height="50px"></h1>
|
<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">
|
<p align="center">
|
||||||
<a href="https://discord.gg/BtnTPFF"><img src="https://img.shields.io/discord/440354555197128704.svg"></a>
|
<a href="https://discord.gg/BtnTPFF"><img src="https://img.shields.io/discord/440354555197128704.svg"></a>
|
||||||
@@ -8,9 +9,7 @@
|
|||||||
<a href="https://www.patreon.com/dyla"><img src="https://img.shields.io/badge/donate-patreon-yellow.svg"></a>
|
<a href="https://www.patreon.com/dyla"><img src="https://img.shields.io/badge/donate-patreon-yellow.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a href="https://repology.org/metapackage/neofetch">
|
<img src="https://i.imgur.com/GFmC5Ad.png" alt="neofetch" align="right" height="240px">
|
||||||
<img src="https://repology.org/badge/vertical-allrepos/neofetch.svg" alt="Packaging status" align="right" width="150px" height="700px">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
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 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.
|
||||||
|
|
||||||
@@ -18,14 +17,14 @@ The overall purpose of Neofetch is to be used in screen-shots of your system. Ne
|
|||||||
|
|
||||||
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.
|
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.
|
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.<br>
|
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.
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
### 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)\]
|
### 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
|
## Articles
|
||||||
|
|
||||||
@@ -42,6 +41,7 @@ Neofetch supports almost 150 different operating systems. From Linux to Windows,
|
|||||||
- https://www.techrepublic.com/article/how-to-get-all-the-information-you-need-about-your-linux-machine-with-a-single-command/
|
- 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.tecmint.com/neofetch-shows-linux-system-information-with-logo/
|
||||||
- https://www.youtube.com/watch?v=bgepGW858fc
|
- https://www.youtube.com/watch?v=bgepGW858fc
|
||||||
|
- https://www.linuxuprising.com/2018/05/display-system-information-on-linux.html
|
||||||
|
|
||||||
|
|
||||||
## Thanks
|
## Thanks
|
||||||
|
|||||||
516
neofetch
516
neofetch
@@ -26,27 +26,21 @@
|
|||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
# Neofetch version.
|
version="4.0.3"
|
||||||
version="4.0.0"
|
|
||||||
|
|
||||||
bash_version="${BASH_VERSION/.*}"
|
bash_version="${BASH_VERSION/.*}"
|
||||||
sys_locale="${LANG:-C}"
|
sys_locale="${LANG:-C}"
|
||||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||||
|
PATH="/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec:${PATH}"
|
||||||
|
|
||||||
# Speed up script by not using unicode.
|
# Speed up script by not using unicode.
|
||||||
export LC_ALL=C
|
LC_ALL=C
|
||||||
export LANG=C
|
LANG=C
|
||||||
|
|
||||||
# Add more paths to $PATH.
|
|
||||||
export PATH="/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec:${PATH}"
|
|
||||||
|
|
||||||
# Fix issues with gsettings.
|
# Fix issues with gsettings.
|
||||||
export GIO_EXTRA_MODULES="/usr/lib/x86_64-linux-gnu/gio/modules/"
|
GIO_EXTRA_MODULES="/usr/lib/x86_64-linux-gnu/gio/modules/"
|
||||||
|
|
||||||
# Set no case match.
|
|
||||||
shopt -s nocasematch
|
shopt -s nocasematch
|
||||||
|
|
||||||
# Reset colors and bold.
|
|
||||||
reset="\e[0m"
|
reset="\e[0m"
|
||||||
|
|
||||||
# Neofetch default config.
|
# Neofetch default config.
|
||||||
@@ -747,6 +741,14 @@ crop_offset="center"
|
|||||||
# --size
|
# --size
|
||||||
image_size="auto"
|
image_size="auto"
|
||||||
|
|
||||||
|
# Catimg block size.
|
||||||
|
# Control the resolution of catimg.
|
||||||
|
#
|
||||||
|
# Default: '2'
|
||||||
|
# Values: '1', '2'
|
||||||
|
# Flags: --catimg_size
|
||||||
|
catimg_size="2"
|
||||||
|
|
||||||
# Gap between image and text
|
# Gap between image and text
|
||||||
#
|
#
|
||||||
# Default: '3'
|
# Default: '3'
|
||||||
@@ -773,51 +775,6 @@ xoffset=0
|
|||||||
background_color=
|
background_color=
|
||||||
|
|
||||||
|
|
||||||
# Scrot Options
|
|
||||||
|
|
||||||
|
|
||||||
# Whether or not to always take a screenshot
|
|
||||||
# You can manually take a screenshot with "--scrot" or "-s"
|
|
||||||
#
|
|
||||||
# Default: 'off'
|
|
||||||
# Values: 'on', 'off'
|
|
||||||
# Flags: --scrot
|
|
||||||
# -s
|
|
||||||
scrot="off"
|
|
||||||
|
|
||||||
# Screenshot Program
|
|
||||||
# Neofetch will automatically use whatever screenshot tool
|
|
||||||
# is installed on your system.
|
|
||||||
#
|
|
||||||
# If 'neofetch -v' says that it couldn't find a screenshot
|
|
||||||
# tool or you're using a custom tool then you can change
|
|
||||||
# the option below to a custom command.
|
|
||||||
#
|
|
||||||
# Default: 'auto'
|
|
||||||
# Values: 'auto' 'cmd -flags'
|
|
||||||
# Flag: --scrot_cmd
|
|
||||||
scrot_cmd="auto"
|
|
||||||
|
|
||||||
# Screenshot Filename
|
|
||||||
# What to name the screenshots
|
|
||||||
#
|
|
||||||
# Default: 'neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png'
|
|
||||||
# Values: 'string'
|
|
||||||
# Flag: --scrot_name
|
|
||||||
scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png"
|
|
||||||
|
|
||||||
# Image upload host
|
|
||||||
# Where to upload the image.
|
|
||||||
#
|
|
||||||
# Default: 'teknik'
|
|
||||||
# Values: 'imgur', 'teknik'
|
|
||||||
# Flag: --image_host
|
|
||||||
#
|
|
||||||
# NOTE: If you'd like another image host to be added to Neofetch.
|
|
||||||
# Open an issue on github.
|
|
||||||
image_host="teknik"
|
|
||||||
|
|
||||||
|
|
||||||
# Misc Options
|
# Misc Options
|
||||||
|
|
||||||
# Stdout mode
|
# Stdout mode
|
||||||
@@ -826,12 +783,6 @@ image_host="teknik"
|
|||||||
# Default: 'off'
|
# Default: 'off'
|
||||||
# Values: 'on', 'off'
|
# Values: 'on', 'off'
|
||||||
stdout="off"
|
stdout="off"
|
||||||
|
|
||||||
# Config version.
|
|
||||||
#
|
|
||||||
# NOTE: Don't change this value, neofetch reads this to determine
|
|
||||||
# how to handle backwards compatibility.
|
|
||||||
config_version="4.0.0"
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# DETECT INFORMATION
|
# DETECT INFORMATION
|
||||||
@@ -1303,83 +1254,83 @@ get_packages() {
|
|||||||
packages="$(pacman -Qq --color never | wc -l)"
|
packages="$(pacman -Qq --color never | wc -l)"
|
||||||
|
|
||||||
type -p dpkg >/dev/null && \
|
type -p dpkg >/dev/null && \
|
||||||
packages="$((packages+=$(dpkg --get-selections | grep -cv deinstall$)))"
|
((packages+=$(dpkg --get-selections | grep -cv deinstall$)))
|
||||||
|
|
||||||
type -p pkgtool >/dev/null && \
|
type -p pkgtool >/dev/null && \
|
||||||
packages="$((packages+=$(ls -1 /var/log/packages | wc -l)))"
|
((packages+=$(ls -1 /var/log/packages | wc -l)))
|
||||||
|
|
||||||
type -p rpm >/dev/null && \
|
type -p rpm >/dev/null && \
|
||||||
packages="$((packages+=$(rpm -qa | wc -l)))"
|
((packages+=$(rpm -qa | wc -l)))
|
||||||
|
|
||||||
type -p xbps-query >/dev/null && \
|
type -p xbps-query >/dev/null && \
|
||||||
packages="$((packages+=$(xbps-query -l | wc -l)))"
|
((packages+=$(xbps-query -l | wc -l)))
|
||||||
|
|
||||||
type -p pkginfo >/dev/null && \
|
type -p pkginfo >/dev/null && \
|
||||||
packages="$((packages+=$(pkginfo -i | wc -l)))"
|
((packages+=$(pkginfo -i | wc -l)))
|
||||||
|
|
||||||
type -p emerge >/dev/null && \
|
type -p emerge >/dev/null && \
|
||||||
packages="$((packages+=$(ls -d /var/db/pkg/*/* | wc -l)))"
|
((packages+=$(ls -d /var/db/pkg/*/* | wc -l)))
|
||||||
|
|
||||||
type -p nix-env >/dev/null && \
|
type -p nix-env >/dev/null && \
|
||||||
packages="$((packages+=$(ls -d -1 /nix/store/*/ | wc -l)))"
|
((packages+=$(ls -d -1 /nix/store/*/ | wc -l)))
|
||||||
|
|
||||||
type -p guix >/dev/null && \
|
type -p guix >/dev/null && \
|
||||||
packages="$((packages+=$(ls -d -1 /gnu/store/*/ | wc -l)))"
|
((packages+=$(ls -d -1 /gnu/store/*/ | wc -l)))
|
||||||
|
|
||||||
type -p apk >/dev/null && \
|
type -p apk >/dev/null && \
|
||||||
packages="$((packages+=$(apk info | wc -l)))"
|
((packages+=$(apk info | wc -l)))
|
||||||
|
|
||||||
type -p opkg >/dev/null && \
|
type -p opkg >/dev/null && \
|
||||||
packages="$((packages+=$(opkg list-installed | wc -l)))"
|
((packages+=$(opkg list-installed | wc -l)))
|
||||||
|
|
||||||
type -p pacman-g2 >/dev/null && \
|
type -p pacman-g2 >/dev/null && \
|
||||||
packages="$((packages+=$(pacman-g2 -Q | wc -l)))"
|
((packages+=$(pacman-g2 -Q | wc -l)))
|
||||||
|
|
||||||
type -p lvu >/dev/null && \
|
type -p lvu >/dev/null && \
|
||||||
packages="$((packages+=$(lvu installed | wc -l)))"
|
((packages+=$(lvu installed | wc -l)))
|
||||||
|
|
||||||
type -p tce-status >/dev/null && \
|
type -p tce-status >/dev/null && \
|
||||||
packages="$((packages+=$(tce-status -i | wc -l)))"
|
((packages+=$(tce-status -i | wc -l)))
|
||||||
|
|
||||||
type -p Compile >/dev/null && \
|
type -p Compile >/dev/null && \
|
||||||
packages="$((packages+=$(ls -d -1 /Programs/*/ | wc -l)))"
|
((packages+=$(ls -d -1 /Programs/*/ | wc -l)))
|
||||||
|
|
||||||
type -p eopkg >/dev/null && \
|
type -p eopkg >/dev/null && \
|
||||||
packages="$((packages+=$(ls -1 /var/lib/eopkg/package | wc -l)))"
|
((packages+=$(ls -1 /var/lib/eopkg/package | wc -l)))
|
||||||
|
|
||||||
type -p pkg_info >/dev/null && \
|
type -p pkg_info >/dev/null && \
|
||||||
packages="$((packages+=$(pkg_info | wc -l)))"
|
((packages+=$(pkg_info | wc -l)))
|
||||||
|
|
||||||
type -p crew >/dev/null && \
|
type -p crew >/dev/null && \
|
||||||
packages="$((packages+=$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)))"
|
((packages+=$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)))
|
||||||
|
|
||||||
type -p tazpkg >/dev/null && \
|
type -p tazpkg >/dev/null && \
|
||||||
packages="$((packages+=$(tazpkg list | wc -l) - 6))"
|
((packages+=$(tazpkg list | wc -l) - 6))
|
||||||
|
|
||||||
type -p sorcery >/dev/null && \
|
type -p sorcery >/dev/null && \
|
||||||
packages="$((packages+=$(gaze installed | wc -l)))"
|
((packages+=$(gaze installed | wc -l)))
|
||||||
|
|
||||||
type -p alps >/dev/null && \
|
type -p alps >/dev/null && \
|
||||||
packages="$((packages+=$(alps showinstalled | wc -l)))"
|
((packages+=$(alps showinstalled | wc -l)))
|
||||||
|
|
||||||
type -p kpt >/dev/null && \
|
type -p kpt >/dev/null && \
|
||||||
type -p kpm >/dev/null && \
|
type -p kpm >/dev/null && \
|
||||||
packages="$((packages+=$(kpm --get-selections | grep -cv deinstall$)))"
|
((packages+=$(kpm --get-selections | grep -cv deinstall$)))
|
||||||
|
|
||||||
if type -p cave >/dev/null; then
|
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)))"
|
((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l)))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
type -p butch >/dev/null && \
|
type -p butch >/dev/null && \
|
||||||
packages="$((packages+=$(butch list | wc -l)))"
|
((packages+=$(butch list | wc -l)))
|
||||||
|
|
||||||
if type -p pkg >/dev/null; then
|
if type -p pkg >/dev/null; then
|
||||||
case "$kernel_name" in
|
case "$kernel_name" in
|
||||||
"FreeBSD") packages="$((packages+=$(pkg info | wc -l)))" ;;
|
"FreeBSD") ((packages+=$(pkg info | wc -l))) ;;
|
||||||
*)
|
*)
|
||||||
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))"
|
((packages+=$(ls -1 /var/db/pkg | wc -l)))
|
||||||
((packages == 0)) && packages="$((packages+=$(pkg list | wc -l)))"
|
((packages == 0)) && ((packages+=$(pkg list | wc -l)))
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -1389,13 +1340,13 @@ get_packages() {
|
|||||||
packages="$(($(ls -l /usr/local/bin/ | grep -cv "\(../Cellar/\|brew\)") - 1))"
|
packages="$(($(ls -l /usr/local/bin/ | grep -cv "\(../Cellar/\|brew\)") - 1))"
|
||||||
|
|
||||||
type -p port >/dev/null && \
|
type -p port >/dev/null && \
|
||||||
packages="$((packages + $(port installed | wc -l) - 1))"
|
((packages+=$(port installed | wc -l) - 1))
|
||||||
|
|
||||||
type -p brew >/dev/null && \
|
type -p brew >/dev/null && \
|
||||||
packages="$((packages + $(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1))"
|
((packages+=$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1))
|
||||||
|
|
||||||
type -p pkgin >/dev/null && \
|
type -p pkgin >/dev/null && \
|
||||||
packages="$((packages + $(pkgin list | wc -l)))"
|
((packages+=$(pkgin list | wc -l)))
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Windows")
|
"Windows")
|
||||||
@@ -1406,7 +1357,7 @@ get_packages() {
|
|||||||
|
|
||||||
# Count chocolatey packages.
|
# Count chocolatey packages.
|
||||||
[[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \
|
[[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \
|
||||||
packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))"
|
((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Haiku")
|
"Haiku")
|
||||||
@@ -1415,7 +1366,7 @@ get_packages() {
|
|||||||
|
|
||||||
"AIX")
|
"AIX")
|
||||||
packages="$(lslpp -J -l -q | grep -cv '^#')"
|
packages="$(lslpp -J -l -q | grep -cv '^#')"
|
||||||
packages="$((packages+=$(rpm -qa | wc -l)))"
|
((packages+=$(rpm -qa | wc -l)))
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"IRIX")
|
"IRIX")
|
||||||
@@ -1424,7 +1375,7 @@ get_packages() {
|
|||||||
|
|
||||||
"FreeMiNT")
|
"FreeMiNT")
|
||||||
type -p rpm >/dev/null && \
|
type -p rpm >/dev/null && \
|
||||||
packages="$((packages+=$(rpm -qa | wc -l)))"
|
packages="$(rpm -qa | wc -l)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -1786,7 +1737,6 @@ get_wm_theme() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
wm_theme="$(trim_quotes "$wm_theme")"
|
wm_theme="$(trim_quotes "$wm_theme")"
|
||||||
wm_theme="$(uppercase "$wm_theme")"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cpu() {
|
get_cpu() {
|
||||||
@@ -2118,6 +2068,10 @@ get_gpu() {
|
|||||||
|
|
||||||
case "$gpu" in
|
case "$gpu" in
|
||||||
*"advanced"*)
|
*"advanced"*)
|
||||||
|
brand="${gpu/*AMD*ATI*/AMD ATI}"
|
||||||
|
brand="${brand:-${gpu/*AMD*/AMD}}"
|
||||||
|
brand="${brand:-${gpu/*ATI*/ATi}}"
|
||||||
|
|
||||||
gpu="${gpu/'[AMD/ATI]' }"
|
gpu="${gpu/'[AMD/ATI]' }"
|
||||||
gpu="${gpu/'[AMD]' }"
|
gpu="${gpu/'[AMD]' }"
|
||||||
gpu="${gpu/OEM }"
|
gpu="${gpu/OEM }"
|
||||||
@@ -2125,7 +2079,7 @@ get_gpu() {
|
|||||||
gpu="${gpu/ \/ *}"
|
gpu="${gpu/ \/ *}"
|
||||||
gpu="${gpu/*\[}"
|
gpu="${gpu/*\[}"
|
||||||
gpu="${gpu/\]*}"
|
gpu="${gpu/\]*}"
|
||||||
gpu="AMD $gpu"
|
gpu="$brand $gpu"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*"nvidia"*)
|
*"nvidia"*)
|
||||||
@@ -2250,8 +2204,8 @@ get_memory() {
|
|||||||
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
|
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
|
||||||
while IFS=":" read -r a b; do
|
while IFS=":" read -r a b; do
|
||||||
case "$a" in
|
case "$a" in
|
||||||
"MemTotal") mem_used="$((mem_used+=${b/kB}))"; mem_total="${b/kB}" ;;
|
"MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;;
|
||||||
"Shmem") mem_used="$((mem_used+=${b/kB}))" ;;
|
"Shmem") ((mem_used+=${b/kB})) ;;
|
||||||
"MemFree" | "Buffers" | "Cached" | "SReclaimable")
|
"MemFree" | "Buffers" | "Cached" | "SReclaimable")
|
||||||
mem_used="$((mem_used-=${b/kB}))"
|
mem_used="$((mem_used-=${b/kB}))"
|
||||||
;;
|
;;
|
||||||
@@ -2363,7 +2317,9 @@ get_memory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_song() {
|
get_song() {
|
||||||
player="$(ps -e | grep -m 1 -o \
|
player="$(ps -e)"
|
||||||
|
player="${player/iTunesHelper}"
|
||||||
|
player="$(grep -m 1 -F \
|
||||||
-e "Google Play" \
|
-e "Google Play" \
|
||||||
-e "Spotify" \
|
-e "Spotify" \
|
||||||
-e "amarok" \
|
-e "amarok" \
|
||||||
@@ -2378,7 +2334,7 @@ get_song() {
|
|||||||
-e "exaile" \
|
-e "exaile" \
|
||||||
-e "gnome-music" \
|
-e "gnome-music" \
|
||||||
-e "guayadeque" \
|
-e "guayadeque" \
|
||||||
-e "iTunes$" \
|
-e "iTunes" \
|
||||||
-e "juk" \
|
-e "juk" \
|
||||||
-e "lollypop" \
|
-e "lollypop" \
|
||||||
-e "mocp" \
|
-e "mocp" \
|
||||||
@@ -2394,7 +2350,9 @@ get_song() {
|
|||||||
-e "xmms2d" \
|
-e "xmms2d" \
|
||||||
-e "yarock" \
|
-e "yarock" \
|
||||||
-e "sayonara" \
|
-e "sayonara" \
|
||||||
-e "vlc")"
|
-e "vlc" -- <<< "$player")"
|
||||||
|
player="${player/* }"
|
||||||
|
player="${player##*/}"
|
||||||
|
|
||||||
[[ "$music_player" && "$music_player" != "auto" ]] && \
|
[[ "$music_player" && "$music_player" != "auto" ]] && \
|
||||||
player="$music_player"
|
player="$music_player"
|
||||||
@@ -2618,7 +2576,7 @@ get_style() {
|
|||||||
kde_font_size="${kde_font_size/,*}"
|
kde_font_size="${kde_font_size/,*}"
|
||||||
kde_theme="${kde_theme/,*} ${kde_theme/*,} ${kde_font_size}"
|
kde_theme="${kde_theme/,*} ${kde_theme/*,} ${kde_font_size}"
|
||||||
fi
|
fi
|
||||||
kde_theme="$(uppercase "$kde_theme") [KDE], "
|
kde_theme="$kde_theme [KDE], "
|
||||||
else
|
else
|
||||||
err "Theme: KDE config files not found, skipping."
|
err "Theme: KDE config files not found, skipping."
|
||||||
fi
|
fi
|
||||||
@@ -2694,10 +2652,6 @@ get_style() {
|
|||||||
gtk2_theme="$(trim_quotes "$gtk2_theme")"
|
gtk2_theme="$(trim_quotes "$gtk2_theme")"
|
||||||
gtk3_theme="$(trim_quotes "$gtk3_theme")"
|
gtk3_theme="$(trim_quotes "$gtk3_theme")"
|
||||||
|
|
||||||
# Uppercase the first letter of each GTK theme.
|
|
||||||
gtk2_theme="$(uppercase "$gtk2_theme")"
|
|
||||||
gtk3_theme="$(uppercase "$gtk3_theme")"
|
|
||||||
|
|
||||||
# Toggle visibility of GTK themes.
|
# Toggle visibility of GTK themes.
|
||||||
[[ "$gtk2" == "off" ]] && unset gtk2_theme
|
[[ "$gtk2" == "off" ]] && unset gtk2_theme
|
||||||
[[ "$gtk3" == "off" ]] && unset gtk3_theme
|
[[ "$gtk3" == "off" ]] && unset gtk3_theme
|
||||||
@@ -2787,14 +2741,16 @@ get_term() {
|
|||||||
[[ -z "$parent" ]] && break
|
[[ -z "$parent" ]] && break
|
||||||
name="$(get_process_name "$parent")"
|
name="$(get_process_name "$parent")"
|
||||||
case "${name// }" in
|
case "${name// }" in
|
||||||
"${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;;
|
"${SHELL/*\/}" | *"sh" | "screen" | "su"*) ;;
|
||||||
"login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;;
|
"login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;;
|
||||||
"ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"* | "kdeinit"*)
|
"ruby" | "1" | "systemd" | "sshd"* | "python"* |\
|
||||||
|
"USER"*"PID"* | "kdeinit"* | "launchd"*)
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"gnome-terminal-") term="gnome-terminal" ;;
|
"gnome-terminal-") term="gnome-terminal" ;;
|
||||||
*"nvim") term="Neovim Terminal" ;;
|
*"nvim") term="Neovim Terminal" ;;
|
||||||
*"NeoVimServer"*) term="VimR Terminal" ;;
|
*"NeoVimServer"*) term="VimR Terminal" ;;
|
||||||
|
*"tmux"*) term="tmux" ;;
|
||||||
*) term="${name##*/}" ;;
|
*) term="${name##*/}" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@@ -2852,9 +2808,10 @@ END
|
|||||||
font_file="${HOME}/Library/Preferences/com.googlecode.iterm2.plist"
|
font_file="${HOME}/Library/Preferences/com.googlecode.iterm2.plist"
|
||||||
|
|
||||||
# Count Guids in "New Bookmarks"; they should be unique
|
# Count Guids in "New Bookmarks"; they should be unique
|
||||||
profiles_count="$(PlistBuddy -c "Print :New\ Bookmarks:" "$font_file" | grep -c "Guid")"
|
profiles_count="$(PlistBuddy -c "Print :New\ Bookmarks:" "$font_file" | \
|
||||||
|
grep -w -c "Guid")"
|
||||||
|
|
||||||
for ((i=0; i<=profiles_count; i++)); do
|
for ((i=0; i<profiles_count; i++)); do
|
||||||
profile_name="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Name:" "$font_file")"
|
profile_name="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Name:" "$font_file")"
|
||||||
|
|
||||||
if [[ "$profile_name" == "$current_profile_name" ]]; then
|
if [[ "$profile_name" == "$current_profile_name" ]]; then
|
||||||
@@ -3404,9 +3361,9 @@ get_cols() {
|
|||||||
cols="${cols//nl/\\n\\e[${text_padding}C${zws}}"
|
cols="${cols//nl/\\n\\e[${text_padding}C${zws}}"
|
||||||
|
|
||||||
# Add block height to info height.
|
# Add block height to info height.
|
||||||
info_height="$((info_height+=block_height+2))"
|
((info_height+=block_height-1))
|
||||||
|
|
||||||
printf "%b\n" "\e[${text_padding}C${zws}${cols}"
|
printf "%b" "\e[${text_padding}C${zws}${cols}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset -v blocks blocks2 cols
|
unset -v blocks blocks2 cols
|
||||||
@@ -3414,7 +3371,7 @@ get_cols() {
|
|||||||
# TosWin2 on FreeMiNT is terrible at this,
|
# TosWin2 on FreeMiNT is terrible at this,
|
||||||
# so we'll reset colors arbitrarily.
|
# so we'll reset colors arbitrarily.
|
||||||
[[ "$term" == "TosWin2" ]] && \
|
[[ "$term" == "TosWin2" ]] && \
|
||||||
printf "%b\n" "\e[30;47m"
|
printf "%b" "\e[30;47m"
|
||||||
|
|
||||||
# Tell info() that we printed manually.
|
# Tell info() that we printed manually.
|
||||||
prin=1
|
prin=1
|
||||||
@@ -3491,7 +3448,7 @@ get_ascii() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Set locale to get correct padding.
|
# Set locale to get correct padding.
|
||||||
export LC_ALL="$sys_locale"
|
LC_ALL="$sys_locale"
|
||||||
|
|
||||||
# Turn file into variable.
|
# Turn file into variable.
|
||||||
while IFS=$'\n' read -r line; do
|
while IFS=$'\n' read -r line; do
|
||||||
@@ -3520,7 +3477,7 @@ get_ascii() {
|
|||||||
|
|
||||||
text_padding="$((ascii_length + gap))"
|
text_padding="$((ascii_length + gap))"
|
||||||
printf "%b" "$print"
|
printf "%b" "$print"
|
||||||
export LC_ALL=C
|
LC_ALL=C
|
||||||
}
|
}
|
||||||
|
|
||||||
get_image_source() {
|
get_image_source() {
|
||||||
@@ -3691,7 +3648,7 @@ get_term_size() {
|
|||||||
fi
|
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 (( "${term_width:-0}" < 50 )) && [[ "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||||
if type -p xdotool >/dev/null 2>&1; then
|
if type -p xdotool >/dev/null 2>&1; then
|
||||||
current_window="$(xdotool getactivewindow)"
|
current_window="$(xdotool getactivewindow)"
|
||||||
source <(xdotool getwindowgeometry --shell "$current_window")
|
source <(xdotool getwindowgeometry --shell "$current_window")
|
||||||
@@ -3714,13 +3671,11 @@ get_term_size() {
|
|||||||
awk -F ': ' '/Width|Height/ {printf $2 " "}')"
|
awk -F ': ' '/Width|Height/ {printf $2 " "}')"
|
||||||
term_width="${term_size/ *}"
|
term_width="${term_size/ *}"
|
||||||
term_height="${term_size/${term_width}}"
|
term_height="${term_size/${term_width}}"
|
||||||
else
|
|
||||||
term_width=0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
term_width=0
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
term_width="${term_width:-0}"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_image_size() {
|
get_image_size() {
|
||||||
@@ -3848,7 +3803,7 @@ display_image() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"catimg")
|
"catimg")
|
||||||
catimg -w "$((width * 2 / font_width))" "$image" ||\
|
catimg -w "$((width * 2 / font_width))" -r "$catimg_size" "$image" ||\
|
||||||
to_off "Image: catimg failed to display the image."
|
to_off "Image: catimg failed to display the image."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -3928,116 +3883,6 @@ to_off() {
|
|||||||
text_padding=
|
text_padding=
|
||||||
}
|
}
|
||||||
|
|
||||||
# SCREENSHOT
|
|
||||||
|
|
||||||
take_scrot() {
|
|
||||||
scrot_program "${scrot_dir}${scrot_name}"
|
|
||||||
|
|
||||||
err "Scrot: Saved screenshot as: ${scrot_dir}${scrot_name}"
|
|
||||||
|
|
||||||
[[ "$scrot_upload" == "on" ]] && scrot_upload
|
|
||||||
}
|
|
||||||
|
|
||||||
scrot_upload() {
|
|
||||||
if ! type -p curl >/dev/null 2>&1; then
|
|
||||||
printf "%s\n" "[!] Install curl to upload images"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
image_file="${scrot_dir}${scrot_name}"
|
|
||||||
|
|
||||||
# Print a message letting the user know we're uploading
|
|
||||||
# the screenshot.
|
|
||||||
printf "%s\r" "Uploading scrot"
|
|
||||||
sleep .2
|
|
||||||
printf "%s\r" "Uploading scrot."
|
|
||||||
sleep .2
|
|
||||||
printf "%s\r" "Uploading scrot.."
|
|
||||||
sleep .2
|
|
||||||
printf "%s\r" "Uploading scrot..."
|
|
||||||
|
|
||||||
case "$image_host" in
|
|
||||||
"teknik")
|
|
||||||
image_url="$(curl -sf -F file="@${image_file};type=image/png" \
|
|
||||||
"https://api.teknik.io/v1/Upload")"
|
|
||||||
image_url="$(awk -F 'url:|,' '{printf $2}' <<< "${image_url//\"}")"
|
|
||||||
;;
|
|
||||||
|
|
||||||
"imgur")
|
|
||||||
image_url="$(curl -sH "Authorization: Client-ID 0e8b44d15e9fc95" \
|
|
||||||
-F image="@${image_file}" "https://api.imgur.com/3/upload")"
|
|
||||||
image_url="$(awk -F 'id:|,' '{printf $2}' <<< "${image_url//\"}")"
|
|
||||||
[[ "$image_url" ]] && image_url="https://i.imgur.com/${image_url}.png"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf "%s\n" "${image_url:-'[!] Image failed to upload'}"
|
|
||||||
}
|
|
||||||
|
|
||||||
scrot_args() {
|
|
||||||
scrot="on"
|
|
||||||
|
|
||||||
if [[ "$2" =~ \.(png|jpg|jpe|jpeg|gif)$ ]]; then
|
|
||||||
scrot_name="${2##*/}"
|
|
||||||
scrot_dir="${2/$scrot_name}"
|
|
||||||
|
|
||||||
elif [[ -d "$2" ]]; then
|
|
||||||
scrot_dir="$2"
|
|
||||||
else
|
|
||||||
scrot_dir="${PWD:+${PWD}/}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
scrot_program() {
|
|
||||||
# Detect screenshot program.
|
|
||||||
#
|
|
||||||
# We first check to see if an X server is running before
|
|
||||||
# falling back to OS specific screenshot tools.
|
|
||||||
if [[ -n "$DISPLAY" ]]; then
|
|
||||||
if [[ "$scrot_cmd" != "auto" ]] && type -p "${scrot_cmd%% *}" >/dev/null; then
|
|
||||||
IFS=" " read -ra scrot_program <<< "$scrot_cmd"
|
|
||||||
|
|
||||||
elif type -p maim >/dev/null; then
|
|
||||||
scrot_program=(maim)
|
|
||||||
|
|
||||||
elif type -p scrot >/dev/null; then
|
|
||||||
scrot_program=(scrot)
|
|
||||||
|
|
||||||
elif type -p import >/dev/null && [[ "$os" != "Mac OS X" ]]; then
|
|
||||||
scrot_program=(import -window root)
|
|
||||||
|
|
||||||
elif type -p imlib2_grab >/dev/null; then
|
|
||||||
scrot_program=(imlib2_grab)
|
|
||||||
|
|
||||||
elif type -p gnome-screenshot >/dev/null; then
|
|
||||||
scrot_program=(gnome-screenshot -f)
|
|
||||||
|
|
||||||
else
|
|
||||||
err "Scrot: No screen capture tool found."
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
case "$os" in
|
|
||||||
"Mac OS X") scrot_program=(screencapture -S) ;;
|
|
||||||
"Haiku") scrot_program=(screenshot -s) ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Print a message letting the user know we're taking
|
|
||||||
# a screenshot.
|
|
||||||
printf "%s\r" "Taking scrot"
|
|
||||||
sleep .2
|
|
||||||
printf "%s\r" "Taking scrot."
|
|
||||||
sleep .2
|
|
||||||
printf "%s\r" "Taking scrot.."
|
|
||||||
sleep .2
|
|
||||||
printf "%s\r" "Taking scrot..."
|
|
||||||
|
|
||||||
# Take the scrot.
|
|
||||||
"${scrot_program[@]}" "$1"
|
|
||||||
|
|
||||||
err "Scrot: Screen captured using ${scrot_program[0]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# TEXT FORMATTING
|
# TEXT FORMATTING
|
||||||
|
|
||||||
@@ -4073,6 +3918,8 @@ info() {
|
|||||||
prin() {
|
prin() {
|
||||||
# If $2 doesn't exist we format $1 as info.
|
# If $2 doesn't exist we format $1 as info.
|
||||||
if [[ "$(trim "$1")" && "$2" ]]; then
|
if [[ "$(trim "$1")" && "$2" ]]; then
|
||||||
|
[[ "$json" ]] && { printf " %s\n" "\"${1}\": \"${2}\","; return; }
|
||||||
|
|
||||||
string="${1}${2:+: $2}"
|
string="${1}${2:+: $2}"
|
||||||
else
|
else
|
||||||
string="${2:-$1}"
|
string="${2:-$1}"
|
||||||
@@ -4107,6 +3954,8 @@ get_underline() {
|
|||||||
"${underline// /$underline_char}${reset} "
|
"${underline// /$underline_char}${reset} "
|
||||||
unset -v length
|
unset -v length
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
((++info_height))
|
||||||
prin=1
|
prin=1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4116,7 +3965,6 @@ get_line_break() {
|
|||||||
|
|
||||||
# Calculate info height.
|
# Calculate info height.
|
||||||
((++info_height))
|
((++info_height))
|
||||||
line_breaks+="\n"
|
|
||||||
|
|
||||||
# Tell info() that we printed manually.
|
# Tell info() that we printed manually.
|
||||||
prin=1
|
prin=1
|
||||||
@@ -4157,14 +4005,6 @@ strip_sequences() {
|
|||||||
printf "%s\n" "$strip"
|
printf "%s\n" "$strip"
|
||||||
}
|
}
|
||||||
|
|
||||||
uppercase() {
|
|
||||||
if ((bash_version >= 4)); then
|
|
||||||
printf "%s" "${1^}"
|
|
||||||
else
|
|
||||||
printf "%s" "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# COLORS
|
# COLORS
|
||||||
|
|
||||||
set_colors() {
|
set_colors() {
|
||||||
@@ -4280,7 +4120,6 @@ get_user_config() {
|
|||||||
if [[ -f "$config_file" ]]; then
|
if [[ -f "$config_file" ]]; then
|
||||||
source "$config_file"
|
source "$config_file"
|
||||||
err "Config: Sourced user config. (${config_file})"
|
err "Config: Sourced user config. (${config_file})"
|
||||||
old_options
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
mkdir -p "${XDG_CONFIG_HOME}/neofetch/"
|
mkdir -p "${XDG_CONFIG_HOME}/neofetch/"
|
||||||
@@ -4302,7 +4141,6 @@ get_user_config() {
|
|||||||
|
|
||||||
source "$config_file"
|
source "$config_file"
|
||||||
err "Config: Sourced user config. (${config_file})"
|
err "Config: Sourced user config. (${config_file})"
|
||||||
old_options
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bar() {
|
bar() {
|
||||||
@@ -4363,49 +4201,19 @@ kde_config_dir() {
|
|||||||
kde_config_dir="${kde_config_dir/$'/:'*}"
|
kde_config_dir="${kde_config_dir/$'/:'*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_term_padding() {
|
|
||||||
# Terminal info.
|
|
||||||
#
|
|
||||||
# Parse terminal config files to get
|
|
||||||
# info about padding. Due to how w3m-img
|
|
||||||
# works padding around the terminal throws
|
|
||||||
# off the cursor placement calculation in
|
|
||||||
# specific terminals.
|
|
||||||
#
|
|
||||||
# Note: This issue only seems to affect
|
|
||||||
# URxvt.
|
|
||||||
((term_run != 1)) && get_term
|
|
||||||
|
|
||||||
case "$term" in
|
|
||||||
"URxvt"*)
|
|
||||||
border="$(xrdb -query | awk -F ':' '/^(URxvt|\*).internalBorder/ {printf $2; exit}')"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
dynamic_prompt() {
|
dynamic_prompt() {
|
||||||
case "$image_backend" in
|
[[ "$image_backend" == "off" ]] && { printf "\n"; return; }
|
||||||
"ascii") printf "\n" ;;
|
[[ "$image_backend" != "ascii" ]] && ((lines+=1000))
|
||||||
"off") return ;;
|
|
||||||
*)
|
|
||||||
get_term_padding
|
|
||||||
lines="$(((border + height + yoffset) / font_height))"
|
|
||||||
image_prompt="on"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If the info is higher than the ascii/image place the prompt
|
# If the ascii art is taller than the info.
|
||||||
# based on the info height instead of the ascii/image height.
|
if ((lines > info_height)); then
|
||||||
if ((lines < info_height)); then
|
|
||||||
[[ "$image_prompt" ]] && printf "\n"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
[[ "$image_prompt" ]] && printf "%b\n" "$line_breaks"
|
|
||||||
lines="$((lines - info_height + 1))"
|
lines="$((lines - info_height + 1))"
|
||||||
|
else
|
||||||
|
lines=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the prompt location.
|
# Set the prompt location.
|
||||||
if ((lines > 1)); then
|
if ((lines >= 1)); then
|
||||||
case "$kernel_name" in
|
case "$kernel_name" in
|
||||||
"OpenBSD") tput cud "$lines" ;;
|
"OpenBSD") tput cud "$lines" ;;
|
||||||
*) printf "%b" "\e[${lines}B" ;;
|
*) printf "%b" "\e[${lines}B" ;;
|
||||||
@@ -4413,87 +4221,6 @@ dynamic_prompt() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
old_functions() {
|
|
||||||
# Deprecated functions.
|
|
||||||
# Neofetch 2.0 changed the names of a few variables.
|
|
||||||
# This function adds backwards compatibility for the
|
|
||||||
# old variable names.
|
|
||||||
if type printinfo >/dev/null 2>&1; then
|
|
||||||
print_info() { printinfo ; }
|
|
||||||
get_wmtheme() { get_wm_theme; wmtheme="$wm_theme"; }
|
|
||||||
get_termfont() { get_term_font; termfont="$term_font"; }
|
|
||||||
get_localip() { get_local_ip; localip="$local_ip"; }
|
|
||||||
get_publicip() { get_public_ip; publicip="$public_ip"; }
|
|
||||||
get_linebreak() { get_line_break; linebreak="$line_break"; }
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_birthday() { get_install_date; birthday="$install_date"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
old_options() {
|
|
||||||
[[ -n "$osx_buildversion" ]] && \
|
|
||||||
err "Config: \$osx_buildversion is deprecated, use \$distro_shorthand instead."
|
|
||||||
[[ -n "$osx_codename" ]] && \
|
|
||||||
err "Config: \$osx_codename is deprecated, use \$distro_shorthand instead."
|
|
||||||
[[ "$cpu_cores" == "on" ]] && \
|
|
||||||
err "Config: cpu_cores='on' is deprecated, use cpu_cores='logical|physical|off' instead."
|
|
||||||
[[ -n "$image" ]] && \
|
|
||||||
{ err "Config: \$image is deprecated, use \$image_source instead."; image_source="$image"; }
|
|
||||||
|
|
||||||
# All progress_ variables were changed to bar_.
|
|
||||||
[[ -n "$progress_char" ]] && \
|
|
||||||
err "Config: \$progress_char is deprecated, use \$bar_char_{elapsed,total} instead."
|
|
||||||
[[ -n "$progress_border" ]] && \
|
|
||||||
{ err "Config: \$progress_border is deprecated, use \$bar_border instead."; \
|
|
||||||
bar_border="$progress_border"; }
|
|
||||||
[[ -n "$progress_length" ]] && \
|
|
||||||
{ err "Config: \$progress_length is deprecated, use \$bar_length instead."; \
|
|
||||||
bar_length="$progress_length"; }
|
|
||||||
[[ -n "$progress_color_elapsed" ]] && \
|
|
||||||
{ err "Config: \$progress_color_elapsed is deprecated, use \$bar_color_elapsed instead."; \
|
|
||||||
bar_color_elapsed="$progress_color_elapsed"; }
|
|
||||||
[[ -n "$progress_color_total" ]] && \
|
|
||||||
{ err "Config: \$progress_color_total is deprecated, use \$bar_color_total instead."; \
|
|
||||||
bar_color_total="$progress_color_total"; }
|
|
||||||
|
|
||||||
# All cpufreq values were changed in 3.0.
|
|
||||||
[[ "$speed_type" == "current" ]] && \
|
|
||||||
err "Config: speed_type='current' is deprecated, use speed_type='scaling_cur_freq' instead."
|
|
||||||
[[ "$speed_type" == "min" ]] && \
|
|
||||||
err "Config: speed_type='min' is deprecated, use speed_type='scaling_min_freq' instead."
|
|
||||||
[[ "$speed_type" == "max" ]] && \
|
|
||||||
err "Config: speed_type='max' is deprecated, use speed_type='scaling_max_freq' instead."
|
|
||||||
[[ "$speed_type" == "bios" ]] && \
|
|
||||||
err "Config: speed_type='bios' is deprecated, use speed_type='bios_limit' instead."
|
|
||||||
|
|
||||||
# Ascii_logo_size was removed in 3.0.
|
|
||||||
[[ "$ascii_logo_size" ]] && \
|
|
||||||
err "Config: ascii_logo_size is deprecated, use ascii_distro='{distro}_small' instead."
|
|
||||||
|
|
||||||
# $start and $end were replaced with ${block_range[@]} in 3.0.
|
|
||||||
[[ "$start" && "$end" ]] && \
|
|
||||||
{ err "Config: \$start and \$end are deprecated, use block_range=(0 7) instead."; \
|
|
||||||
block_range=("$start" "$end"); }
|
|
||||||
|
|
||||||
# Fahrenheit support was added to CPU so the options were changed.
|
|
||||||
[[ "$cpu_temp" == "on" ]] && \
|
|
||||||
{ err "Config: cpu_temp='on' is deprecated, use cpu_temp='C' or 'F' instead.";
|
|
||||||
cpu_temp="C"; }
|
|
||||||
|
|
||||||
# Birthday was renamed to Install Date in 3.0
|
|
||||||
[[ -n "$birthday_time" ]] && \
|
|
||||||
{ err "Config: \$birthday_time is deprecated, use \3install_time instead."; \
|
|
||||||
install_time="$birthday_time"; }
|
|
||||||
|
|
||||||
# Scrot dir was removed in 3.1.0.
|
|
||||||
[[ -n "$scrot_dir" ]] && scrot_dir=
|
|
||||||
|
|
||||||
# cpu_shorthand was deprecated in 3.3.0
|
|
||||||
[[ -n "$cpu_shorthand" ]] && \
|
|
||||||
{ err "Config: \$cpu_shorthand is deprecated, use \$cpu_brand, \$cpu_cores, and
|
|
||||||
\$cpu_speed instead."; }
|
|
||||||
}
|
|
||||||
|
|
||||||
cache_uname() {
|
cache_uname() {
|
||||||
# Cache the output of uname so we don't
|
# Cache the output of uname so we don't
|
||||||
# have to spawn it multiple times.
|
# have to spawn it multiple times.
|
||||||
@@ -4784,6 +4511,7 @@ IMAGE:
|
|||||||
in some terminals emulators when using image mode.
|
in some terminals emulators when using image mode.
|
||||||
--size 00px | --size 00% How to size the image.
|
--size 00px | --size 00% How to size the image.
|
||||||
Possible values: auto, 00px, 00%, none
|
Possible values: auto, 00px, 00%, none
|
||||||
|
--catimg_size 1/2 Change the resolution of catimg.
|
||||||
--crop_mode mode Which crop mode to use
|
--crop_mode mode Which crop mode to use
|
||||||
Takes the values: normal, fit, fill
|
Takes the values: normal, fit, fill
|
||||||
--crop_offset value Change the crop offset for normal mode.
|
--crop_offset value Change the crop offset for normal mode.
|
||||||
@@ -4803,16 +4531,10 @@ IMAGE:
|
|||||||
|
|
||||||
--clean Delete cached files and thumbnails.
|
--clean Delete cached files and thumbnails.
|
||||||
|
|
||||||
SCREENSHOT:
|
|
||||||
-s, --scrot /path/to/img Take a screenshot, if path is left empty the screen-
|
|
||||||
shot function will use \$scrot_dir and \$scrot_name.
|
|
||||||
-su, --upload /path/to/img Same as --scrot but uploads the scrot to a website.
|
|
||||||
--image_host imgur/teknik Website to upload scrots to.
|
|
||||||
--scrot_cmd cmd Screenshot program to launch
|
|
||||||
|
|
||||||
OTHER:
|
OTHER:
|
||||||
--config /path/to/config Specify a path to a custom config file
|
--config /path/to/config Specify a path to a custom config file
|
||||||
--config none Launch the script without a config file
|
--config none Launch the script without a config file
|
||||||
|
--print_config Print the default config file to stdout.
|
||||||
--stdout Turn off all colors and disables any ASCII/image backend.
|
--stdout Turn off all colors and disables any ASCII/image backend.
|
||||||
--help Print this text and exit
|
--help Print this text and exit
|
||||||
--version Show neofetch version
|
--version Show neofetch version
|
||||||
@@ -4945,6 +4667,7 @@ get_args() {
|
|||||||
# Image options
|
# Image options
|
||||||
"--loop") image_loop="on" ;;
|
"--loop") image_loop="on" ;;
|
||||||
"--image_size" | "--size") image_size="$2" ;;
|
"--image_size" | "--size") image_size="$2" ;;
|
||||||
|
"--catimg_size") catimg_size="$2" ;;
|
||||||
"--crop_mode") crop_mode="$2" ;;
|
"--crop_mode") crop_mode="$2" ;;
|
||||||
"--crop_offset") crop_offset="$2" ;;
|
"--crop_offset") crop_offset="$2" ;;
|
||||||
"--xoffset") xoffset="$2" ;;
|
"--xoffset") xoffset="$2" ;;
|
||||||
@@ -4981,18 +4704,6 @@ get_args() {
|
|||||||
print_info() { info line_break; }
|
print_info() { info line_break; }
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Screenshot
|
|
||||||
"--scrot" | "-s")
|
|
||||||
scrot_args "$@"
|
|
||||||
;;
|
|
||||||
"--upload" | "-su")
|
|
||||||
scrot_upload="on"
|
|
||||||
scrot_args "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
"--image_host") image_host="$2" ;;
|
|
||||||
"--scrot_cmd") scrot_cmd="$2" ;;
|
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
"--config")
|
"--config")
|
||||||
case "$2" in
|
case "$2" in
|
||||||
@@ -5005,6 +4716,7 @@ get_args() {
|
|||||||
;;
|
;;
|
||||||
"--stdout") stdout="on" ;;
|
"--stdout") stdout="on" ;;
|
||||||
"-v") verbose="on" ;;
|
"-v") verbose="on" ;;
|
||||||
|
"--print_config") printf "%s\\n" "$config"; exit ;;
|
||||||
"-vv") set -x; verbose="on" ;;
|
"-vv") set -x; verbose="on" ;;
|
||||||
"--help") usage ;;
|
"--help") usage ;;
|
||||||
"--version")
|
"--version")
|
||||||
@@ -5017,6 +4729,17 @@ get_args() {
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"--json")
|
||||||
|
json="on"
|
||||||
|
unset -f get_title get_cols get_line_break get_underline
|
||||||
|
|
||||||
|
printf "{\n"
|
||||||
|
print_info 2>/dev/null
|
||||||
|
printf " %s\n" "\"Version\": \"${version}\""
|
||||||
|
printf "}\n"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
|
||||||
"--travis")
|
"--travis")
|
||||||
print_info() {
|
print_info() {
|
||||||
info title
|
info title
|
||||||
@@ -5081,7 +4804,7 @@ get_distro_ascii() {
|
|||||||
# This function gets the distro ascii art and colors.
|
# This function gets the distro ascii art and colors.
|
||||||
#
|
#
|
||||||
# $ascii_distro is the same as $distro.
|
# $ascii_distro is the same as $distro.
|
||||||
case "$ascii_distro" in
|
case "$( trim "$ascii_distro")" in
|
||||||
"AIX"*)
|
"AIX"*)
|
||||||
set_colors 2 7
|
set_colors 2 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -7727,6 +7450,28 @@ ${c1} ..
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Redcore"*)
|
||||||
|
set_colors 1
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1} RRRRRRRRR
|
||||||
|
RRRRRRRRRRRRR
|
||||||
|
RRRRRRRRRR RRRRR
|
||||||
|
RRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||||
|
RRRRRRR RRR RRR RRRRRRRR
|
||||||
|
RRRRR RR RRRRRRRRR
|
||||||
|
RRRR RR RRRRRRRR RR RRRRRR
|
||||||
|
RRRR R RRRRRRRRRRRRRR RR RRRRR
|
||||||
|
RRRR R RRRRRRRRRRRRRRRRRR R RRRRR
|
||||||
|
RRRR RRRRRRRRRRRRRRRRRRR R RRRR
|
||||||
|
RRR RRRRRRRRRRRRRRRRRRRR R RRRR
|
||||||
|
RRR RRRRRRRRRRRRRRRRRRRR RRRR
|
||||||
|
RR RRRRRRRRRRRRRRRRRRR RRR
|
||||||
|
RR RRRRRRRRRRRRRRRRR RRR
|
||||||
|
RR RRRRRRRRRRRRRR RR
|
||||||
|
R RRRR RR
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"Redhat"* | "Red Hat"* | "rhel"*)
|
"Redhat"* | "Red Hat"* | "rhel"*)
|
||||||
set_colors 1 7 3
|
set_colors 1 7 3
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -8677,7 +8422,7 @@ main() {
|
|||||||
get_os
|
get_os
|
||||||
|
|
||||||
# Load default config.
|
# Load default config.
|
||||||
source /dev/stdin < <(printf "%s\n" "$config")
|
eval "$config"
|
||||||
|
|
||||||
get_args "$@"
|
get_args "$@"
|
||||||
[[ "$verbose" != "on" ]] && exec 2>/dev/null
|
[[ "$verbose" != "on" ]] && exec 2>/dev/null
|
||||||
@@ -8696,7 +8441,6 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
image_backend
|
image_backend
|
||||||
old_functions
|
|
||||||
get_cache_dir
|
get_cache_dir
|
||||||
print_info
|
print_info
|
||||||
dynamic_prompt
|
dynamic_prompt
|
||||||
@@ -8705,19 +8449,15 @@ main() {
|
|||||||
# rendering issues in specific terminal emulators.
|
# rendering issues in specific terminal emulators.
|
||||||
[[ "$image_backend" == *w3m* ]] && display_image
|
[[ "$image_backend" == *w3m* ]] && display_image
|
||||||
|
|
||||||
# Take a screenshot.
|
|
||||||
[[ "$scrot" == "on" ]] && take_scrot
|
|
||||||
|
|
||||||
# Add neofetch info to verbose output.
|
# Add neofetch info to verbose output.
|
||||||
err "Neofetch command: $0 $*"
|
err "Neofetch command: $0 $*"
|
||||||
err "Neofetch version: $version"
|
err "Neofetch version: $version"
|
||||||
err "Neofetch config: $config_version"
|
|
||||||
|
|
||||||
# Show error messages.
|
# Show error messages.
|
||||||
[[ "$verbose" == "on" ]] && printf "%b" "$err" >&2
|
[[ "$verbose" == "on" ]] && printf "%b" "$err" >&2
|
||||||
|
|
||||||
# If `--loop` was used, constantly redraw the image.
|
# If `--loop` was used, constantly redraw the image.
|
||||||
while [[ "$image_loop" == "on" && "$image_backend" == "w3m" ]]; do display_image; sleep 1s; done
|
while [[ "$image_loop" == "on" && "$image_backend" == "w3m" ]]; do display_image; sleep 1; done
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
21
neofetch.1
21
neofetch.1
@@ -1,5 +1,5 @@
|
|||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||||
.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.0" "User Commands"
|
.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.3" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Neofetch \- A fast, highly customizable system info script
|
Neofetch \- A fast, highly customizable system info script
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -276,6 +276,9 @@ in some terminals emulators when using image mode.
|
|||||||
How to size the image.
|
How to size the image.
|
||||||
Possible values: auto, 00px, 00%, none
|
Possible values: auto, 00px, 00%, none
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-catimg_size\fR 1/2
|
||||||
|
Change the resolution of catimg.
|
||||||
|
.TP
|
||||||
\fB\-\-crop_mode\fR mode
|
\fB\-\-crop_mode\fR mode
|
||||||
Which crop mode to use
|
Which crop mode to use
|
||||||
Takes the values: normal, fit, fill
|
Takes the values: normal, fit, fill
|
||||||
@@ -305,19 +308,6 @@ closer to the left side.
|
|||||||
.TP
|
.TP
|
||||||
\fB\-\-clean\fR
|
\fB\-\-clean\fR
|
||||||
Delete cached files and thumbnails.
|
Delete cached files and thumbnails.
|
||||||
.SS "SCREENSHOT:"
|
|
||||||
.TP
|
|
||||||
\fB\-s\fR, \fB\-\-scrot\fR \fI\,/path/to/img\/\fP
|
|
||||||
Take a screenshot, if path is left empty the screenshot function will use $scrot_dir and $scrot_name.
|
|
||||||
.TP
|
|
||||||
\fB\-su\fR, \fB\-\-upload\fR \fI\,/path/to/img\/\fP
|
|
||||||
Same as \fB\-\-scrot\fR but uploads the scrot to a website.
|
|
||||||
.TP
|
|
||||||
\fB\-\-image_host\fR imgur/teknik
|
|
||||||
Website to upload scrots to.
|
|
||||||
.TP
|
|
||||||
\fB\-\-scrot_cmd\fR cmd
|
|
||||||
Screenshot program to launch
|
|
||||||
.SS "OTHER:"
|
.SS "OTHER:"
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-config\fR \fI\,/path/to/config\/\fP
|
\fB\-\-config\fR \fI\,/path/to/config\/\fP
|
||||||
@@ -326,6 +316,9 @@ Specify a path to a custom config file
|
|||||||
\fB\-\-config\fR none
|
\fB\-\-config\fR none
|
||||||
Launch the script without a config file
|
Launch the script without a config file
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-print_config\fR
|
||||||
|
Print the default config file to stdout.
|
||||||
|
.TP
|
||||||
\fB\-\-stdout\fR
|
\fB\-\-stdout\fR
|
||||||
Turn off all colors and disables any ASCII/image backend.
|
Turn off all colors and disables any ASCII/image backend.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
Reference in New Issue
Block a user