Page 1 of 1

Notification timeout...[SOLVED]

Posted: Sat Feb 08, 2020 11:07 pm
by invex
Is it possible to change the notification popup timeout?

Re: Notification timeout...

Posted: Sun Feb 09, 2020 2:58 am
by smurphos
Cinnamon deals with notification time-outs a bit weirdly.

The application providing the notification can specify a timeout, but that doesn't control how long the notification is visible on screen (unless the timeout is shorter than the default) only how long it will stay in the notification tray before disappearing for good assuming 'Remove notifications after timeout is reached' is checked in the main Notification Settings.


The actual time on screen for transient notifications is hardcoded on /usr/share/cinnamon/js/ui/messageTray.js. Luckily it's a plain text javascript file so amenable to end user tweaking (after making a backup and with elevated privileges)

The hard-coded values are near the start of the file and look like this. Time is in seconds.

Code: Select all

NOTIFICATION_TIMEOUT is the default timeout

NOTIFICATION_CRITICAL_TIMEOUT_WITH_APPLET is used if the notification is flagged by the sending app as CRITICAL and the notification applet is present. If the applet is absent critical notifications won't timeout.

So if you wanted to tweak

Make a back up

Code: Select all

sudo cp /usr/share/cinnamon/js/ui/messageTray.js /usr/share/cinnamon/js/ui/messageTray.js.original
Open the file with elevated privileges

Code: Select all

xed admin:///usr/share/cinnamon/js/ui/messageTray.js
Once tweaked and saved restart Cinnamon with Ctrl-Alt-Esc

Re: Notification timeout...[SOLVED]

Posted: Sun Feb 09, 2020 11:38 am
by invex
Thank you very much.