K
K
Kir Mozor2021-09-26 12:30:03
linux
Kir Mozor, 2021-09-26 12:30:03

Notify2.UninittedError: You must call notify2.init() before using the notification features how to fix?

Watched how to make notifications in Linux. I used the notify2 library. Displays quietly notifications and ok. But then it stopped displaying, throwing the error notify2.UninittedError: You must call notify2.init() before using the notification features
How to fix this?
see code

def notifications (progress, timeout):
    ICON_PATH = "spotidownload.svg"

    n = notify2.Notification(f"SpotiDownload - {progress}", icon = ICON_PATH)
    n.set_urgency(notify2.URGENCY_NORMAL)
    n.set_timeout(timeout)

    n.show()
    n.close()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kir Mozor, 2021-09-27
@150_Kirill_150

Add a line to the beginning
notify2.init("SpotiDownload")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question