Fandom

Sawfish

App

773pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Scripts quick access edit this


  • Author: Jeremy Hankins <nowan at nowan dot org>
  • License: GPL v2
  • Download: App.jl (upload)


Synopsis Edit

Yet another focus-or-run script; this one uses cycle-commands.

Description Edit

The only reason to use this script over Jump-or-exec, Waffle or Gimme is that this takes advantage of the cycle-commands system to cycle between matching windows in case there are multiple matches. Otherwise it's much like the other scripts; with it you can bind a key to either jump to or run a particular application.

Installation Edit

Just put the file in the appropriate place and:

(require 'app)

Configuration Edit

Use define-cycle-command-pair or something equivalent to set up commands. I have something similar to these in my .sawfishrc:

(define-cycle-command-pair
  'cycle-emacs 'cycle-emacs-backwards
  (app-selector (filter-byclass "Emacs") nil))
		
(define-cycle-command-pair
  'cycle-buddy 'cycle-buddy-backwards
  (app-selector (filter-byclass "Pidgin") nil))

(define-cycle-command-pair
  'cycle-shell 'cycle-shell-backwards
  (app-selector (filter-byclass "XTerm") "xterm"))

(let ((gnus-re
       "^\\*((Group|Server|Agent Category|Gnus Browse Server|Gnus edit form|Article|mail)\\*$|Summary |(wide )?reply to)"))
  (define-cycle-command-pair
    'cycle-gnus 'cycle-gnus-backwards
    (app-selector (filter-byname gnus-re)
		  (lambda ()
		    (if (emacs-eval "(gnus-alive-p)" 'parse)
			(emacs-run "(switch-to-buffer gnus-group-buffer)"
				   'frame)
		      (emacs-run "(gnus)" 'frame))))))

(bind-keys global-keymap "H-g" 'cycle-gnus
                         "H-c" 'cycle-shell
                         "H-t" 'cycle-emacs
                         "H-b" 'cycle-buddy)

The first two are a degenerate case: they don't actually start the application in question, they only cycle through its instances. The third will start an xterm if no matching window is found. The last cycle pair is more complicated; it uses Emacs to have emacs display the appropriate buffer or run gnus.

Also on Fandom

Random Wiki