Changeset 8661 in project


Ignore:
Timestamp:
02/23/08 13:53:34 (12 years ago)
Author:
sjamaan
Message:

Add documentation on the remaining procedures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/wmiirc

    r8657 r8661  
    172172quit.  It defaults to {{#t}}.
    173173
     174==== wmii operations
     175
     176  procedure: (wmii:quit)
     177
     178Tells wmii to quit.
     179
     180  procedure: (wmii:exec cmdline)
     181
     182Tells wmii to execute the given commandline, replacing the wmii
     183process.  This can be used to change to a different window manager.
     184
     185  procedure: (wmii:global-settings)
     186
     187Returns an alist of the current global settings.
     188
     189  procedure: (wmii:global-settings-set! alist)
     190
     191Change the global settings.  Example:
     192
     193<enscript highlight=scheme>
     194(wmii:global-settings-set!
     195 `((font . "-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*")
     196   (focuscolors . (#xffffff #x285577 #x4c7899))
     197   (normcolors . (#x888888 #x222222 #x333333))
     198   (grabmod . "Mod1")
     199   (border . "1")))
     200</enscript>
     201
     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.
     207
    174208==== Column rules
    175209
     
    188222
    189223Example:
     224
    190225<enscript highlight=scheme>
    191226  (wmii:colrules-set! '(("www" . (20 80))
     
    277312these events.
    278313
    279 .... MORE TO COME SOON ....
    280 
     314You can also use the following procedure to get the current event handlers:
     315
     316  procedure: (wmii:event-handlers)
     317
     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.
     320
     321=== Keys
     322
     323  procedure: (wmii:grabbed-keys)
     324
     325Get a list of currently grabbed keys.
     326
     327  procedure: (wmii:grabbed-keys-set! keys)
     328
     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.
     331Example:
     332
     333<enscript highlight="scheme">
     334  (wmii:grabbed-keys-set! '(("Mod1" "x")
     335                            ("Mod2" "Space")
     336                            ("Mod1" "Shift" "Space")))
     337</enscript>
     338
     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").
     343
     344  procedure: (wmii:key-code->string)
     345  procedure: (wmii:string->key-code)
     346
     347Translate a chicken-wmiirc keycode to a string that can be written to wmii's
     348{{/keys}} file.  Example:
     349
     350  (wmii:key-code->string '("Mod1" "Shift" "x")) => "Mod1-Shift-x"
     351  (wmii:string->keycode "Mod1-Shift-x") => ("Mod1" "Shift" "x")
     352
     353=== Navigating
     354
     355  procedure: (wmii:goto-tag tag)
     356
     357Switch the view to the named {{tag}}.
     358
     359  procedure: (wmii:navigate-to direction [tag])
     360
     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.
     371
     372  procedure: (wmii:send-to direction [client] [tag])
     373
     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.
     378 
     379=== Tags
     380
     381  procedure: (wmii:tags)
     382 
     383This procedure returns a list of all the tags known to wmii, as strings.
     384
     385  procedure: (wmii:tag-settings-set! alist [tag])
     386
     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:
     390
     391  (wmii:tag-settings-set! '(("colmode" . ("sel" "stack"))))
     392
     393This sets the current tag's column mode to stacked.
     394 
     395  procedure: (wmii:tag-settings [tag])
     396
     397Returns an alist of the settings for the named {{tag}}.  {{tag}} defaults
     398to {{"sel"}}, that is the current tag.
     399
     400=== Bars
     401
     402  procedure: (wmii:tabs bar)
     403
     404Return a list of all tabs on the {{bar}}.  {{bar}} can be {{"lbar"}}
     405(the left bar) or {{"rbar"}} (the right bar).
     406
     407  procedure: (wmii:write-tab bar tab contents [colors])
     408
     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.
     414
     415Example:
     416
     417  (wmii:write-tab "lbar" "hello" "hello there")
     418
     419Creates a tab called "hello" on the left bar, which displays the
     420string "hello there".
     421
     422  procedure: (wmii:destroy-tab bar tab)
     423
     424Destroy {{tab}} on {{bar}}.
     425
     426=== Clients
     427
     428  procedure: (wmii:client=? client1 client2)
     429
     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.
     436
     437  procedure: (wmii:clients)
     438
     439Returns a list of all the clients managed by wmii, in all tabs.
     440
     441  procedure: (wmii:client-tags [client])
     442
     443Return a list of all tags on {{client}}.  Defaults to the
     444currently selected client ("sel").
     445
     446  procedure: (wmii:client-tags-set! tags [client])
     447
     448Set the {{tags}} (a list of strings) on the {{client}}.
     449
     450=== Low-level procedures
     451
     452If you would like access to the 9p filesystem exported by wmii, you
     453can use the following procedures:
     454
     455  procedure: (wmii:write file data)
     456
     457Write the string contents of {{data}} to the named {{file}}.  If the
     458file does not exist, it is created.
     459
     460  procedure: (wmii:read file)
     461
     462Read the given {{file}} into a string.
     463
     464  procedure: (wmii:read-lines file)
     465
     466Read the given {{file}} line by line and create a list with an entry
     467per line.
     468
     469  procedure: (wmii:directory path)
     470
     471Show the directory contents of the named {{path}}.
     472
     473 
    281474=== Example
    282475
Note: See TracChangeset for help on using the changeset viewer.