Focus window by name using xdotool and awesome window manager

| No Comments | No TrackBacks

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.

No TrackBacks

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

Leave a comment

About this Entry

This page contains a single entry by Dobrica Pavlinušić published on July 15, 2010 6:10 PM.

OBD2: geek with a car was the previous entry in this blog.

Recording podcast using Skype under Linux is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

  • pics
OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.04