Sublets » History » Version 55

Anonymous, 10/25/2010 02:01 PM

1 55
h1. Sublets\015\012\015\012{{>toc}}\015\012\015\012[[Sublets]] are small "Ruby": scripts written in a small "DSL": that can provide things like system information for the [[panel]]. They are well included in the main loop of [[subtle]] and can be used in various ways. \015\012\015\012h2. Installation\015\012\015\012h3. Easy\015\012\015\012The easiest way to install a [[sublets|sublet]] is to let [[sur]] do all the dirty work, it's designed to be really easy and works in a "rubygems": like fashion and since r2138 bundled with [[subtle]].\015\012\015\012Generally [[sur]] is the *subtle user repository* for user contributed [[sublets]], everyone can submit [[sublets]] via [[sur]].\015\012\015\012<pre>\015\012sur install clock\015\012sur uninstall clock\015\012sur notes clock\015\012</pre>\015\012\015\012h3. Hard\015\012\015\012Ok, you asked for it: Point your browser to and download a [[sublets|sublet]]. Then you need to unpack the [[sublets|sublet]] - they are just tarballs. Once unpacked you will probably find three types of files:\015\012\015\012# A [[sublets|sublet]] file (*.rb*) [@$XDG_DATA_HOME/subtle/sublets@]\015\012# A [[specification]] file (*.spec*) [@$XDG_DATA_HOME/subtle/specifications@]\015\012# Zero or more icons (*.xbm*) [@$XDG_DATA_HOME/subtle/icons@]\015\012\015\012The files need to be installed in the appropriate folders in @$XDG_DATA_HOME/subtle@ and after a reload of either the configor the [[sublets]] you are done.\015\012\015\012h2. Configuration\015\012\015\012Many [[sublets]] can be configured by editing the [[sublets|sublet]] file itself, which can be troublesome for users not that in love with "ruby": In case the [[sublet]] supports the newer way (since r2148) there is a special "DSL": command for this:\015\012\015\012<pre>{{hide}}<code class="ruby">sublet :clock do\015\012  interval      50\015\012  format_string "%H:%S"\015\012end</code></pre>\015\012