#!/usr/bin/env lua -- -- Copyrigh (c) 2007, Bart Trojanowski -- -- Some stuff below will eventually go to a separate file, and configuration -- will remain here similar to the split between the wmii+ruby wmiirc and -- wmiirc-config. For now I just want to get the feel of how things will -- work in lua. -- -- http://www.jukie.net/~bart/blog/tag/wmiirc-lua -- git://www.jukie.net/wmiirc-lua.git/ -- io.stderr:write ("----------------------------------------------\n") -- load wmii.lua package.path = package.path .. ";" .. os.getenv("HOME") .. "/.wmii-3.5/core/?.lua" .. ";" .. os.getenv("HOME") .. "/.wmii-3.5/plugins/?.lua" require "wmii" require "os" -- Setup my environment hostname = os.getenv("HOSTNAME") if type(hostname) == 'string' and hostname:match("^oxygen") then os.execute ("xmodmap ~/.xmodmaprc") end os.execute ("if ( ! ssh-add -l >/dev/null ) || test $(ssh-add -l | wc -l) = 0 ; then " .. "ssh-add width[+width[+width...]] -- When a new column, n, is created on a view whose name matches regex, the -- n'th given width percentage of the screen is given to it. If there is -- no nth width, 1/ncolth of the screen is given to it. -- wmii.write ("/colrules", "/gaim/ -> 80+20\n" .. "/gimp/ -> 10+90\n") -- tagrules file contains a list of riles which affect which tags are -- applied to a new client. Rules has a form of -- /regexp/ -> tag[+tag[+tag...]] -- When client's name:class:title matches regex, it is given the -- tagstring tag(s). There are two special tags: -- sel (or the deprecated form: !) represents the current tag, and -- ~ which represents the floating layer wmii.write ("/tagrules", "/XMMS.*/ -> ~\n" .. "/Firefox.*/ -> www\n" --.. "/Gimp.*/ -> ~\n" .. "/Gimp.*/ -> gimp\n" .. "/Gaim.*/ -> gaim\n" .. "/MPlayer.*/ -> ~\n" .. "/gitk.*/ -> ~\n" .. "/x?vnc[^ ]*viewer.*/ -> ~\n" .. "/VNC.*:VNC.*/ -> ~\n" .. "/.*/ -> sel\n" .. "/.*/ -> 1\n") -- load some plugins wmii.load_plugin ("messages") wmii.load_plugin ("clock") wmii.load_plugin ("dstat_load") wmii.load_plugin ("browser") -- here are some other examples... --[[ -- use Mod1-tab to flip to the previous view wmii.remap_key_handler ("Mod1-r", "Mod1-tab") --]] -- ------------------------------------------------------------------------ -- configuration is finished, run the event loop wmii.run_event_loop()