0

I would like to add an icon link in the Unity Launcher which opens the application switcher (the one that the keyboard shortcut alt+tab opens). How can I do this?

Edit: I installed xdotools and have attempted make the desktop file.

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-window-list
Name[en_US]=App Switcher
Exec=sh -c 'xdotool keydown Alt key Tab && sleep 4 && xdotool keyup Alt'
Name=App Switcher
Icon=gnome-panel-window-list

It almost works. The app launcher opens, however, I can't select the open windows.

Edit: The code above works. You just need to use the wheel on the mouse to switch :D

GSM-S
  • 604
  • I have edited the question to clear up the confusion. I would like to have a click able icon in the unity launcher that opens the application switcher (the one that alt+tab opens). – GSM-S Jan 01 '16 at 06:31
  • Typically the launcher bar on the left side contains icons for all running applications. Is there a particular reason, why you don't want to use that? Your solution requires more mouse clicks and movement. – David Foerster Jan 01 '16 at 13:17
  • See comment below David's answer. – Jacob Vlijm Jan 01 '16 at 21:08

2 Answers2

1

You could

  1. create an application launcher that
  2. runs a command which simulates a keyboard combination.
  3. You can then use gsettings to add the launcher to the favourite list.
David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • Hi David, did you try? This was my first idea too, but it needs a physical key up to select the latest active/selected item. There is a clash of acting with the design of alt- tab here. The second time won't work. – Jacob Vlijm Jan 01 '16 at 14:17
  • No, I didn't try it since I don't have Unity conveniently available. – David Foerster Jan 01 '16 at 15:57
  • 1
    The same principle as here: http://askubuntu.com/a/517626/72216 I was wondering why it works there, but not in this case, until I realized the last selection is chosen by key release, not by clicking. That makes (an answer to) the question not work anyway. – Jacob Vlijm Jan 01 '16 at 16:04
0

Install mainmenu application: https://apps.ubuntu.com/cat/applications/precise/alacarte/

Then drag and drop your new launcher from the Unity dash to the Unity bar.

Quentin
  • 1,307
  • Search alacarte apps in the Ubuntu Software Center. – Quentin Dec 31 '15 at 14:08
  • Thanks for the suggestion. I checked through all the options. There isn't an option in alacarte that opens the application switcher. – GSM-S Dec 31 '15 at 14:14
  • 1
    I think I do not understand what is the application switcher for you. Is it the Unity bar on the left ? Or the menu of ALT+TAB shortcut ? – Quentin Dec 31 '15 at 14:27
  • The alt+tab one. – GSM-S Dec 31 '15 at 15:11
  • The icon is the same in both case. When you change the icon with alacarte you should see the same in the switcher. Maybe a unity log in/out is required. – Quentin Dec 31 '15 at 15:16
  • I had proofread and edited my original post. (Sorry about that =_=;) What I meant was for an icon that opens the application switcher (the alt+tab one). – GSM-S Jan 01 '16 at 06:45