Notification timeout...[SOLVED]

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Post Reply
User avatar
invex
Level 3
Level 3
Posts: 161
Joined: Sun Aug 14, 2016 12:38 pm

Notification timeout...[SOLVED]

Post by invex »

Is it possible to change the notification popup timeout?
TIA
Last edited by invex on Tue Mar 24, 2020 8:35 pm, edited 1 time in total.
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Notification timeout...

Post 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.

Image

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

var NOTIFICATION_TIMEOUT = 4;
var NOTIFICATION_CRITICAL_TIMEOUT_WITH_APPLET = 10;
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
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
invex
Level 3
Level 3
Posts: 161
Joined: Sun Aug 14, 2016 12:38 pm

Re: Notification timeout...[SOLVED]

Post by invex »

Perfect.
Thank you very much.
Post Reply

Return to “Cinnamon”