Re: [dev] Re: [ANN] Ruby wmiirc - YAML import feature

2010-01-03 Thread Emmanuel Oga
On Sun, Jan 3, 2010 at 5:32 PM, Suraj Kurapati  wrote:
> Suraj Kurapati wrote:
>> I'm pleased to announce the next evolution of my YAML-based Ruby wmiirc:
>>
>>  http://github.com/sunaku/wmiirc

Suraj:

Thanks a lot for your hard work. I just recently started using your
ruby based wmiirc and I'm enjoying a lot being able to configure my
wmii with ruby so easily.

At the same time, I must point out that I find very annoying the usage
of YAML for the configuration files.

I suppose you choose to use it because it seemed to make sense for a
configuration file. But this configuration is so overcharged with ruby
scripts that IMHO is not very practical to use YAML. wmii audiance is
clearly programmers, and I think so called power users need to know at
least a little about programming to be able to use the wmiirc.

Using YAML, the scripts end up looking like python (i.e., how you use
white space matters), which is very annoying.

I had a goal to convert your YAML scripts to plain old ruby code, ...
good thing I procrastinated it this time, now I'll be able to use your
new code as a starting point! :-)

Regards!

>
> I forgot to mention that the YAML structure has changed in this new
> version, so your old config.yaml will not work as-is.  In particular,
> the following incompatible changes have been mode.
>
> (1) The "script" section now defines an array:
>
> # Arbitrary logic to execute either before or after processing this file.  Any
> # number of "before" and "after" subsections may be defined within this 
> section.
> #
> #   script:
> #     - before: 
> #     - after:  
> #     # ...
> #
>
> (2) Keys in the"display:status" section have changed, and the code is
> evaluated inside a Wmiirc::Status object (see "display/status.yaml"
> for details).
>
>  # Status bar applets.
>  #
>  #   - :
>  #
>  #       refresh:  
>  #
>  #       script:     #                  object that corresponds to this definition.>
>  #
>  #       label:      #                  content.  This code is placed inside a
>  #                  label() method in the Wmiirc::Status object
>  #                  that corresponds to this definition.>
>  #
>  #       mouse_action:
>  #         : 
>  #
>  # You can refresh a particular status bar applet in Ruby using:
>  #
>  #   Status["your applet name"].refresh
>  #
>  status:
>
> (3) The "control:grab" section was moved to "control:keyboard:grabmod".
>
> (4) The "control:key" section was split into "control:action" and
> "control:keyboard_action" so that the same logic can be shared among
> keyboard shortcuts and mouse events.
>
>  # Keyboard shortcuts.
>  #
>  #   : 
>  #
>  # A key sequence may contain ${...} expressions which
>  # are replaced with the value corresponding to '...' in
>  # the "control:keyboard" section of this configuration.
>  #
>  # For example, if the "control:keyboard" section was:
>  #
>  #   control:
>  #     keyboard:
>  #       foo: Mod4
>  #       bar: y
>  #
>  # and the following key sequence was used:
>  #
>  #   ${foo}-${bar},${bar}
>  #
>  # then after ${...} expression replacement,
>  # that key sequence would appear like this:
>  #
>  #   Mod4-y,y
>  #
>  keyboard_action:
>
> (5) The "program" section was renamed to "prefer".
>
> I think that's about it.  Cheers.
>
>



-- 
--
EmmanuelOga.com - Software Developer



[dev] about handling the event loop of wmii

2010-05-05 Thread Emmanuel Oga
hey

I'm doing some experiments on scripting  wmii with the help of eventmachine.

I mounted the wmii fs using the instructions on http://wmii.suckless.org/9p

Then, I came up with this:

http://gist.github.com/390396

The thing is, I haven't had much experience dealing with eventmachine and
I'm not sure if this is a good idea.
In a way EM feels like a natural way of handling an event loop. But there is
this voice on the back of my mind that keeps telling my this might be
overkill ...

Thoughts?


-- 
--
EmmanuelOga.com - Software Developer