memmon/lib.py

14 lines
348 B
Python
Raw Permalink Normal View History

2024-12-21 14:03:39 +01:00
import logging
import subprocess
import config
def run_os_command(cmd):
logging.debug(f'COMMAND: {cmd}')
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
return result.stdout
def send_notification(line1, line2):
run_os_command(f'notify-send -w -u critical -i "{config.ICON_NOTIFY}" "{line1}" "{line2}"')