User Tools

Site Tools


lisp-em

Lisp Event Manager for Uzbl. By Michael Raskin. Works with ECL now; seems to be working with SBCL; should work with CCL. Reads from stdin and writes mostly to stdout - socat is supposed to care about sockets. It is supposed to be run one-instance-per-Uzbl-instance. But a few progv-s would allow to localize all the *uzbl-[something]* variables.

You can browse Monotone repository at: http://mtn-host.prjek.net/viewmtn/uzbl-lisp-em/branch/head/info/com.ignorelist.401a0bf1.raskin.uzbl-lisp-em (my config is also there)

Another branch, http://mtn-host.prjek.net/viewmtn/uzbl-lisp-em/branch/head/info/com.ignorelist.401a0bf1.raskin.uzbl-js , contains JavaScript snippets I use in my config.

It depends on ASDF packages :cl-ppcre, :iterate and :trivial-utf-8. The main fuction is “event-loop”, it is called without arguments.

It can be built with ECL by loading the following:

(asdf:defsystem :uzbl-em.bin
  :serial t
  :depends-on
  (
   :cl-ppcre   
   :trivial-utf-8
   :iterate
   )
  :components (
               (:file #.(pathname-name (truename "em.lisp")))
               )
  )
  
(asdf:make-build :uzbl-em.bin :type :program                        
  :epilogue-code `(progn (funcall (find-symbol "EVENT-LOOP" :common-lisp-user)) (ext:quit 0)))
                                                    
(quit)  

Recent fixes:

* UTF-8 processing in URLs for new tabs (and in general for commands) * Added ${var-name} Uzbl variable expansion for shell commands. * Fixed UTF-8 processing: exporting variables with Unicode characters in them and running commands with Unicode characters embedded crashed Uzbl * Fixed uri variable processing - set it on LOAD_COMMIT, too * Fixed combos - “press Shift press A release Shift release a” no longer leave EM in the state “A is still pressed”

It is not split into separate files, but everything is split into fairly small functions (no single multi-screen switch), so splitting would be simple.

Look at my configuration for usage examples. If you consider actually trying to use this, you can ask me for more detailed explanations (on IRC or using my e-mail in the mailing list)

Basic bindings are done using

event bind [mode] [key-combo] [parameter-treatment-mode] [handler-type] [binding-content]

Modes are just names; the default mode is command. You can register some modes to ignore bindings.

Lisp-EM supports proper key combos: [{Ctrl}w]q means “Control and w together; then release both and press q”. Non-special-symbols-only combos are ignored (because they occur at random while typing quickly).

Parameter passing modes:

* on-first: run the binding once the main command is entered; clear input buffer afterwards * once-preserving: run the binding once the main command is entered; do not clear input buffer afterwards. Currently useless, but can later become useful if chains gain proper triggering post-effect support. * on-enter: read parameter until special key called :enter is pressed; then run binding and clear input buffer. * each-key: read parameter, calling the binding on each keypress.

Handler types:

* uzbl - run a uzbl command * uzbl-raw - the same, but without escaping * shell - export uzbl variables to environment and run a command. It is supposed to be a command with arguments; separating symbol should be specified in “quotes” - you can use any symbol, actually

shell |!#| sh!#-c!#xterm

should run xterm.

Please just copy-paste code from web-UI to the monotone interface

lisp-em.txt · Last modified: 2016/08/31 14:10 (external edit)