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

30
_notify.py Normal file
View File

@@ -0,0 +1,30 @@
import tkinter as ttk
from tkinter import ttk as tk
from tkinter import PhotoImage
import os
import sv_ttk
def draw(cid, num, img, title="Notification"):
root = ttk.Tk()
root.title(title)
root.geometry("1280x50")
root.attributes("-topmost", True)
if os.name == 'posix':
root.overrideredirect(1)
try:
sv_ttk.use_dark_theme()
except:
pass
phone = PhotoImage(file=img)
phone_image = tk.Label(root, image=phone)
cid_label = tk.Label(root, text=cid, font=("Arial", 32))
num_label = tk.Label(root, text=num, font=("Arial", 32))
phone_image.grid(row=0, column=0, padx=10)
cid_label.grid(row=0, column=1, padx=10)
num_label.grid(row=0, column=2, padx=10)
root.after(15000, lambda: root.destroy())
root.mainloop()