Eigen Class
Posts: 358
Nickname: eigenclass
Registered: Oct, 2005
|
Eigenclass is a hardcore Ruby blog.
|
|
|
|
ruby-wmii 0.3.0: extensibility via plugins, easier upgrades, new applets (MPD, battery monitor)...
|
Posted: Jul 4, 2006 4:30 AM
|
|
For those who like scripting their window manager, the most notable change in ruby-wmii 0.3.0 is the new configuration system which preserves your settings across upgrades and allows for extensibility via plugins.
Implemented as explained in an earlier posting where I showed the basics of a plugin framework for Ruby apps, the new plugin functionality looks like this:
Usage
from "standard" do
use_bar_applet "volume", 999
use_bar_applet "mode", 900
use_bar_applet "status", 100
use_bar_applet "mpd", 10
use_binding "dict-lookup", "MODKEY-x"
use_binding "execute-program-with-tag"
use_binding "execute-action"
use_binding "execute-program"
(0..9).each{|k| use_binding "numeric-jump-#{k}" }
end
Definition
(in a separate file under the plugin directory)
Plugin.define "standard" do
author "Mauricio Fernandez <mfp@acm.org>"
bar_applet("cpuinfo", 800) do |wmii, bar|
Thread.new do
loop do
cpuinfo = IO.readlines("/proc/cpuinfo")[6].split[-1].sub(/\..*$/,'')
bar.data = cpuinfo.chomp + " Mhz"
sleep 5
end
end
end
binding("dict-lookup", "MODKEY-Control-d") do |wmii,|
LOGGER.debug "dict-lookup called!!!"
Thread.new do
wmii.wmiimenu([]) do |phrase|
system "dcop kdict KDictIface definePhrase '#{phrase}'"
end.value
wmii.set_curr_view "dict"
end
end
end
Download
As usual, the latest version is available here.
Change summary
Read more...
Read: ruby-wmii 0.3.0: extensibility via plugins, easier upgrades, new applets (MPD, battery monitor)...
|
|