Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

Jump-or-exec

From Sawfish

Jump to: navigation, search
Scripts quick access
  • Author: Damien Elmes <resolve@repose.cx>
  • Version: 0.1
  • License: GNU GPL 2 or later
  • Download: jump-or-exec.jl

[edit] Synopsis

Focus a specific application or start it if it is not running.

[edit] Description

Jump-or-exec can be used to blur the line between which applications are running and which need to be started. You can hit a key to launch the application or otherwise jump to it, if it is already running.

[edit] Installation

  1. Save jump-or-exec.jl in your load-path.
  2. Add this code to your ~/.sawfishrc:
    (require 'jump-or-exec)

[edit] Configuration

Here is a sample configuration:

(bind-keys global-keymap
    "W-o" `(jump-or-exec "MGT"         ; window title to jump to
        ,(lambda ()                    ; if the window doesn't exist
           (select-workspace 0)
           (system
            "multi-gnome-terminal --start-factory-server --use-factory &"))
        ,(lambda (wind)                ; if the window is focused already
           (display-window wind)
           (synthesize-event "C-F1" wind)
           (synthesize-event "n" wind))))
Rate this article:
Share this article: