Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override timeout if program specified it; can't override urgency #1020

Open
tastytea opened this issue Jan 22, 2022 · 5 comments
Open
Labels

Comments

@tastytea
Copy link

Issue description

I'm trying to override the timeout for some notifications. It does not work when the application specified a timeout. I also discovered that I can not override the urgency.

  • notify-send -a "program" "summary" "body" — timeout override works, urgency override does not work.
  • notify-send -a "program" -t 10000 "summary" "body" — timeout override does not work, urgency override does not work.

Example notification

This is the output I get with notify-send -a "program" -t 10000 "summary" "body" The urgency seems to be set correctly, but it is displayed as a normal notidication.

{
        appname: 'program'
        summary: 'summary'
        body: 'body'
        icon: 'dialog-warning'
        raw_icon set: false
        icon_id: '(null)'
        desktop_entry: ''
        category:
        timeout: 10000
        urgency: CRITICAL
        transient: 0
        formatted: '<b>summary</b>
body'
        fg: #ffffff
        bg: #00ff00
        highlight: #1745d1
        frame: #888888
        fullscreen: show
        format: <b>%s</b>
%b
        progress: -1
        stack_tag:
        id: 2
        actions: {}
        script_count: 0
}

Installation info

  • Version: Dunst - A customizable and lightweight notification-daemon 1.7.3 (2021-12-08)
  • Install type: Gentoo repo
  • Window manager / Desktop environment: i3
Minimal dunstrc
[urgency_normal]
    background  = "#00ff00"
    timeout = 10

[urgency_critical]
    background  = "#ff0000"
    timeout = 0

[override_test]
    appname = "program"
    timeout = 2
    urgency = critical
@fwsmit
Copy link
Member

fwsmit commented Feb 7, 2022

Allowing the timeout to be overwritten by the rules would break a lot of configs. Many configs, including the example dunstrc, include default timeouts for all the urgencies. If the timeout inside the rules has priority over the dbus timeout, something like notify-send -t 1000 "test" would not set a timeout of 1 second as expected.

So the correct priority to me should be:

  1. Dbus timeout
  2. Rule timeout
    (3. Internal defaults)

I think this is all correct behaviour and as discussed in #1022, you should pay attention to rule order.

@tastytea
Copy link
Author

My problem is that some programs set a timeout and don't allow me to change it. I was expecting that the override sections would override everything, like this:

  1. Override rule timeout
  2. Dbus timeout
  3. Normal rule timeout
    (4. Internal defaults)

I thought my original problem was with Firefox, but it was a website, and it turned out that it doesn't set a timeout but closes the notification after X seconds, so it can't be solved here. While I'm annoyed at the programs which do set a timeout and don't allow me to change it, I think it's relatively uncommon (I found 1 so far) and not a huge deal to me.

So I still think it should be possible to override timeouts from applications, but I don't really need it anymore and maybe I'm the only one who is annoyed by this. 😊

@fwsmit
Copy link
Member

fwsmit commented Feb 16, 2022

I would be open for adding a new setting for overriding the dbus timeout (for example override_timeout. I closed #1022 because it changed the behaviour of the normal timeout, which breaks many configs.

Are you aware of the ignore_dbusclose setting? This makes sure applications don't close notifications too early by sending a dbus close command. It seems that it currently isn't a rule, but it could be made one to enforce it only on some programs.

Of course, you can also go to the programs that do this and tell them they should change, or add an option to disable it.

@fwsmit fwsmit added the Feature label Feb 16, 2022
@tastytea
Copy link
Author

I would be open for adding a new setting for overriding the dbus timeout (for example override_timeout. I closed #1022 because it changed the behaviour of the normal timeout, which breaks many configs.

That would be nice to have as a band-aid solution.

Are you aware of the ignore_dbusclose setting? This makes sure applications don't close notifications too early by sending a dbus close command. It seems that it currently isn't a rule, but it could be made one to enforce it only on some programs.

I was not aware, thanks! It would help me a lot if it were a rule.

Of course, you can also go to the programs that do this and tell them they should change, or add an option to disable it.

Yes, that's what I usually do. (In this case the project is in maintenance mode, so that doesn't seem like a promising endeavor)

@fwsmit
Copy link
Member

fwsmit commented Feb 16, 2022

I've added issues for both settings (see above). It would be great if you or @rpbranco could tackle these.

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

Successfully merging a pull request may close this issue.

2 participants