mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
--logo-source / --load-config: support path with env variables (*nix)
This commit is contained in:
@@ -38,6 +38,7 @@ Features:
|
||||
* Support yakuake terminal version & font detection (Terminal, Linux)
|
||||
* Add new option `--bright-color` which can be used to disable the default bright color of keys, title and ASCII logo.
|
||||
* Add module `Monitor` which prints physical parameters (native resolutions and demensions) of connected monitors
|
||||
* Support path with environment variables for `--logo-source` and `--load-config`.
|
||||
|
||||
Bugfixes:
|
||||
* Fix possible hanging (TerminalFont, #493)
|
||||
|
||||
+15
-1
@@ -6,6 +6,7 @@
|
||||
#include <termios.h>
|
||||
#include <poll.h>
|
||||
#include <dirent.h>
|
||||
#include <wordexp.h>
|
||||
|
||||
static void createSubfolders(const char* fileName)
|
||||
{
|
||||
@@ -109,7 +110,20 @@ bool ffPathExists(const char* path, FFPathType type)
|
||||
|
||||
bool ffPathExpandEnv(const char* in, FFstrbuf* out)
|
||||
{
|
||||
return false;
|
||||
bool result = false;
|
||||
wordexp_t exp;
|
||||
if(wordexp(in, &exp, WRDE_NOCMD) != 0)
|
||||
return false;
|
||||
|
||||
if (exp.we_wordc == 1)
|
||||
{
|
||||
result = true;
|
||||
ffStrbufSetS(out, exp.we_wordv[0]);
|
||||
}
|
||||
|
||||
wordfree(&exp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
|
||||
+1
-1
@@ -361,7 +361,7 @@ static bool logoPrintFileIfExists(bool doColorReplacement, bool raw)
|
||||
|
||||
if(!ffAppendFileBuffer(options->source.chars, &content))
|
||||
{
|
||||
fputs("Logo: Failed to load file content from logo source\n", stderr);
|
||||
fprintf(stderr, "Logo: Failed to load file content from logo source: %s \n", options->source.chars);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user