summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-10-19 12:07:12 +0200
committerBotond Hende <nettingman@gmail.com>2024-10-19 12:07:12 +0200
commitd6e55af9f2421641a5d4c8945869a1463b353272 (patch)
tree74e71b15f1218a1b59c0db114604f9b2f94a7c2e /__main__.py
parent3cc11c690197dfd321e9580a6e3a7221bddc1dc9 (diff)
search for processes in /usr/bin instead of using wildcard
Diffstat (limited to '__main__.py')
-rw-r--r--__main__.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/__main__.py b/__main__.py
index 79d6a23..bae42ce 100644
--- a/__main__.py
+++ b/__main__.py
@@ -1,3 +1,4 @@
+import os
import sys
import yaml
@@ -15,7 +16,19 @@ def main():
yaml_path = Path(sys.argv[1])
yaml_file_paths = yaml_path.glob("*.yaml")
- slot_lists = {}
+ processes = []
+ bin_dir = "/usr/bin"
+ for file in os.listdir(bin_dir):
+ if file == "[":
+ continue
+
+ full_path = os.path.join(bin_dir, file)
+ if os.path.isfile(full_path) or os.path.islink(full_path):
+ processes.append(file)
+
+ slot_lists = {
+ "process": TextSlotList.from_strings(processes)
+ }
for yaml_file_path in yaml_file_paths:
with open(yaml_file_path, "r", encoding="utf-8") as yaml_file: