Changeset 8661 in project

02/23/08 13:53:34 (12 years ago)

Add documentation on the remaining procedures

1 edited


  • wiki/wmiirc

    r8657 r8661  
    172172quit.  It defaults to {{#t}}.
     174==== wmii operations
     176  procedure: (wmii:quit)
     178Tells wmii to quit.
     180  procedure: (wmii:exec cmdline)
     182Tells wmii to execute the given commandline, replacing the wmii
     183process.  This can be used to change to a different window manager.
     185  procedure: (wmii:global-settings)
     187Returns an alist of the current global settings.
     189  procedure: (wmii:global-settings-set! alist)
     191Change the global settings.  Example:
     193<enscript highlight=scheme>
     195 `((font . "-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*")
     196   (focuscolors . (#xffffff #x285577 #x4c7899))
     197   (normcolors . (#x888888 #x222222 #x333333))
     198   (grabmod . "Mod1")
     199   (border . "1")))
     202This sets the default font (used in titlebars, for example) to the
     203one in the string, sets the colors of a window that is focused to the
     204given colorcodes in {{focuscolors}}, the default colors to the one in
     205{{normcolors}} and grabs Mod1 for dragging windows around.  The border
     206thickness is set to one pixel.
    174208==== Column rules
    190225<enscript highlight=scheme>
    191226  (wmii:colrules-set! '(("www" . (20 80))
    277312these events.
    279 .... MORE TO COME SOON ....
     314You can also use the following procedure to get the current event handlers:
     316  procedure: (wmii:event-handlers)
     318Note that this procedure can not return event handlers in other processes.
     319It's simply a getter for the current wmiirc instance's list of event handlers.
     321=== Keys
     323  procedure: (wmii:grabbed-keys)
     325Get a list of currently grabbed keys.
     327  procedure: (wmii:grabbed-keys-set! keys)
     329Sets the keys grabbed by wmii.  {{keys}} is a list of key descriptions.
     330Keys must be grabbed or they won't be passed to the wmiirc event loop.
     333<enscript highlight="scheme">
     334  (wmii:grabbed-keys-set! '(("Mod1" "x")
     335                            ("Mod2" "Space")
     336                            ("Mod1" "Shift" "Space")))
     339This grabs the key combinations Mod1-x, Mod2-space and Mod1-shift-space.
     340Key names of "special" keys are always capitalized in wmii.  Normal literal
     341keys like the x in the example are always lower case.  If you would like
     342to hook shift-x, that would not be ("X"), but ("Shift" "x").
     344  procedure: (wmii:key-code->string)
     345  procedure: (wmii:string->key-code)
     347Translate a chicken-wmiirc keycode to a string that can be written to wmii's
     348{{/keys}} file.  Example:
     350  (wmii:key-code->string '("Mod1" "Shift" "x")) => "Mod1-Shift-x"
     351  (wmii:string->keycode "Mod1-Shift-x") => ("Mod1" "Shift" "x")
     353=== Navigating
     355  procedure: (wmii:goto-tag tag)
     357Switch the view to the named {{tag}}.
     359  procedure: (wmii:navigate-to direction [tag])
     361Navigate to the given {{direction}} in the given {{tag}}.  Tag
     362defaults to "sel", the current tag.  {{where}} can be "up", "down",
     363"left", "right" or "toggle".  If one of the directions, the client
     364above, below, to the left or to the right of the current client is
     365selected.  If the direction is toggle, clients in float mode are
     366selected if currently a client in normal mode is selected, or the
     367other way around.  If tag is not the current tag, the currently
     368selected client on that tag is changed, but nothing happens in the
     369current view, unless the current view just happens to be a view on
     370that tag.
     372  procedure: (wmii:send-to direction [client] [tag])
     374Send the given {{client}} (defaults to "sel", the currently selected
     375client) into the given {{direction}}, as described above.  If {{tag}}
     376is given, the client is sent to the given direction on that tag.  It
     377is ''not'' sent to that tag.
     379=== Tags
     381  procedure: (wmii:tags)
     383This procedure returns a list of all the tags known to wmii, as strings.
     385  procedure: (wmii:tag-settings-set! alist [tag])
     387Change the settings for the named {{tag}}, which defaults to "sel",
     388the current tag.  {{alist}} is an alist with setting names (strings)
     389as keys, and setting lists as values. Example:
     391  (wmii:tag-settings-set! '(("colmode" . ("sel" "stack"))))
     393This sets the current tag's column mode to stacked.
     395  procedure: (wmii:tag-settings [tag])
     397Returns an alist of the settings for the named {{tag}}.  {{tag}} defaults
     398to {{"sel"}}, that is the current tag.
     400=== Bars
     402  procedure: (wmii:tabs bar)
     404Return a list of all tabs on the {{bar}}.  {{bar}} can be {{"lbar"}}
     405(the left bar) or {{"rbar"}} (the right bar).
     407  procedure: (wmii:write-tab bar tab contents [colors])
     409Change the string {{contents}} of a {{tab}} on the indicated
     410{{bar}}. Creates the tab if it doesn't exist yet.  If {{colors}}
     411is given and not {{#f}} it should be a list of three numbers which
     412represent in hexadecimal the color values of the foreground,
     413background and border, respectively.
     417  (wmii:write-tab "lbar" "hello" "hello there")
     419Creates a tab called "hello" on the left bar, which displays the
     420string "hello there".
     422  procedure: (wmii:destroy-tab bar tab)
     424Destroy {{tab}} on {{bar}}.
     426=== Clients
     428  procedure: (wmii:client=? client1 client2)
     430Are two clients one and the same?  Currently clients are represented
     431as simple strings, the way wmii returns them, but in the future
     432clients may have more information-rich representations, so always use
     433this to compare them to be forwards-compatible.  These "opaque" client
     434objects can be obtained by event handlers from the various events that
     435operate on a client, or by {{wmii:clients}}, for example.
     437  procedure: (wmii:clients)
     439Returns a list of all the clients managed by wmii, in all tabs.
     441  procedure: (wmii:client-tags [client])
     443Return a list of all tags on {{client}}.  Defaults to the
     444currently selected client ("sel").
     446  procedure: (wmii:client-tags-set! tags [client])
     448Set the {{tags}} (a list of strings) on the {{client}}.
     450=== Low-level procedures
     452If you would like access to the 9p filesystem exported by wmii, you
     453can use the following procedures:
     455  procedure: (wmii:write file data)
     457Write the string contents of {{data}} to the named {{file}}.  If the
     458file does not exist, it is created.
     460  procedure: (wmii:read file)
     462Read the given {{file}} into a string.
     464  procedure: (wmii:read-lines file)
     466Read the given {{file}} line by line and create a list with an entry
     467per line.
     469  procedure: (wmii:directory path)
     471Show the directory contents of the named {{path}}.
    281474=== Example
Note: See TracChangeset for help on using the changeset viewer.