LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Rate this Entry

Using xdotool to clear notifications, particularly those of notify-send, handled by lxqt-notificationd

Posted 08-15-2023 at 08:35 PM by the dsc
Updated 08-15-2023 at 08:45 PM by the dsc

Code:
 xdotool search --name "lxqt-notificationd" windowkill
Probably can be easily adapted to notifications handled by any other notification daemon, requiring one to see what they're called with xprop or something:

Code:
 notify-send "bogus" "$(ls /usr/bin)" & xprop
Then click on the notification. "lxqt-notificationd" is the "_NET_WM_NAME(UTF8_STRING)" but also a lot of other things, I'm not sure which one is actually used by xdotool search name, probably that one, but may be some other.

The idea is to have that associated with "esc" or some other key command, so to clear an eventual excess or notifications without requiring to close them individually, which is really a PITA with the ones of lxqt-notificationd. Maybe combined with killing aosd_cat and other analog stuff.

I used to achieve the same by killing the daemon itself, having also a daemon-script that would respawn the actual notification daemon not long after, but apparently for some reason (systemd, I suspect, but maybe "xdg-portal" stuff) mate-notification-daemon somehow comes up during the interval, without my direct/conscious/deliberate request. I've also created a fake-script that has mate-notification-daemon as a filename, but is really a link to lxqt-nd, left on a $PATH position ahead of the actual one. Just in case. Kind of ridiculous to need to do that, but that's the state of things, apparently.


The xdotool windowkill solution is not altogether uncanny and/or ingenious, counter-intuitive, but for some reason I couldn't find anyone suggesting anything along those lines. Instead there were suggestions of tweaking how long the notifications themselves last spontaneously, and some xdotool/wmctrl trickery sending alt+f4 or other commands directly to the windows, but that wouldn't work for many notification types, I suspect. I'm surprised that wmctrl apparently cannot do the same with this kind of window in particular, but maybe my command is just "wrong," although it works for other windows.
Posted in Uncategorized
Views 303 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration