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
69046ae1
Commit
69046ae1
authored
Feb 09, 2017
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Image: Added sixel backend
parent
04d180c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
neofetch
neofetch
+12
-11
No files found.
neofetch
View file @
69046ae1
...
...
@@ -1985,7 +1985,7 @@ image_backend() {
"ascii") get_ascii ;;
"off") image_backend="off" ;;
"caca" | "catimg" | "jp2a" | "iterm2" | "tycat" | "w3m")
"caca" | "catimg" | "jp2a" | "iterm2" | "tycat" | "w3m"
| "sixel"
)
get_image_source
if [[ ! -f "$image" ]]; then
...
...
@@ -1997,7 +1997,6 @@ image_backend() {
if [[ "
$term_width
" ]] && ((term_width >= 1)); then
clear
zws="
"
else
to_ascii "
Image: Failed to find terminal window size.
"
err "
Image: Check the
'Images in the terminal'
wiki page
for
more info,
"
...
...
@@ -2011,7 +2010,7 @@ image_backend() {
*)
err "
Image: Unknown image backend specified
'$image_backend'
.
"
err "
Image: Valid backends are:
'ascii'
,
'caca'
,
'catimg'
,
'jp2a'
,
'iterm2'
,
'off'
,
'tycat'
,
'w3m'
)
"
err "
Image: Valid backends are:
'ascii'
,
'caca'
,
'catimg'
,
'jp2a'
,
'iterm2'
,
'off'
,
'
sixel'
,
'
tycat'
,
'w3m'
)
"
err "
Image: Falling back to ascii mode.
"
get_ascii
;;
...
...
@@ -2384,23 +2383,23 @@ make_thumbnail() {
display_image
()
{
case
"
$image_backend
"
in
"caca"
)
img2txt
-W
"
$((
width
/
font_width
))
)"
-H
"
$((
height
/
font_height
))
"
--gamma
=
0.6
"
$image
"
||
to_off
"Image: catimg failed to display the image."
zws
=
img2txt
-W
"
$((
width
/
font_width
))
)"
-H
"
$((
height
/
font_height
))
"
--gamma
=
0.6
"
$image
"
||
to_off
"Image: libcaca failed to display the image."
;;
"catimg"
)
catimg
-w
"
$((
width
*
2
/
font_width
))
"
-r
0
"
$image
"
||
to_off
"Image: catimg failed to display the image."
zws
=
;;
"jp2a"
)
jp2a
--width
=
"
$((
width
/
font_width
))
"
--colors
"
$image
"
||
to_off
"Image: jp2a failed to display the image."
zws
=
;;
"sixel"
)
img2sixel
-w
"
$width
"
"
$image
"
||
to_off
"Image: libsixel failed to display the image."
;;
"iterm2"
)
printf
"%b
\a\n
"
"
\0
33]1337;File=width=
${
width
}
px;height=
${
height
}
px;inline=1:
$(
base64
<
"
$image
"
)
"
zws
=
;;
"tycat"
)
...
...
@@ -2415,6 +2414,8 @@ display_image() {
sleep
0.05
printf
"%b
\n
"
"0;1;
$xoffset
;
$yoffset
;
$width
;
$height
;;;;;
$image
\n
4;
\n
3;"
|
\
"
${
w3m_img_path
:-
false
}
"
-bg
"
$background_color
"
>
/dev/null & 2>&1
||
to_off
"Image: w3m-img failed to display the image."
zws
=
" "
;;
esac
}
...
...
@@ -2438,7 +2439,6 @@ to_off() {
err
"
$1
"
image_backend
=
"off"
text_padding
=
zws
=
}
# SCREENSHOT
...
...
@@ -3804,7 +3804,7 @@ BARS:
IMAGE BACKEND:
--backend backend Which image backend to use.
Possible values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', 'tycat', 'w3m'
Possible values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', '
sixel', '
tycat', 'w3m'
--source source Which image or ascii file to use.
Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
--ascii source Shortcut to use 'ascii' backend.
...
...
@@ -3812,6 +3812,7 @@ IMAGE BACKEND:
--catimg source Shortcut to use 'catimg' backend.
--iterm2 source Shortcut to use 'iterm2' backend.
--jp2a source Shortcut to use 'jp2a' backend.
--sixel source Shortcut to use 'sixel' backend.
--tycat source Shortcut to use 'tycat' backend.
--w3m source Shortcut to use 'w3m' backend.
--off Shortcut to use 'off' backend.
...
...
@@ -4014,7 +4015,7 @@ get_args() {
# Image backend
"--backend"
)
image_backend
=
"
$2
"
;;
"--source"
)
image_source
=
"
$2
"
;;
"--ascii"
|
"--caca"
|
"--catimg"
|
"--jp2a"
|
"--iterm2"
|
"--off"
|
"--tycat"
|
"--w3m"
)
"--ascii"
|
"--caca"
|
"--catimg"
|
"--jp2a"
|
"--iterm2"
|
"--off"
|
"--
sixel"
|
"--
tycat"
|
"--w3m"
)
image_backend
=
"
${
1
/--
}
"
case
"
$2
"
in
"-"
*
|
""
)
;;
...
...
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