memmon/lib.py
2024-12-21 15:03:39 +02:00

14 lines
348 B
Python

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}"')