Is it possible to display a right-click menu using a shell script (or some kind of Unix command?) I'm trying to find a program that can be used to display a context menu at a specific location on the screen.

For example, it would be useful to display the desktop right-click context menu programmatically (the one that appears when right-clicking on a file.) This would require some method of launching the desktop right-click menu from the command line.

  • This might be relevant (a Java popup window that closes automatically when the user clicks outside it): stackoverflow.com/questions/1675912/… It might be possible to modify this program so that it can be launched at a specific screen position using a shell script. Nov 17 '12 at 20:18

You can do this using xdotool, see the MOUSE COMMANDS section of the manual, specifically the click argument.

  • Do you mean this section here? semicomplete.com/projects/xdotool/xdotool.xhtml#mouse_commands Nov 17 '12 at 20:06
  • 1
    @AndersonGreen - Yes.
    – Chris Down
    Nov 17 '12 at 20:07
  • Do the mouse commands do anything besides moving the mouse to a specific position on the screen? (Specifically, which commands can be used to display a context menu at a specific position on the screen?) Nov 17 '12 at 20:10
  • @AndersonGreen It's not that simple. You need to find and activate the window (see the window section of that manual), then right click on that window using the click command.
    – Chris Down
    Nov 17 '12 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.