documentation updates
[wmiirc-lua.git] / wmiirc.lua
blob1be4aeae93ad9c39de8696e13251acf015e759f2
1 #!/usr/bin/env lua
2 --
3 -- Copyrigh (c) 2007, Bart Trojanowski <bart@jukie.net>
4 --
5 -- Some stuff below will eventually go to a separate file, and configuration
6 -- will remain here similar to the split between the wmii+ruby wmiirc and
7 -- wmiirc-config. For now I just want to get the feel of how things will
8 -- work in lua.
9 --
10 -- http://www.jukie.net/~bart/blog/tag/wmiirc-lua
11 -- git://www.jukie.net/wmiirc-lua.git/
14 io.stderr:write ("----------------------------------------------\n")
16 -- load wmii.lua
17 package.path = package.path
18 .. ";" .. os.getenv("HOME") .. "/.wmii-3.5/core/?.lua"
19 .. ";" .. os.getenv("HOME") .. "/.wmii-3.5/plugins/?.lua"
20 require "wmii"
22 -- This is the base configuration of wmii, it writes to the /ctl file.
23 wmii.set_ctl ({
24 view = 1,
25 border = 1,
26 font = '-windows-proggytiny-medium-r-normal--10-80-96-96-c-60-iso8859-1',
27 focuscolors = '#FFFFaa #007700 #88ff88',
28 normcolors = '#888888 #222222 #333333',
29 grabmod = 'Mod1'
32 -- This overrides some variables that are used by event and key handlers.
33 -- TODO: need to have a list of the standard ones somewhere.
34 -- For now look in the wmii.lua for the key_handlers table, it
35 -- will reference the variables as getconf("varname").
36 -- If you add your own actions, or key handlers you are encouraged to
37 -- use configuration values as appropriate with wmii.setconf("var", "val"), or
38 -- as a table like the example below.
39 wmii.set_conf ({
40 xterm = 'x-terminal-emulator'
43 -- colrules file contains a list of rules which affect the width of newly
44 -- created columns. Rules have a form of
45 -- /regexp/ -> width[+width[+width...]]
46 -- When a new column, n, is created on a view whose name matches regex, the
47 -- n'th given width percentage of the screen is given to it. If there is
48 -- no nth width, 1/ncolth of the screen is given to it.
50 wmii.write ("/colrules", "/.*/ -> 50+50\n"
51 .. "/gaim/ -> 80+20\n")
53 -- tagrules file contains a list of riles which affect which tags are
54 -- applied to a new client. Rules has a form of
55 -- /regexp/ -> tag[+tag[+tag...]]
56 -- When client's name:class:title matches regex, it is given the
57 -- tagstring tag(s). There are two special tags:
58 -- sel (or the deprecated form: !) represents the current tag, and
59 -- ~ which represents the floating layer
60 wmii.write ("/tagrules", "/XMMS.*/ -> ~\n"
61 .. "/Firefox.*/ -> www\n"
62 .. "/Gimp.*/ -> ~\n"
63 .. "/Gimp.*/ -> gimp\n"
64 .. "/Gaim.*/ -> gaim\n"
65 .. "/MPlayer.*/ -> ~\n"
66 .. "/.*/ -> sel\n"
67 .. "/.*/ -> 1\n")
69 -- load some plugins
70 wmii.load_plugin ("messages")
71 wmii.load_plugin ("clock")
72 wmii.load_plugin ("dstat_load")
73 wmii.load_plugin ("browser")
76 -- here are some other examples...
77 --[[
79 -- use Mod1-tab to flip to the previous view
80 wmii.remap_key_handler ("Mod1-r", "Mod1-tab")
82 --]]
84 -- ------------------------------------------------------------------------
85 -- configuration is finished, run the event loop
86 wmii.run_event_loop()