Project

General

Profile

unexist.dev

Assorted tidbits and projects

Sublets

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. Further information about writing a sublet can be found here.

Installation

Easy

The easiest way to install a 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.

Generally sur is the subtle user repository for user contributed sublets, everyone can submit sublets via sur.

sur install clock
sur uninstall clock
sur notes clock
sur config clock

Hard

Ok, you asked for it: Point your browser to http://sur.subforge.org/ and download a sublet. Then you need to unpack the sublet - they are just tarballs. Once unpacked you will probably find three types of files:

  1. A sublet file (.rb) [$XDG_DATA_HOME/subtle/sublets]
  2. A specification file (.spec) [$XDG_DATA_HOME/subtle/specifications]
  3. Zero or more icons (.xbm) [$XDG_DATA_HOME/subtle/icons]

The files need to be installed in the appropriate folders in $XDG_DATA_HOME/subtle and after a reload of either the config or the sublets you are done.

Configuration

There are two default sublet properties than can be changed from the config of subtle without ever touching the sublet files:

  1. interval Update interval of the sublet
  2. style Set the style of the sublet (r2979)

To configure a sublet you just need to add a sublet block to your subtle config, similar to the ones for e.g. tags.

Here is an example how to customize the interval, style and format of the clock sublet:

{{hide}}sublet :clock do
  interval      50
  style         :foobar
  format_string "%H:%M" 
end

Generally sublets can provide further properties, but it's up to the author to use this and to add either notes or config information about it.

Grabs

Sublets can also provide grabs (since r2608), that are just added to the supported types and can be used like all other from the config. Like notes and config it's up to the author to supply information, sur shows of list of grabs with following command: sur grabs subletname

Example:

{{hide}}grab "A-b", :SubletTest