mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-01-20 23:18:34 +01:00
Add chafasixel option
This commit is contained in:
parent
df6a273505
commit
f1f649fd9c
@ -19,7 +19,11 @@ noimages() {
|
||||
}
|
||||
|
||||
autochafa() {
|
||||
[ -z "$autochafa" ]
|
||||
[ -n "$autochafa" ]
|
||||
}
|
||||
|
||||
chafasixel() {
|
||||
[ -n "$chafasixel" ]
|
||||
}
|
||||
|
||||
is_kitty() {
|
||||
@ -67,7 +71,9 @@ is_anim_image() {
|
||||
}
|
||||
|
||||
chafa_run() {
|
||||
autochafa && format='-f symbols' || format=
|
||||
format='-f symbols'
|
||||
autochafa && format=
|
||||
chafasixel && format='-f sixels'
|
||||
chafa -s "${w}x${h}" $format "$1" | sed 's/#/\n#/g'
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,7 @@ static struct Option options[] = {
|
||||
DEF_OPTION_BOOL(noimages),
|
||||
DEF_OPTION_BOOL(nosymlinkinfo),
|
||||
DEF_OPTION_BOOL(autochafa),
|
||||
DEF_OPTION_BOOL(chafasixel),
|
||||
DEF_OPTION_BOOL(showgpg),
|
||||
DEF_OPTION_STR(shell),
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ struct CTPV {
|
||||
char *server_id_s;
|
||||
struct {
|
||||
int forcekitty, forcekittyanim, forcechafa, noimages, nosymlinkinfo;
|
||||
int autochafa, showgpg;
|
||||
int autochafa, chafasixel, showgpg;
|
||||
char *shell;
|
||||
} opts;
|
||||
};
|
||||
|
@ -46,6 +46,7 @@ RESULT run_script(char *script, size_t script_len, int *exitcode, int *signal,
|
||||
OPT_SETENV_INT(noimages);
|
||||
OPT_SETENV_INT(nosymlinkinfo);
|
||||
OPT_SETENV_INT(autochafa);
|
||||
OPT_SETENV_INT(chafasixel);
|
||||
OPT_SETENV_INT(showgpg);
|
||||
OPT_SETENV_STR(shell);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user