Friday, August 17, 2007

The Slit

Fluxbox has something called the slit. It's like the Windows Vista Sidebar—except n times better because you're not running Windows Vista. In short, it gives you convenient access to "dockable" applications in the form of a sidebar on your desktop.

For example, GKrellM can be run with the "withdrawn" option and will then appear in the slit. It provides an easily customized set of system monitors, so you can keep an eye on your box's vital signs. If you don't have it already, it's no problem to install.

apt-get install gkrellm
gkrellm -w


I know no one's working on the original XMMS project anymore, but I still use it. It can also be docked in the slit. Just run wmxmms & and it should appear there.

The Fluxbox FAQ suggests that you can use wmDrawer to display the Fluxbox logo in the slit. Of course, you could use the same method to display any other image. The FAQ doesn't go into the specifics, but it's simple.

First we install it. I also chose to copy the example resource file to my home directory.

apt-get install wmdrawer
cp /usr/share/doc/wmdrawer/wmdrawerrc.example ~


Then I copied the Fluxbox logo to the directory where wmDrawer looks for images.

cp fb-icon48x48-metal.png /usr/share/pixmaps

The example file also has a line for /usr/local/share/pixmaps, which I ignored because that path doesn't exist on my system. I edited the file to use the logo as its dock icon and commented out the lines defining the buttons, since I don't use them. When I was done, the file looked like this:
# Config file example for wmdrawer
[general]
# Dock's icon [optional]
dock_icon fb-icon48x48-metal.png

# Drawer's opening direction [required]
# Top to bottom = 0
# Right to Left = 1
# Bottom to Top = 2
# Left to Right = 3
direction 2

# Image used for icons' background [optional]
#icons_bg defaultTile.xpm

# Allow icons' enlargement to fit them to buttons' size [optional, default 1]
# 0 indicate that icons should never be larger than their original size.
#icons_expand 1

# Activate the drawer's pseudo-transparency [optional, default 0]
# if you choose transparency, icons_bg will be ignored
#transparency 0

# dock's width: min=12, max=128 [optional, default=64]
#dock_width 64

# dock's height: min=12, max=128 [optional, default=64]
#dock_height 64

# buttons' size: min=12, max=128 [optional]
# Useful for the people who want for example to have big icons
# and to define several columns.
#btns_size 32

# Icon's highlight type: 0, 1 or 2 [optional, default 2]
# 0 : no highlight
# 1 : target (unavailable if transparency is activated)
# 2 : shading
#highlight 2

# Image used as highlight [optional]
# only used if you choice target type
#highlight_img highlight.xpm

# Tint icons by a specified color [optional, default #ffffff]
# only used if you choice shading type
#highlight_tint #ffffff

# Shade icons at a specified level [optional, default 60]
# only used if you choice shading type
#highlight_sh 60

# Display buttons' tooltips [optional, default 1]
#tooltips 1

# Tooltips' font [optional, default fixed]
#tooltips_font fixed

# Drawer's animation speed: 0, 1, 2, 3, 4 [optional, default 1]
#animation_speed 1

# Mouse cursor in drawer: 0, 1, ..., 76 [optional, default 30]
#cursor 30

# Auto opening of the drawer: 0, 1 [optional, default 0]
#show_on_hover 0

# Auto closing of the drawer: 0, 1 [optional, default 0]
#hide_on_out 0

# drawer's hiding timeout in miliseconds [optional, default 1000]
#hide_timeout 1000

# Runs the dockapp in windowed mode: 0, 1 [optional, default 0]
# Useful for AfterStep, Fvwm, Sawfish or KDE users.
#windowed_mode 0

# Instance name so window manager can distinguish between multiple copies
#instance_name distinguish_name

# Drawer's border size in pixels [optional, default 1]
#border_size 1

# Images directories
[images_paths]
/usr/share/pixmaps
/usr/local/share/pixmaps/

# A first column with 5 buttons
# Each button must be defined with this syntax:
# (tooltip) (image) (command)
#[column]
#(X Terminal) (gnome-term.png) (xterm -bg black -fg wheat)
#(Galeon) (galeon.xpm) (galeon -s)
#(Sylpheed) (sylpheed.png) (sylpheed)
#(XChat) (xchat.png) (xchat)
#(MPlayer) (gnome-multimedia.png) (mplayer)

# A second column with 5 buttons
#[column]
#(Xmms) (gnome-audio2.png) (xmms)
#(Gimp) (gnome-gimp.png) (gimp)
#(GQview) (gqview.png) (gqview)
#(Xcalc) (gnome-calc3.png) (xcalc)
#(GFtp) (gftp.png) (gftp)
The lines I changed are boldfaced. Although it serves a purely cosmetic purpose on my desktop, wmDrawer has many other capabilities. Its documentation can tell you more.

Once you've arranged your slit apps to your satisfaction, right-click on the slit. You may need to try clicking in a few different places before you get the slit menu instead of the menu of a slit app. Select the "save slit list" item. Now the next time you restart Fluxbox, all your favorite dockable applications will be at your fingertips.

EDIT: Okay, it took me over a month to realize I omitted some important info here. In order to have your apps run in the slit when you start a Fluxbox session, you must add them to the ~/.fluxbox/startup script. There are plenty of comments in the default script to guide you.

No comments: