mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Escape bedrock option
This commit is contained in:
@@ -130,6 +130,7 @@ __fastfetch_completion()
|
||||
"--localip-show-ipv4"
|
||||
"--localip-show-ipv6"
|
||||
"--localip-show-loop"
|
||||
"--escape-bedrock"
|
||||
)
|
||||
|
||||
local FF_OPTIONS_STRING=(
|
||||
|
||||
@@ -124,6 +124,7 @@ static void defaultConfig(FFinstance* instance)
|
||||
instance->config.allowSlowOperations = false;
|
||||
instance->config.disableLinewrap = true;
|
||||
instance->config.hideCursor = true;
|
||||
instance->config.escapeBedrock = true;
|
||||
|
||||
ffStrbufInitA(&instance->config.osFormat, 0);
|
||||
ffStrbufInitA(&instance->config.osKey, 0);
|
||||
|
||||
@@ -151,6 +151,12 @@
|
||||
# Default is the first match starting with org.mpris.MediaPlayer2.
|
||||
#--player-name spotify
|
||||
|
||||
# Escape bedrock option
|
||||
# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--escape-bedrock true
|
||||
|
||||
# Key options:
|
||||
# Sets the displayed key of a module
|
||||
# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help.
|
||||
|
||||
@@ -18,6 +18,7 @@ General options:
|
||||
--load-config <file>: load a config file or a preset (+)
|
||||
--multithreading <?value>: use multiple threads to detect values
|
||||
--allow-slow-operations <?value>: allow operations that are usually very slow for more detailed output
|
||||
--escape-bedrock <?value>: on bedrock linux, sets if it should escape the bedrock jail or not
|
||||
|
||||
Logo options:
|
||||
-l,--logo <logo>: set the logo to use. The type is specified by --logo-type. If default: the name of a builtin logo or a path to a file
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ const FFOSResult* ffDetectOS(const FFinstance* instance)
|
||||
{
|
||||
parseFile(instance->config.osFile.chars, &result);
|
||||
}
|
||||
else if(ffFileExists(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", S_IFDIR)) {
|
||||
else if(instance->config.escapeBedrock && ffFileExists(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", S_IFDIR)) {
|
||||
parseFile(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", &result);
|
||||
|
||||
if(result.id.length == 0)
|
||||
|
||||
@@ -718,6 +718,8 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
|
||||
data->multithreading = optionParseBoolean(value);
|
||||
else if(strcasecmp(key, "--allow-slow-operations") == 0)
|
||||
instance->config.allowSlowOperations = optionParseBoolean(value);
|
||||
else if(strcasecmp(key, "--escape-bedrock") == 0)
|
||||
instance->config.escapeBedrock = optionParseBoolean(value);
|
||||
|
||||
////////////////
|
||||
//Logo options//
|
||||
|
||||
@@ -62,6 +62,7 @@ typedef struct FFconfig
|
||||
bool allowSlowOperations;
|
||||
bool disableLinewrap;
|
||||
bool hideCursor;
|
||||
bool escapeBedrock;
|
||||
|
||||
FFstrbuf osFormat;
|
||||
FFstrbuf osKey;
|
||||
|
||||
Reference in New Issue
Block a user