mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-03 16:51:29 +00:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bd0f396305 | ||
|
3c03c47f50 | ||
|
b628ec0f4d | ||
|
6c238a03b2 | ||
|
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 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -3,14 +3,25 @@
|
||||
- [**@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 LEDE. [**@dawidd6**](https://github.com/dawidd6)
|
||||
|
||||
|
||||
## Images
|
||||
|
||||
- [MacOS/iTerm2] Fixed thumbnail not appearing (replaced by placeholder) [**@StarryTony**](https://github.com/StarryTony)
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
@@ -22,6 +33,10 @@
|
||||
|
||||
- [macOS] Fixed Install Date. [**@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)
|
||||
|
9
ascii/distro/lede
Normal file
9
ascii/distro/lede
Normal file
@@ -0,0 +1,9 @@
|
||||
${c1} _________
|
||||
/ /\
|
||||
/ LE / \
|
||||
/ DE / \
|
||||
/________/ LE \
|
||||
\ \ DE /
|
||||
\ LE \ /
|
||||
\ DE \ /
|
||||
\________\/
|
@@ -617,18 +617,8 @@ image_loop="off"
|
||||
# Values: 'dir'
|
||||
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
|
||||
|
||||
# Crop mode
|
||||
#
|
||||
# Default: 'normal'
|
||||
# Values: 'normal', 'fit', 'fill'
|
||||
# Flag: --crop_mode
|
||||
#
|
||||
# See this wiki page to learn about the fit and fill options.
|
||||
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
|
||||
crop_mode="normal"
|
||||
|
||||
# Crop offset
|
||||
# Note: Only affects 'normal' crop mode.
|
||||
# Note: Only affects 'square' image size.
|
||||
#
|
||||
# Default: 'center'
|
||||
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
|
||||
@@ -637,20 +627,21 @@ crop_mode="normal"
|
||||
crop_offset="center"
|
||||
|
||||
# Image size
|
||||
# The image is half the terminal width by default.
|
||||
# NOTE: 'square' is the OLD behavior.
|
||||
# NOTE: 'auto' keeps image aspect ratio and size where possible.
|
||||
#
|
||||
# Default: 'auto'
|
||||
# Values: 'auto', '00px', '00%', 'none'
|
||||
# Values: 'auto', 'square'
|
||||
# Flags: --image_size
|
||||
# --size
|
||||
image_size="auto"
|
||||
|
||||
# Ggap between image and text
|
||||
# Gap between image and text
|
||||
#
|
||||
# Default: '3'
|
||||
# Default: '4'
|
||||
# Values: 'num', '-num'
|
||||
# Flag: --gap
|
||||
gap=3
|
||||
gap=4
|
||||
|
||||
# Image offsets
|
||||
# Only works with the w3m backend.
|
||||
|
165
neofetch
165
neofetch
@@ -153,7 +153,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"
|
||||
@@ -552,6 +552,9 @@ get_packages() {
|
||||
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)))" ;;
|
||||
@@ -686,6 +689,10 @@ get_de() {
|
||||
*"xfce5"*) de="Xfce5" ;;
|
||||
*"xfce"*) de="Xfce" ;;
|
||||
*"mate"*) de="MATE" ;;
|
||||
*"GNOME"*)
|
||||
de="$(gnome-shell --version)"
|
||||
de="${de/Shell }"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Log that the function was run.
|
||||
@@ -751,7 +758,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")"
|
||||
;;
|
||||
|
||||
@@ -919,7 +926,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
|
||||
@@ -937,8 +949,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.
|
||||
@@ -1001,12 +1013,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
|
||||
;;
|
||||
@@ -1123,15 +1135,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
|
||||
}
|
||||
|
||||
@@ -2032,7 +2044,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
|
||||
;;
|
||||
@@ -2290,10 +2302,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
|
||||
@@ -2649,44 +2667,32 @@ get_image_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.
|
||||
# Get image size.
|
||||
size="$(identify -format "%w %h" "$image")"
|
||||
width="${size%% *}"
|
||||
height="${size##* }"
|
||||
crop_mode="none"
|
||||
|
||||
case "$image_size" in
|
||||
"square")
|
||||
width="$((columns * font_width / 2))"
|
||||
height="$width"
|
||||
;;
|
||||
|
||||
*) image_size="${image_size/px}" ;;
|
||||
*)
|
||||
while (( width >= (term_width / 2) ||
|
||||
height >= (term_height / 2) )); do
|
||||
width="$((width * 10 / 15))"
|
||||
height="$((height * 10 / 15))"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
width="${width:-$image_size}"
|
||||
height="${height:-$image_size}"
|
||||
|
||||
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//'/'/_}"
|
||||
# Name the thumbnail using variables so we can use it later.
|
||||
image_name="$image_size-$crop_offset-$width-$height-${image##*/}"
|
||||
|
||||
# Handle file extensions.
|
||||
case "${image##*.}" in
|
||||
@@ -2698,62 +2704,17 @@ make_thumbnail() {
|
||||
# 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:)"
|
||||
|
||||
[[ ! -f "$thumbnail_dir/$image_name" ]] && \
|
||||
convert \
|
||||
-background none \
|
||||
"$image" \
|
||||
-trim +repage \
|
||||
-gravity south \
|
||||
-background "$c" \
|
||||
-extent "$size"x"$size" \
|
||||
-scale "$width"x"$height" \
|
||||
"$thumbnail_dir/$image_name"
|
||||
;;
|
||||
|
||||
"fill")
|
||||
convert \
|
||||
-strip \
|
||||
-quality 50 \
|
||||
-gravity "$crop_offset" \
|
||||
-background none \
|
||||
"$image" \
|
||||
-trim +repage \
|
||||
-scale "$width"x"$height"^ \
|
||||
-sample "$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"
|
||||
}
|
||||
|
||||
@@ -3397,6 +3358,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"
|
||||
@@ -4069,7 +4035,7 @@ dynamic_prompt() {
|
||||
fi
|
||||
|
||||
# Set the prompt location.
|
||||
((lines > 0)) && printf "%b" "\033[${lines}B"
|
||||
((lines > 1)) && printf "%b" "\033[${lines}B"
|
||||
}
|
||||
|
||||
old_functions() {
|
||||
@@ -4436,11 +4402,9 @@ ASCII:
|
||||
IMAGE:
|
||||
--loop Redraw the image constantly until Ctrl+C is used. This fixes issues
|
||||
in some terminals emulators when using image mode.
|
||||
--size 00px | --size 00% How to size the image.
|
||||
--size auto | --size square How to size the image.
|
||||
Possible values: auto, 00px, 00%, none
|
||||
--crop_mode mode Which crop mode to use
|
||||
Takes the values: normal, fit, fill
|
||||
--crop_offset value Change the crop offset for normal mode.
|
||||
--crop_offset value Change the crop offset for square mode.
|
||||
Possible values: northwest, north, northeast,
|
||||
west, center, east, southwest, south, southeast
|
||||
|
||||
@@ -4735,6 +4699,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
|
||||
|
||||
|
13
neofetch.1
13
neofetch.1
@@ -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
|
||||
@@ -259,16 +259,11 @@ Possible values: bar, infobar, barinfo, off
|
||||
Redraw the image constantly until Ctrl+C is used. This fixes issues
|
||||
in some terminals emulators when using image mode.
|
||||
.TP
|
||||
\fB\-\-size\fR 00px | \fB\-\-size\fR 00%
|
||||
How to size the image.
|
||||
\fB\-\-size\fR auto | \fB\-\-size\fR square How to size the image.
|
||||
Possible values: auto, 00px, 00%, none
|
||||
.TP
|
||||
\fB\-\-crop_mode\fR mode
|
||||
Which crop mode to use
|
||||
Takes the values: normal, fit, fill
|
||||
.TP
|
||||
\fB\-\-crop_offset\fR value
|
||||
Change the crop offset for normal mode.
|
||||
Change the crop offset for square mode.
|
||||
Possible values: northwest, north, northeast,
|
||||
west, center, east, southwest, south, southeast
|
||||
.TP
|
||||
|
Reference in New Issue
Block a user