Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Support X11 urgency hint on Linux #202

Open
maximbaz opened this issue Mar 24, 2018 · 6 comments
Open

Support X11 urgency hint on Linux #202

maximbaz opened this issue Mar 24, 2018 · 6 comments

Comments

@maximbaz
Copy link

maximbaz commented Mar 24, 2018

Today it is possible to set urgency hint using the "Custom command" option:

notify-send '%title' '%text' -i '%image'; wmctrl -r 'Thunderbird' -b add,demands_attention

However I'd like to use the GNotifier engine instead of the Custom one, especially because I'm using notify-send anyway.

What I'd like to see is a new option to optionally set the urgency hint in addition to showing the notification.

Thanks!

@mkiol
Copy link
Owner

mkiol commented Mar 27, 2018

Currently, GNotifier tries to set the focus on TB window only when user clicks "Open" action on the notification.

In 8e82b90 I've added new option: "Set focus on Thunderbird window on new notification". When enabled, on Windows it will bring TB window to the foreground but on Linux it should trigger "X11 urgency hint".

Please try the latest dev XPI and let me know if it works for you.

@maximbaz
Copy link
Author

Thanks! The behavior is the following on Arch Linux + i3wm:

  • When I'm currently on a different workspace (virtual desktop) from Thunderbird, the urgency hint is triggered (correct!)
  • When I'm on the same workspace as Thunderbird (e.g. working in a text editor), the urgency hint is not triggered, instead the focus is being stolen by Thunderbird (which I think is not very cool).

For me personally 8e82b90 is enough and I'm fine with closing this ticket, I'll be using this functionality because I usually keep Thunderbird on a dedicated workspace. However I'm not sure if the same applies for other people who also want urgency hint 🙂 Up to you.

@mkiol
Copy link
Owner

mkiol commented Mar 27, 2018

You right, it will steal focus. I'm using focus() method that is built into TB API. Probably this method do more than only setting urgency hint...

My (hopefully temporal) workaround is as follows:

  • In c270272 I've added option to execute custom command together with GNotifier engine. You have to set engine to "GNotifier + Custom command"
  • Now, you can execute "wmctrl -r 'Thunderbird' -b add,demands_attention" and still use GNotifier implementation

Check the latest dev XPI.

@maximbaz
Copy link
Author

This works correctly in all cases, thanks! 👍

I think this is actually not a bad workaround at all, I can see how useful it can be. And if choosing between this approach and "Set focus on Thunderbird window on new notification", I would definitely prefer this one, I find the automatically stealing focus a bit too much intrusive. Will you keep that checkbox at all, or will you remove it?

@mkiol
Copy link
Owner

mkiol commented Mar 28, 2018

You right. I've renamed option to "Set urgency hint on new notification" (4f98f83). When enabled, wmctrl -r 'Thunderbird' -b add,demands_attention command will execute on every new notification.

@maximbaz
Copy link
Author

This is the best! Just tested, it works perfectly with GNotifier engine 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants