Skip to content

Commit ea6805d

Browse files
Escape bedrock option
1 parent 9aba57c commit ea6805d

File tree

7 files changed

+13
-1
lines changed

7 files changed

+13
-1
lines changed

completions/bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ __fastfetch_completion()
130130
"--localip-show-ipv4"
131131
"--localip-show-ipv6"
132132
"--localip-show-loop"
133+
"--escape-bedrock"
133134
)
134135

135136
local FF_OPTIONS_STRING=(

src/common/init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static void defaultConfig(FFinstance* instance)
124124
instance->config.allowSlowOperations = false;
125125
instance->config.disableLinewrap = true;
126126
instance->config.hideCursor = true;
127+
instance->config.escapeBedrock = true;
127128

128129
ffStrbufInitA(&instance->config.osFormat, 0);
129130
ffStrbufInitA(&instance->config.osKey, 0);

src/data/config.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@
151151
# Default is the first match starting with org.mpris.MediaPlayer2.
152152
#--player-name spotify
153153

154+
# Escape bedrock option
155+
# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one
156+
# Must be true or false.
157+
# Default is true.
158+
#--escape-bedrock true
159+
154160
# Key options:
155161
# Sets the displayed key of a module
156162
# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help.

src/data/help.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ General options:
1818
--load-config <file>: load a config file or a preset (+)
1919
--multithreading <?value>: use multiple threads to detect values
2020
--allow-slow-operations <?value>: allow operations that are usually very slow for more detailed output
21+
--escape-bedrock <?value>: on bedrock linux, sets if it should escape the bedrock jail or not
2122

2223
Logo options:
2324
-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

src/detection/os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const FFOSResult* ffDetectOS(const FFinstance* instance)
124124
{
125125
parseFile(instance->config.osFile.chars, &result);
126126
}
127-
else if(ffFileExists(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", S_IFDIR)) {
127+
else if(instance->config.escapeBedrock && ffFileExists(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", S_IFDIR)) {
128128
parseFile(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", &result);
129129

130130
if(result.id.length == 0)

src/fastfetch.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,8 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
718718
data->multithreading = optionParseBoolean(value);
719719
else if(strcasecmp(key, "--allow-slow-operations") == 0)
720720
instance->config.allowSlowOperations = optionParseBoolean(value);
721+
else if(strcasecmp(key, "--escape-bedrock") == 0)
722+
instance->config.escapeBedrock = optionParseBoolean(value);
721723

722724
////////////////
723725
//Logo options//

src/fastfetch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ typedef struct FFconfig
6262
bool allowSlowOperations;
6363
bool disableLinewrap;
6464
bool hideCursor;
65+
bool escapeBedrock;
6566

6667
FFstrbuf osFormat;
6768
FFstrbuf osKey;

0 commit comments

Comments
 (0)