mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-24 05:43:08 +01:00
A better way to fix chafa and foot issue
This commit is contained in:
parent
1c7dc792cd
commit
08095635bc
24
doc/ctpv.1
24
doc/ctpv.1
@ -312,6 +312,30 @@ Print only text and do not use any image previewing method.
|
||||
Do not print resolved path of symbolic links.
|
||||
.
|
||||
.TP
|
||||
.B autochafa
|
||||
By default,
|
||||
.I Chafa
|
||||
is always forced to use \(lqsymbols\(rq format because
|
||||
.I lf
|
||||
does not support
|
||||
\(lqsixel\(rq output in the preview window.
|
||||
However, one could install a
|
||||
.UR https://github.com/horriblename/lf
|
||||
fork of
|
||||
.I lf
|
||||
.UE
|
||||
that does.
|
||||
For such cases the
|
||||
.B autochafa
|
||||
option exists, which allows
|
||||
.I Chafa
|
||||
to decide which format to use.
|
||||
Use it if you are sure that the version of
|
||||
.I lf
|
||||
you are using will be able to handle whatever output produced by
|
||||
.IR Chafa .
|
||||
.
|
||||
.TP
|
||||
.B showgpg
|
||||
Preview
|
||||
.BR gpg (1)
|
||||
|
@ -18,6 +18,10 @@ noimages() {
|
||||
[ -n "$noimages" ]
|
||||
}
|
||||
|
||||
autochafa() {
|
||||
[ -z "$autochafa" ]
|
||||
}
|
||||
|
||||
is_kitty() {
|
||||
case "$TERM" in
|
||||
*-kitty) return 0 ;;
|
||||
@ -61,7 +65,8 @@ is_anim_image() {
|
||||
}
|
||||
|
||||
chafa_run() {
|
||||
chafa -s "${w}x${h}" -f symbols "$1"
|
||||
autochafa && format='-f symbols' || format=
|
||||
chafa -s "${w}x${h}" $format "$1" | sed 's/#/\n#/g'
|
||||
}
|
||||
|
||||
setup_fifo() {
|
||||
|
@ -60,6 +60,7 @@ static struct Option options[] = {
|
||||
DEF_OPTION_BOOL(forcechafa),
|
||||
DEF_OPTION_BOOL(noimages),
|
||||
DEF_OPTION_BOOL(nosymlinkinfo),
|
||||
DEF_OPTION_BOOL(autochafa),
|
||||
DEF_OPTION_BOOL(showgpg),
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,7 @@ struct CTPV {
|
||||
char *server_id_s;
|
||||
struct {
|
||||
int forcekitty, forcekittyanim, forcechafa, noimages, nosymlinkinfo;
|
||||
int showgpg;
|
||||
int autochafa, showgpg;
|
||||
} opts;
|
||||
};
|
||||
|
||||
|
@ -42,6 +42,7 @@ RESULT run_script(char *script, size_t script_len, int *exitcode, int *signal,
|
||||
OPT_SETENV(forcechafa);
|
||||
OPT_SETENV(noimages);
|
||||
OPT_SETENV(nosymlinkinfo);
|
||||
OPT_SETENV(autochafa);
|
||||
OPT_SETENV(showgpg);
|
||||
|
||||
char *scr = prepend_helpers(script, script_len);
|
||||
|
Loading…
Reference in New Issue
Block a user