Преглед на файлове

[+] Get command path in package resource

Azalea (on HyDEV-Daisy) преди 3 години
родител
ревизия
9dce0d9667
променени са 2 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 13 0
      hyfetch/neofetch_util.py
  2. 1 0
      hyfetch/scripts/neofetch_mod.sh

+ 13 - 0
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')

+ 1 - 0
hyfetch/scripts/neofetch_mod.sh

@@ -0,0 +1 @@
+../../neofetch