look-at - focus manager

    What is look-at?


    This is a utility that switches focus between application windows from the command line.

    What for?


    When working with a large number of open windows, a problem often arises in order to quickly switch to the window of the desired application. You can, of course, use the keyboard shortcut Alt + Tab, but Cthulhu is easier to call. It is much more convenient to use shotkat. For example, Super + 1 - and you are already working with the terminal, Super + 2 - and in front of you is Firefox. I bring to your attention the look-at utility , which allows you to do this (Unity fans keep silent!) In almost any desktop with X.Org .

    How does it work?


    It is known that almost any desktop with X.Org has a program for setting up shortcuts that can run applications. (If you think yours is an exception, then read man xbindkeys). The problem is that the launched applications themselves do not always understand what to do with open windows and, on command, they either create a new instance (for example, gnome-terminal), or do not react at all, because, in their opinion, everything that is possible is already long launched (thunderbird). In general, they do not behave at all as you expect. Look-at

    Fork me on github utilityCreated in order to manage application windows quickly, accurately and correctly, without resorting to the mouse poke method. It is written in the popular python language (2.5-2.7, 3.2, pypy), and this opens up almost limitless possibilities for customizing, as well as fixing bugs.

    How to install?


    Packages for Ubuntu 12.04 users live here:
    sudo apt-add-repository ppa:e15/ppa
    sudo apt-get update
    sudo apt-get install look-at
    

    Prefer other distros? Install wmctrl, setuptools for python and run the command:
    sudo easy_install look-at
    

    Use it!


    Everything is simple. The look-at command takes a single argument - the name of the application. If it is already running, the utility will switch to the window that was used last (if not already, it will launch). Restarting with the same argument will switch to the next application window:


    Now you can write ingenious scripts, for example, in support of the pomodoro technique:
    #!/bin/sh
    WORK="gvim"
    RELAX="firefox"
    ( while true; do look-at $WORK; sleep 25m; look-at $RELAX; sleep 5m; done ) & # =)
    

    But what about quick access, you ask? Let's figure out how to use it, using the example of compiz. Keyboard shortcuts for quick access can be set using the "Commands" plugin in the settings manager:
    sudo apt-get install compizconfig-settings-manager
    ccsm
    

    Open the “Commands” tab and add the necessary applications:


    On the “Keyboard Shortcuts” tab, assign convenient shortcuts:

    ... and so on for each command.

    Useful links:


    GitHub: github.com/generalov/look-at
    PyPI: pypi.python.org/pypi/look-at
    wmctrl: tomas.styblo.name/wmctrl

    Questions


    * Is it possible to work with windows faster than starting wmctrl?
    * Why do many see SHG in the screenshots, although I have everything in order?

    Also popular now: