dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.42k stars 338 forks source link

Can't force timeout on notifications from web browser. #1283

Closed Samueru-sama closed 4 days ago

Samueru-sama commented 4 months ago

When using telegram web on the browser (brave) notifications don't timeout at the time I have set in my dunst configuration.

When looking at dunst --print There's an error for the notifications of the web browser:

{
    appname: 'Brave'
    summary: '_message_'
    body: '<a href="https://web.telegram.org/">web.telegram.org</a>

New notification'
    icon: '/tmp/.org.chromium.Chromium.pWzR1I'
    raw_icon set: false
    icon_id: '(null)'
    desktop_entry: 'brave-browser'
    category: 
    timeout: 25000
    urgency: NORMAL
    transient: 0
    formatted: '<b>_message_</b>
web.telegram.org

New notification'
    fg: #ffffff
    bg: #04090e
    highlight: #1745d1
    frame: #F0C674
    fullscreen: show
    format: <b>%s</b>\n%b
    progress: -1
    stack_tag: 
    id: 2
    urls:
    {
        [web.telegram.org] https://web.telegram.org/
    }
    actions: {
        "default": "Activate"
        "settings": "Settings"
    }
    script_count: 0
}
CRITICAL: Source ID 525 was not found when attempting to remove it

Installation info

Dunstrc here

[urgency_low]
    background = "#04090e"
    foreground = "#888888"
    frame_color = "#F0C674"
    timeout = 2

[urgency_normal]
    background = "#04090e"
    foreground = "#ffffff"
    frame_color = "#F0C674"
    timeout = 2

[urgency_critical]
    background = "#900000"
    foreground = "#ffffff"
    frame_color = "#ff0000"
    timeout = 60
fwsmit commented 4 months ago

The error you see is solved in master. Not sure if that's the cause, though

Samueru-sama commented 4 months ago

The error you see is solved in master. Not sure if that's the cause, though

I built and installed the latest version of dunst and now dunst --print doesn't show info from any notification and only shows the CRITICAL error:

~/ dunst -v     
Dunst - A customizable and lightweight notification-daemon v1.10.0-1-g7775775
~/ dunst --print     
CRITICAL: Source ID 42 was not found when attempting to remove it
CRITICAL: Source ID 52 was not found when attempting to remove it
CRITICAL: Source ID 68 was not found when attempting to remove it
WARNING: Expected image data to be of length 9213 but got a length of 9216
WARNING: Expected image data to be of length 9213 but got a length of 9216

And the issue of the telegram web notification not timing out is still present.

bynect commented 3 months ago

It seems the timeout set by the browser is overriding the default one you set. Maybe you could try using a rule that sets the timeout to notifications sent by the browser?

Samueru-sama commented 3 months ago

It seems the timeout set by the browser is overriding the default one you set. Maybe you could try using a rule that sets the timeout to notifications sent by the browser?

I tried this before and didn't work, but now I can't try it again because how do I get the appname now? before dunst --print would show that info so I could add it to my dunstrc but since the last version I built that is broken as well and now dunst --print doesn't show that info as seen in the previous comment, it only shows errors.

Sorry for the late reply, the email was sent to my junk.

UPDATE:

I was able to get the appname again by simply reading the original log I posted here lol, I added this my dunstrc config:

[brave]
    appname = Brave
    background =  "#1ffff0"
    timeout = 1

And it is "working" because the background color for the notifications does change to the one I have set there, however the timeout of 1 second doesn't work still.

ldionmarcil commented 5 days ago

Hi @Samueru-sama, for your use case you should use override_dbus_timeout. Just tested with a chrome-produced notification and it works, when timeout didn't.

Samueru-sama commented 4 days ago

Hi @Samueru-sama, for your use case you should use override_dbus_timeout. Just tested with a chrome-produced notification and it works, when timeout didn't.

Thank you so much! that was the issue indeed.