Panel

subtle comes with two panels per screen, one at the top and one at the bottom of the screen. The location of both panels is fix and cannot be changed, the height is determined by the height of the font and the styles. The default config uses the top panel on the first screen only, it's up to the user to enable the bottom panel or disable either one or both.

Using subtle's panels is no must, foreign panels can also be used as long as they support the WM_STRUT or DOCK window type properties. If this is not the case, subtle can be advised to spare some parts of the screen with the padding style property.

Styles allow to define different borders, spacings and colors for every item type.

Item types

The panels can contain different items and will be hidden when empty.

Following items are available:

Items Description
:views List of views with buttons
:title Title of the current active window
:tray Systray icons (Can be used only once)
:keychain Display current chain (Can be used only once)
:sublets Catch-all for installed sublets
:sublet Name of a sublet for direct placement
:spacer Variable spacer (free width / count of spacers)
:center Enclose items with :center to center them
:separator Insert separator
icon Insert an icon (see here)

All items except the :tray and :keychain items can be used freely in any combination and multiple times on every panel.

Numbers: on /off1 # Panels
2 screen 1 do
3   top    [ :views, :spacer, :title ]
4   bottom [ :views, :spacer, :title ]
5 end

Sublets

Sublets can either be placed directly by adding the name of the sublet as item name (like :clock) into one of the panels or by using the catch-all item :sublets. The latter will display all unplaced sublets delimited by a separator. If a sublet is placed multiple times on a panel, just the output will be cloned.

Example:

Numbers: on /off 1 # Sublets: Direct placement
 2 screen 1 do
 3   top [ :sublets, :clock ]
 4 end
 5 
 6 # Sublets: Catch-all
 7 screen 1 do
 8   top [ :sublets ]
 9 end

Icons

Since r2457 it's possible to add icons directly to the panel, this makes it possible e.g. to use an icon as spacer.

Example:

Numbers: on /off1 icon = Subtlext::Icon.new("/path/to/icon.xbm")
2 
3 screen 1 do
4   top [ icon, :sublets, icon, :clock ]
5 end

Alignment

The alignment inside of a panel can be changed with :spacer and the :center, per default all items are left-aligned.

Spacer

Basically, a spacer is just empty space in the panel and it's width is defined by the total free space divided by the amount of total spacers. When using spacers to center something, be aware that this will most likely never be the exact center of the panel. This can be done with the :center item.

Example:

Numbers: on /off 1 # Left aligned
 2 screen 1 do
 3   top [ :views ]
 4 end
 5 
 6 # Right aligned
 7 screen 1 do
 8   top [ :spacer, :views ]
 9 end
10 
11 # Centered
12 screen 1 do
13   top [ :spacer, :views, :spacer ]
14 end

Center

Items that are enclosed by two center items will be moved into a special group, that is excluded from the overall alignment of the panel and guaranteed to be in the center of the panel. This group won't affect other items in the panel and spacers inside of it will affect the group only.

Example:

 1 # Left aligned
 2 screen 1 do
 3   top [ :views, :center, :title, :center ]
 4 end
 5 
 6 # Right aligned
 7 screen 1 do
 8   top [ :spacer, :views, :center, :title, :center ]
 9 end
10 
11 # Centered
12 screen 1 do
13   top [ :spacer, :views, :spacer, :center, :title, :center ]
14 end

Examples

Numbers: on /off 1 screen 1 do
 2   top    [ :views, :title, :spacer, :tray, :sublets ]
 3   bottom [ ]
 4 end
 5 
 6 screen 1 do
 7  top    [ :tray, :title, :spacer, :sublets, :spacer, :views ]
 8  bottom [ :clock, :spacer, :mpd ]
 9 end