added notifications
added freepbx integration as notification source
This commit is contained in:
30
_notify.py
Normal file
30
_notify.py
Normal 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()
|
||||
Reference in New Issue
Block a user