mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Small Sixel improvements
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ bool ffLogoPrintBuiltinIfExists(FFinstance* instance);
|
||||
void ffLogoPrintBuiltinDetected(FFinstance* instance);
|
||||
|
||||
//image.c
|
||||
bool ffLogoPrintSixelIfExists(FFinstance* instance);
|
||||
void ffLogoPrintSixel(FFinstance* instance);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user