Re: [dev] [wmii]clarifications on python script usage

From: Kris Maglione <>
Date: Sun, 30 May 2010 16:12:08 -0400

On Sun, May 30, 2010 at 09:52:35PM +0200, pascal wrote:
>Hi again
>I'm using the python script and I wonder if I do it correctly. I copied the
>content of /etc/wmii-hg/python into ~/.wmii-hg and moved to
> The thing is it seems the script in /etc/wmii-hg is read first
>because wmii is starting with the default appearance (for less than one second),
>and I get the message "witray: fatal: another system tray is already running",
>probably due to the fact that it's also called from the
>So I tried to only leave my modifications in the along with the
>import statements, but then some of my modifications aren't effective, for
>example it keeps using xterm in place of urxvtc, and my theme is not applied
>all at once.

I'm getting confused trying to read the above, so I'll just
explain from the begining.

You don't want to copy to The whole
point of is that it gets called *in addion to* So if you copy the former to the latter, you just
execute it twice (and therefore you execute witray twice, as
well). The witray error is because, for the moment, witray just
gives up rathe than taking over for another system tray. It may
change in the future.

As for copying files from /etc/wmii-hg, you almost certainly
don't want to do that. Instead, run wmii as ‚€˜wmii -r
python/wmiirc‚€™ and it will run /etc/wmii-hg/python/wmiirc for
you. Any customization you want to do, do in
~/.wmii-hg/ or
~/.wmii-hg/plugins/ Only in the event
that you can't manage your customizations in
should you copy /etc/wmii-hg/python/ to
~/.wmii-hg/ and edit it. But don't copy *any* other

I hope the above wasn't too confusing. If you want an example,
my is attached.

>And then a detail, to get the time displayed in my locale I add these two lines
>in ~/.wmii-hg/wmiirc :
>import locale
>locale.setlocale(locale.LC_ALL, "")
>I wonder if that's the right place to put it, and if it could be included in
>the default configuration?

Why would you want any kind of locale-specific time? Here's what
I do:

@defmonitoR(colors=wmii['focuscolors'], name='time')
def s9time(self):
     return time.strftime('%H:%M:%S %Z')
def s9date(self):
     return time.strftime('%a, %d %b')

Kris Maglione
Oh, come *on*.  Revelation was a mushroom dream that belonged in the
Apocrypha.  The New Testament is basically about what happened when
God got religion.
	--Terry Pratchett,

Received on Sun May 30 2010 - 20:12:08 UTC

This archive was generated by hypermail 2.2.0 : Sun May 30 2010 - 20:24:01 UTC