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
4ca4e886
Commit
4ca4e886
authored
Dec 22, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Images: Fix bugs
parent
8318a9c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
neofetch
neofetch
+20
-17
No files found.
neofetch
View file @
4ca4e886
...
@@ -1832,9 +1832,9 @@ get_image_backend() {
...
@@ -1832,9 +1832,9 @@ get_image_backend() {
# If image source is ascii fallback to ascii.
# If image source is ascii fallback to ascii.
if
[[
"
$image_source
"
==
"ascii"
]]
;
then
if
[[
"
$image_source
"
==
"ascii"
]]
;
then
image_backend
=
"ascii"
to_ascii
"Image:
\$
image_source set to 'ascii', falling back to ascii mode."
err
"Image:
\$
image_source set to 'ascii', falling back to ascii mode. "
err
"Image: Change
\$
image_source to another value to use image mode."
err
"Image: Change
\$
image_source to another value to use image mode."
return
fi
fi
case
"
${
image_backend
:
=image
}
"
in
case
"
${
image_backend
:
=image
}
"
in
...
@@ -1861,8 +1861,9 @@ get_image_backend() {
...
@@ -1861,8 +1861,9 @@ get_image_backend() {
get_term_size
get_term_size
# Fallback to ascii mode if terminal size wasn't found.
# Fallback to ascii mode if terminal size wasn't found.
if
[[
-z
"
$term_width
"
]]
&&
((
term_width
==
0
))
;
then
if
[[
-z
"
$term_width
"
]]
||
((
term_width
==
0
))
;
then
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"
return
return
fi
fi
...
@@ -1878,8 +1879,7 @@ get_image_backend() {
...
@@ -1878,8 +1879,7 @@ get_image_backend() {
esac
esac
# Set cursor position next to ascii art.
# Set cursor position next to ascii art.
[[
"
$image_backend
"
!=
"off"
]]
&&
\
[[
"
$image_backend
"
!=
"off"
]]
&&
printf
"%b"
"
\0
33[
${
lines
:-
0
}
A
\0
33[9999999D"
printf
"%b"
"
\0
33[
$((${
lines
:-
0
}
-
${
prompt_loc
:-
0
}))
A
\0
33[9999999D"
}
}
get_ascii
()
{
get_ascii
()
{
...
@@ -2063,7 +2063,7 @@ get_term_size() {
...
@@ -2063,7 +2063,7 @@ get_term_size() {
# The escape codes above print the desired output as
# The escape codes above print the desired output as
# user input so we have to use read to store the out
# user input so we have to use read to store the out
# -put as a variable.
# -put as a variable.
builtin read
-s
-t
1
"
${
read_flags
[@]
}
"
-r
term_size
IFS
=
";"
read
-s
-t
1
"
${
read_flags
[@]
}
"
-r
-a
term_size
# Split the string into height/width.
# Split the string into height/width.
if
[[
"
$image_program
"
==
"tycat"
]]
;
then
if
[[
"
$image_program
"
==
"tycat"
]]
;
then
...
@@ -2072,16 +2072,12 @@ get_term_size() {
...
@@ -2072,16 +2072,12 @@ get_term_size() {
term_height
=
"
$((
term_size[3]
*
term_size[1]
))
"
term_height
=
"
$((
term_size[3]
*
term_size[1]
))
"
else
else
term_size
=
"
${
term_size
//
'['
}
"
term_height
=
"
${
term_size
[1]
}
"
term_size
=
"
${
term_size
/
';'
}
"
term_width
=
"
${
term_size
[2]/t*
}
"
term_size
=
"
${
term_size
/
$'
\E
4'
}
"
term_size
=
"
${
term_size
/t*
}
"
term_height
=
"
${
term_size
/
';'
*
}
"
term_width
=
"
${
term_size
/*
';'
}
"
fi
fi
# Get terminal width/height if \033[14t is unsupported.
# Get terminal width/height if \033[14t is unsupported.
if
((
"
${#
term_size
}
"
<
=
5
))
&&
[[
"
$image_program
"
==
"w3m"
]]
;
then
if
[[
-z
"
$term_width
"
&&
"
$image_program
"
==
"w3m"
]]
;
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
"
)
...
@@ -2103,15 +2099,15 @@ get_term_size() {
...
@@ -2103,15 +2099,15 @@ get_term_size() {
term_width
=
"
${
term_size
/ *
}
"
term_width
=
"
${
term_size
/ *
}
"
term_height
=
"
${
term_size
/
${
term_width
}}
"
term_height
=
"
${
term_size
/
${
term_width
}}
"
else
else
term_width
=
"0"
term_width
=
0
fi
fi
else
else
term_width
=
"0"
term_width
=
0
fi
fi
fi
fi
# If the terminal size was found correctly.
# If the terminal size was found correctly.
if
[[
"
$term_width
"
]]
&&
((
term_width
>
0
))
;
then
if
[[
"
$term_width
"
]]
&&
((
term_width
>
=
1
))
;
then
clear
clear
zws
=
" "
zws
=
" "
fi
fi
...
@@ -2258,7 +2254,14 @@ display_image() {
...
@@ -2258,7 +2254,14 @@ display_image() {
to_ascii
()
{
to_ascii
()
{
# This function makes neofetch fallback to ascii mode.
# This function makes neofetch fallback to ascii mode.
image_backend
=
"ascii"
image_backend
=
"ascii"
# Print the ascii art.
get_ascii 2>/dev/null
get_ascii 2>/dev/null
# Move cursor next to ascii art.
printf
"%b"
"
\0
33[
${
lines
:-
0
}
A
\0
33[9999999D"
# Log the error.
err
"
$1
"
err
"
$1
"
}
}
...
@@ -2942,7 +2945,7 @@ old_options() {
...
@@ -2942,7 +2945,7 @@ old_options() {
[[
"
$speed_type
"
==
"bios"
]]
&&
err
"Config: speed_type='bios' is deprecated, use speed_type='bios_limit' instead."
[[
"
$speed_type
"
==
"bios"
]]
&&
err
"Config: speed_type='bios' is deprecated, use speed_type='bios_limit' instead."
# Ascii_logo_size was removed in 2.1.0.
# Ascii_logo_size was removed in 2.1.0.
[[
"
$ascii_logo_size
"
]]
&&
err
"Config: ascii_logo_size is deprecated
m
use ascii_distro='{arch,crux,gentoo}_small' instead."
[[
"
$ascii_logo_size
"
]]
&&
err
"Config: ascii_logo_size is deprecated
,
use ascii_distro='{arch,crux,gentoo}_small' instead."
}
}
cache_uname
()
{
cache_uname
()
{
...
...
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