mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 09:08:38 +00:00
Compare commits
3 Commits
wm_theme-m
...
rewrites
Author | SHA1 | Date | |
---|---|---|---|
|
4217626cff | ||
|
ce91e2f39a | ||
|
cac22ec505 |
113
neofetch
113
neofetch
@@ -812,27 +812,26 @@ EOF
|
||||
# DETECT INFORMATION
|
||||
|
||||
get_os() {
|
||||
# $kernel_name is set in a function called cache_uname and is
|
||||
# just the output of "uname -s".
|
||||
case "$kernel_name" in
|
||||
"Darwin"): "$darwin_name" ;;
|
||||
"SunOS"): "Solaris" ;;
|
||||
"Haiku"): "Haiku" ;;
|
||||
"MINIX"): "MINIX" ;;
|
||||
"AIX"): "AIX" ;;
|
||||
"IRIX"*): "IRIX" ;;
|
||||
"FreeMiNT"): "FreeMiNT" ;;
|
||||
# $kernel_name is the output of 'uname -s'.
|
||||
case $kernel_name in
|
||||
Darwin): "$darwin_name" ;;
|
||||
SunOS): Solaris ;;
|
||||
Haiku): Haiku ;;
|
||||
MINIX): MINIX ;;
|
||||
AIX): AIX ;;
|
||||
IRIX*): IRIX ;;
|
||||
FreeMiNT): FreeMiNT ;;
|
||||
|
||||
"Linux" | "GNU"*)
|
||||
: "Linux"
|
||||
Linux|GNU*)
|
||||
: Linux
|
||||
;;
|
||||
|
||||
*"BSD" | "DragonFly" | "Bitrig")
|
||||
: "BSD"
|
||||
*BSD|DragonFly|Bitrig)
|
||||
: BSD
|
||||
;;
|
||||
|
||||
"CYGWIN"* | "MSYS"* | "MINGW"*)
|
||||
: "Windows"
|
||||
CYGWIN*|MSYS*|MINGW*)
|
||||
: Windows
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -841,6 +840,7 @@ get_os() {
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
os="$_"
|
||||
}
|
||||
|
||||
@@ -1393,7 +1393,6 @@ get_packages() {
|
||||
;;
|
||||
|
||||
"IRIX")
|
||||
manager="swpkg"
|
||||
tot versions -b && ((packages-=3))
|
||||
;;
|
||||
esac
|
||||
@@ -1753,23 +1752,15 @@ get_wm_theme() {
|
||||
"Quartz Compositor")
|
||||
global_preferences="${HOME}/Library/Preferences/.GlobalPreferences.plist"
|
||||
wm_theme="$(PlistBuddy -c "Print AppleInterfaceStyle" "$global_preferences")"
|
||||
wm_theme_color="$(PlistBuddy -c "Print AppleAccentColor" "$global_preferences")"
|
||||
wm_theme_color="$(PlistBuddy -c "Print AppleAquaColorVariant" "$global_preferences")"
|
||||
|
||||
[[ -z "$wm_theme" ]] && \
|
||||
wm_theme="Light"
|
||||
|
||||
case "$wm_theme_color" in
|
||||
"-1") wm_theme_color="Graphite" ;;
|
||||
"0") wm_theme_color="Red" ;;
|
||||
"1") wm_theme_color="Orange" ;;
|
||||
"2") wm_theme_color="Yellow" ;;
|
||||
"3") wm_theme_color="Green" ;;
|
||||
"5") wm_theme_color="Purple" ;;
|
||||
"6") wm_theme_color="Pink" ;;
|
||||
*) wm_theme_color="Blue" ;;
|
||||
esac
|
||||
[[ -z "$wm_theme_color" ]] || ((wm_theme_color == 1)) && \
|
||||
wm_theme_color="Blue"
|
||||
|
||||
wm_theme="${wm_theme_color} ($wm_theme)"
|
||||
wm_theme="${wm_theme_color:-Graphite} ($wm_theme)"
|
||||
;;
|
||||
|
||||
*"Explorer")
|
||||
@@ -4075,6 +4066,8 @@ get_full_path() {
|
||||
}
|
||||
|
||||
get_user_config() {
|
||||
mkdir -p "${XDG_CONFIG_HOME}/neofetch/"
|
||||
|
||||
# --config /path/to/config.conf
|
||||
if [[ -f "$config_file" ]]; then
|
||||
source "$config_file"
|
||||
@@ -4089,11 +4082,10 @@ get_user_config() {
|
||||
source "${XDG_CONFIG_HOME}/neofetch/config"
|
||||
err "Config: Sourced user config. (${XDG_CONFIG_HOME}/neofetch/config)"
|
||||
|
||||
elif [[ -z "$no_config" ]]; then
|
||||
else
|
||||
config_file="${XDG_CONFIG_HOME}/neofetch/config.conf"
|
||||
|
||||
# The config file doesn't exist, create it.
|
||||
mkdir -p "${XDG_CONFIG_HOME}/neofetch/"
|
||||
printf '%s\n' "$config" > "$config_file"
|
||||
fi
|
||||
}
|
||||
@@ -4467,7 +4459,6 @@ IMAGE:
|
||||
OTHER:
|
||||
--config /path/to/config Specify a path to a custom config file
|
||||
--config none Launch the script without a config file
|
||||
--no_config Don't create the user config file.
|
||||
--print_config Print the default config file to stdout.
|
||||
--stdout Turn off all colors and disables any ASCII/image backend.
|
||||
--help Print this text and exit
|
||||
@@ -4487,7 +4478,7 @@ exit 1
|
||||
|
||||
get_args() {
|
||||
# Check the commandline flags early for '--config'.
|
||||
[[ "$*" != *--config* && "$*" != *--no_config* ]] && get_user_config
|
||||
[[ "$*" != *--config* ]] && get_user_config
|
||||
|
||||
while [[ "$1" ]]; do
|
||||
case "$1" in
|
||||
@@ -4648,7 +4639,6 @@ get_args() {
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"--no_config") no_config="on" ;;
|
||||
"--stdout") stdout="on" ;;
|
||||
"-v") verbose="on" ;;
|
||||
"--print_config") printf '%s\n' "$config"; exit ;;
|
||||
@@ -5209,26 +5199,22 @@ EOF
|
||||
"Artix"*)
|
||||
set_colors 6 6 7 1
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
${c1} '
|
||||
'o'
|
||||
'ooo'
|
||||
'ooxoo'
|
||||
'ooxxxoo'
|
||||
'oookkxxoo'
|
||||
'oiioxkkxxoo'
|
||||
':;:iiiioxxxoo'
|
||||
`'.;::ioxxoo'
|
||||
'-. `':;jiooo'
|
||||
'oooio-.. `'i:io'
|
||||
'ooooxxxxoio:,. `'-;'
|
||||
'ooooxxxxxkkxoooIi:-. `'
|
||||
'ooooxxxxxkkkkxoiiiiiji'
|
||||
'ooooxxxxxkxxoiiii:'` .i'
|
||||
'ooooxxxxxoi:::'` .;ioxo'
|
||||
'ooooxooi::'` .:iiixkxxo'
|
||||
'ooooi:'` `'';ioxxo'
|
||||
'i:'` '':io'
|
||||
'` `'
|
||||
${c1} .'
|
||||
.cc'
|
||||
.cccc.
|
||||
cccccc.
|
||||
:ccccccc.
|
||||
;ccccccccc
|
||||
.;cccccc:
|
||||
.. .;cccc;
|
||||
'cccc;.. .,cc;
|
||||
'ccccccccc:'. ''
|
||||
.cccccccccccccc:;.
|
||||
.cccccccccccccc:,. .
|
||||
ccccccccccc;'. .;cc.
|
||||
cccccccc,.. ':cccccc.
|
||||
:ccc:'. .';ccccc
|
||||
;;.. .';:
|
||||
EOF
|
||||
;;
|
||||
|
||||
@@ -8829,10 +8815,9 @@ EOF
|
||||
;;
|
||||
esac
|
||||
|
||||
# Overwrite distro colors if '$ascii_colors' doesn't
|
||||
# equal 'distro'.
|
||||
if [[ "${ascii_colors[0]}" != "distro" ]]; then
|
||||
color_text="off"
|
||||
# Overwrite distro colors if '$ascii_colors' doesn't equal 'distro'.
|
||||
if [[ ${ascii_colors[0]} != distro ]]; then
|
||||
color_text=off
|
||||
set_colors "${ascii_colors[@]}"
|
||||
fi
|
||||
}
|
||||
@@ -8846,14 +8831,14 @@ main() {
|
||||
|
||||
get_args "$@"
|
||||
get_simple "$@"
|
||||
[[ "$verbose" != "on" ]] && exec 2>/dev/null
|
||||
[[ $verbose != on ]] && exec 2>/dev/null
|
||||
get_distro
|
||||
get_bold
|
||||
get_distro_ascii
|
||||
[[ "$stdout" == "on" ]] && stdout
|
||||
[[ $stdout == on ]] && stdout
|
||||
|
||||
# Minix doesn't support these sequences.
|
||||
if [[ "$TERM" != "minix" && "$stdout" != "on" ]]; then
|
||||
if [[ $TERM != minix && $stdout != on ]]; then
|
||||
# If the script exits for any reason, unhide the cursor.
|
||||
trap 'printf "\e[?25h\e[?7h"' EXIT
|
||||
|
||||
@@ -8869,17 +8854,17 @@ main() {
|
||||
|
||||
# w3m-img: Draw the image a second time to fix
|
||||
# rendering issues in specific terminal emulators.
|
||||
[[ "$image_backend" == *w3m* ]] && display_image
|
||||
[[ $image_backend == *w3m* ]] && display_image
|
||||
|
||||
# Add neofetch info to verbose output.
|
||||
err "Neofetch command: $0 $*"
|
||||
err "Neofetch version: $version"
|
||||
|
||||
# Show error messages.
|
||||
[[ "$verbose" == "on" ]] && printf "%b" "$err" >&2
|
||||
[[ $verbose == on ]] && printf '%b' "$err" >&2
|
||||
|
||||
# If `--loop` was used, constantly redraw the image.
|
||||
while [[ "$image_loop" == "on" && "$image_backend" == "w3m" ]]; do display_image; sleep 1; done
|
||||
while [[ $image_loop == on && $image_backend == w3m ]]; do display_image; sleep 1; done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user