Changes to Celestia

This commit is contained in:
Kevin Alberts 2021-04-15 17:11:48 +02:00
parent f4c6430eb4
commit a033bde573
Signed by: Kurocon
GPG key ID: BCD496FEBA0C6BC1
5 changed files with 101 additions and 103 deletions

View file

@ -12,7 +12,10 @@ from libqtile.bar import Bar
from notify2 import Notification, URGENCY_NORMAL
from libqtile.log_utils import logger
notify2.init("QTileWM")
try:
notify2.init("QTileWM")
except DBusException as e:
logger.error("Could not initialize notify2: {}".format(e))
BUTTON_LEFT = 1
BUTTON_MIDDLE = 2
@ -100,6 +103,10 @@ def notify(title, content, urgency=URGENCY_NORMAL, timeout=5000, image=None):
try:
return notification.show()
except notify2.UninittedError:
logger.warning("Notify2 was uninitialized, initializing...")
notify2.init("qtile")
return notification.show()
except DBusException as e:
logger.warning("Showing notification failed: {}".format(e))
logger.warning(traceback.format_exc())