Can I have a textual Alt-Tab functionality?Simply set xterm title?ALT-ESC to switch between windows -->...

Prioritising polygons in QGIS

How to not let the Identify spell spoil everything?

Subsurf on a crown. How can I smooth some edges and keep others sharp?

Why does 0.-5 evaluate to -5?

How to access internet and run apt-get through a middle server?

Is there a verb that means to inject with poison?

Does diversity provide anything that meritocracy does not?

How do I prevent a homebrew Grappling Hook feature from trivializing Tomb of Annihilation?

Why does magnet wire need to be insulated?

Does an Eldritch Knight's Weapon Bond protect him from losing his weapon to a Telekinesis spell?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

Microtypography protrusion with Polish quotation marks

Does it take energy to move something in a circle?

What makes papers publishable in top-tier journals?

What is the industry term for house wiring diagrams?

How to delete duplicate text from a file?

In harmony: key or the flow?

Does a paladin have to announce that they're using Divine Smite before attacking?

Which RAF squadrons and aircraft types took part in the bombing of Berlin on the 25th of August 1940?

Plausible reason for gold-digging ant

A Missing Symbol for This Logo

Why do neural networks need so many training examples to perform?

How to politely refuse in-office gym instructor for steroids and protein

Definition of "atomic object"



Can I have a textual Alt-Tab functionality?


Simply set xterm title?ALT-ESC to switch between windows --> window manager is hangingIs there an alternative task switcher to KRunner which is focused exclusively on window switching?Asking for tool that effectively jump between windowsHow do you set the title of the active gnome-terminal from the command line?Simpler ALT-TAB in UnityDisable focus for all windows of same type when using Alt+Tab in UnitySSH shell launched using “expect” doesn't have full width. How can I make fix it?Running a command in a new terminal instance in a bash scriptDisplaying TTY name in Terminal nameSwitch between applications by using the keyboardbackground tab dissapeared in terminal profile preferencesNo tab completion with asterisk *How to switch between windows within same group?













4















Once upon a time there was the fabulous window manager called "enlightenment".



If you used it, and you hit ALT-TAB then you saw a small list of window titles below each other.



Like this:




  • user@remote-host

  • foo@db-server

  • emacs

  • ...


Or like this:



window-switcher-simple-and-beautiful



I liked it a lot.



I want it back. I mean the feature, not the app.



I am using Ubuntu 18.04



I don't want to see icons of applications like this:



alt-tab-is-useless-at-the-moment



I have up to five terminals open. If I press the windows-key I will see the roughly same image (small version of a big terminal) five times.



window-key-icons



It takes time and mental energy to find the right terminal. And I want to switch with the keyboard only, without using the mouse.



The magic behind the terminal:



xtermset -title foo


I have this the bash script which gets executed if I login via ssh.



This way I can distinguish between several terminals easily.



How to get this feature which worked in the year 1998 back?



(Please don't tell me to install the enlightenment window-manager, this question is about a simple feature, not the app)



User "DK Bose" wanted me to show the output of these commands:



===> wmctrl -m
Name: GNOME Shell
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
tguettler@aptguettler:~
===>


tguettler@aptguettler:~
===> wmctrl -lx
0x0200000a 0 desktop_window.Nautilus aptguettler Schreibtisch
0x01c00178 0 Pidgin.Pidgin aptguettler tbz
0x02600010 0 Navigator.Firefox aptguettler command line - List of window names on ALT-Tab - Ask Ubuntu - Mozilla Firefox
0x02200010 0 Mail.Thunderbird aptguettler Posteingang - tguettler@tbz-pariv.de (IMAP) - Mozilla Thunderbird
0x04400006 0 gnome-terminal-server.Gnome-terminal aptguettler foooooo
0x044000ce 0 gnome-terminal-server.Gnome-terminal aptguettler tguettler@aptguettler


The string "foooooo" was set via xtermset -title foooooo. The title was set in a shell which was running ssh on a remote server.










share|improve this question

















This question has an open bounty worth +100
reputation from guettli ending in 7 days.


This question has not received enough attention.












  • 1





    Something like i.stack.imgur.com/59JH3.png?

    – DK Bose
    Feb 8 at 14:30











  • From this and your previous question I am getting a feeling that somehow you've misunderstood the application-switching feature or using it wrong. Ideally there should not be five terminal icons for five terminal windows. <Alt><Tab> switches between applications whereas <Alt><key-above-Tab> switches between windows of the same application. If you use <Alt><key-above-Tab> you should see small window previews with window titles, à la i2.wp.com/itsfoss.com/wp-content/uploads/2017/10/…

    – pomsky
    Feb 8 at 14:46






  • 1





    @pomsky, I stole it from my answer here: askubuntu.com/a/1085193/248158. It's one of many defaults in Kubuntu 18.04 and is not an add-on.

    – DK Bose
    Feb 8 at 14:57











  • @DKBose yes, the screenshot looks very nice. More is not needed. Simple and beautiful :-)

    – guettli
    Feb 8 at 14:57






  • 1





    @pomsky yes, the screenshot by DK is what I would like ALT-TAB to look like.

    – guettli
    Feb 9 at 8:33
















4















Once upon a time there was the fabulous window manager called "enlightenment".



If you used it, and you hit ALT-TAB then you saw a small list of window titles below each other.



Like this:




  • user@remote-host

  • foo@db-server

  • emacs

  • ...


Or like this:



window-switcher-simple-and-beautiful



I liked it a lot.



I want it back. I mean the feature, not the app.



I am using Ubuntu 18.04



I don't want to see icons of applications like this:



alt-tab-is-useless-at-the-moment



I have up to five terminals open. If I press the windows-key I will see the roughly same image (small version of a big terminal) five times.



window-key-icons



It takes time and mental energy to find the right terminal. And I want to switch with the keyboard only, without using the mouse.



The magic behind the terminal:



xtermset -title foo


I have this the bash script which gets executed if I login via ssh.



This way I can distinguish between several terminals easily.



How to get this feature which worked in the year 1998 back?



(Please don't tell me to install the enlightenment window-manager, this question is about a simple feature, not the app)



User "DK Bose" wanted me to show the output of these commands:



===> wmctrl -m
Name: GNOME Shell
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
tguettler@aptguettler:~
===>


tguettler@aptguettler:~
===> wmctrl -lx
0x0200000a 0 desktop_window.Nautilus aptguettler Schreibtisch
0x01c00178 0 Pidgin.Pidgin aptguettler tbz
0x02600010 0 Navigator.Firefox aptguettler command line - List of window names on ALT-Tab - Ask Ubuntu - Mozilla Firefox
0x02200010 0 Mail.Thunderbird aptguettler Posteingang - tguettler@tbz-pariv.de (IMAP) - Mozilla Thunderbird
0x04400006 0 gnome-terminal-server.Gnome-terminal aptguettler foooooo
0x044000ce 0 gnome-terminal-server.Gnome-terminal aptguettler tguettler@aptguettler


The string "foooooo" was set via xtermset -title foooooo. The title was set in a shell which was running ssh on a remote server.










share|improve this question

















This question has an open bounty worth +100
reputation from guettli ending in 7 days.


This question has not received enough attention.












  • 1





    Something like i.stack.imgur.com/59JH3.png?

    – DK Bose
    Feb 8 at 14:30











  • From this and your previous question I am getting a feeling that somehow you've misunderstood the application-switching feature or using it wrong. Ideally there should not be five terminal icons for five terminal windows. <Alt><Tab> switches between applications whereas <Alt><key-above-Tab> switches between windows of the same application. If you use <Alt><key-above-Tab> you should see small window previews with window titles, à la i2.wp.com/itsfoss.com/wp-content/uploads/2017/10/…

    – pomsky
    Feb 8 at 14:46






  • 1





    @pomsky, I stole it from my answer here: askubuntu.com/a/1085193/248158. It's one of many defaults in Kubuntu 18.04 and is not an add-on.

    – DK Bose
    Feb 8 at 14:57











  • @DKBose yes, the screenshot looks very nice. More is not needed. Simple and beautiful :-)

    – guettli
    Feb 8 at 14:57






  • 1





    @pomsky yes, the screenshot by DK is what I would like ALT-TAB to look like.

    – guettli
    Feb 9 at 8:33














4












4








4


1






Once upon a time there was the fabulous window manager called "enlightenment".



If you used it, and you hit ALT-TAB then you saw a small list of window titles below each other.



Like this:




  • user@remote-host

  • foo@db-server

  • emacs

  • ...


Or like this:



window-switcher-simple-and-beautiful



I liked it a lot.



I want it back. I mean the feature, not the app.



I am using Ubuntu 18.04



I don't want to see icons of applications like this:



alt-tab-is-useless-at-the-moment



I have up to five terminals open. If I press the windows-key I will see the roughly same image (small version of a big terminal) five times.



window-key-icons



It takes time and mental energy to find the right terminal. And I want to switch with the keyboard only, without using the mouse.



The magic behind the terminal:



xtermset -title foo


I have this the bash script which gets executed if I login via ssh.



This way I can distinguish between several terminals easily.



How to get this feature which worked in the year 1998 back?



(Please don't tell me to install the enlightenment window-manager, this question is about a simple feature, not the app)



User "DK Bose" wanted me to show the output of these commands:



===> wmctrl -m
Name: GNOME Shell
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
tguettler@aptguettler:~
===>


tguettler@aptguettler:~
===> wmctrl -lx
0x0200000a 0 desktop_window.Nautilus aptguettler Schreibtisch
0x01c00178 0 Pidgin.Pidgin aptguettler tbz
0x02600010 0 Navigator.Firefox aptguettler command line - List of window names on ALT-Tab - Ask Ubuntu - Mozilla Firefox
0x02200010 0 Mail.Thunderbird aptguettler Posteingang - tguettler@tbz-pariv.de (IMAP) - Mozilla Thunderbird
0x04400006 0 gnome-terminal-server.Gnome-terminal aptguettler foooooo
0x044000ce 0 gnome-terminal-server.Gnome-terminal aptguettler tguettler@aptguettler


The string "foooooo" was set via xtermset -title foooooo. The title was set in a shell which was running ssh on a remote server.










share|improve this question
















Once upon a time there was the fabulous window manager called "enlightenment".



If you used it, and you hit ALT-TAB then you saw a small list of window titles below each other.



Like this:




  • user@remote-host

  • foo@db-server

  • emacs

  • ...


Or like this:



window-switcher-simple-and-beautiful



I liked it a lot.



I want it back. I mean the feature, not the app.



I am using Ubuntu 18.04



I don't want to see icons of applications like this:



alt-tab-is-useless-at-the-moment



I have up to five terminals open. If I press the windows-key I will see the roughly same image (small version of a big terminal) five times.



window-key-icons



It takes time and mental energy to find the right terminal. And I want to switch with the keyboard only, without using the mouse.



The magic behind the terminal:



xtermset -title foo


I have this the bash script which gets executed if I login via ssh.



This way I can distinguish between several terminals easily.



How to get this feature which worked in the year 1998 back?



(Please don't tell me to install the enlightenment window-manager, this question is about a simple feature, not the app)



User "DK Bose" wanted me to show the output of these commands:



===> wmctrl -m
Name: GNOME Shell
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
tguettler@aptguettler:~
===>


tguettler@aptguettler:~
===> wmctrl -lx
0x0200000a 0 desktop_window.Nautilus aptguettler Schreibtisch
0x01c00178 0 Pidgin.Pidgin aptguettler tbz
0x02600010 0 Navigator.Firefox aptguettler command line - List of window names on ALT-Tab - Ask Ubuntu - Mozilla Firefox
0x02200010 0 Mail.Thunderbird aptguettler Posteingang - tguettler@tbz-pariv.de (IMAP) - Mozilla Thunderbird
0x04400006 0 gnome-terminal-server.Gnome-terminal aptguettler foooooo
0x044000ce 0 gnome-terminal-server.Gnome-terminal aptguettler tguettler@aptguettler


The string "foooooo" was set via xtermset -title foooooo. The title was set in a shell which was running ssh on a remote server.







command-line bash window-manager application-switcher






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 18 at 14:28









Jacob Vlijm

64.6k9129224




64.6k9129224










asked Feb 8 at 14:15









guettliguettli

52152267




52152267






This question has an open bounty worth +100
reputation from guettli ending in 7 days.


This question has not received enough attention.








This question has an open bounty worth +100
reputation from guettli ending in 7 days.


This question has not received enough attention.










  • 1





    Something like i.stack.imgur.com/59JH3.png?

    – DK Bose
    Feb 8 at 14:30











  • From this and your previous question I am getting a feeling that somehow you've misunderstood the application-switching feature or using it wrong. Ideally there should not be five terminal icons for five terminal windows. <Alt><Tab> switches between applications whereas <Alt><key-above-Tab> switches between windows of the same application. If you use <Alt><key-above-Tab> you should see small window previews with window titles, à la i2.wp.com/itsfoss.com/wp-content/uploads/2017/10/…

    – pomsky
    Feb 8 at 14:46






  • 1





    @pomsky, I stole it from my answer here: askubuntu.com/a/1085193/248158. It's one of many defaults in Kubuntu 18.04 and is not an add-on.

    – DK Bose
    Feb 8 at 14:57











  • @DKBose yes, the screenshot looks very nice. More is not needed. Simple and beautiful :-)

    – guettli
    Feb 8 at 14:57






  • 1





    @pomsky yes, the screenshot by DK is what I would like ALT-TAB to look like.

    – guettli
    Feb 9 at 8:33














  • 1





    Something like i.stack.imgur.com/59JH3.png?

    – DK Bose
    Feb 8 at 14:30











  • From this and your previous question I am getting a feeling that somehow you've misunderstood the application-switching feature or using it wrong. Ideally there should not be five terminal icons for five terminal windows. <Alt><Tab> switches between applications whereas <Alt><key-above-Tab> switches between windows of the same application. If you use <Alt><key-above-Tab> you should see small window previews with window titles, à la i2.wp.com/itsfoss.com/wp-content/uploads/2017/10/…

    – pomsky
    Feb 8 at 14:46






  • 1





    @pomsky, I stole it from my answer here: askubuntu.com/a/1085193/248158. It's one of many defaults in Kubuntu 18.04 and is not an add-on.

    – DK Bose
    Feb 8 at 14:57











  • @DKBose yes, the screenshot looks very nice. More is not needed. Simple and beautiful :-)

    – guettli
    Feb 8 at 14:57






  • 1





    @pomsky yes, the screenshot by DK is what I would like ALT-TAB to look like.

    – guettli
    Feb 9 at 8:33








1




1





Something like i.stack.imgur.com/59JH3.png?

– DK Bose
Feb 8 at 14:30





Something like i.stack.imgur.com/59JH3.png?

– DK Bose
Feb 8 at 14:30













From this and your previous question I am getting a feeling that somehow you've misunderstood the application-switching feature or using it wrong. Ideally there should not be five terminal icons for five terminal windows. <Alt><Tab> switches between applications whereas <Alt><key-above-Tab> switches between windows of the same application. If you use <Alt><key-above-Tab> you should see small window previews with window titles, à la i2.wp.com/itsfoss.com/wp-content/uploads/2017/10/…

– pomsky
Feb 8 at 14:46





From this and your previous question I am getting a feeling that somehow you've misunderstood the application-switching feature or using it wrong. Ideally there should not be five terminal icons for five terminal windows. <Alt><Tab> switches between applications whereas <Alt><key-above-Tab> switches between windows of the same application. If you use <Alt><key-above-Tab> you should see small window previews with window titles, à la i2.wp.com/itsfoss.com/wp-content/uploads/2017/10/…

– pomsky
Feb 8 at 14:46




1




1





@pomsky, I stole it from my answer here: askubuntu.com/a/1085193/248158. It's one of many defaults in Kubuntu 18.04 and is not an add-on.

– DK Bose
Feb 8 at 14:57





@pomsky, I stole it from my answer here: askubuntu.com/a/1085193/248158. It's one of many defaults in Kubuntu 18.04 and is not an add-on.

– DK Bose
Feb 8 at 14:57













@DKBose yes, the screenshot looks very nice. More is not needed. Simple and beautiful :-)

– guettli
Feb 8 at 14:57





@DKBose yes, the screenshot looks very nice. More is not needed. Simple and beautiful :-)

– guettli
Feb 8 at 14:57




1




1





@pomsky yes, the screenshot by DK is what I would like ALT-TAB to look like.

– guettli
Feb 9 at 8:33





@pomsky yes, the screenshot by DK is what I would like ALT-TAB to look like.

– guettli
Feb 9 at 8:33










4 Answers
4






active

oldest

votes


















4





+25









I'm not sure it's advisable to attempt to change the window manager in Ubuntu 18.04. The window manager is integrated into GNOME Shell.



You may find Rofi suitable for the purpose you describe while leaving the system's default intact.



Rofi in window switcher mode




  • Rofi is available in the universe section.


  • It has an installed size of 524 kB and and very few dependencies which you can see by running apt show rofi as well as by simulating its install using apt install -s rofi.


  • Rofi has several functions but the one of interest here is the window switcher.



Once Rofi is installed:




  • Create a folder called rofi in ~/.config.


  • Run rofi -dump-config > ~/.config/rofi/config.rasi to generate a local config file which you can modify to suit your needs.


  • Preview the theme you'd like to use by running rofi-theme-selector. If you want to tweak the theme further, you could copy the theme over from /usr/share/rofi/themes to ~/.config/rofi and give it a new name to avoid confusion. I like Pop-Dark and named the local version myPop-Dark. In the images posted in this answer, I've used myPop-Dark.



Usage



To demonstrate Rofi's use as an alternative to the system's Alt+Tab:




  • I opened several windows including five xterm windows. (I opened GNOME terminal and ran nohup xterm -xrm 'XTerm.vt100.allowTitleOps: false' -T whatever & as based on the accepted answer in Simply set xterm title.)


  • I assigned Ctrl+Win+R as a shortcut keyboard combination to run rofi -show window -theme myPop-Dark



In the image posted above, there are three columns. If you always want only the name of the application and the title of the window, edit ~/.config/rofi/config.rasi to change the commented out window-format line to



window-format: "{n}    {t}";


You can also modify the width, the height, and the location of the rofi window.



To bring the window you want into focus, use the arrow keys or your mouse pointer to highlight the entry and then press Enter.



If you have a really long list of windows, press a key that's unique to the window you want to filter out all other windows. If that's not possible, filter the entries by typing, as in the animation below, f, followed by o to limit the list to windows containing the string "foo".



The animation below illustrates that.



filtering windows



To close a highlighted window, press Shift+Delete.






share|improve this answer


























  • The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

    – guettli
    Feb 13 at 14:20





















4














Ubuntu, including 18.04, is now based on GNOME and some additional features could be made available via GNOME Shell Extensions. Go to the website and search: use "window switcher" as keywords and the relevant extension may be listed in the first page of search result.



This one seems relevant and maintained:




Switcher by dlandau



switcher by dlandau in action



Switch windows or launch applications quickly by typing



Use the configured global hotkey (Super+w by default) to open a list
of current windows. Type a part of the name or title of the
application window you want to activate and hit enter or click on the
item you wish to activate. You can use the arrow keys to navigate
among the filtered selection and type several space separated search
terms to filter further. Use Esc or click anywhere outside the
switcher to cancel.



Use the configured global hotkey (Super+x by default) to open the
application launcher. Type a part of the name of the application you
want to launch and hit enter. You can use Ctrl+Space or Ctrl+Tab to
switch between the switcher and the launcher, or when there are no
open windows matching a name but there are apps the mode is switched
automatically.



You can customize the look and feel and functionality in the
preferences.



Extension Homepage: https://github.com/daniellandau/switcher



Shell version: 3.30 3.28 3.26 3.24 3.22 3.20 3.18 3.16.3 3.16 3.14




To bind the common keyboard shortcut Alt+Tab or Super+Tab with this extension, user may be required to use a workaround. A GitHub user, PHLAK, has submitted this issue #63 on GitHub and also explained the workaround in several comments:




I would like to bind the Switcher to Super + Tab but am unable to. I've also noticed I cannot bind it to Alt + Tab either.





I was able to work around this by setting the value directly with dconf:



dconf write /org/gnome/shell/extensions/switcher/show-switcher "['<Super>tab']"


You can also do the same by using the dconf-config GUI.





You might also have to unbind any pre-configured shortcuts using that key combination. Specifically, "Switch applications" is bound to Super+Tab in Gnome.



You can change this by opening the Settings and navigating to Devices > Keyboard. Then Search for Super+Tab and change or remove this binding.




Disclaimer: I do not use Ubuntu 18.04 or GNOME Shell, so I did not test this extension. I merely quoted the most seemingly reliable resources found on the web. The screenshot was redone and optimized (122kB) in GIMP instead, because the original screenshot and the animated image were too large (500kB, 7MB).



TL;DR Go to the GNOME Shell Extensions website and install the extension of choice: Switcher by dlandau. Subject to compatibility with the Shell version.






share|improve this answer
























  • Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

    – clearkimura
    Feb 14 at 19:32











  • This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

    – guettli
    yesterday











  • Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

    – clearkimura
    56 mins ago











  • The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

    – clearkimura
    41 mins ago











  • In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

    – clearkimura
    27 mins ago





















2














I think you are specifically looking for "Cycling through windows in a list" feature that is available in Window Manager Tweaks->Cycling in XFCE.



ALT-TAB Cycling in a List



enter image description here






share|improve this answer


























  • Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

    – guettli
    yesterday



















2














Just for fun



A late home-cooked one:



In action



enter image description here



The setup exists of two tiny scripts, to be saved into one and the same directory:



script 1



#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
gi.require_version('Wnck', '3.0')
from gi.repository import Gtk, Wnck, Gdk
import subprocess

css_data = """
.activestyle {
background-color: grey;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""

class AltTabStuff(Gtk.Window):
def __init__(self):
# css
self.provider = Gtk.CssProvider.new()
self.provider.load_from_data(css_data.encode())
Gtk.Window.__init__(
self, title="AltTab replacement"
)
self.curr_index = 0
self.connect('key-press-event', self.get_key)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
self.set_decorated(False)
buttongrid = Gtk.Grid()
self.add(buttongrid)
self.connect("delete_event", Gtk.main_quit)

wins = get_winlist()
self.buttonindex = 0
self.buttonsets = []
index = 0
for w in wins:
button = Gtk.Button("t" + w.get_name())
button.set_relief(Gtk.ReliefStyle.NONE)
buttongrid.attach(button, 0, index, 1, 1)
index = index + 1
button.connect("clicked", raise_window, w)
self.buttonsets.append([button, w])
self.set_focus()
self.show_all()
Gtk.main()

def set_focus(self):
for b in self.buttonsets:
button = b[0]
self.set_style(button, active=False)
newactive = self.buttonsets[self.buttonindex][0]
self.set_style(newactive, active=True)
n_buttons = len(self.buttonsets)
self.buttonindex = self.buttonindex + 1
if self.buttonindex >= n_buttons:
self.buttonindex = 0

def set_style(self, button, active):
st_cont = button.get_style_context()
if active:
st_cont.add_class("activestyle")
st_cont.remove_class("defaultstyle")
else:
st_cont.remove_class("activestyle")
st_cont.add_class("defaultstyle")
Gtk.StyleContext.add_provider(
st_cont,
self.provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
)

def get_key(self, val1, val2):
keyname = Gdk.keyval_name(val2.keyval)
if keyname == "Tab":
self.set_focus()
elif keyname == "Alt_L":
window = self.buttonsets[self.buttonindex-1][1]
button = self.buttonsets[self.buttonindex-1][0]
raise_window(button, window)
elif keyname == "Escape":
Gtk.main_quit()


def raise_window(button, window):
subprocess.Popen(["wmctrl", "-ia", str(window.get_xid())])
Gtk.main_quit()

def check_windowtype(window):
try:
return "WNCK_WINDOW_NORMAL" in str(
window.get_window_type()
)
except AttributeError:
pass

def get_winlist(scr=None):
"""

"""
if not scr:
scr = Wnck.Screen.get_default()
scr.force_update()
windows = [w for w in scr.get_windows() if check_windowtype(w)]
return windows


AltTabStuff()


script 2



#!/bin/bash

dr=`dirname $0`
f=$dr'/alttab_runner'

if ! pgrep -f $f
then
$f
else
echo "runs"
fi


Set up





  1. Not sure if Wnck and/or wmctrl is installed by default, if not:



    sudo apt install python3-gi gir1.2-wnck-3.0


    and possibly:



    sudo apt install wmctrl


  2. Save script 1 into an empty file as (exactly) alttab_runner, script 2 as (exactly) alttab_alternative. make both scripts executable



  3. Disable the existing Alt-Tab:



    gsettings set org.gnome.desktop.wm.keybindings switch-applications '[]'



  4. Set the shortcut (exactly) Alt-Tab to run script 2:



    /path/to/alttab_alternative



Usage



Press Alt + Tab to call the switcher (as in the picture), release Alt and press Tab to cycle through the windows, press Alt again to pick the selected window from the list.



Escape will dismiss (close) the switcher.



Options



If you'd like different colors, you can play with the css in script 1 to set your own styling.



enter image description hereenter image description here



To do so, edit this section, where activestyle is obviously the currently selected item:



css_data = """
.activestyle {
background-color: blue;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""


See for Gtk css options here on font and buttons.






share|improve this answer





















  • 1





    @DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

    – Jacob Vlijm
    Feb 18 at 15:13













  • Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

    – Jacob Vlijm
    Feb 20 at 6:40













  • @DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

    – Jacob Vlijm
    Feb 20 at 6:54











  • @DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

    – Jacob Vlijm
    Feb 20 at 6:59








  • 1





    @DKBose Haha, no problem, glad it works :)

    – Jacob Vlijm
    Feb 20 at 8:26











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1116691%2fcan-i-have-a-textual-alt-tab-functionality%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























4 Answers
4






active

oldest

votes








4 Answers
4






active

oldest

votes









active

oldest

votes






active

oldest

votes









4





+25









I'm not sure it's advisable to attempt to change the window manager in Ubuntu 18.04. The window manager is integrated into GNOME Shell.



You may find Rofi suitable for the purpose you describe while leaving the system's default intact.



Rofi in window switcher mode




  • Rofi is available in the universe section.


  • It has an installed size of 524 kB and and very few dependencies which you can see by running apt show rofi as well as by simulating its install using apt install -s rofi.


  • Rofi has several functions but the one of interest here is the window switcher.



Once Rofi is installed:




  • Create a folder called rofi in ~/.config.


  • Run rofi -dump-config > ~/.config/rofi/config.rasi to generate a local config file which you can modify to suit your needs.


  • Preview the theme you'd like to use by running rofi-theme-selector. If you want to tweak the theme further, you could copy the theme over from /usr/share/rofi/themes to ~/.config/rofi and give it a new name to avoid confusion. I like Pop-Dark and named the local version myPop-Dark. In the images posted in this answer, I've used myPop-Dark.



Usage



To demonstrate Rofi's use as an alternative to the system's Alt+Tab:




  • I opened several windows including five xterm windows. (I opened GNOME terminal and ran nohup xterm -xrm 'XTerm.vt100.allowTitleOps: false' -T whatever & as based on the accepted answer in Simply set xterm title.)


  • I assigned Ctrl+Win+R as a shortcut keyboard combination to run rofi -show window -theme myPop-Dark



In the image posted above, there are three columns. If you always want only the name of the application and the title of the window, edit ~/.config/rofi/config.rasi to change the commented out window-format line to



window-format: "{n}    {t}";


You can also modify the width, the height, and the location of the rofi window.



To bring the window you want into focus, use the arrow keys or your mouse pointer to highlight the entry and then press Enter.



If you have a really long list of windows, press a key that's unique to the window you want to filter out all other windows. If that's not possible, filter the entries by typing, as in the animation below, f, followed by o to limit the list to windows containing the string "foo".



The animation below illustrates that.



filtering windows



To close a highlighted window, press Shift+Delete.






share|improve this answer


























  • The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

    – guettli
    Feb 13 at 14:20


















4





+25









I'm not sure it's advisable to attempt to change the window manager in Ubuntu 18.04. The window manager is integrated into GNOME Shell.



You may find Rofi suitable for the purpose you describe while leaving the system's default intact.



Rofi in window switcher mode




  • Rofi is available in the universe section.


  • It has an installed size of 524 kB and and very few dependencies which you can see by running apt show rofi as well as by simulating its install using apt install -s rofi.


  • Rofi has several functions but the one of interest here is the window switcher.



Once Rofi is installed:




  • Create a folder called rofi in ~/.config.


  • Run rofi -dump-config > ~/.config/rofi/config.rasi to generate a local config file which you can modify to suit your needs.


  • Preview the theme you'd like to use by running rofi-theme-selector. If you want to tweak the theme further, you could copy the theme over from /usr/share/rofi/themes to ~/.config/rofi and give it a new name to avoid confusion. I like Pop-Dark and named the local version myPop-Dark. In the images posted in this answer, I've used myPop-Dark.



Usage



To demonstrate Rofi's use as an alternative to the system's Alt+Tab:




  • I opened several windows including five xterm windows. (I opened GNOME terminal and ran nohup xterm -xrm 'XTerm.vt100.allowTitleOps: false' -T whatever & as based on the accepted answer in Simply set xterm title.)


  • I assigned Ctrl+Win+R as a shortcut keyboard combination to run rofi -show window -theme myPop-Dark



In the image posted above, there are three columns. If you always want only the name of the application and the title of the window, edit ~/.config/rofi/config.rasi to change the commented out window-format line to



window-format: "{n}    {t}";


You can also modify the width, the height, and the location of the rofi window.



To bring the window you want into focus, use the arrow keys or your mouse pointer to highlight the entry and then press Enter.



If you have a really long list of windows, press a key that's unique to the window you want to filter out all other windows. If that's not possible, filter the entries by typing, as in the animation below, f, followed by o to limit the list to windows containing the string "foo".



The animation below illustrates that.



filtering windows



To close a highlighted window, press Shift+Delete.






share|improve this answer


























  • The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

    – guettli
    Feb 13 at 14:20
















4





+25







4





+25



4




+25





I'm not sure it's advisable to attempt to change the window manager in Ubuntu 18.04. The window manager is integrated into GNOME Shell.



You may find Rofi suitable for the purpose you describe while leaving the system's default intact.



Rofi in window switcher mode




  • Rofi is available in the universe section.


  • It has an installed size of 524 kB and and very few dependencies which you can see by running apt show rofi as well as by simulating its install using apt install -s rofi.


  • Rofi has several functions but the one of interest here is the window switcher.



Once Rofi is installed:




  • Create a folder called rofi in ~/.config.


  • Run rofi -dump-config > ~/.config/rofi/config.rasi to generate a local config file which you can modify to suit your needs.


  • Preview the theme you'd like to use by running rofi-theme-selector. If you want to tweak the theme further, you could copy the theme over from /usr/share/rofi/themes to ~/.config/rofi and give it a new name to avoid confusion. I like Pop-Dark and named the local version myPop-Dark. In the images posted in this answer, I've used myPop-Dark.



Usage



To demonstrate Rofi's use as an alternative to the system's Alt+Tab:




  • I opened several windows including five xterm windows. (I opened GNOME terminal and ran nohup xterm -xrm 'XTerm.vt100.allowTitleOps: false' -T whatever & as based on the accepted answer in Simply set xterm title.)


  • I assigned Ctrl+Win+R as a shortcut keyboard combination to run rofi -show window -theme myPop-Dark



In the image posted above, there are three columns. If you always want only the name of the application and the title of the window, edit ~/.config/rofi/config.rasi to change the commented out window-format line to



window-format: "{n}    {t}";


You can also modify the width, the height, and the location of the rofi window.



To bring the window you want into focus, use the arrow keys or your mouse pointer to highlight the entry and then press Enter.



If you have a really long list of windows, press a key that's unique to the window you want to filter out all other windows. If that's not possible, filter the entries by typing, as in the animation below, f, followed by o to limit the list to windows containing the string "foo".



The animation below illustrates that.



filtering windows



To close a highlighted window, press Shift+Delete.






share|improve this answer















I'm not sure it's advisable to attempt to change the window manager in Ubuntu 18.04. The window manager is integrated into GNOME Shell.



You may find Rofi suitable for the purpose you describe while leaving the system's default intact.



Rofi in window switcher mode




  • Rofi is available in the universe section.


  • It has an installed size of 524 kB and and very few dependencies which you can see by running apt show rofi as well as by simulating its install using apt install -s rofi.


  • Rofi has several functions but the one of interest here is the window switcher.



Once Rofi is installed:




  • Create a folder called rofi in ~/.config.


  • Run rofi -dump-config > ~/.config/rofi/config.rasi to generate a local config file which you can modify to suit your needs.


  • Preview the theme you'd like to use by running rofi-theme-selector. If you want to tweak the theme further, you could copy the theme over from /usr/share/rofi/themes to ~/.config/rofi and give it a new name to avoid confusion. I like Pop-Dark and named the local version myPop-Dark. In the images posted in this answer, I've used myPop-Dark.



Usage



To demonstrate Rofi's use as an alternative to the system's Alt+Tab:




  • I opened several windows including five xterm windows. (I opened GNOME terminal and ran nohup xterm -xrm 'XTerm.vt100.allowTitleOps: false' -T whatever & as based on the accepted answer in Simply set xterm title.)


  • I assigned Ctrl+Win+R as a shortcut keyboard combination to run rofi -show window -theme myPop-Dark



In the image posted above, there are three columns. If you always want only the name of the application and the title of the window, edit ~/.config/rofi/config.rasi to change the commented out window-format line to



window-format: "{n}    {t}";


You can also modify the width, the height, and the location of the rofi window.



To bring the window you want into focus, use the arrow keys or your mouse pointer to highlight the entry and then press Enter.



If you have a really long list of windows, press a key that's unique to the window you want to filter out all other windows. If that's not possible, filter the entries by typing, as in the animation below, f, followed by o to limit the list to windows containing the string "foo".



The animation below illustrates that.



filtering windows



To close a highlighted window, press Shift+Delete.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 13 at 15:00









Kristopher Ives

2,83111525




2,83111525










answered Feb 13 at 14:07









DK BoseDK Bose

14.2k124285




14.2k124285













  • The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

    – guettli
    Feb 13 at 14:20





















  • The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

    – guettli
    Feb 13 at 14:20



















The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

– guettli
Feb 13 at 14:20







The link was initial broken. I updated the answer. To make AskU happy I added more characters. Unfortunately I can't remove them again. useless constraint. Sometimes patches containing on changed character are important - useless feature of AskU

– guettli
Feb 13 at 14:20















4














Ubuntu, including 18.04, is now based on GNOME and some additional features could be made available via GNOME Shell Extensions. Go to the website and search: use "window switcher" as keywords and the relevant extension may be listed in the first page of search result.



This one seems relevant and maintained:




Switcher by dlandau



switcher by dlandau in action



Switch windows or launch applications quickly by typing



Use the configured global hotkey (Super+w by default) to open a list
of current windows. Type a part of the name or title of the
application window you want to activate and hit enter or click on the
item you wish to activate. You can use the arrow keys to navigate
among the filtered selection and type several space separated search
terms to filter further. Use Esc or click anywhere outside the
switcher to cancel.



Use the configured global hotkey (Super+x by default) to open the
application launcher. Type a part of the name of the application you
want to launch and hit enter. You can use Ctrl+Space or Ctrl+Tab to
switch between the switcher and the launcher, or when there are no
open windows matching a name but there are apps the mode is switched
automatically.



You can customize the look and feel and functionality in the
preferences.



Extension Homepage: https://github.com/daniellandau/switcher



Shell version: 3.30 3.28 3.26 3.24 3.22 3.20 3.18 3.16.3 3.16 3.14




To bind the common keyboard shortcut Alt+Tab or Super+Tab with this extension, user may be required to use a workaround. A GitHub user, PHLAK, has submitted this issue #63 on GitHub and also explained the workaround in several comments:




I would like to bind the Switcher to Super + Tab but am unable to. I've also noticed I cannot bind it to Alt + Tab either.





I was able to work around this by setting the value directly with dconf:



dconf write /org/gnome/shell/extensions/switcher/show-switcher "['<Super>tab']"


You can also do the same by using the dconf-config GUI.





You might also have to unbind any pre-configured shortcuts using that key combination. Specifically, "Switch applications" is bound to Super+Tab in Gnome.



You can change this by opening the Settings and navigating to Devices > Keyboard. Then Search for Super+Tab and change or remove this binding.




Disclaimer: I do not use Ubuntu 18.04 or GNOME Shell, so I did not test this extension. I merely quoted the most seemingly reliable resources found on the web. The screenshot was redone and optimized (122kB) in GIMP instead, because the original screenshot and the animated image were too large (500kB, 7MB).



TL;DR Go to the GNOME Shell Extensions website and install the extension of choice: Switcher by dlandau. Subject to compatibility with the Shell version.






share|improve this answer
























  • Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

    – clearkimura
    Feb 14 at 19:32











  • This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

    – guettli
    yesterday











  • Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

    – clearkimura
    56 mins ago











  • The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

    – clearkimura
    41 mins ago











  • In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

    – clearkimura
    27 mins ago


















4














Ubuntu, including 18.04, is now based on GNOME and some additional features could be made available via GNOME Shell Extensions. Go to the website and search: use "window switcher" as keywords and the relevant extension may be listed in the first page of search result.



This one seems relevant and maintained:




Switcher by dlandau



switcher by dlandau in action



Switch windows or launch applications quickly by typing



Use the configured global hotkey (Super+w by default) to open a list
of current windows. Type a part of the name or title of the
application window you want to activate and hit enter or click on the
item you wish to activate. You can use the arrow keys to navigate
among the filtered selection and type several space separated search
terms to filter further. Use Esc or click anywhere outside the
switcher to cancel.



Use the configured global hotkey (Super+x by default) to open the
application launcher. Type a part of the name of the application you
want to launch and hit enter. You can use Ctrl+Space or Ctrl+Tab to
switch between the switcher and the launcher, or when there are no
open windows matching a name but there are apps the mode is switched
automatically.



You can customize the look and feel and functionality in the
preferences.



Extension Homepage: https://github.com/daniellandau/switcher



Shell version: 3.30 3.28 3.26 3.24 3.22 3.20 3.18 3.16.3 3.16 3.14




To bind the common keyboard shortcut Alt+Tab or Super+Tab with this extension, user may be required to use a workaround. A GitHub user, PHLAK, has submitted this issue #63 on GitHub and also explained the workaround in several comments:




I would like to bind the Switcher to Super + Tab but am unable to. I've also noticed I cannot bind it to Alt + Tab either.





I was able to work around this by setting the value directly with dconf:



dconf write /org/gnome/shell/extensions/switcher/show-switcher "['<Super>tab']"


You can also do the same by using the dconf-config GUI.





You might also have to unbind any pre-configured shortcuts using that key combination. Specifically, "Switch applications" is bound to Super+Tab in Gnome.



You can change this by opening the Settings and navigating to Devices > Keyboard. Then Search for Super+Tab and change or remove this binding.




Disclaimer: I do not use Ubuntu 18.04 or GNOME Shell, so I did not test this extension. I merely quoted the most seemingly reliable resources found on the web. The screenshot was redone and optimized (122kB) in GIMP instead, because the original screenshot and the animated image were too large (500kB, 7MB).



TL;DR Go to the GNOME Shell Extensions website and install the extension of choice: Switcher by dlandau. Subject to compatibility with the Shell version.






share|improve this answer
























  • Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

    – clearkimura
    Feb 14 at 19:32











  • This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

    – guettli
    yesterday











  • Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

    – clearkimura
    56 mins ago











  • The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

    – clearkimura
    41 mins ago











  • In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

    – clearkimura
    27 mins ago
















4












4








4







Ubuntu, including 18.04, is now based on GNOME and some additional features could be made available via GNOME Shell Extensions. Go to the website and search: use "window switcher" as keywords and the relevant extension may be listed in the first page of search result.



This one seems relevant and maintained:




Switcher by dlandau



switcher by dlandau in action



Switch windows or launch applications quickly by typing



Use the configured global hotkey (Super+w by default) to open a list
of current windows. Type a part of the name or title of the
application window you want to activate and hit enter or click on the
item you wish to activate. You can use the arrow keys to navigate
among the filtered selection and type several space separated search
terms to filter further. Use Esc or click anywhere outside the
switcher to cancel.



Use the configured global hotkey (Super+x by default) to open the
application launcher. Type a part of the name of the application you
want to launch and hit enter. You can use Ctrl+Space or Ctrl+Tab to
switch between the switcher and the launcher, or when there are no
open windows matching a name but there are apps the mode is switched
automatically.



You can customize the look and feel and functionality in the
preferences.



Extension Homepage: https://github.com/daniellandau/switcher



Shell version: 3.30 3.28 3.26 3.24 3.22 3.20 3.18 3.16.3 3.16 3.14




To bind the common keyboard shortcut Alt+Tab or Super+Tab with this extension, user may be required to use a workaround. A GitHub user, PHLAK, has submitted this issue #63 on GitHub and also explained the workaround in several comments:




I would like to bind the Switcher to Super + Tab but am unable to. I've also noticed I cannot bind it to Alt + Tab either.





I was able to work around this by setting the value directly with dconf:



dconf write /org/gnome/shell/extensions/switcher/show-switcher "['<Super>tab']"


You can also do the same by using the dconf-config GUI.





You might also have to unbind any pre-configured shortcuts using that key combination. Specifically, "Switch applications" is bound to Super+Tab in Gnome.



You can change this by opening the Settings and navigating to Devices > Keyboard. Then Search for Super+Tab and change or remove this binding.




Disclaimer: I do not use Ubuntu 18.04 or GNOME Shell, so I did not test this extension. I merely quoted the most seemingly reliable resources found on the web. The screenshot was redone and optimized (122kB) in GIMP instead, because the original screenshot and the animated image were too large (500kB, 7MB).



TL;DR Go to the GNOME Shell Extensions website and install the extension of choice: Switcher by dlandau. Subject to compatibility with the Shell version.






share|improve this answer













Ubuntu, including 18.04, is now based on GNOME and some additional features could be made available via GNOME Shell Extensions. Go to the website and search: use "window switcher" as keywords and the relevant extension may be listed in the first page of search result.



This one seems relevant and maintained:




Switcher by dlandau



switcher by dlandau in action



Switch windows or launch applications quickly by typing



Use the configured global hotkey (Super+w by default) to open a list
of current windows. Type a part of the name or title of the
application window you want to activate and hit enter or click on the
item you wish to activate. You can use the arrow keys to navigate
among the filtered selection and type several space separated search
terms to filter further. Use Esc or click anywhere outside the
switcher to cancel.



Use the configured global hotkey (Super+x by default) to open the
application launcher. Type a part of the name of the application you
want to launch and hit enter. You can use Ctrl+Space or Ctrl+Tab to
switch between the switcher and the launcher, or when there are no
open windows matching a name but there are apps the mode is switched
automatically.



You can customize the look and feel and functionality in the
preferences.



Extension Homepage: https://github.com/daniellandau/switcher



Shell version: 3.30 3.28 3.26 3.24 3.22 3.20 3.18 3.16.3 3.16 3.14




To bind the common keyboard shortcut Alt+Tab or Super+Tab with this extension, user may be required to use a workaround. A GitHub user, PHLAK, has submitted this issue #63 on GitHub and also explained the workaround in several comments:




I would like to bind the Switcher to Super + Tab but am unable to. I've also noticed I cannot bind it to Alt + Tab either.





I was able to work around this by setting the value directly with dconf:



dconf write /org/gnome/shell/extensions/switcher/show-switcher "['<Super>tab']"


You can also do the same by using the dconf-config GUI.





You might also have to unbind any pre-configured shortcuts using that key combination. Specifically, "Switch applications" is bound to Super+Tab in Gnome.



You can change this by opening the Settings and navigating to Devices > Keyboard. Then Search for Super+Tab and change or remove this binding.




Disclaimer: I do not use Ubuntu 18.04 or GNOME Shell, so I did not test this extension. I merely quoted the most seemingly reliable resources found on the web. The screenshot was redone and optimized (122kB) in GIMP instead, because the original screenshot and the animated image were too large (500kB, 7MB).



TL;DR Go to the GNOME Shell Extensions website and install the extension of choice: Switcher by dlandau. Subject to compatibility with the Shell version.







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 14 at 19:29









clearkimuraclearkimura

4,11521957




4,11521957













  • Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

    – clearkimura
    Feb 14 at 19:32











  • This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

    – guettli
    yesterday











  • Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

    – clearkimura
    56 mins ago











  • The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

    – clearkimura
    41 mins ago











  • In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

    – clearkimura
    27 mins ago





















  • Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

    – clearkimura
    Feb 14 at 19:32











  • This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

    – guettli
    yesterday











  • Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

    – clearkimura
    56 mins ago











  • The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

    – clearkimura
    41 mins ago











  • In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

    – clearkimura
    27 mins ago



















Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

– clearkimura
Feb 14 at 19:32





Ubuntu 18.04 uses GNOME Shell 3.28, so the extension is supposedly compatible.

– clearkimura
Feb 14 at 19:32













This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

– guettli
yesterday





This is a great answer. But does it fit to the above question? The app you talk about does this: "Switch windows or launch applications quickly by typing". The question is about a simple list of the window titles to switch between windows with alt-tab.

– guettli
yesterday













Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

– clearkimura
56 mins ago





Initially, I found "Openboxy Alt-Tab by sharat87" that fits perfectly to the question; however, this extension is unmaintained and compatible with only Shell version 3.10. Hence this answer suggested "Switcher by dlandau" as the closest alternative.

– clearkimura
56 mins ago













The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

– clearkimura
41 mins ago





The described feature is something similar to the traditional smart launcher i.e. Kupfer, GNOME Do, or Launchy: press Alt-<key> or any assigned shortcut, then display a launcher window pop-up (requires to type to find opened windows). In contrast, the Shell extension will display a launcher window pop-up that readily show list of opened windows. The typing or using cursor keys is only required for switching to the target window (the only missing criteria).

– clearkimura
41 mins ago













In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

– clearkimura
27 mins ago







In short: the extension "Switcher by dlandau" will display a simple list of the window titles, but does not switch between windows with the same Alt-Tab. That is the closest you can get on GNOME with Shell extension to this date.

– clearkimura
27 mins ago













2














I think you are specifically looking for "Cycling through windows in a list" feature that is available in Window Manager Tweaks->Cycling in XFCE.



ALT-TAB Cycling in a List



enter image description here






share|improve this answer


























  • Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

    – guettli
    yesterday
















2














I think you are specifically looking for "Cycling through windows in a list" feature that is available in Window Manager Tweaks->Cycling in XFCE.



ALT-TAB Cycling in a List



enter image description here






share|improve this answer


























  • Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

    – guettli
    yesterday














2












2








2







I think you are specifically looking for "Cycling through windows in a list" feature that is available in Window Manager Tweaks->Cycling in XFCE.



ALT-TAB Cycling in a List



enter image description here






share|improve this answer















I think you are specifically looking for "Cycling through windows in a list" feature that is available in Window Manager Tweaks->Cycling in XFCE.



ALT-TAB Cycling in a List



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 17 at 17:52

























answered Feb 17 at 17:28









BarBar1234BarBar1234

362




362













  • Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

    – guettli
    yesterday



















  • Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

    – guettli
    yesterday

















Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

– guettli
yesterday





Up to now I am using the default gnome desktop of Ubuntu 18.04. AFAIK xfce is not running on my desktop. Could you please elaborate your answer. Do I need to install linux mint first?

– guettli
yesterday











2














Just for fun



A late home-cooked one:



In action



enter image description here



The setup exists of two tiny scripts, to be saved into one and the same directory:



script 1



#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
gi.require_version('Wnck', '3.0')
from gi.repository import Gtk, Wnck, Gdk
import subprocess

css_data = """
.activestyle {
background-color: grey;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""

class AltTabStuff(Gtk.Window):
def __init__(self):
# css
self.provider = Gtk.CssProvider.new()
self.provider.load_from_data(css_data.encode())
Gtk.Window.__init__(
self, title="AltTab replacement"
)
self.curr_index = 0
self.connect('key-press-event', self.get_key)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
self.set_decorated(False)
buttongrid = Gtk.Grid()
self.add(buttongrid)
self.connect("delete_event", Gtk.main_quit)

wins = get_winlist()
self.buttonindex = 0
self.buttonsets = []
index = 0
for w in wins:
button = Gtk.Button("t" + w.get_name())
button.set_relief(Gtk.ReliefStyle.NONE)
buttongrid.attach(button, 0, index, 1, 1)
index = index + 1
button.connect("clicked", raise_window, w)
self.buttonsets.append([button, w])
self.set_focus()
self.show_all()
Gtk.main()

def set_focus(self):
for b in self.buttonsets:
button = b[0]
self.set_style(button, active=False)
newactive = self.buttonsets[self.buttonindex][0]
self.set_style(newactive, active=True)
n_buttons = len(self.buttonsets)
self.buttonindex = self.buttonindex + 1
if self.buttonindex >= n_buttons:
self.buttonindex = 0

def set_style(self, button, active):
st_cont = button.get_style_context()
if active:
st_cont.add_class("activestyle")
st_cont.remove_class("defaultstyle")
else:
st_cont.remove_class("activestyle")
st_cont.add_class("defaultstyle")
Gtk.StyleContext.add_provider(
st_cont,
self.provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
)

def get_key(self, val1, val2):
keyname = Gdk.keyval_name(val2.keyval)
if keyname == "Tab":
self.set_focus()
elif keyname == "Alt_L":
window = self.buttonsets[self.buttonindex-1][1]
button = self.buttonsets[self.buttonindex-1][0]
raise_window(button, window)
elif keyname == "Escape":
Gtk.main_quit()


def raise_window(button, window):
subprocess.Popen(["wmctrl", "-ia", str(window.get_xid())])
Gtk.main_quit()

def check_windowtype(window):
try:
return "WNCK_WINDOW_NORMAL" in str(
window.get_window_type()
)
except AttributeError:
pass

def get_winlist(scr=None):
"""

"""
if not scr:
scr = Wnck.Screen.get_default()
scr.force_update()
windows = [w for w in scr.get_windows() if check_windowtype(w)]
return windows


AltTabStuff()


script 2



#!/bin/bash

dr=`dirname $0`
f=$dr'/alttab_runner'

if ! pgrep -f $f
then
$f
else
echo "runs"
fi


Set up





  1. Not sure if Wnck and/or wmctrl is installed by default, if not:



    sudo apt install python3-gi gir1.2-wnck-3.0


    and possibly:



    sudo apt install wmctrl


  2. Save script 1 into an empty file as (exactly) alttab_runner, script 2 as (exactly) alttab_alternative. make both scripts executable



  3. Disable the existing Alt-Tab:



    gsettings set org.gnome.desktop.wm.keybindings switch-applications '[]'



  4. Set the shortcut (exactly) Alt-Tab to run script 2:



    /path/to/alttab_alternative



Usage



Press Alt + Tab to call the switcher (as in the picture), release Alt and press Tab to cycle through the windows, press Alt again to pick the selected window from the list.



Escape will dismiss (close) the switcher.



Options



If you'd like different colors, you can play with the css in script 1 to set your own styling.



enter image description hereenter image description here



To do so, edit this section, where activestyle is obviously the currently selected item:



css_data = """
.activestyle {
background-color: blue;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""


See for Gtk css options here on font and buttons.






share|improve this answer





















  • 1





    @DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

    – Jacob Vlijm
    Feb 18 at 15:13













  • Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

    – Jacob Vlijm
    Feb 20 at 6:40













  • @DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

    – Jacob Vlijm
    Feb 20 at 6:54











  • @DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

    – Jacob Vlijm
    Feb 20 at 6:59








  • 1





    @DKBose Haha, no problem, glad it works :)

    – Jacob Vlijm
    Feb 20 at 8:26
















2














Just for fun



A late home-cooked one:



In action



enter image description here



The setup exists of two tiny scripts, to be saved into one and the same directory:



script 1



#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
gi.require_version('Wnck', '3.0')
from gi.repository import Gtk, Wnck, Gdk
import subprocess

css_data = """
.activestyle {
background-color: grey;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""

class AltTabStuff(Gtk.Window):
def __init__(self):
# css
self.provider = Gtk.CssProvider.new()
self.provider.load_from_data(css_data.encode())
Gtk.Window.__init__(
self, title="AltTab replacement"
)
self.curr_index = 0
self.connect('key-press-event', self.get_key)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
self.set_decorated(False)
buttongrid = Gtk.Grid()
self.add(buttongrid)
self.connect("delete_event", Gtk.main_quit)

wins = get_winlist()
self.buttonindex = 0
self.buttonsets = []
index = 0
for w in wins:
button = Gtk.Button("t" + w.get_name())
button.set_relief(Gtk.ReliefStyle.NONE)
buttongrid.attach(button, 0, index, 1, 1)
index = index + 1
button.connect("clicked", raise_window, w)
self.buttonsets.append([button, w])
self.set_focus()
self.show_all()
Gtk.main()

def set_focus(self):
for b in self.buttonsets:
button = b[0]
self.set_style(button, active=False)
newactive = self.buttonsets[self.buttonindex][0]
self.set_style(newactive, active=True)
n_buttons = len(self.buttonsets)
self.buttonindex = self.buttonindex + 1
if self.buttonindex >= n_buttons:
self.buttonindex = 0

def set_style(self, button, active):
st_cont = button.get_style_context()
if active:
st_cont.add_class("activestyle")
st_cont.remove_class("defaultstyle")
else:
st_cont.remove_class("activestyle")
st_cont.add_class("defaultstyle")
Gtk.StyleContext.add_provider(
st_cont,
self.provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
)

def get_key(self, val1, val2):
keyname = Gdk.keyval_name(val2.keyval)
if keyname == "Tab":
self.set_focus()
elif keyname == "Alt_L":
window = self.buttonsets[self.buttonindex-1][1]
button = self.buttonsets[self.buttonindex-1][0]
raise_window(button, window)
elif keyname == "Escape":
Gtk.main_quit()


def raise_window(button, window):
subprocess.Popen(["wmctrl", "-ia", str(window.get_xid())])
Gtk.main_quit()

def check_windowtype(window):
try:
return "WNCK_WINDOW_NORMAL" in str(
window.get_window_type()
)
except AttributeError:
pass

def get_winlist(scr=None):
"""

"""
if not scr:
scr = Wnck.Screen.get_default()
scr.force_update()
windows = [w for w in scr.get_windows() if check_windowtype(w)]
return windows


AltTabStuff()


script 2



#!/bin/bash

dr=`dirname $0`
f=$dr'/alttab_runner'

if ! pgrep -f $f
then
$f
else
echo "runs"
fi


Set up





  1. Not sure if Wnck and/or wmctrl is installed by default, if not:



    sudo apt install python3-gi gir1.2-wnck-3.0


    and possibly:



    sudo apt install wmctrl


  2. Save script 1 into an empty file as (exactly) alttab_runner, script 2 as (exactly) alttab_alternative. make both scripts executable



  3. Disable the existing Alt-Tab:



    gsettings set org.gnome.desktop.wm.keybindings switch-applications '[]'



  4. Set the shortcut (exactly) Alt-Tab to run script 2:



    /path/to/alttab_alternative



Usage



Press Alt + Tab to call the switcher (as in the picture), release Alt and press Tab to cycle through the windows, press Alt again to pick the selected window from the list.



Escape will dismiss (close) the switcher.



Options



If you'd like different colors, you can play with the css in script 1 to set your own styling.



enter image description hereenter image description here



To do so, edit this section, where activestyle is obviously the currently selected item:



css_data = """
.activestyle {
background-color: blue;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""


See for Gtk css options here on font and buttons.






share|improve this answer





















  • 1





    @DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

    – Jacob Vlijm
    Feb 18 at 15:13













  • Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

    – Jacob Vlijm
    Feb 20 at 6:40













  • @DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

    – Jacob Vlijm
    Feb 20 at 6:54











  • @DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

    – Jacob Vlijm
    Feb 20 at 6:59








  • 1





    @DKBose Haha, no problem, glad it works :)

    – Jacob Vlijm
    Feb 20 at 8:26














2












2








2







Just for fun



A late home-cooked one:



In action



enter image description here



The setup exists of two tiny scripts, to be saved into one and the same directory:



script 1



#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
gi.require_version('Wnck', '3.0')
from gi.repository import Gtk, Wnck, Gdk
import subprocess

css_data = """
.activestyle {
background-color: grey;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""

class AltTabStuff(Gtk.Window):
def __init__(self):
# css
self.provider = Gtk.CssProvider.new()
self.provider.load_from_data(css_data.encode())
Gtk.Window.__init__(
self, title="AltTab replacement"
)
self.curr_index = 0
self.connect('key-press-event', self.get_key)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
self.set_decorated(False)
buttongrid = Gtk.Grid()
self.add(buttongrid)
self.connect("delete_event", Gtk.main_quit)

wins = get_winlist()
self.buttonindex = 0
self.buttonsets = []
index = 0
for w in wins:
button = Gtk.Button("t" + w.get_name())
button.set_relief(Gtk.ReliefStyle.NONE)
buttongrid.attach(button, 0, index, 1, 1)
index = index + 1
button.connect("clicked", raise_window, w)
self.buttonsets.append([button, w])
self.set_focus()
self.show_all()
Gtk.main()

def set_focus(self):
for b in self.buttonsets:
button = b[0]
self.set_style(button, active=False)
newactive = self.buttonsets[self.buttonindex][0]
self.set_style(newactive, active=True)
n_buttons = len(self.buttonsets)
self.buttonindex = self.buttonindex + 1
if self.buttonindex >= n_buttons:
self.buttonindex = 0

def set_style(self, button, active):
st_cont = button.get_style_context()
if active:
st_cont.add_class("activestyle")
st_cont.remove_class("defaultstyle")
else:
st_cont.remove_class("activestyle")
st_cont.add_class("defaultstyle")
Gtk.StyleContext.add_provider(
st_cont,
self.provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
)

def get_key(self, val1, val2):
keyname = Gdk.keyval_name(val2.keyval)
if keyname == "Tab":
self.set_focus()
elif keyname == "Alt_L":
window = self.buttonsets[self.buttonindex-1][1]
button = self.buttonsets[self.buttonindex-1][0]
raise_window(button, window)
elif keyname == "Escape":
Gtk.main_quit()


def raise_window(button, window):
subprocess.Popen(["wmctrl", "-ia", str(window.get_xid())])
Gtk.main_quit()

def check_windowtype(window):
try:
return "WNCK_WINDOW_NORMAL" in str(
window.get_window_type()
)
except AttributeError:
pass

def get_winlist(scr=None):
"""

"""
if not scr:
scr = Wnck.Screen.get_default()
scr.force_update()
windows = [w for w in scr.get_windows() if check_windowtype(w)]
return windows


AltTabStuff()


script 2



#!/bin/bash

dr=`dirname $0`
f=$dr'/alttab_runner'

if ! pgrep -f $f
then
$f
else
echo "runs"
fi


Set up





  1. Not sure if Wnck and/or wmctrl is installed by default, if not:



    sudo apt install python3-gi gir1.2-wnck-3.0


    and possibly:



    sudo apt install wmctrl


  2. Save script 1 into an empty file as (exactly) alttab_runner, script 2 as (exactly) alttab_alternative. make both scripts executable



  3. Disable the existing Alt-Tab:



    gsettings set org.gnome.desktop.wm.keybindings switch-applications '[]'



  4. Set the shortcut (exactly) Alt-Tab to run script 2:



    /path/to/alttab_alternative



Usage



Press Alt + Tab to call the switcher (as in the picture), release Alt and press Tab to cycle through the windows, press Alt again to pick the selected window from the list.



Escape will dismiss (close) the switcher.



Options



If you'd like different colors, you can play with the css in script 1 to set your own styling.



enter image description hereenter image description here



To do so, edit this section, where activestyle is obviously the currently selected item:



css_data = """
.activestyle {
background-color: blue;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""


See for Gtk css options here on font and buttons.






share|improve this answer















Just for fun



A late home-cooked one:



In action



enter image description here



The setup exists of two tiny scripts, to be saved into one and the same directory:



script 1



#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
gi.require_version('Wnck', '3.0')
from gi.repository import Gtk, Wnck, Gdk
import subprocess

css_data = """
.activestyle {
background-color: grey;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""

class AltTabStuff(Gtk.Window):
def __init__(self):
# css
self.provider = Gtk.CssProvider.new()
self.provider.load_from_data(css_data.encode())
Gtk.Window.__init__(
self, title="AltTab replacement"
)
self.curr_index = 0
self.connect('key-press-event', self.get_key)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
self.set_decorated(False)
buttongrid = Gtk.Grid()
self.add(buttongrid)
self.connect("delete_event", Gtk.main_quit)

wins = get_winlist()
self.buttonindex = 0
self.buttonsets = []
index = 0
for w in wins:
button = Gtk.Button("t" + w.get_name())
button.set_relief(Gtk.ReliefStyle.NONE)
buttongrid.attach(button, 0, index, 1, 1)
index = index + 1
button.connect("clicked", raise_window, w)
self.buttonsets.append([button, w])
self.set_focus()
self.show_all()
Gtk.main()

def set_focus(self):
for b in self.buttonsets:
button = b[0]
self.set_style(button, active=False)
newactive = self.buttonsets[self.buttonindex][0]
self.set_style(newactive, active=True)
n_buttons = len(self.buttonsets)
self.buttonindex = self.buttonindex + 1
if self.buttonindex >= n_buttons:
self.buttonindex = 0

def set_style(self, button, active):
st_cont = button.get_style_context()
if active:
st_cont.add_class("activestyle")
st_cont.remove_class("defaultstyle")
else:
st_cont.remove_class("activestyle")
st_cont.add_class("defaultstyle")
Gtk.StyleContext.add_provider(
st_cont,
self.provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
)

def get_key(self, val1, val2):
keyname = Gdk.keyval_name(val2.keyval)
if keyname == "Tab":
self.set_focus()
elif keyname == "Alt_L":
window = self.buttonsets[self.buttonindex-1][1]
button = self.buttonsets[self.buttonindex-1][0]
raise_window(button, window)
elif keyname == "Escape":
Gtk.main_quit()


def raise_window(button, window):
subprocess.Popen(["wmctrl", "-ia", str(window.get_xid())])
Gtk.main_quit()

def check_windowtype(window):
try:
return "WNCK_WINDOW_NORMAL" in str(
window.get_window_type()
)
except AttributeError:
pass

def get_winlist(scr=None):
"""

"""
if not scr:
scr = Wnck.Screen.get_default()
scr.force_update()
windows = [w for w in scr.get_windows() if check_windowtype(w)]
return windows


AltTabStuff()


script 2



#!/bin/bash

dr=`dirname $0`
f=$dr'/alttab_runner'

if ! pgrep -f $f
then
$f
else
echo "runs"
fi


Set up





  1. Not sure if Wnck and/or wmctrl is installed by default, if not:



    sudo apt install python3-gi gir1.2-wnck-3.0


    and possibly:



    sudo apt install wmctrl


  2. Save script 1 into an empty file as (exactly) alttab_runner, script 2 as (exactly) alttab_alternative. make both scripts executable



  3. Disable the existing Alt-Tab:



    gsettings set org.gnome.desktop.wm.keybindings switch-applications '[]'



  4. Set the shortcut (exactly) Alt-Tab to run script 2:



    /path/to/alttab_alternative



Usage



Press Alt + Tab to call the switcher (as in the picture), release Alt and press Tab to cycle through the windows, press Alt again to pick the selected window from the list.



Escape will dismiss (close) the switcher.



Options



If you'd like different colors, you can play with the css in script 1 to set your own styling.



enter image description hereenter image description here



To do so, edit this section, where activestyle is obviously the currently selected item:



css_data = """
.activestyle {
background-color: blue;
color: white;
border-width: 1px;
border-radius: 0px;
border-color: white;
}
.defaultstyle {
border-width: 0px;
color: black;
background-color: white;
}
"""


See for Gtk css options here on font and buttons.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 20 at 4:22









DK Bose

14.2k124285




14.2k124285










answered Feb 18 at 9:02









Jacob VlijmJacob Vlijm

64.6k9129224




64.6k9129224








  • 1





    @DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

    – Jacob Vlijm
    Feb 18 at 15:13













  • Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

    – Jacob Vlijm
    Feb 20 at 6:40













  • @DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

    – Jacob Vlijm
    Feb 20 at 6:54











  • @DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

    – Jacob Vlijm
    Feb 20 at 6:59








  • 1





    @DKBose Haha, no problem, glad it works :)

    – Jacob Vlijm
    Feb 20 at 8:26














  • 1





    @DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

    – Jacob Vlijm
    Feb 18 at 15:13













  • Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

    – Jacob Vlijm
    Feb 20 at 6:40













  • @DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

    – Jacob Vlijm
    Feb 20 at 6:54











  • @DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

    – Jacob Vlijm
    Feb 20 at 6:59








  • 1





    @DKBose Haha, no problem, glad it works :)

    – Jacob Vlijm
    Feb 20 at 8:26








1




1





@DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

– Jacob Vlijm
Feb 18 at 15:13







@DKBose Ah, sorry, I was editing exactly at the same time! accidentally overwrote your edit.

– Jacob Vlijm
Feb 18 at 15:13















Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

– Jacob Vlijm
Feb 20 at 6:40







Hi @DKBose not at my box atm, but did you by any chance forget to make the python script executable or forgot to include the shebang? Both scripts need to be. Looks like bash is trying to interprete python code. No imagemagick involved of course.

– Jacob Vlijm
Feb 20 at 6:40















@DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

– Jacob Vlijm
Feb 20 at 6:54





@DKBose could you run the python scrip with python3 script? Again: the error message even isn't python error code. Bash is trying to run the python code.

– Jacob Vlijm
Feb 20 at 6:54













@DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

– Jacob Vlijm
Feb 20 at 6:59







@DKBose Yep, What I thought, please check your python shebang. You might have missed one character.. Exactly getting your message when I remove !#/usr/bin/env python3

– Jacob Vlijm
Feb 20 at 6:59






1




1





@DKBose Haha, no problem, glad it works :)

– Jacob Vlijm
Feb 20 at 8:26





@DKBose Haha, no problem, glad it works :)

– Jacob Vlijm
Feb 20 at 8:26


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1116691%2fcan-i-have-a-textual-alt-tab-functionality%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...