Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
ffe94c26
Commit
ffe94c26
authored
Jun 01, 2018
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc: cleanup
parent
5cac0a8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
30 deletions
+21
-30
neofetch
neofetch
+21
-30
No files found.
neofetch
View file @
ffe94c26
...
@@ -3389,12 +3389,8 @@ get_cols() {
...
@@ -3389,12 +3389,8 @@ get_cols() {
# IMAGES
# IMAGES
image_backend() {
image_backend() {
if [[ ! "$image_backend" =~ ^(off|ascii)$ ]]; then
[[ "$image_backend" != "off" ]] && ! type -p convert >/dev/null 2>&1 && \
if ! type -p convert >/dev/null 2>&1; then
{ image_backend="ascii"; err "Image: Imagemagick not found, falling back to ascii mode."; }
image_backend="ascii"
err "Image: Imagemagick not found, falling back to ascii mode."
fi
fi
case "${image_backend:-off}" in
case "${image_backend:-off}" in
"ascii") get_ascii ;;
"ascii") get_ascii ;;
...
@@ -3404,26 +3400,22 @@ image_backend() {
...
@@ -3404,26 +3400,22 @@ image_backend() {
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty")
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty")
get_image_source
get_image_source
if [[ ! -f "$image" ]]; then
[[ ! -f "$image" ]] && {
to_ascii "Image: '$image_source' doesn't exist, falling back to ascii mode."
to_ascii "Image: '$image_source' doesn't exist, falling back to ascii mode."
return
return
fi
}
get_term_size
get_term_size
if [[ "$term_width" ]] && ((term_width >= 1)); then
((term_width < 1)) && {
printf "\e[2J\e[H"
else
to_ascii "Image: Failed to find terminal window size."
to_ascii "Image: Failed to find terminal window size."
err "Image: Check the 'Images in the terminal' wiki page for more info,"
err "Image: Check the 'Images in the terminal' wiki page for more info,"
return
return
fi
}
printf '\e[2J\e[H'
get_image_size
get_image_size
make_thumbnail
make_thumbnail
[[ "$image_backend" == *"w3m"* ]] && zws="\xE2\x80\x8B\x20"
display_image
display_image
;;
;;
...
@@ -3514,17 +3506,14 @@ END
...
@@ -3514,17 +3506,14 @@ END
"Windows")
"Windows")
case "$distro" in
case "$distro" in
"Windows XP")
"Windows XP")
case "$kernel_name" in
image="/c/Documents and Settings/${USER}"
"CYGWIN"*) image="/cygdrive/c/Documents and Settings/${USER}" ;;
image+="/Local Settings/Application Data/Microsoft/Wallpaper1.bmp"
"MSYS2"* | "MINGW*") image="/c/Documents and Settings/${USER}" ;;
esac
[[ "$kernel_name" == *CYGWIN* ]] && image="/cygdrive${image}"
image+="/Local Settings/Application Data/Microsoft"
image+="/Wallpaper1.bmp"
;;
;;
"Windows"*)
"Windows"*)
image="$APPDATA/Microsoft/Windows/Themes"
image="${APPDATA}/Microsoft/Windows/Themes/TranscodedWallpaper.jpg"
image+="/TranscodedWallpaper.jpg"
;;
;;
esac
esac
;;
;;
...
@@ -3533,13 +3522,14 @@ END
...
@@ -3533,13 +3522,14 @@ END
# Get DE if user has disabled the function.
# Get DE if user has disabled the function.
((de_run != 1)) && get_de
((de_run != 1)) && get_de
if type -p wal >/dev/null && [[ -f "${HOME}/.cache/wal/wal" ]]; then
type -p wal >/dev/null && [[ -f "${HOME}/.cache/wal/wal" ]] && \
image="$(< "${HOME}/.cache/wal/wal")"
{ image="$(< "${HOME}/.cache/wal/wal")"; return; }
return
fi
case "$de" in
case "$de" in
"MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;;
"MATE"*)
image="$(gsettings get org.mate.background picture-filename)"
;;
"Xfce"*)
"Xfce"*)
image="$(xfconf-query -c xfce4-desktop -p \
image="$(xfconf-query -c xfce4-desktop -p \
"/backdrop/screen0/monitor0/workspace0/last-image")"
"/backdrop/screen0/monitor0/workspace0/last-image")"
...
@@ -3843,6 +3833,7 @@ display_image() {
...
@@ -3843,6 +3833,7 @@ display_image() {
"w3m")
"w3m")
get_w3m_img_path
get_w3m_img_path
zws='\xE2\x80\x8B\x20'
# Add a tiny delay to fix issues with images not
# Add a tiny delay to fix issues with images not
# appearing in specific terminal emulators.
# appearing in specific terminal emulators.
...
@@ -3964,12 +3955,12 @@ get_line_break() {
...
@@ -3964,12 +3955,12 @@ get_line_break() {
get_bold() {
get_bold() {
case "$ascii_bold" in
case "$ascii_bold" in
"on") ascii_bold="\e[1m" ;;
"on")
ascii_bold="\e[1m" ;;
"off") ascii_bold="" ;;
"off") ascii_bold="" ;;
esac
esac
case "$bold" in
case "$bold" in
"on") bold="\e[1m" ;;
"on")
bold="\e[1m" ;;
"off") bold="" ;;
"off") bold="" ;;
esac
esac
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment