📜 ⬆️ ⬇️

look-at - focus manager

What is a 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, there is often a problem 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 shokkat. 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 - be silent!) In almost any desktop with X.Org .

How does it work?


It is known that in almost any desktop, where there is X.Org, contains a program for setting shortcuts, which can run applications. (If you think yours is an exception, read man xbindkeys). The problem is that the launched applications themselves do not always understand what to do with open windows and create a new instance (for example, gnome-terminal) by a command, then they don’t react at all, because, in their opinion, all that is possible long running (thunderbird). In general, they do not behave in the way you expect.

Fork me on github The look-at utility is designed to manage application windows quickly, accurately and correctly, without resorting to the mouse-click 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 distributions? Install wmctrl, setuptools for python and run the command:
 sudo easy_install look-at 

Use!


It's 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 last used (if not already, start it). 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 compact example. Key combinations 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 combinations:

... and so for each team.

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 running wmctrl?
* Why do many people see screenshots on screenshots, although I am fine?

Source: https://habr.com/ru/post/145018/


All Articles