Small Sixel improvements

This commit is contained in:
Linus Dierheimer
2022-04-06 14:54:39 +02:00
parent 88fe34102e
commit a4861606b7
6 changed files with 23 additions and 9 deletions
+3
View File
@@ -308,6 +308,9 @@ void ffListFeatures()
#ifdef FF_HAVE_DBUS
"dbus\n"
#endif
#ifdef FF_HAVE_IMAGEMAGICK
"imagemagick\n"
#endif
#ifdef FF_HAVE_XFCONF
"xfconf\n"
#endif
+1
View File
@@ -28,6 +28,7 @@ Logo options:
--logo-padding-left <padding>: set the padding on the left of the logo
--logo-padding-right <padding>: set the padding on the right of the logo
--logo-print-remaining <?value>: weather to print the remaining logo, if it has more lines than modules to display
--sixel <file>: short for --logo-type sixel --logo <file>
Display options:
-s,--structure <structure>: sets the structure of the fetch. Must be a colon separated list of keys. Use "fastfetch --list-modules" to see the ones available.
+5
View File
@@ -767,6 +767,11 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
instance->config.logoPaddingRight = optionParseUInt32(key, value);
else if(strcasecmp(key, "--logo-print-remaining") == 0)
instance->config.logoPrintRemaining = optionParseBoolean(value);
else if(strcasecmp(key, "--sixel") == 0)
{
optionParseString(key, value, &instance->config.logoName);
instance->config.logoType = FF_LOGO_TYPE_SIXEL;
}
///////////////////
//Display options//
+9 -7
View File
@@ -106,14 +106,16 @@ static bool printSixel(FFinstance* instance)
#endif
bool ffLogoPrintSixelIfExists(FFinstance* instance)
{
#ifdef FF_HAVE_IMAGEMAGICK
return printSixel(instance);
#endif
return false;
}
void ffLogoPrintSixel(FFinstance* instance)
{
bool sixelPrinted = false;
#ifdef FF_HAVE_IMAGEMAGICK
sixelPrinted = printSixel(instance);
#endif
if(!sixelPrinted)
if(!ffLogoPrintSixelIfExists(instance))
ffLogoPrintBuiltinDetected(instance);
}
+4 -2
View File
@@ -160,8 +160,10 @@ static void logoPrintDetected(FFinstance* instance)
{
if(instance->config.logoName.length > 0)
{
if(!ffLogoPrintBuiltinIfExists(instance))
logoPrintFile(instance, true);
if(
!ffLogoPrintBuiltinIfExists(instance) &&
!ffLogoPrintSixelIfExists(instance)
) logoPrintFile(instance, true);
return;
}
+1
View File
@@ -17,6 +17,7 @@ bool ffLogoPrintBuiltinIfExists(FFinstance* instance);
void ffLogoPrintBuiltinDetected(FFinstance* instance);
//image.c
bool ffLogoPrintSixelIfExists(FFinstance* instance);
void ffLogoPrintSixel(FFinstance* instance);
#endif