![]() |
#1 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Nov 2024
Device: Tolino Vision 5
|
System-Notification
Hello, I see in calibre also a system notification.
How can I use this in Python? A simple example would be nice. Thank You |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Nov 2024
Device: Tolino Vision 5
|
Thanks to kovidgoyal
Here is an example from calibre.gui2 import notify n = notify.get_notifier() n('hello', timeout=3000) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
I tried it here but couldn't make it work. notify.get_notifier() returns None (either from the command line or from a gui Plugin).
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,289
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That means no notification backend was found on your system.
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,289
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,289
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Well, first I checked if the tray was available and supported messages:
Code:
QSystemTrayIcon.isSystemTrayAvailable() QSystemTrayIcon.supportsMessages() Then, I tried to show a message from a GUI plugin: Code:
from calibre.gui2.ui import get_gui from calibre.gui2 import notify gui = get_gui() tray = QSystemTrayIcon(gui) n = notify.get_notifier(systray=tray) n('hello', timeout=3000) 1) If I call get_notifier() without the systray argument, then it returns None 2) If instead of get_gui(), I use QApplication.instance(), it doesn't work either What am I missing? |
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,289
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Did you enable the system tray icon in calibrepreferences? do notifications from calibre itself work? for example when a conversion is done you will get a notification about it normally.
|
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
2) No. No notification when calibre completes a conversion. I remember seeing notifications in the Windows notification panel only when I was in debug mode. I've never seen a notification in normal mode. I my Windows 11 machine, when I check the system config 'System > Notifications', calibre is not listed there. I see many other programs, but not calibre. |
|
![]() |
![]() |
![]() |
#12 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,606
Karma: 7511185
Join Date: Sep 2020
Device: none
|
I see the taskbar flash upon any job completion, and I'm happy with it by the way.
For instance, in my Waterfox settings I have alerts.useSystemBackend set to false. I don't need every program in the system to be fully integrated to Windows, especially when the browser itself is almost like an OS (I have hundreds of add-ons that provide extended functionality) and send out tons of useful notifications, that I need to monitor. The other day I tried to make a .bat script reproduce this same behavior Calibre has in my system. Taskbar flashing for that script would be perfectly sufficient because it's not too intrusive. When I realised I would need to use powershell, I put this on hold. (I can only do some basic stuff using windows classic shell) However, from time to time I miss the ability to see when some task is completed in Calibre. For instance: GR Author Notes plugin. |
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
|
![]() |
![]() |
![]() |
#14 | |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,289
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,289
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I tried it on my win11 machine with system tray enabled and notifications on job completion not disabled and I got popup notifications as expected when converting. Though I dont see any system tray anymore in windows. IIRC windows requires shortcuts to be installed for the application otherwise it refuses to show notifications so maybe its caused by using calibre portable.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hide System Fonts feature (make system fonts toggable)? | spedinfargo | KOReader | 7 | 10-27-2022 09:11 PM |
Kobo system cannot recognize fonts added into system-wide fonts directory? | codychan | Kobo Developer's Corner | 11 | 12-08-2018 05:35 PM |
Notification not working | BobC | Feedback | 12 | 08-04-2016 04:04 AM |
Arc Notification bar freeze and eventual system UI crash (Arc 10HD) | Glompish | Kobo Tablets | 6 | 12-26-2014 02:32 AM |
how to clean more disk space in root file system to upgrade system | chinaet | iRex | 1 | 12-18-2006 03:54 PM |