Home » Questions » Computers [ Ask a new question ]

How to switch applications in Ubuntu/Gnome using an alternative keystroke to the default ALT+TAB?

How to switch applications in Ubuntu/Gnome using an alternative keystroke to the default ALT+TAB?

On Ubuntu/Gnome, is it possible to simulate ALT+TAB using a single alternative keystroke?

Asked by: Guest | Views: 312
Total answers/comments: 3
Guest [Entry]

If you are using compiz as your windows manager, i.e. if you have enabled visual effects, simply install the compizconfig-settings-manager package. The start the settings manager via System -> Preferences -> CompizConfig Settings Manager. Now find the settings for the Application Switcher module and you can assign any keypress of your liking to the Next and Previous Window commands.
Guest [Entry]

"New answer

I have been messing around for the past hour or so in order to come up with a solution, but I am stumped. What I have managed to do is make a macro that does Alt+Tab, then sends an additional Tab every two seconds... But I have no idea on how to terminate the script when you have had enough. (You only need to tap a key once to start)

I am wondering if any macro/Linux gurus can make a second macro or script that can terminate the macro from playing upon request - This simply works when you press one key and let go.

In Ubuntu, start by going to terminal and type:

sudo apt-get install xmacro

(Now, I am not the best Linux guy, but I am clueless as to why I couldn't find this in synaptic package manager, but I had to type it from the terminal).

Next, The script I made is (save this somewhere, I called it test.macro in my home directory)

KeyStrPress Alt_L

Then, copy and paste the following as many times as you want:

KeyStrPress Tab
KeyStrRelease Tab
Delay 2

To run this, you need to type the following (from the place that the macro is saved):

cat test.macro | xmacroplay "":0.0""

I created an alias/hotkey to the above command.

Again, This is not a solution, but hopefully a start point. I got close but after spending a lot of time, I cannot come up with a solid solution. Sorry, but hopefully this will get you closer.


As far as I know, it isn't possible.

I looked in various config files but cannot find a good way to replicate Alt+Tab due to the way it works.

Simply put, you need to hold one down whilst the other does the switching.

What I recommend you do and I can look in to it for you if you want, is to write a macro that automatically, upon one key being pressed, does Alt+Tab, then sends another Tab every couple of seconds. Letting go simply releases on the application currently selected."
Guest [Entry]

"Make a script that re-binds the assigned key to:

Start the script (Alt+Tab)
Move down the app line (Tab)"