Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For a variety of reasons, I have two x screens configured on my Ubuntu 10.10 desktop. But, I can't use Alt+Tab to switch between any all of the windows at the same time.

For example, if 2 Windows are on Screen A and 1 window is on screen B, and my mouse is over screen A, then Alt+Tab only shows the two windows on screen A.

Is there a shortcut I can use to switch the focus to various screens, or is there a way to combine the entries in Alt+tab to show all windows. (Note that I am NOT looking for a solution that will make all monitors work as one, e.g. through xinerama).

Thanks!

Bernie

share|improve this question
    
It must be a glitch in compiz drivers. With nvidia closed source drivers, I get exactly the behaviour you desire without doing anything. Sorry I couldn't be more help –  hbdgaf Oct 5 '10 at 0:33
    
i don't think you are talking about switching workspaces, that ctl-alt arrows for my configuration –  hbdgaf Oct 5 '10 at 0:35
    
You're right aking, I'm not talking about workspaces, just the focus of the X-Screen...Although I can move my mouse between the screens, the 'individualized' x-screen configuration does not allow me to move windows between screens, which (for a variety of reasons) I prefer to having windows be movable...just wondering if there's a way to change the focus or add all windows to the alt+tab –  btelles Oct 5 '10 at 0:51

1 Answer 1

up vote 0 down vote accepted

Figured it out.

I ended up writing a small script that would set focus on a window in the desired screen. Then I placed it in my /home/my_name/bin directory, and set keyboard shortcuts to execute the script with the correct options.

All the script does is move the mouse to the desired screen coordinates, then simulates a click at that location. it accepts options for up, down, left, and right so that I can choose any one of the four screens.

Here it is:

#file: /home/my_user/bin/smon 
#(make sure you have execute privileges on this file)

while getopts ":udlr" Option
do
  case $Option in
    u    ) s=2;;
    d    ) s=1;;
    l    ) s=0;;
    r    ) s=3;;
  esac

done
xdotool mousemove --screen $s 500 28 click 1

You can execute the script like so:

/home/my_user/bin/smon -u
=> moves the mouse to the top of screen 2, and clicks at 28 pixels below the top.

So if you open the Ubuntu keyboard shortcuts dialog, (currently in System -> Preferences -> Keyboard Shortcuts), then click the "Add" button, then you should be able to copy the above command, paste it in the 'command' text box, and map it to some useful shortcut.

I know, not the most elegant solution, but it works for me.

share|improve this answer

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.