Re: [dev] wmii status bar config

From: Benjamin R. Haskell <suckless_AT_benizi.com>
Date: Thu, 17 Mar 2011 17:18:16 -0400 (EDT)

On Thu, 17 Mar 2011, Le Tian wrote:

> Hi again, I'm trying to find out how to make a custom status bar in
> wmii. I have found "status()" lines in /home/wmii.rc file(hmmm what is
> it doing here?!)

Maybe your '$HOME' env var was unset or improperly set at some point?

> these is what I found:
> status() {
>     Action status
>         if wmiir remove /rbar/status 2>/dev/null; then
>         echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
>         while status | wmiir write /rbar/status; do
> Action status &
>
> I can barely understand it.

Posting a 'grep' without context is pretty worthless. The only section
you should care about is the part starting at 'status() {'.

> So if anyone had an experience in setting up his custom bar, could you
> please tip me how to do it, cause I don't know where to look else. 

Look in the actual file, not the grep, and you should see something
like:

# Status Bar Info
status() {
         echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)
}

(I think that's the default for some version or another...)

The point is that whatever's in the function is what gets run each time
the status is updated.

If the custom script you mentioned in the first post is called
do-the-thing, and it's in your $PATH and executable, just change those
four lines to:

# Status Bar Info
status() {
         do-the-thing
}

-- 
Best,
Ben
Received on Thu Mar 17 2011 - 22:18:16 CET

This archive was generated by hypermail 2.2.0 : Thu Mar 17 2011 - 22:24:02 CET