Skip to content

Commit d58d786

Browse files
committed
Logo (Image): add --kitty-icat; honor --logo-height if set
1 parent 9f37557 commit d58d786

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

src/data/help.json

+8
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,14 @@
352352
"type": "path"
353353
}
354354
},
355+
{
356+
"long": "kitty-icat",
357+
"desc": "Short for --logo-type kitty-icat --logo <path>",
358+
"remark": "See \"--help logo-type\" for more info",
359+
"arg": {
360+
"type": "path"
361+
}
362+
},
355363
{
356364
"long": "iterm",
357365
"desc": "Short for --logo-type iterm --logo <path>",

src/logo/image/image.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,18 @@ static bool printImageKittyIcat(bool printError)
190190
{
191191
char place[64];
192192
snprintf(place,
193-
ARRAY_SIZE(place),
194-
"--place=%ux9999@%ux%u",
195-
options->width,
196-
options->paddingLeft + 1,
197-
options->paddingTop + 1);
193+
ARRAY_SIZE(place),
194+
"--place=%ux%u@%ux%u",
195+
options->width,
196+
options->height == 0 ? 9999 : options->height,
197+
options->paddingLeft + 1,
198+
options->paddingTop + 1);
198199

199200
error = ffProcessAppendStdOut(&buf, (char* []) {
200201
"kitten",
201202
"icat",
202203
"-n",
203-
"--align=left",
204+
"--align=center",
204205
place,
205206
"--scale-up",
206207
options->source.chars,

src/options/logo.c

+5
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons
173173
ffOptionParseString(key, value, &options->source);
174174
options->type = FF_LOGO_TYPE_IMAGE_KITTY_DIRECT;
175175
}
176+
else if(ffStrEqualsIgnCase(key, "--kitty-icat"))
177+
{
178+
ffOptionParseString(key, value, &options->source);
179+
options->type = FF_LOGO_TYPE_IMAGE_KITTY_ICAT;
180+
}
176181
else if(ffStrEqualsIgnCase(key, "--iterm"))
177182
{
178183
ffOptionParseString(key, value, &options->source);

0 commit comments

Comments
 (0)