History Report a problem
Article Edit this page Discussion

Restore-focus

From Sawfish

Jump to: navigation, search
Scripts quick access



[edit] Synopsis

Restore focus to last "interesting" window when switching to an workspace.

[edit] Description

This script solves a minor annoyance that I'm having for ages; I'm no Lisp hacker, but I finally decided to fix it.

In my setup, I'm using Sawfish as a WM for Gnome (so I'm using Gnome panels, Nautilus for desktop, Gnome's workspace switcher, etc.). The problem was that every time I switch an workspace with the mouse (click in the workspace switcher), the panel window gets focused and Sawfish remembers that the last window in the workspace that I'm leaving is Gnome Panel. When I later return to that workspace, instead of focusing some window, it focuses the Gnome Panel.

This script installs some hooks that will maintain focus on interesting windows (i.e. the last window used which is not Panel or Desktop).

In order to solve this problem previously, I had some rules in "matched windows" that forbidden focus at all on Panel or Desktop windows, but that was bad too because I couldn't, for example, rename a file on my Desktop by just clicking on it and hitting F2 (since the Desktop never would receive focus).

[edit] Installation

Save it in ~/.sawfish/lisp/ and add (require 'restore-focus) in your ~/.sawfishrc

[edit] Configuration

You can edit the script and change the definition of *avoid-focus* regexp.

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Pixar
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
One Piece
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Restore-focus"
 
 
Hi!

I thought you'd like this page from Wikia!

http://sawfish.wikia.com

Come check it out!
Send confirmation