From 6f6b88bd889999008db30fc51f53edb885be18a4 Mon Sep 17 00:00:00 2001 From: Azalea Gui <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:55:41 -0400 Subject: [PATCH] [F] Fix multiple gpus --- scripts/bin/tmux-tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bin/tmux-tool.py b/scripts/bin/tmux-tool.py index 1ef21d3..94ed6bd 100755 --- a/scripts/bin/tmux-tool.py +++ b/scripts/bin/tmux-tool.py @@ -67,14 +67,14 @@ def get_hardware_info(cpu=False, gpu=False): if cpu: # Fetch CPU info cpu_info = subprocess.run([fastfetch, '--logo', 'none', '-s', 'CPU'], stdout=subprocess.PIPE) - cpu_str = cpu_info.stdout.decode().strip() + cpu_str = cpu_info.stdout.decode().splitlines()[0].strip() # cpu_str = cpu_str.split(':', 1)[1].split('@', 1)[0].strip() cpu_str = cpu_str.split(':', 1)[1].strip() if gpu: # Fetch GPU info gpu_info = subprocess.run([fastfetch, '--logo', 'none', '-s', 'GPU'], stdout=subprocess.PIPE) - gpu_str = gpu_info.stdout.decode().strip() + gpu_str = gpu_info.stdout.decode().splitlines()[0].strip() gpu_str = gpu_str.split(':', 1)[1].strip() gpu_str = re.sub(r'lite hash rate', 'LHR', gpu_str, flags=re.IGNORECASE)