Add forcekittyanim option

This commit is contained in:
Nikita Ivanov 2022-07-07 18:55:13 +05:00
parent 10f54e0dd5
commit 78dd61e73b
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133
5 changed files with 12 additions and 2 deletions

View File

@ -270,6 +270,13 @@ Always use
terminal's built-in method of previewing images.
.
.TP
.B forcekittyanim
Always use
.I Kitty
terminal's built-in method of previewing images for animated
images.
.
.TP
.B forcechafa
Always use
.I Chafa

View File

@ -32,6 +32,7 @@ set_image_method() {
image_method=
[ -n "$forcekitty" ] && is_kitty && { image_method="$image_method_kitty"; return 0; }
[ -n "$forcekittyanim" ] && is_kitty && is_anim_image && { image_method="$image_method_kitty"; return 0; }
[ -n "$forcechafa" ] && exists chafa && { image_method="$image_method_chafa"; return 0; }
[ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && exists ueberzug &&

View File

@ -47,6 +47,7 @@ static VectorPreview *previews;
static struct Option options[] = {
DEF_OPTION_BOOL(forcekitty),
DEF_OPTION_BOOL(forcekittyanim),
DEF_OPTION_BOOL(forcechafa),
DEF_OPTION_BOOL(noimages),
DEF_OPTION_BOOL(nosymlinkinfo),

View File

@ -14,7 +14,7 @@ struct CTPV {
} mode;
char *server_id_s;
struct {
int forcekitty, forcechafa, noimages, nosymlinkinfo;
int forcekitty, forcekittyanim, forcechafa, noimages, nosymlinkinfo;
} opts;
};

View File

@ -37,8 +37,9 @@ static char *prepend_helpers(char *str, size_t len)
int run_script(char *script, size_t script_len, int *exitcode, int *signal,
SpawnProg sp, void *sp_arg)
{
OPT_SETENV(forcechafa);
OPT_SETENV(forcekitty);
OPT_SETENV(forcekittyanim);
OPT_SETENV(forcechafa);
OPT_SETENV(noimages);
OPT_SETENV(nosymlinkinfo);