[compiz] Scheme extension language plugin.

Robert Carr racarr at beryl-project.org
Wed Apr 25 10:46:45 PDT 2007


I've put a scheme plugin in users/racarr/compiz-scheme on
gitweb.open-compositing.org.

Essentially it allows the user to define a startup file
(~/.compiz/startup.scm) and fill it with scheme code to do neat things
and extend Beryl.

On one hand it acts like a super powered state plugin, on the other it
lets you define useful behavior specific to what you do with your
Compiz and share these new behaviors with other people.

Following are a few examples:

#Following snippet gives you transparent dropdown menus.
 (window-rule #Define a window rule
   (make-rule #Make a rule passed in
     (set-opacity-when # Set opacity of a window when
            (window-is dropdownp) # The window is a dropdown menu
         0.75))) # Set to 0.75

 #Following snippet shades maximized windows when you grab them.
(grab-rule  # Define a window grab rule.
   (make-rule  # Make a rule passed to grab-rule
     (if (maximizedp w) # If window maximized.
       (toggle-shaded w)))) #Shade window


(define amatch (make-match "type=normal|state=sticky")) #Define a
match for sticky windows or normal windows
   (bind-key "s" #Bind the key ctrl+super+s
     (lambda () #Define an anonymous function to be passed to bind-key
       (toggle-shaded-when #Toggle window shaded then
         (lambda (w) (matchp w amatch)))))  #Window passed matches amatch


You can read ~/.compiz/window.scm to see some of the wrapping around
the C level functions (which themselves are wrapped in the C files).

Ask me if you have any questions or want an example of how to do
anything. I'll be improving this and doing documentation in the near
future.

Regards,
Robert


More information about the compiz mailing list