mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 17:09:21 +00:00
Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c902c2d69e | ||
|
efa9ff6726 | ||
|
0e59d6c041 | ||
|
8e29cd00b3 | ||
|
f2300d3306 | ||
|
77596ea868 | ||
|
11a2adc8ed | ||
|
aaabb9c3c0 | ||
|
6e20dfe759 | ||
|
2e5384581f | ||
|
e4224c4f77 | ||
|
4870a863ac | ||
|
9ad9d4d75e | ||
|
80a34bdf28 | ||
|
a9df517fd4 | ||
|
6711ebc91f | ||
|
8762403de9 | ||
|
a2290b7398 | ||
|
9f263fe184 | ||
|
c5c4f901ba | ||
|
9b5d75907b | ||
|
ed05c6460b | ||
|
7fc4f84217 | ||
|
c43ffb028e | ||
|
8540a2f1e3 | ||
|
db21981373 | ||
|
ca49b178fe | ||
|
1e8f12dd4a | ||
|
39cda4f29f | ||
|
ed99973989 | ||
|
fe9933f544 | ||
|
045577653c | ||
|
c3d47ece7d | ||
|
23340e29c3 | ||
|
fe057a157b | ||
|
f8c2bc2573 | ||
|
bb4bc945be | ||
|
acdd75220e | ||
|
a1e6843884 | ||
|
63df9687db | ||
|
744dd46330 | ||
|
dd8ee366b1 |
68
CHANGELOG.md
68
CHANGELOG.md
@@ -3,25 +3,89 @@
|
||||
- [**@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)
|
||||
|
||||
|
||||
## OS
|
||||
|
||||
- Fixed detection bug with Gentoo.
|
||||
- Fixed detection bug with TrueOS. [**@dawidd6**](https://github.com/dawidd6)
|
||||
- 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 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.
|
||||
|
||||
|
||||
## General
|
||||
|
||||
- Added more info to verbose mode for debugging.
|
||||
- Fixed bug in prompt location calculation.
|
||||
|
||||
|
||||
## Ascii
|
||||
|
||||
- Added color updates for Kubuntu logo. **Maulik Mistry**
|
||||
|
||||
|
||||
## Images
|
||||
|
||||
- [MacOS/iTerm2] Fixed thumbnail not appearing. [**@StarryTony**](https://github.com/StarryTony)
|
||||
- Fixed bug with getting wallpaper from feh.
|
||||
- Added `pixterm` backend.
|
||||
|
||||
## Info
|
||||
|
||||
**Desktop Environment**
|
||||
|
||||
- Added GNOME version.
|
||||
|
||||
**Window Manager**
|
||||
|
||||
- [macOS] Fixed chunkwm being detected as Kwm. [**@iandrewt**](https://github.com/iandrewt)
|
||||
- Added support for most (*if not all*) current Wayland compositors/window manager's.
|
||||
- [macOS] Fixed `chunkwm` being detected as `Kwm`. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Window Manager Theme**
|
||||
|
||||
- Fixed `sawfish` detection.
|
||||
|
||||
**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.
|
||||
|
||||
**GPU**
|
||||
|
||||
- [linux] Added driver version to NVIDIA output.
|
||||
- [macOS] Added NVIDIA support. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Package Manager**
|
||||
|
||||
- Added detection for Sabotage Linux's `butch` [**@MitchWeaver**](https://github.com/MitchWeaver)
|
||||
|
||||
**Resolution**
|
||||
|
||||
- [macOS] Fixed errors on non-retina screens. [**@iandrewt**](https://github.com/iandrewt)
|
||||
|
||||
**Song**
|
||||
|
||||
- Added support for Elisa. [**@mstraube**](https://github.com/mstraube)
|
||||
|
||||
**Model**
|
||||
|
||||
- Remove more unneeded outputs. [**@konimex**](https://github.com/konimex)
|
||||
|
||||
**Disk**
|
||||
|
||||
- Update Haiku's detection. [**@dawidd6**](https://github.com/dawidd6)
|
||||
|
9
ascii/distro/lede
Normal file
9
ascii/distro/lede
Normal file
@@ -0,0 +1,9 @@
|
||||
${c1} _________
|
||||
/ /\
|
||||
/ LE / \
|
||||
/ DE / \
|
||||
/________/ LE \
|
||||
\ \ DE /
|
||||
\ LE \ /
|
||||
\ DE \ /
|
||||
\________\/
|
@@ -543,7 +543,7 @@ disk_display="off"
|
||||
# Image backend.
|
||||
#
|
||||
# Default: 'ascii'
|
||||
# Values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', 'tycat', 'w3m'
|
||||
# Values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', 'termpix', 'pixterm', 'tycat', 'w3m'
|
||||
# Flag: --backend
|
||||
image_backend="ascii"
|
||||
|
||||
|
210
neofetch
210
neofetch
@@ -44,7 +44,6 @@ get_os() {
|
||||
"MINIX") os="MINIX" ;;
|
||||
"AIX") os="AIX" ;;
|
||||
"IRIX64") os="IRIX" ;;
|
||||
"HP-UX") os="HP-UX" ;;
|
||||
*)
|
||||
printf "%s\n" "Unknown OS detected: '$kernel_name', aborting..." >&2
|
||||
printf "%s\n" "Open an issue on GitHub to add support for your OS." >&2
|
||||
@@ -115,7 +114,8 @@ get_distro() {
|
||||
elif type -p tazpkg >/dev/null; then
|
||||
distro="SliTaz $(< /etc/slitaz-release)"
|
||||
|
||||
elif type -p kpm > /dev/null; then
|
||||
elif type -p kpt >/dev/null && \
|
||||
type -p kpm >/dev/null; then
|
||||
distro="KSLinux"
|
||||
|
||||
elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then
|
||||
@@ -154,7 +154,7 @@ get_distro() {
|
||||
|
||||
# Workarounds for FreeBSD based distros.
|
||||
[[ -f "/etc/pcbsd-lang" ]] && distro="PCBSD"
|
||||
[[ -f "/etc/rc.conf.trueos" ]] && distro="TrueOS"
|
||||
[[ -f "/etc/trueos-lang" ]] && distro="TrueOS"
|
||||
|
||||
# /etc/pacbsd-release is an empty file
|
||||
[[ -f "/etc/pacbsd-release" ]] && distro="PacBSD"
|
||||
@@ -227,11 +227,8 @@ get_distro() {
|
||||
distro="AIX $(oslevel)"
|
||||
;;
|
||||
|
||||
"IRIX" | "HP-UX")
|
||||
distro="$os ${kernel_version}"
|
||||
case "$distro_shorthand" in
|
||||
"on" | "tiny") distro="${distro/ ${kernel_version}}" ;;
|
||||
esac
|
||||
"IRIX")
|
||||
distro="IRIX ${kernel_version}"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -343,10 +340,6 @@ get_model() {
|
||||
"AIX")
|
||||
model="$(/usr/bin/uname -M)"
|
||||
;;
|
||||
|
||||
"HP-UX")
|
||||
model="$(model)"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove dummy OEM info.
|
||||
@@ -376,8 +369,8 @@ get_title() {
|
||||
}
|
||||
|
||||
get_kernel() {
|
||||
# Since AIX has no useful output in uname, it's better to skip this function altogether
|
||||
[[ "$os" == "AIX" ]] && return
|
||||
# Since these OS are integrated systems, it's better to skip this function altogether
|
||||
[[ "$os" =~ (AIX|IRIX) ]] && return
|
||||
|
||||
case "$kernel_shorthand" in
|
||||
"on") kernel="$kernel_version" ;;
|
||||
@@ -385,7 +378,7 @@ get_kernel() {
|
||||
esac
|
||||
|
||||
# Hide kernel info if it's identical to the distro info.
|
||||
if [[ "$os" =~ (BSD|MINIX|IRIX|HP-UX) && "$distro" == *"$kernel_name"* ]]; then
|
||||
if [[ "$os" =~ (BSD|MINIX) && "$distro" == *"$kernel_name"* ]]; then
|
||||
case "$distro_shorthand" in
|
||||
"on" | "tiny") kernel="$kernel_version" ;;
|
||||
*) unset kernel ;;
|
||||
@@ -425,8 +418,8 @@ get_uptime() {
|
||||
seconds="${seconds/.*}"
|
||||
;;
|
||||
|
||||
"AIX" | "IRIX" | "HP-UX")
|
||||
t="$(LC_ALL=POSIX UNIX95=1 ps -o etime= -p 1)"
|
||||
"AIX" | "IRIX")
|
||||
t="$(LC_ALL=POSIX ps -o etime= -p 1)"
|
||||
d="0" h="0"
|
||||
case "$t" in *"-"*) d="${t%%-*}"; t="${t#*-}";; esac
|
||||
case "$t" in *":"*":"*) h="${t%%:*}"; t="${t#*:}";; esac
|
||||
@@ -495,9 +488,6 @@ get_packages() {
|
||||
type -p dpkg >/dev/null && \
|
||||
packages="$((packages+=$(dpkg --get-selections | grep -cv deinstall$)))"
|
||||
|
||||
type -p kpm >/dev/null && \
|
||||
packages="$((packages+=$(kpm --get-selections | grep -cv deinstall$)))"
|
||||
|
||||
type -p pkgtool >/dev/null && \
|
||||
packages="$((packages+=$(ls -1 /var/log/packages | wc -l)))"
|
||||
|
||||
@@ -555,11 +545,18 @@ get_packages() {
|
||||
type -p alps >/dev/null && \
|
||||
packages="$((packages+=$(alps showinstalled | wc -l)))"
|
||||
|
||||
type -p kpt >/dev/null && \
|
||||
type -p kpm >/dev/null && \
|
||||
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/*)
|
||||
packages="$((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l)))"
|
||||
fi
|
||||
|
||||
type -p butch >/dev/null && \
|
||||
packages="$((packages+=$(butch list | wc -l)))"
|
||||
|
||||
if type -p pkg >/dev/null; then
|
||||
case "$kernel_name" in
|
||||
"FreeBSD") packages="$((packages+=$(pkg info | wc -l)))" ;;
|
||||
@@ -607,10 +604,6 @@ get_packages() {
|
||||
"IRIX")
|
||||
packages="$(($(versions -b | wc -l)-3))"
|
||||
;;
|
||||
|
||||
"HP-UX")
|
||||
packages="$(($(swlist -l product | wc -l)-6))"
|
||||
;;
|
||||
esac
|
||||
|
||||
((packages == 0)) && unset packages
|
||||
@@ -675,6 +668,9 @@ get_de() {
|
||||
|
||||
elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then
|
||||
de="MATE"
|
||||
|
||||
elif [[ "$TDE_FULL_SESSION" ]]; then
|
||||
de="Trinity"
|
||||
fi
|
||||
|
||||
# When a window manager is started from a display manager
|
||||
@@ -686,18 +682,21 @@ get_de() {
|
||||
esac
|
||||
|
||||
# Fallback to using xprop.
|
||||
[[ -n "$DISPLAY" && -z "$de" ]] && \
|
||||
[[ "$DISPLAY" && -z "$de" ]] && \
|
||||
de="$(xprop -root | awk '/KDE_SESSION_VERSION|^_MUFFIN|xfce4|xfce5/')"
|
||||
|
||||
# Format strings.
|
||||
case "$de" in
|
||||
"KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;;
|
||||
*"TDE_FULL_SESSION"*) de="Trinity" ;;
|
||||
*"MUFFIN"* | "Cinnamon") de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;;
|
||||
*"xfce4"*) de="Xfce4" ;;
|
||||
*"xfce5"*) de="Xfce5" ;;
|
||||
*"xfce"*) de="Xfce" ;;
|
||||
*"mate"*) de="MATE" ;;
|
||||
*"GNOME"*)
|
||||
de="$(gnome-shell --version)"
|
||||
de="${de/Shell }"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Log that the function was run.
|
||||
@@ -708,21 +707,37 @@ get_wm() {
|
||||
# If function was run, stop here.
|
||||
((wm_run == 1)) && return
|
||||
|
||||
if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||
if [[ "$WAYLAND_DISPLAY" ]]; then
|
||||
wm="$(ps -e | grep -m 1 -o -F \
|
||||
-e "asc" \
|
||||
-e "fireplace" \
|
||||
-e "grefsen" \
|
||||
-e "mazecompositor" \
|
||||
-e "maynard" \
|
||||
-e "motorcar" \
|
||||
-e "orbment" \
|
||||
-e "orbital" \
|
||||
-e "perceptia" \
|
||||
-e "rustland" \
|
||||
-e "sway" \
|
||||
-e "velox" \
|
||||
-e "wavy" \
|
||||
-e "wayhouse" \
|
||||
-e "way-cooler" \
|
||||
-e "westford" \
|
||||
-e "weston")"
|
||||
|
||||
elif [[ "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||
id="$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)"
|
||||
id="${id##* }"
|
||||
wm="$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)"
|
||||
wm="${wm/*_NET_WM_NAME = }"
|
||||
wm="${wm/*WM_NAME = }"
|
||||
wm="${wm/\"}"
|
||||
wm="${wm/\"*}"
|
||||
|
||||
# Window Maker does not set _NET_WM_NAME
|
||||
[[ "$wm" =~ "WINDOWMAKER" ]] && wm="wmaker"
|
||||
|
||||
# Fallback for Wayland wms.
|
||||
[[ "$wm" == "xwlc" ]] && \
|
||||
wm="$(ps -e | grep -m 1 -o -F -e "sway" -e "orbment" -e "velox" -e "orbital")"
|
||||
|
||||
else
|
||||
case "$os" in
|
||||
"Mac OS X")
|
||||
@@ -738,11 +753,13 @@ get_wm() {
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
wm="$(tasklist | grep -m 1 -o -F -e "bugn" \
|
||||
wm="$(tasklist | grep -m 1 -o -F \
|
||||
-e "bugn" \
|
||||
-e "Windawesome" \
|
||||
-e "blackbox" \
|
||||
-e "emerge" \
|
||||
-e "litestep")"
|
||||
|
||||
[[ "$wm" == "blackbox" ]] && wm="bbLean (Blackbox)"
|
||||
wm="${wm:+$wm, }Explorer"
|
||||
;;
|
||||
@@ -763,7 +780,7 @@ get_wm_theme() {
|
||||
;;
|
||||
|
||||
"Sawfish")
|
||||
wm_theme="$(awk -F ")" '/\(quote default-frame-style/ {print $2}' \
|
||||
wm_theme="$(awk -F '\\(quote|\\)' '/default-frame-style/ {print $(NF-4)}' \
|
||||
"${HOME}/.sawfish/custom")"
|
||||
;;
|
||||
|
||||
@@ -931,7 +948,12 @@ get_cpu() {
|
||||
esac
|
||||
|
||||
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
||||
temp_dir="/sys/class/hwmon/hwmon0/temp1_input"
|
||||
|
||||
# Select the right temperature file.
|
||||
for temp_dir in /sys/class/hwmon/*; do
|
||||
[[ "$(< "${temp_dir}/name")" =~ (coretemp|fam15h_power) ]] && \
|
||||
{ temp_dir="${temp_dir}/temp1_input"; break; }
|
||||
done
|
||||
|
||||
# Get CPU speed.
|
||||
if [[ -d "$speed_dir" ]]; then
|
||||
@@ -949,8 +971,8 @@ get_cpu() {
|
||||
|
||||
# Get CPU temp.
|
||||
if [[ -f "$temp_dir" ]]; then
|
||||
temp="$(< "$temp_dir")"
|
||||
temp="$((temp * 100 / 10000))"
|
||||
deg="$(< "$temp_dir")"
|
||||
deg="$((deg * 100 / 10000))"
|
||||
fi
|
||||
|
||||
# Get CPU cores.
|
||||
@@ -1013,12 +1035,12 @@ get_cpu() {
|
||||
# Get CPU temp.
|
||||
case "$kernel_name" in
|
||||
"FreeBSD"* | "DragonFly"* | "NetBSD"*)
|
||||
temp="$(sysctl -n dev.cpu.0.temperature)"
|
||||
temp="${temp/C}"
|
||||
deg="$(sysctl -n dev.cpu.0.temperature)"
|
||||
deg="${deg/C}"
|
||||
;;
|
||||
"OpenBSD"* | "Bitrig"*)
|
||||
temp="$(sysctl -n hw.sensors.lm0.temp0)"
|
||||
temp="${temp/ degC}"
|
||||
deg="$(sysctl -n hw.sensors.lm0.temp0)"
|
||||
deg="${deg/ degC}"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -1082,18 +1104,6 @@ get_cpu() {
|
||||
# Get CPU cores.
|
||||
cores="$(sysconf NPROC_ONLN)"
|
||||
;;
|
||||
|
||||
"HP-UX")
|
||||
# Get CPU name.
|
||||
# This will be partial for now, because apparently hppa and
|
||||
# IA64 has different approaches of how it should be handled.
|
||||
|
||||
# Get CPU speed.
|
||||
# Same reasons as above.
|
||||
|
||||
# Get CPU cores.
|
||||
cores="$(ioscan -k | grep -c "processor")"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove un-needed patterns from cpu output.
|
||||
@@ -1147,15 +1157,15 @@ get_cpu() {
|
||||
fi
|
||||
|
||||
# Add CPU temp to the output.
|
||||
if [[ "$cpu_temp" != "off" && "$temp" ]]; then
|
||||
temp="${temp//.}"
|
||||
if [[ "$cpu_temp" != "off" && "$deg" ]]; then
|
||||
deg="${deg//.}"
|
||||
|
||||
# Convert to Fahrenheit if enabled
|
||||
[[ "$cpu_temp" == "F" ]] && temp="$((temp * 90 / 50 + 320))"
|
||||
[[ "$cpu_temp" == "F" ]] && deg="$((deg * 90 / 50 + 320))"
|
||||
|
||||
# Format the output
|
||||
temp="[${temp/${temp: -1}}.${temp: -1}°${cpu_temp:-C}]"
|
||||
cpu="$cpu $temp"
|
||||
deg="[${deg/${deg: -1}}.${deg: -1}°${cpu_temp:-C}]"
|
||||
cpu="$cpu $deg"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1202,7 +1212,7 @@ get_gpu() {
|
||||
# Read GPUs into array.
|
||||
IFS=$'\n'
|
||||
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
|
||||
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a)
|
||||
'/"Display|"3D|"VGA/ {a[$0] = $1 $3 " " $4} END{for(i in a)
|
||||
{if(!seen[a[i]]++) print a[i]}}'))
|
||||
IFS="$old_ifs"
|
||||
|
||||
@@ -1234,9 +1244,16 @@ get_gpu() {
|
||||
;;
|
||||
|
||||
*"intel"*)
|
||||
# (sorry)
|
||||
freq="$(< /sys/devices/pci0000:00/0000:\
|
||||
"${gpu/ *}"/drm/card0/gt_cur_freq_mhz)"
|
||||
|
||||
type -p glxinfo >/dev/null && \
|
||||
gpu="$(glxinfo | grep "Device:.*Intel")"
|
||||
|
||||
gpu="${gpu/*Intel/Intel}"
|
||||
gpu="${gpu/'(R)'}"
|
||||
gpu="${gpu/'Corporation'}"
|
||||
gpu="${gpu/ \(*}"
|
||||
|
||||
[[ -z "$(trim "$gpu")" ]] && gpu="Intel Integrated Graphics"
|
||||
@@ -1253,7 +1270,8 @@ get_gpu() {
|
||||
gpu="${gpu/Intel }"
|
||||
fi
|
||||
|
||||
prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu"
|
||||
prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu ${freq:+@ ${freq}Mhz}"
|
||||
|
||||
((++gpu_num))
|
||||
done
|
||||
|
||||
@@ -1429,13 +1447,6 @@ get_memory() {
|
||||
mem_free="$((mem_stat[5] / 1024))"
|
||||
mem_used="$((mem_total - mem_free))"
|
||||
;;
|
||||
|
||||
"HP-UX")
|
||||
mem_total="$(machinfo | awk -F':' '/Memory/ {print $2}')"
|
||||
mem_total="${mem_total/MB*}"
|
||||
mem_free="$(($(vmstat | awk 'NR==3{printf $5}') / 1024))"
|
||||
mem_used="$((mem_total - mem_free))"
|
||||
;;
|
||||
esac
|
||||
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB}"
|
||||
|
||||
@@ -1650,7 +1661,7 @@ get_style() {
|
||||
# Fix weird output when the function is run multiple times.
|
||||
unset gtk2_theme gtk3_theme theme path
|
||||
|
||||
if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||
if [[ "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||
# Get DE if user has disabled the function.
|
||||
((de_run != 1)) && get_de
|
||||
|
||||
@@ -2063,7 +2074,7 @@ get_disk() {
|
||||
# Get "df" version.
|
||||
df_version="$(df --version 2>&1)"
|
||||
case "$df_version" in
|
||||
*"blocks"*) # Haiku
|
||||
*"Tracker"*) # Haiku
|
||||
err "Your version of df cannot be used due to the non-standard flags"
|
||||
return
|
||||
;;
|
||||
@@ -2075,10 +2086,7 @@ 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'
|
||||
case "$os" in
|
||||
"HP-UX") disks=($(bdf "${disk_show[@]:-/}" 2>/dev/null)); df_version="bdf" ;;
|
||||
*) disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}" 2>/dev/null)) ;;
|
||||
esac
|
||||
disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}"))
|
||||
unset 'disks[0]'
|
||||
IFS="$old_ifs"
|
||||
|
||||
@@ -2094,10 +2102,9 @@ get_disk() {
|
||||
disk_perc="${disk_info[4]/'%'}"
|
||||
|
||||
case "$df_version" in
|
||||
*"befhikm"*|"bdf")
|
||||
disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024)) (${disk_perc}%)"
|
||||
*"befhikm"*)
|
||||
disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)"
|
||||
;;
|
||||
|
||||
*) disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)" ;;
|
||||
esac
|
||||
|
||||
@@ -2275,7 +2282,6 @@ get_install_date() {
|
||||
esac
|
||||
;;
|
||||
"AIX") install_file="/var/adm/ras/bosinstlog" ;;
|
||||
"HP-UX") install_file="/dev/config" ;;
|
||||
esac
|
||||
|
||||
ls_prog="$(ls --version 2>&1)"
|
||||
@@ -2296,7 +2302,7 @@ get_install_date() {
|
||||
install_date="$(ls -tcd --full-time "$install_file" | awk '{printf $6 " " $7}')"
|
||||
;;
|
||||
|
||||
*"ACFHLNRS"* | *"RadC1xmnlog"* | *"1ARadeCx"*) # AIX ls / IRIX ls / HP-UX ls
|
||||
*"ACFHLNRS"* | *"RadC1xmnlog"*) # AIX ls / IRIX ls
|
||||
err "Install Date doesn't work because your 'ls' doesn't support full date/time."
|
||||
return
|
||||
;;
|
||||
@@ -2326,10 +2332,16 @@ get_gpu_driver() {
|
||||
gpu_driver="$(lspci -nnk | awk -F ': ' \
|
||||
'/Display|3D|VGA/{nr[NR+2]}; NR in nr {printf $2 ", "}')"
|
||||
gpu_driver="${gpu_driver%, }"
|
||||
|
||||
if [[ "$gpu_driver" == *"nvidia"* ]]; then
|
||||
gpu_driver="$(< /proc/driver/nvidia/version)"
|
||||
gpu_driver="${gpu_driver/*Module }"
|
||||
gpu_driver="NVIDIA ${gpu_driver/ *}"
|
||||
fi
|
||||
;;
|
||||
"Mac OS X")
|
||||
if [[ "$(kextstat | grep "GeForceWeb")" != "" ]]; then
|
||||
gpu_driver="Nvidia Web Driver"
|
||||
gpu_driver="NVIDIA Web Driver"
|
||||
else
|
||||
gpu_driver="macOS Default Graphics Driver"
|
||||
fi
|
||||
@@ -2392,7 +2404,8 @@ image_backend() {
|
||||
"ascii") get_ascii ;;
|
||||
"off") image_backend="off" ;;
|
||||
|
||||
"caca" | "catimg" | "jp2a" | "iterm2" | "termpix" | "tycat" | "w3m" | "sixel")
|
||||
"caca" | "catimg" | "jp2a" | "iterm2" | "termpix" |\
|
||||
"tycat" | "w3m" | "sixel" | "pixterm")
|
||||
get_image_source
|
||||
|
||||
if [[ ! -f "$image" ]]; then
|
||||
@@ -2418,7 +2431,7 @@ image_backend() {
|
||||
*)
|
||||
err "Image: Unknown image backend specified '$image_backend'."
|
||||
err "Image: Valid backends are: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2',
|
||||
'off', 'sixel', 'termpix', 'tycat', 'w3m')"
|
||||
'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')"
|
||||
err "Image: Falling back to ascii mode."
|
||||
get_ascii
|
||||
;;
|
||||
@@ -2708,6 +2721,12 @@ get_image_size() {
|
||||
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}" ;;
|
||||
@@ -2722,7 +2741,7 @@ get_image_size() {
|
||||
make_thumbnail() {
|
||||
# Name the thumbnail using variables so we can
|
||||
# use it later.
|
||||
image_name="$crop_mode-$crop_offset-$width-$height-${image//'/'/_}"
|
||||
image_name="$crop_mode-$crop_offset-$width-$height-${image##*/}"
|
||||
|
||||
# Handle file extensions.
|
||||
case "${image##*.}" in
|
||||
@@ -2812,8 +2831,16 @@ display_image() {
|
||||
to_off "Image: jp2a failed to display the image."
|
||||
;;
|
||||
|
||||
"pixterm")
|
||||
pixterm -tc "$((width / font_width))" \
|
||||
-tr "$((height / font_height))" \
|
||||
"$image" ||\
|
||||
to_off "Image: pixterm failed to display the image."
|
||||
;;
|
||||
|
||||
"sixel")
|
||||
img2sixel -w "$width" "$image" || to_off "Image: libsixel failed to display the image."
|
||||
img2sixel -w "$width" "$image" ||\
|
||||
to_off "Image: libsixel failed to display the image."
|
||||
;;
|
||||
|
||||
"termpix")
|
||||
@@ -3433,6 +3460,11 @@ get_distro_colors() {
|
||||
ascii_file="kubuntu"
|
||||
;;
|
||||
|
||||
"LEDE"*)
|
||||
set_colors 4 7 1
|
||||
ascii_file="lede"
|
||||
;;
|
||||
|
||||
"Linux")
|
||||
set_colors fg 8 3
|
||||
ascii_file="linux"
|
||||
@@ -4105,7 +4137,7 @@ dynamic_prompt() {
|
||||
fi
|
||||
|
||||
# Set the prompt location.
|
||||
((lines > 0)) && printf "%b" "\033[${lines}B"
|
||||
((lines > 1)) && printf "%b" "\033[${lines}B"
|
||||
}
|
||||
|
||||
old_functions() {
|
||||
@@ -4437,6 +4469,7 @@ IMAGE BACKEND:
|
||||
--catimg source Shortcut to use 'catimg' backend.
|
||||
--iterm2 source Shortcut to use 'iterm2' backend.
|
||||
--jp2a source Shortcut to use 'jp2a' backend.
|
||||
--pixterm source Shortcut to use 'pixterm' backend.
|
||||
--sixel source Shortcut to use 'sixel' backend.
|
||||
--termpix source Shortcut to use 'termpix' backend.
|
||||
--tycat source Shortcut to use 'tycat' backend.
|
||||
@@ -4652,8 +4685,8 @@ get_args() {
|
||||
# Image backend
|
||||
"--backend") image_backend="$2" ;;
|
||||
"--source") image_source="$2" ;;
|
||||
"--ascii" | "--caca" | "--catimg" | "--jp2a" | "--iterm2" | "--off" | "--sixel" |\
|
||||
"--termpix" | "--tycat" | "--w3m")
|
||||
"--ascii" | "--caca" | "--catimg" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
|
||||
"--sixel" | "--termpix" | "--tycat" | "--w3m")
|
||||
image_backend="${1/--}"
|
||||
case "$2" in
|
||||
"-"* | "") ;;
|
||||
@@ -4771,6 +4804,11 @@ main() {
|
||||
# Take a screenshot.
|
||||
[[ "$scrot" == "on" ]] && take_scrot
|
||||
|
||||
# Add neofetch info to verbose output.
|
||||
err "Neofetch command: $0 $*"
|
||||
err "Neofetch version: $version"
|
||||
err "Neofetch config: $config_version"
|
||||
|
||||
# Show error messages.
|
||||
[[ "$verbose" == "on" ]] && printf "%b" "$err" >&2
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4.
|
||||
.TH NEOFETCH "1" "September 2017" "Neofetch 3.3.0" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.5.
|
||||
.TH NEOFETCH "1" "December 2017" "Neofetch 3.3.1-git" "User Commands"
|
||||
.SH NAME
|
||||
Neofetch \- A fast, highly customizable system info script
|
||||
.SH SYNOPSIS
|
||||
@@ -207,6 +207,9 @@ Shortcut to use 'iterm2' backend.
|
||||
\fB\-\-jp2a\fR source
|
||||
Shortcut to use 'jp2a' backend.
|
||||
.TP
|
||||
\fB\-\-pixterm\fR source
|
||||
Shortcut to use 'pixterm' backend.
|
||||
.TP
|
||||
\fB\-\-sixel\fR source
|
||||
Shortcut to use 'sixel' backend.
|
||||
.TP
|
||||
|
Reference in New Issue
Block a user