[F] Fix #379
This commit is contained in:
parent
4e9c510240
commit
02c64ef281
2 changed files with 6 additions and 3 deletions
|
|
@ -438,6 +438,7 @@ where
|
||||||
debug!(?ff_path, "fastfetch path");
|
debug!(?ff_path, "fastfetch path");
|
||||||
|
|
||||||
let mut command = Command::new(ff_path);
|
let mut command = Command::new(ff_path);
|
||||||
|
command.env("FFTS_IGNORE_PARENT", "1");
|
||||||
command.args(args);
|
command.args(args);
|
||||||
Ok(command)
|
Ok(command)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ def run_qwqfetch(asc: str, args: str = ''):
|
||||||
import qwqfetch
|
import qwqfetch
|
||||||
# distro_detector only return a bash variable
|
# distro_detector only return a bash variable
|
||||||
# so we use qwqfetch builtin distro detector
|
# so we use qwqfetch builtin distro detector
|
||||||
print(qwqfetch.get_ascres(asc))
|
print(qwqfetch.get_ascres(asc))
|
||||||
except ImportError as e: # module not found etc
|
except ImportError as e: # module not found etc
|
||||||
print("qwqfetch is not installed. Install it by executing:") # use print to output hint directly
|
print("qwqfetch is not installed. Install it by executing:") # use print to output hint directly
|
||||||
print("pip install git+https://github.com/nexplorer-3e/qwqfetch") # TODO: public repo
|
print("pip install git+https://github.com/nexplorer-3e/qwqfetch") # TODO: public repo
|
||||||
|
|
@ -379,17 +379,19 @@ def run_fastfetch(asc: str, args: str = '', legacy: bool = False):
|
||||||
"""
|
"""
|
||||||
# Find fastfetch binary
|
# Find fastfetch binary
|
||||||
ff_path = fastfetch_path()
|
ff_path = fastfetch_path()
|
||||||
|
|
||||||
if not ff_path:
|
if not ff_path:
|
||||||
printc("&cError: fastfetch binary is not found. Please install fastfetch first.")
|
printc("&cError: fastfetch binary is not found. Please install fastfetch first.")
|
||||||
exit(127)
|
exit(127)
|
||||||
|
|
||||||
# Write temp file
|
# Write temp file
|
||||||
with TemporaryDirectory() as tmp_dir:
|
with TemporaryDirectory() as tmp_dir:
|
||||||
tmp_dir = Path(tmp_dir)
|
tmp_dir = Path(tmp_dir)
|
||||||
path = tmp_dir / 'ascii.txt'
|
path = tmp_dir / 'ascii.txt'
|
||||||
path.write_text(asc, 'utf-8')
|
path.write_text(asc, 'utf-8')
|
||||||
|
|
||||||
|
os.environ['FFTS_IGNORE_PARENT'] = '1'
|
||||||
|
|
||||||
# Call fastfetch with the temp file
|
# Call fastfetch with the temp file
|
||||||
proc = subprocess.run([str(ff_path), '--raw' if legacy else '--file-raw',
|
proc = subprocess.run([str(ff_path), '--raw' if legacy else '--file-raw',
|
||||||
str(path.absolute()), *shlex.split(args)])
|
str(path.absolute()), *shlex.split(args)])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue