« OBD2: geek with a car | Main | Recording podcast using Skype under Linux »

Focus window by name using xdotool and awesome window manager

I have two screens, and 9 virtual dekstops on my machines. Which sometimes makes it tricy to remember on which virtual desktop is xterm connected to klin. Fortunatly, I have that information in window title, so something as simple as:

xdotool search --name klin windowactivate
Will do the right thing. However, my mouse pointer is not always over xterm on local machine, so keyboard shortcut in awesome window manager for this simple xdotool usage would be helpful. So, here it is:
-- XXX dpavlin: search windows and active them
awful.key({ modkey }, "F12",
  function () 
    awful.prompt.run({ prompt = "window: " },
      mypromptbox[mouse.screen].widget,
      function (find)
        awful.util.spawn("xdotool search --name "..find.." windowactivate", false)
      end)
  end),

I would love to be able to insert this snippet somehow dynamically instead of editing rc.lua by hand, so suggestions are welcomed.

TrackBack

TrackBack URL for this entry:
http://blog.rot13.org/mt/mt-tb.cgi/700

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on July 15, 2010 6:10 PM.

The previous post in this blog was OBD2: geek with a car.

The next post in this blog is Recording podcast using Skype under Linux.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 5.04