dj95/fn-notify

Make widget identifiable by xdotool

Opened this issue · 0 comments

Kwbmm commented

I have bound the app to volume and brigtness keys of my laptop. Whenever I press those, the volume/brightness is raised/lowered and the widget is displayed. The issue is when you press repeatedly the keys, you then need to kill the previous instance and show the new one.

Currently, I do this:

# Kill previous instances so they don't overlap
for pid in $(ps aux | grep fn-notify); do
    kill -9 $pid
done

However, if you keep doing that for some time, compton crashes. That's probably an issue with compton.

A workaround I've found with previous notification widgets was to hide the window associated to the program through xdotool, like this:

# Hide the previous notifications windows. Don't kill them as they crash
# compton.
custom_widget_name="something"
for wid in $(xdotool search --classname ${custom_widget_name}); do
    xdotool windowunmap $wid
done

Unfortunately, looks like fn-notify doesn't have any meaningful property that can be used to uniquely identify it when it's run. I tried xprop on it, but it returns just:

WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW

An improvement to this application would be to add a classname to it so that it could be caught with xdotool search function