Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Anderson Green Nov 17 '12 at 20:18
add comment

1 Answer 1

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

share|improve this answer
    
Do you mean this section here? semicomplete.com/projects/xdotool/xdotool.xhtml#mouse_commands –  Anderson Green 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?) –  Anderson Green 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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