From e38ad965812800e6efea3f0e49159f2dbec2349e Mon Sep 17 00:00:00 2001 From: lanxu Date: Sat, 23 Dec 2017 14:08:23 +0200 Subject: [PATCH] Improved gputemp on my T400 --- gputemp.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gputemp.py b/gputemp.py index 9aa879d..6512b75 100755 --- a/gputemp.py +++ b/gputemp.py @@ -2,6 +2,7 @@ import os import re import logging +import subprocess from subprocess import check_output FORMAT = "%(asctime)s %(levelname)s %(message)s" @@ -14,13 +15,17 @@ aticonfig_available = is_exe("/usr/bin/aticonfig") sensors_available = is_exe("/usr/bin/sensors") if sensors_available: - commands = ["sensors radeon-pci-* | grep temp1", "sensors thinkpad-isa-* | grep ATI"] + commands = ["sensors radeon-pci-* | grep temp1", "sensors thinkpad-isa-0000 | grep ATI"] for try_command in commands: command = try_command - return_command = check_output(command, shell=True) - if return_command is not None: - break + try: + return_command = check_output(command, stderr=subprocess.STDOUT, shell=True) + if return_command is not None: + break + except subprocess.CalledProcessError as commandexc: + continue + if aticonfig_available: command = "aticonfig --odgt"