mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Seperate color config of title and keys
This commit is contained in:
+3
-1
@@ -138,7 +138,9 @@ static void defaultConfig(FFinstance* instance)
|
||||
instance->config.logo.paddingRight = 4;
|
||||
instance->config.logo.printRemaining = true;
|
||||
|
||||
ffStrbufInit(&instance->config.mainColor);
|
||||
ffStrbufInit(&instance->config.colorKeys);
|
||||
ffStrbufInit(&instance->config.colorTitle);
|
||||
|
||||
ffStrbufInit(&instance->config.separator);
|
||||
ffStrbufAppendS(&instance->config.separator, ": ");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ void ffPrintLogoAndKey(FFinstance* instance, const char* moduleName, uint8_t mod
|
||||
if(!instance->config.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
|
||||
ffPrintColor(&instance->config.mainColor);
|
||||
ffPrintColor(&instance->config.colorKeys);
|
||||
}
|
||||
|
||||
//NULL check is required for modules with custom keys, e.g. disk with the folder path
|
||||
|
||||
@@ -113,12 +113,19 @@
|
||||
# Default is true.
|
||||
#--logo-print-remaining true
|
||||
|
||||
# Color option:
|
||||
# Color keys option:
|
||||
# Sets the color of the keys.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the primary color of the logo.
|
||||
# Default is the key color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
#--color magenta
|
||||
#--color-keys magenta
|
||||
|
||||
# Color title option:
|
||||
# Sets the color of the title.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the title color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
#--color-title magenta
|
||||
|
||||
# Binary prefix option:
|
||||
# Sets the binary prefix to use.
|
||||
|
||||
+3
-1
@@ -40,7 +40,9 @@ Logo options:
|
||||
|
||||
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.
|
||||
-c,--color <color>: sets the color of the keys. Must be a linux console color code or the name of a color (+)
|
||||
--color-keys <color>: sers the color of the keys
|
||||
--color-title <color>: sets the color of the title
|
||||
-c,--color <color>: sets the color of both the keys and the title
|
||||
--separator <str>: sets the separator between key and value. Default is a colon with a space
|
||||
--set <key=value>: hard set the value of a key
|
||||
--set-keyless <key=value>: hard set the value of a key, but don't print the key or the separator
|
||||
|
||||
+8
-1
@@ -929,8 +929,15 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
|
||||
optionParseString(key, value, &data->structure);
|
||||
else if(strcasecmp(key, "--separator") == 0)
|
||||
optionParseString(key, value, &instance->config.separator);
|
||||
else if(strcasecmp(key, "--color-keys") == 0)
|
||||
optionParseColor(key, value, &instance->config.colorKeys);
|
||||
else if(strcasecmp(key, "--color-title") == 0)
|
||||
optionParseColor(key, value, &instance->config.colorTitle);
|
||||
else if(strcasecmp(key, "-c") == 0 || strcasecmp(key, "--color") == 0)
|
||||
optionParseColor(key, value, &instance->config.mainColor);
|
||||
{
|
||||
optionParseColor(key, value, &instance->config.colorKeys);
|
||||
ffStrbufSet(&instance->config.colorTitle, &instance->config.colorKeys);
|
||||
}
|
||||
else if(strcasecmp(key, "--set") == 0)
|
||||
optionParseCustomValue(data, key, value, true);
|
||||
else if(strcasecmp(key, "--set-keyless") == 0)
|
||||
|
||||
+4
-1
@@ -74,7 +74,10 @@ typedef struct FFconfig
|
||||
bool printRemaining;
|
||||
} logo;
|
||||
|
||||
FFstrbuf mainColor; //If this is empty, ffLogoPrint will set it to the main color of the logo
|
||||
//If one of those is empty, ffLogoPrint will set them
|
||||
FFstrbuf colorKeys;
|
||||
FFstrbuf colorTitle;
|
||||
|
||||
FFstrbuf separator;
|
||||
|
||||
bool showErrors;
|
||||
|
||||
+129
-5
@@ -4,6 +4,8 @@
|
||||
#define FF_LOGO_NAMES(...) static const char* names[] = (const char*[]) { __VA_ARGS__, NULL }; logo.names = names;
|
||||
#define FF_LOGO_LINES(x) logo.data = x;
|
||||
#define FF_LOGO_COLORS(...) static const char* colors[] = (const char*[]) { __VA_ARGS__, NULL }; logo.builtinColors = colors;
|
||||
#define FF_LOGO_COLOR_KEYS(x) logo.colorKeys = x;
|
||||
#define FF_LOGO_COLOR_TITLE(x) logo.colorTitle = x;
|
||||
#define FF_LOGO_RETURN return &logo;
|
||||
|
||||
const FFlogo* ffLogoBuiltinGetUnknown()
|
||||
@@ -31,6 +33,8 @@ const FFlogo* ffLogoBuiltinGetUnknown()
|
||||
" \"\""
|
||||
)
|
||||
FF_LOGO_COLORS("")
|
||||
FF_LOGO_COLOR_KEYS("")
|
||||
FF_LOGO_COLOR_TITLE("")
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -40,6 +44,8 @@ static const FFlogo* getLogoNone()
|
||||
FF_LOGO_NAMES("none", "empty")
|
||||
FF_LOGO_LINES("")
|
||||
FF_LOGO_COLORS("")
|
||||
FF_LOGO_COLOR_KEYS("")
|
||||
FF_LOGO_COLOR_TITLE("")
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -76,6 +82,8 @@ static const FFlogo* getLogoAlmaLinux()
|
||||
"1;32", // light green
|
||||
"36" // cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("1;33"); //yellow
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -108,6 +116,8 @@ static const FFlogo* getLogoAlpine()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -126,6 +136,8 @@ static const FFlogo* getLogoAlpineSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -157,6 +169,8 @@ static const FFlogo* getLogoAndroid()
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -175,6 +189,8 @@ static const FFlogo* getLogoAndroidSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -206,6 +222,8 @@ static const FFlogo* getLogoArch()
|
||||
FF_LOGO_COLORS(
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -225,6 +243,8 @@ static const FFlogo* getLogoArchSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -257,6 +277,8 @@ static const FFlogo* getLogoArtix()
|
||||
FF_LOGO_COLORS(
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -276,6 +298,8 @@ static const FFlogo* getLogoArtixSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -309,6 +333,8 @@ static const FFlogo* getLogoArcoLinux()
|
||||
"34", //blue
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //green
|
||||
FF_LOGO_COLOR_TITLE("34"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -339,6 +365,8 @@ static const FFlogo* getLogoBedrock()
|
||||
"90", //grey
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("90"); //grey
|
||||
FF_LOGO_COLOR_TITLE("37"); //white
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -375,6 +403,8 @@ static const FFlogo* getLogoCachyOS()
|
||||
"32", //green
|
||||
"30" //black
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -395,6 +425,8 @@ static const FFlogo* getLogoCachyOSSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -424,6 +456,8 @@ static const FFlogo* getLogoCelOS()
|
||||
"35", //magenta
|
||||
"30" //black
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -459,6 +493,8 @@ static const FFlogo* getLogoCentOS()
|
||||
"35", //magenta
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("33"); //yellow
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -481,6 +517,8 @@ static const FFlogo* getLogoCentOSSmall()
|
||||
"34", //blue
|
||||
"35" //magenta
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("33"); //yellow
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -511,6 +549,8 @@ static const FFlogo* getLogoDebian()
|
||||
"31", //red
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -529,6 +569,8 @@ static const FFlogo* getLogoDebianSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"31" //red
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -556,6 +598,8 @@ static const FFlogo* getLogoDevuan()
|
||||
FF_LOGO_COLORS(
|
||||
"35" //magenta
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("35"); //magenta
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -573,8 +617,10 @@ static const FFlogo* getLogoDevuanSmall()
|
||||
"#@@@#=:\n"
|
||||
)
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
"35" //magenta
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("35"); //magenta
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -605,6 +651,8 @@ static const FFlogo* getLogoDeepin()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -634,6 +682,8 @@ static const FFlogo* getLogoEndeavour()
|
||||
"31", //red
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -666,6 +716,8 @@ static const FFlogo* getLogoFedora()
|
||||
"34", //blue
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -687,6 +739,8 @@ static const FFlogo* getLogoFedoraSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -717,6 +771,8 @@ static const FFlogo* getLogoFedoraOld()
|
||||
"34", //blue
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -747,6 +803,8 @@ static const FFlogo* getLogoGaruda()
|
||||
FF_LOGO_COLORS(
|
||||
"31" //red
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -778,6 +836,8 @@ static const FFlogo* getLogoGentoo()
|
||||
"35", //magenta
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("35"); //magenta
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -798,6 +858,8 @@ static const FFlogo* getLogoGentooSmall()
|
||||
"35", //magenta
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("35"); //magenta
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -829,6 +891,8 @@ static const FFlogo* getLogoKDENeon()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -850,6 +914,8 @@ static const FFlogo* getLogoKISSLinux()
|
||||
"37", //white
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -883,6 +949,8 @@ static const FFlogo* getLogoKubuntu()
|
||||
"34", //blue
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -909,6 +977,8 @@ static const FFlogo* getLogoLangitKetujuh()
|
||||
"34", //blue
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -935,6 +1005,8 @@ static const FFlogo* getLogoLinux()
|
||||
"30", //black
|
||||
"33" //yellow
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("37"); //white
|
||||
FF_LOGO_COLOR_TITLE("37"); //white
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -968,6 +1040,8 @@ static const FFlogo* getLogoMacOS()
|
||||
"35", //magenta
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("33"); //yellow
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -994,6 +1068,8 @@ static const FFlogo* getLogoManjaro()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1013,6 +1089,8 @@ static const FFlogo* getLogoManjaroSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1045,6 +1123,8 @@ static const FFlogo* getLogoMint()
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1065,6 +1145,8 @@ static const FFlogo* getLogoMintSmall()
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1094,6 +1176,8 @@ static const FFlogo* getLogoMintOld()
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1133,6 +1217,8 @@ static const FFlogo* getLogoMsys2()
|
||||
"37", //white
|
||||
"31" //red
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("35"); //magenta
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1166,6 +1252,8 @@ static const FFlogo* getLogoNixOS()
|
||||
"34", //blue
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1207,6 +1295,8 @@ static const FFlogo* getLogoNixOsOld()
|
||||
"34", //blue
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1226,6 +1316,8 @@ static const FFlogo* getLogoNixOsSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1257,6 +1349,8 @@ static const FFlogo* getLogoOpenSuse()
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1276,6 +1370,8 @@ static const FFlogo* getLogoOpenSuseSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1284,7 +1380,7 @@ static const FFlogo* getLogoOpenSuseLeap()
|
||||
FF_LOGO_INIT
|
||||
FF_LOGO_NAMES("opensuse_leap", "open_suse_leap", "opensuse-leap", "open-suse-leap", "suse_leap", "suse-leap", "opensuseleap")
|
||||
FF_LOGO_LINES(
|
||||
" $2.-++:.\n"
|
||||
" .-++:.\n"
|
||||
" ./oooooo/-\n"
|
||||
" `:oooooooooooo:.\n"
|
||||
" -+oooooooooooooooo+-`\n"
|
||||
@@ -1302,9 +1398,10 @@ static const FFlogo* getLogoOpenSuseLeap()
|
||||
" `:/."
|
||||
)
|
||||
FF_LOGO_COLORS(
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1313,7 +1410,7 @@ static const FFlogo* getLogoOpenSuseTumbleweed()
|
||||
FF_LOGO_INIT
|
||||
FF_LOGO_NAMES("opensuse_tumbleweed", "open_suse_tumbleweed", "opensuse-tumbleweed", "open-suse-tumbleweed", "suse_tumbleweed", "suse-tumbleweed", "opensusetumbleweed")
|
||||
FF_LOGO_LINES(
|
||||
" $2......\n"
|
||||
" ......\n"
|
||||
" .,cdxxxoc,. .:kKMMMNWMMMNk:.\n"
|
||||
" cKMMN0OOOKWMMXo. ; ;0MWk:. .:OMMk.\n"
|
||||
" ;WMK;. .lKMMNM, :NMK, .OMW;\n"
|
||||
@@ -1328,9 +1425,10 @@ static const FFlogo* getLogoOpenSuseTumbleweed()
|
||||
" ..... .:dOOXXKOxl,"
|
||||
)
|
||||
FF_LOGO_COLORS(
|
||||
"32", //green
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1364,6 +1462,8 @@ static const FFlogo* getLogoPop()
|
||||
"36", //cyan
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1384,6 +1484,8 @@ static const FFlogo* getLogoPopSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("36"); //cyan
|
||||
FF_LOGO_COLOR_TITLE("36"); //cyan
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1417,6 +1519,8 @@ static const FFlogo* getLogoReborn()
|
||||
"34", //blue
|
||||
"36" //cyan
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1440,6 +1544,8 @@ static const FFlogo* getLogoRebornSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1470,6 +1576,8 @@ static const FFlogo* getLogoRedHatEnterpriseLinux()
|
||||
FF_LOGO_COLORS(
|
||||
"31" //red
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1500,6 +1608,8 @@ static const FFlogo* getLogoRedstarOS()
|
||||
FF_LOGO_COLORS(
|
||||
"31" //red
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1531,6 +1641,8 @@ static const FFlogo* getLogoRockyLinux()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("32"); //green
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1563,6 +1675,8 @@ static const FFlogo* getLogoRosaLinux()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1596,6 +1710,8 @@ static const FFlogo* getLogoUbuntu()
|
||||
"31", //red
|
||||
"37" //white
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1614,6 +1730,8 @@ static const FFlogo* getLogoUbuntuSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"31" //red
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("31"); //red
|
||||
FF_LOGO_COLOR_TITLE("31"); //red
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1645,6 +1763,8 @@ static const FFlogo* getLogoVoid()
|
||||
"32", //green
|
||||
"30" //black
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("37"); //white
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1664,6 +1784,8 @@ static const FFlogo* getLogoVoidSmall()
|
||||
FF_LOGO_COLORS(
|
||||
"32" //green
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("37"); //white
|
||||
FF_LOGO_COLOR_TITLE("32"); //green
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
@@ -1693,6 +1815,8 @@ static const FFlogo* getLogoZorin()
|
||||
FF_LOGO_COLORS(
|
||||
"34" //blue
|
||||
)
|
||||
FF_LOGO_COLOR_KEYS("34"); //blue
|
||||
FF_LOGO_COLOR_TITLE("34"); //blue
|
||||
FF_LOGO_RETURN
|
||||
}
|
||||
|
||||
|
||||
+11
-8
@@ -150,10 +150,13 @@ void ffLogoPrintChars(FFinstance* instance, const char* data, bool doColorReplac
|
||||
printf("\033[%uA", instance->state.logoHeight);
|
||||
}
|
||||
|
||||
static void logoApplyMainColor(FFinstance* instance, const FFlogo* logo)
|
||||
static void logoApplyColors(FFinstance* instance, const FFlogo* logo)
|
||||
{
|
||||
if(instance->config.mainColor.length == 0)
|
||||
ffStrbufAppendS(&instance->config.mainColor, logo->builtinColors[0]);
|
||||
if(instance->config.colorKeys.length == 0)
|
||||
ffStrbufAppendS(&instance->config.colorKeys, logo->colorKeys);
|
||||
|
||||
if(instance->config.colorTitle.length == 0)
|
||||
ffStrbufAppendS(&instance->config.colorTitle, logo->colorTitle);
|
||||
}
|
||||
|
||||
static bool logoHasName(const FFlogo* logo, const char* name)
|
||||
@@ -214,14 +217,14 @@ static const FFlogo* logoGetBuiltinDetected(FFinstance* instance)
|
||||
return ffLogoBuiltinGetUnknown();
|
||||
}
|
||||
|
||||
static inline void logoApplyMainColorDetected(FFinstance* instance)
|
||||
static inline void logoApplyColorsDetected(FFinstance* instance)
|
||||
{
|
||||
logoApplyMainColor(instance, logoGetBuiltinDetected(instance));
|
||||
logoApplyColors(instance, logoGetBuiltinDetected(instance));
|
||||
}
|
||||
|
||||
static void logoPrintStruct(FFinstance* instance, const FFlogo* logo)
|
||||
{
|
||||
logoApplyMainColor(instance, logo);
|
||||
logoApplyColors(instance, logo);
|
||||
|
||||
const char** colors = logo->builtinColors;
|
||||
for(int i = 0; *colors != NULL && i < FASTFETCH_LOGO_MAX_COLORS; i++, colors++)
|
||||
@@ -259,7 +262,7 @@ static bool logoPrintFileIfExists(FFinstance* instance, bool doColorReplacement)
|
||||
return false;
|
||||
}
|
||||
|
||||
logoApplyMainColorDetected(instance);
|
||||
logoApplyColorsDetected(instance);
|
||||
ffLogoPrintChars(instance, content.chars, doColorReplacement);
|
||||
ffStrbufDestroy(&content);
|
||||
return true;
|
||||
@@ -270,7 +273,7 @@ static bool logoPrintImageIfExists(FFinstance* instance, FFLogoType logo)
|
||||
if(!ffLogoPrintImageIfExists(instance, logo))
|
||||
return false;
|
||||
|
||||
logoApplyMainColorDetected(instance);
|
||||
logoApplyColorsDetected(instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ typedef struct FFlogo
|
||||
const char* data;
|
||||
const char** names; //Null terminated
|
||||
const char** builtinColors; //Null terminated
|
||||
const char* colorKeys;
|
||||
const char* colorTitle;
|
||||
} FFlogo;
|
||||
|
||||
typedef const FFlogo*(*GetLogoMethod)();
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ static inline void printTitlePart(FFinstance* instance, const FFstrbuf* content)
|
||||
if(!instance->config.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
|
||||
ffPrintColor(&instance->config.mainColor);
|
||||
ffPrintColor(&instance->config.colorTitle);
|
||||
}
|
||||
|
||||
ffStrbufWriteTo(content, stdout);
|
||||
|
||||
Reference in New Issue
Block a user