2

ScreenshotI was wondering if there is any way to make the Global Menu (File, Edit.......Messages etc) Drop Down Automatically when I Hover my Mouse Pointer above it instead of Clicking them??? Im using Ubuntu 11.10 Unity Desktop.

kernel_panic
  • 11,732

2 Answers2

3

You can install xdotool and create a script to put at "Startup Applications" like this:

  
#!/bin/bash
#
# version 0.06 by desgua 
#
# To click at global menu
#
############################################################
h=
d=

function hittop {

eval $(xdotool getmouselocation --shell)

if [ "$Y" -lt "24" ] ; then
h=1
d=0
fi
}

while :
do

if [ "$h" = "1" ] ; then 
xdotool click 1
sleep .1
h=0
fi

eval $(xdotool getmouselocation --shell)
if [ "$Y" -gt "24" ] ; then
d=1
fi

if [ "$d" = "1" ] ; then
hittop
fi

########################
# Uncomment the following line if your cpu gets hot...
# sleep .2 
######################## 
done

exit 0


Step by step instructions:

1) Press Alt + F2 and paste gedit ~/.click.global.menu then hit Enter - this will open a blank file.

2) Paste the previous script at the blank file and save.

3) Press Alt + F2 and paste gnome-terminal - this will open a terminal.

4) At terminal paste chmod +x ~/.click.global.menu

5) Press Alt + F2 and paste gnome-session-properties - this will open the Startup Applications.

6) At Startup Applications hit "Add".

7) At dialog paste Global Menu at "Name:" and ~/.click.global.menu at "Command:" as showed in this picture:

enter image description here

8) Install xdotool (just click at the link and hit "Install")

9) Logout and Log back in.

10) Have fun ;-)

Automated way

1) Just open a terminal and paste this:

sudo apt-get install xdotool && cd ~/ && wget -c http://dl.dropbox.com/u/4098082/click.global.menu && chmod +x ~/click.global.menu && ~/click.global.menu
desgua
  • 32,917
  • isnt there a way to manually start it up instead of automatic? – kernel_panic Dec 31 '11 at 19:42
  • step 1 isnt opening anything, it just shows a file, that too is not clickable – kernel_panic Dec 31 '11 at 19:47
  • Do you know how to open a terminal? (Applications > Accessories > Terminal) You can substitute Press Alt + F2 for Open a terminal. And yes you can start it manually by opening a terminal and pasting ~/.click.global.menu. – desgua Dec 31 '11 at 23:19
  • I did everything as you have said.... then.... nothing happens... – kernel_panic Jan 01 '12 at 08:11
  • Can you open a terminal and paste sudo apt-get install xdotool && cd ~/ && wget -c http://dl.dropbox.com/u/4098082/click.global.menu && chmod +x ~/click.global.menu && ~/click.global.menu then tell what happens? – desgua Jan 01 '12 at 13:35
  • i get something called find client some random numbers and "unary operator expected all in an infinite loop" – kernel_panic Jan 01 '12 at 18:40
  • Seems like that it is working. Then, when you get your mouse up to the menu, is there an automatic click? – desgua Jan 01 '12 at 18:50
  • Can you paste this on a terminal and post me the screenshot: xdotool mousemove 100 15 && gnome-screenshot ? – desgua Jan 01 '12 at 19:27
  • ive posted a screenshot – kernel_panic Jan 03 '12 at 14:05
  • It looks fine. Can you paste this on a terminal and see if it works? h= ; d= ; while : ; do function hittop { eval $(xdotool getmouselocation --shell) ; if [ "$Y" -lt "24" ] ; then h=1 ; d=0 ; fi ; } ; if [ $h = 1 ] ; then xdotool mousemove 100 15 click 1 ; sleep .1 ; xdotool mousemove $X $Y ; h=0 ; fi ; eval $(xdotool getmouselocation --shell) ; if [ "$Y" -gt "24" ] ; then d=1 ; fi ; if [ $d = 1 ] ; then hittop ; fi ; done – desgua Jan 03 '12 at 23:05
  • nothin happened:(:(:(:(: – kernel_panic Jan 04 '12 at 16:01
  • If you paste xdotool mousemove 100 15 click 1 the menu DropDown? – desgua Jan 04 '12 at 16:04
  • no... the menu dodn dropdwn – kernel_panic Jan 04 '12 at 16:56
  • what does it mean by UNARY OPERATOR EXPECTED? – kernel_panic Jan 04 '12 at 17:02
  • This indicates a little mistake in my script that I've already correct, thank you for pointing this. See more here: http://linuxcommand.org/wss0100.php – desgua Jan 04 '12 at 21:13
  • it worked, i removed everything and did everything from starting, SHAANDAAR – kernel_panic Jan 05 '12 at 08:05
  • That is great! :-) – desgua Jan 05 '12 at 11:35
-1

This is a small answer but it could solve that lazy issue of yours :P Go to System>Preferences>Mouse -- now go to the accessibility tab and check the box "initiate click when stopping pointer movement". This will enable click when not moving your mouse.

Jester
  • 162
  • 1
    In 11.10 this can be accomplished with System Settings -- Universal Access -- Pointing & Clicking tab -- Hover Click ON. You'll be able to select right, left double or drag. However, the result of the click will depend on where the cursor is positioned and unfortunately you get that click weather you wanted it or not. – fragos Dec 30 '11 at 23:04