The only thing left to do is DETECT mouse clicks...
How do I use xdotool (or other methods?) to detect a mouse-click?
This should work, but it doesn't:
Code: Select all
xdotool search --name "VLC" behave %@ mouse-click exec 'myscript'
Code: Select all
xdotool search --name "VLC" behave %@ mouse-enter exec 'myscript'
Same result for both version - 'mouse-click' does not work, but 'mouse-enter' and 'mouse-leave' DO work
_______________________________________________________________
Older post:
I'd like to add a right click menu to VLC video playback windows, by;
1. detecting if a right click is within the VLC window in question,
2. then loading a gtkdialog GUI with <menu> stuff...
I already have stuff in place to detect the window id needed..
It could almost certainly be simplified and improved...
Code: Select all
get_wids () {
#BK vlc 1.1.5 does not display a window with "XVideo output" in title...
#BK note, default video output setting is saved in /root/.config/vlc/vlcrc, exs: vout=xcb_glx, vout=xcb_x11, vout=xcb_xv, vout=vout_sdl
for CNT in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #BK delay is needed.
do
wid=`xdotool search --name "(XVideo output)"` # get the vlc playback windowid specifically
[ "$wid" = "" ] && wid=`xdotool search --name "VLC (hardware YUV SDL output)"` #BK output: SDL
[ "$wid" = "" ] && wid=`xdotool search --name "VLC media player"` #BK outputs: XVideo, X11, GLX
[ "$wid" != "" ] && break
CNT=$(($CNT+1))
sleep 0.25
done
vlcwid=`xdotool search --name "vlc"` # look for the vlc window(s)
vlcgtkwid=`xdotool search --name "vlc-gtk"`
guiwid=`xdotool search --name "VLC Controls"`
# start double-checking for wids
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # delay is needed
do
if [ "$wid" = "" ] || [ "$vlcwid" = "" ];then # dont include guiwid here, it wont be created on first call
wid=`xdotool search --name "(XVideo output)"`
[ "$wid" = "" ] && wid=`xdotool search --name "VLC (hardware YUV SDL output)"` #BK output: SDL
[ "$wid" = "" ] && wid=`xdotool search --name "VLC media player"` #BK outputs: XVideo, X11, GLX
vlcwid=`xdotool search --name "vlc"`
vlcgtkwid=`xdotool search --name "vlc-gtk"`
guiwid=`xdotool search --name "VLC Controls"`
sleep 0.25
else
break
fi
done
}