From 9dce0d966720fa77cef5decdfb7c387efe34fbdc Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Sun, 10 Apr 2022 04:38:09 -0400 Subject: [PATCH] [+] Get command path in package resource --- hyfetch/neofetch_util.py | 13 +++++++++++++ hyfetch/scripts/neofetch_mod.sh | 1 + 2 files changed, 14 insertions(+) create mode 100644 hyfetch/neofetch_util.py create mode 120000 hyfetch/scripts/neofetch_mod.sh diff --git a/hyfetch/neofetch_util.py b/hyfetch/neofetch_util.py new file mode 100644 index 00000000..6977c588 --- /dev/null +++ b/hyfetch/neofetch_util.py @@ -0,0 +1,13 @@ +import os +from subprocess import check_output + +import pkg_resources + + +def get_command_path() -> str: + """ + Get the absolute path of the neofetch command + + :return: Command path + """ + return pkg_resources.resource_filename(__name__, 'scripts/neofetch_mod.sh') diff --git a/hyfetch/scripts/neofetch_mod.sh b/hyfetch/scripts/neofetch_mod.sh new file mode 120000 index 00000000..93b7f0e5 --- /dev/null +++ b/hyfetch/scripts/neofetch_mod.sh @@ -0,0 +1 @@ +../../neofetch \ No newline at end of file