added notifications

added freepbx integration as notification source
This commit is contained in:
Brandon4466
2023-08-11 02:17:41 -07:00
parent 0039308633
commit 4467115135
9 changed files with 91 additions and 23 deletions

View File

@@ -6,7 +6,8 @@ from time import sleep
import subprocess
from pynput import mouse
from functools import partial
from os import name, path, remove, system
from os import name, path, remove, system, kill, popen
import signal
# while True:
@@ -53,7 +54,16 @@ while True:
except urllib.error.HTTPError:
print("No update available.")
pass
for line in popen("ps ax | grep " + "web.py" + " | grep -v grep"):
fields = line.split()
pid = fields[0]
kill(int(pid), signal.SIGKILL)
subprocess.Popen(['python3', 'web/web.py'])
for line in popen("ps ax | grep " + "freepbx.py" + " | grep -v grep"):
fields = line.split()
pid = fields[0]
kill(int(pid), signal.SIGKILL)
subprocess.Popen(['python3', 'freepbx.py'])
subprocess.check_call(['python3', 'spotifycontroller.py'])
except Exception as e:
if e.args[0] == 1: