diff --git a/setup.py b/setup.py index 31a372c..f50d169 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import re -# from distutils.core import setup from setuptools import setup version = re.search( diff --git a/suplemon/main.py b/suplemon/main.py index 883f4c5..ecc8477 100644 --- a/suplemon/main.py +++ b/suplemon/main.py @@ -4,7 +4,6 @@ The main class that starts and runs Suplemon. """ -__version__ = "0.1.43" import os import sys @@ -19,6 +18,8 @@ from .config import Config from .editor import Editor +__version__ = "0.1.44" + class App: def __init__(self, filenames=None, config_file=None): diff --git a/suplemon/modules/battery.py b/suplemon/modules/battery.py index 0df0325..7a5cf65 100644 --- a/suplemon/modules/battery.py +++ b/suplemon/modules/battery.py @@ -1,5 +1,6 @@ # -*- encoding: utf-8 +import os import time import subprocess @@ -71,7 +72,8 @@ def battery_status_read(self): def battery_status_acpi(self): """Get the battery status via acpi.""" try: - raw_str = subprocess.check_output(["acpi"]) + FNULL = open(os.devnull, "w") + raw_str = subprocess.check_output(["acpi"], stdout=FNULL, stderr=FNULL) except: return None raw_str = raw_str.decode("utf-8") @@ -91,6 +93,7 @@ def battery_status_upower(self): except: return None raw_str = raw_str.decode("utf-8") + raw_str = raw_str.splitlines()[0] part = helpers.get_string_between("percentage:", "%", raw_str) if part: try: