Xorg desktop mouseclicks--- help please

@pakrat provided me with the following source for use in dwm config.h:

/* Desktop Mouse button definitions by MR */
{ ClkRootWin, 0, Button3, spawn, SHCMD(“jgmenu --config-file=/home/mark/.config/jgmenu/jgmenurc”) },
{ ClkRootWin, 0, Button1, spawn, SHCMD(“xdotool key F1”) },

I’d like to create something more generic that could be used for bspwm, hlwm, openbox and the like. Ideas, pointers, discouragement are all eagerly solicited.


There’s not really going to be a way to ensure the click is on the root window without the WM supporting it in some way or writing a separate small application to do it (far more robust and not too hard). I’m also sure you can just bind it through sxhkd and use some form of modifier so it doesn’t conflict with other application and the default right click, eg.

# bind alt + right click release to jgmenu, replay the captured event
# for other clients interested, dwm resize for example
alt + ~@button3
    jgmenu --config-file=/home/mark/.config/jgmenu/jgmenurc

Might have a bit of testing/changing to do with the keybind if it conflicts with [insert wm here], I added ~ which should replay it but there may still be problems.

@natemaia Thank you. Here’s what I’m testing. If it breaks on one of my slew of wms, I can try to simply change to using F1… or similar

I apologize for not having thought of this straightforward approach. CRS strikes, I guess. CRS = can’t remember sh*t. :slight_smile:

# rofi menu   (alt+left-mouse-click)
alt + @button1
	 rofi -modi drun,window,run,keys,ssh -show drun -show-icons -sidebar-mode -location 0  -width 360

# jgmenu (alt+right-mouse-click)
alt + @button3
    jgmenu --config-file=/home/mark/.config/jgmenu/jgmenurc