Statusbar

arnault edited this page Mar 13, 2012 · 11 revisions

statusbar configuration

the wmfs statusbar displays tags and systray, but it can display many other datas with the wmfs -c status command.
this way, you can display result of a bash script, a conky or a simple command. statusbar supports progressbars, graphs, positionbars, colors, rectangles, images and themes.

the easiest way to display datas in the statusbar is by a script launched on startup (with ~/.xinitrc): status.sh.
a basic example of status.sh:

#!/bin/sh
#WMFS status.sh example file
TIMING=10
statustext()
{
     wmfs -c status "default `date`"
}
while true;
do
statustext
    sleep $TIMING
done
  • basic use:
    wmfs -c status "<barname> TEXT visible on 'barname'"
  • display colors:
    wmfs -c status "<barname> ^s[<position>;<color>;<text>]"
  • display rectangles:
    wmfs -c status "<barname> ^R[<position>;<dimensions>;<color>]"
  • display images (support by imlib2):
    wmfs -c status "<barname> ^i[<position>;<dimensions>;<imagepath>]"
  • display progressbars:
    wmfs -c status "<barname> ^p[<position>;<dimensions>;<border>;<value>;<valuemax>;<bgcolor>;<fgcolor>]"
  • display positionbars:
    wmfs -c status "<barname> ^P[<position>;<dimensions>;<curser>;<value>;<valuemax>;<bgcolor>;<fgcolor>]"
  • display graph:
    wmfs -c status "<barname> ^g[<position>;<dimensions>;<value>;<valuemax>;<bgcolor>;<fgcolor>;<name>]"

mousebinds:
sequences supports mousebinds with format (<key>;<uicb-function>) or (<key>;<spawn>;<command>)
example: wmfs -c status "<barname> ^R[<position>;<dimensions>;<color>](1;spawn;urxvt -e ranger)" will display a rectangle that open ranger file-manager in urxvtc on click (button1).

popup status
you can display popups from the statusbar with the mousebind (<key>;status_surface;<position>,<dimension>,<color> <datas>)
note: with “status_surface”, the argument “position” is optional. if not given, default position is under the pointer.

syntaxe:

  • position: “left/right” (relative) or “x;y” (absolute)
  • dimension: “ww;hh” for width;height of the rectangle or the image, to display an image at its original dimension, set it to “0;0” .
  • color: ”#rrggbb”
  • imagepath: absolute path for the image
  • border: width of the progressbar border in pixels
  • curser: width of the curser in the positionbar.
  • value: a variable, to draw progressbar
  • valuemax: maximum value of the ‘value’ used in the progressbar

note: “^” can be replaced by “\” in the sequences.
to display a ”]”, you’ll have to put a “\” as prefix.
when using ^p[...], if w < h , the progressbar will be vertical.

basic example

basic statusbar
code:

#!/bin/bash

wmfs -c status “testbar ^s[left;#ff0000; red-alignleft-text]\
^s[130;10;#00ff00;greentext] ^i[190;1;0;0;/home/arp/.config/wmfs/icons/sound.png]\
^R[210;2;40;10;#0000ff] ^s[217;11;#000000;text]”


note [bar] name = “testbar” [/bar] must be declared in your wmfsrc.

complete scripts

  • script + conky :
    status conky
    command to launch at session startup:
    conky -c ~/.conkyrc_wmfs | while true; read line; do wmfs -c status "testbar $line"; done &
    conky launched by the command.
  • script + conky xl :
    status conky xl
    command to launch at session startup:
    conky -c ~/.conkyrc_full | while true; read line; do wmfs -c status "conkybar $line"; done &
    conky launched by the command.
    theme to be @include in your wmfsrc.

wmfsrc integration

the classic wmfs -c status "<barname><datas>" format implies that you’ve declared the ‘barname’ in the [bars] section of your wmfsrc that way:

[bar]
    name = "barname"
    position = 0
    screen = 0
    elements = "tlsy"   # element order in bar
    theme = "default"
[/bar]

adapt this code to your configuration.