Changes to Celestia
This commit is contained in:
parent
f4c6430eb4
commit
a033bde573
5 changed files with 101 additions and 103 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue