Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-07-12 20:49:54

tehkos
Member
Registered: 2021-07-12
Posts: 3

Notifications keyboard shortcut

I'd like to view last notifications with a keyboard shortcut. I need to click the bell on the panel to view the notification window. Is it possible to do this without a mouse?
Xfce 4.14

Offline

#2 2021-07-12 21:51:37

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,860

Re: Notifications keyboard shortcut

Hello and welcome.

If you have logging enabled, it will log all notifications to ~/.cache/xfce4/notifyd/log. You can manually script/parse this file to get the last entry for the most recent notification. Here is an example using zenity (assign this command to a keyboard shortcut):

bash -c "zenity --title Last\ Notification --height 150 --no-wrap --info --text \"$(sed 'H;/^$/h;$!d;x' ~/.cache/xfce4/notifyd/log)\""

Offline

#3 2021-07-12 21:56:54

tehkos
Member
Registered: 2021-07-12
Posts: 3

Re: Notifications keyboard shortcut

I thought about reading the log file. But I'm more worried about the bell itself. It turns red if have unread messages, and I want quickly turn it off.

Offline

#4 2021-07-13 02:06:32

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,860

Re: Notifications keyboard shortcut

Hmm, that makes it difficult. There is no built-in way to do this that I am aware of, but you might be able to make use of an automation tool like xdotool. Assigning a command like:

xdotool mousemove 1200 20 click 1

...to a keyboard shortcut (you will need to adjust the geometry values of 1200 (x) and 20 (y) so that it sits on top of the icon) will move the mouse to the icon and click it displaying the context menu (and clearing the bell colour).

If required, you can also script xdotool to save the current location of the mouse pointer and return it there after the click to make it mostly seamless.

Offline

#5 2021-07-13 04:55:28

tehkos
Member
Registered: 2021-07-12
Posts: 3

Re: Notifications keyboard shortcut

OK. Thank you, ToZ. I'll give it a try.

Offline

Board footer

Powered by FluxBB