Mod1-Shift-r will move a window to another tag and display that tag
[wmiirc-lua.git] / wmiirc.lua
blobd3bca309ced977858b31e303bb2b67563b002307
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 -- git://www.jukie.net/wmiirc-lua.git/
12 require "posix"
14 io.stderr:write ("----------------------------------------------\n")
16 -- this is us
17 local wmiirc = os.getenv("HOME") .. "/.wmii-3.5/wmiirc"
19 -- load wmii.lua
20 package.path = package.path .. ";" .. os.getenv("HOME") .. "/.wmii-3.5/?.lua"
21 require "wmii"
23 -- stop any other instance of wmiirc
24 wmii.write ("/event", "Start wmiirc")
26 -- This is the base configuration of wmii, it writes to the /ctl file.
27 wmii.setctl ({
28 view = 1,
29 border = 1,
30 font = '-windows-proggytiny-medium-r-normal--10-80-96-96-c-60-iso8859-1',
31 focuscolors = '#FFFFaa #007700 #88ff88',
32 normcolors = '#888888 #222222 #333333',
33 grabmod = 'Mod1'
36 -- This overrides some variables that are used by event and key handlers.
37 -- TODO: need to have a list of the standard ones somewhere.
38 -- For now look in the wmii.lua for the key_handlers table, it
39 -- will reference the variables as getconf("varname").
40 -- If you add your own actions, or key handlers you are encouraged to
41 -- use configuration values as appropriate with wmii.setconf("var", "val"), or
42 -- as a table like the example below.
43 wmii.setconf ({
44 xterm = 'x-terminal-emulator'
47 -- colrules file contains a list of rules which affect the width of newly
48 -- created columns. Rules have a form of
49 -- /regexp/ -> width[+width[+width...]]
50 -- When a new column, n, is created on a view whose name matches regex, the
51 -- n'th given width percentage of the screen is given to it. If there is
52 -- no nth width, 1/ncolth of the screen is given to it.
54 wmii.write ("/colrules", "/.*/ -> 50+50\n"
55 .. "/gaim/ -> 80+20\n")
57 -- tagrules file contains a list of riles which affect which tags are
58 -- applied to a new client. Rules has a form of
59 -- /regexp/ -> tag[+tag[+tag...]]
60 -- When client's name:class:title matches regex, it is given the
61 -- tagstring tag(s). There are two special tags:
62 -- sel (or the deprecated form: !) represents the current tag, and
63 -- ~ which represents the floating layer
64 wmii.write ("/tagrules", "/XMMS.*/ -> ~\n"
65 .. "/Firefox.*/ -> www\n"
66 .. "/Gimp.*/ -> ~\n"
67 .. "/Gimp.*/ -> gimp\n"
68 .. "/Gaim.*/ -> gaim\n"
69 .. "/MPlayer.*/ -> ~\n"
70 .. "/.*/ -> sel\n"
71 .. "/.*/ -> 1\n")
74 -- ------------------------------------------------------------------------
75 -- configuration is finished, run the event loop
76 wmii.run_event_loop()