You are not logged in.

#1 2009-05-06 14:27:36

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

wmpy - Python configuration for WMii

wmpy - Python configuration for WMii

http://github.com/decurtis/wmpy

Install:

mv ~/.wmii-hg ~/.origwmii-hg
git clone git://github.com/decurtis/wmpy.git ~/.wmii-hg
cd ~/.wmii-hg
python setup.py build

I just wanted to make a post and see it would spark any interest/collaboration from the arch community.  I know there are some Python-based wmii scripts floating around that aren't maintained anymore, there are some really nice LUA scripts (wmiirc-lua), and there are some advanced Ruby scripts (Rumai).  Basically, I don't like Ruby all that much (blasphemy I know!) and while the lua scripts are great, I really miss the ability to utilize the plethora of Python libraries that are available to do some really cool stuff (most lua plugins do intense parsing to get information).  Taking inspiration from wmiirc-lua I wrote a simple Python wrapper around libixp.  As a side note I did try doing all the message encoding and passing in Python (as rumai does) and with the complicated bitshifting that was required to encode and decode messages the performance took a hit).

I love WMII simply because it has the best layout and tagging system.  I have not yet submitted this work to the WMii website because there are some features missing (ability to change the tag of a window) but features are coming along when I get frustrated and need them.  The few things I found pesky with other configurations was ordering of tags and using Mod4+# to consistently access tags in the same position.  Most WMII configurations order the tags alphabetically but wmpy will actually let you define a tag order and stick to it, while still allowing you to create new tags dynamically and place them in positions in the order they come (ie. tags which are a one-time thing will be placed in the order they are created).

Feel free to request features or provide comments.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#2 2009-05-06 15:01:30

Lexion
Member
Registered: 2008-03-23
Posts: 510

Re: wmpy - Python configuration for WMii

This should go in the GNU/Linux discussion forum, but yes, I do like wmii alot, although I prefer xmonad.  I tried the ruby config method, but python seems intresting.  I wonder what you could do with the python web-integration feature.  "Manage your windows at manage.wmpy.org!"


urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand

Offline

#3 2009-05-12 15:25:59

muflax
Member
From: Germany
Registered: 2008-07-21
Posts: 58

Re: wmpy - Python configuration for WMii

Nice coincident. I've just switched to wmii yesterday and was about to write my own scripts, so thanks for doing most of the work for me. wink Now I'll only have to port over my (long) awesome config.

I like that your script is not as bloated as pywmii and python-wmii. I don't need another awesome, just some tag rules and complex keybindings. ^^

Offline

#4 2009-05-31 08:50:06

jzxu
Member
Registered: 2008-06-23
Posts: 10

Re: wmpy - Python configuration for WMii

I downloaded this and tried it out. For the most part, I didn't run into any problems (yet), except one tiny thing:

diff --git a/wmii.py b/wmii.py
index d9723d6..b0e8943 100644
--- a/wmii.py
+++ b/wmii.py
@@ -20,7 +20,9 @@ HOME=os.path.join(os.getenv('HOME'), '.wmii-hg')
 HISTORYSIZE=5
 
 #log.debug('creating new instance of client')
-client = pyxp.Wmii('unix!/tmp/ns.dcurtis.:0/wmii')
+default_address = os.path.expandvars('unix!/tmp/ns.$USER.:0/wmii')
+client = pyxp.Wmii(os.environ.get('WMII_ADDRESS', default_address))
 
 # applications
 apps = {

Since you're releasing the code, it's probably a bad idea to hard code your username into it. And those default colors ...

Anyway, good job. I've been waiting to ditch Rumai and I'll definitely be using this.

Offline

#5 2009-05-31 09:48:05

N30N
Member
Registered: 2007-04-08
Posts: 273

Re: wmpy - Python configuration for WMii

My personal config is based on python-wmii, but I'll be sure to give yours a try when I have some free time. smile

Offline

#6 2009-06-29 18:36:48

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: wmpy - Python configuration for WMii

I didn't realize that people were replying to this, I thought being the author I would be auto-subscribed but I guess not.

Regardless, I'm doing some changes to the scripts based some other people's comments.

A few comments about performance,

I don't use a pure-python implementation because I notice on my netbook it was causing performance spikes when I'd do the simplest operations.  Of course, if i cared about performance THAT much I should probably be using DWM but anyways.  The pyxp implementation does recursive function calls in python in order to generate the encoded message strings.  Something that C has an upper hand on.  Thus, I am using a small python wrapper.

A lot of the other configs use either regular expressions or specialized classes for matching keystrokes and events.  The major problem here is that it's much easier to just do a dictionary lookup.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#7 2010-05-07 17:03:02

q0tsa
Member
Registered: 2009-07-20
Posts: 39

Re: wmpy - Python configuration for WMii

I just installed wmii-hg from AUR and then wmpy. When starting wmii I get this:

Traceback (most recent call last):
  File "./wmiirc", line 7, in <module>
    import wmii
  File "/home/michael/.wmii-hg/wmii.py", line 24, in <module>
    client = pyxp.Wmii('unix!/tmp/ns.%s.:0/wmii' % os.getenv('USER'))
RuntimeError: Could not connect to server

Offline

#8 2010-07-01 21:26:30

hylix
Member
Registered: 2010-05-06
Posts: 2

Re: wmpy - Python configuration for WMii

@q0tsa:

edit line 24 of wmii.py to have a thing like this:

client = pyxp.Wmii('unix!/tmp/ns.%s.%s/wmii' % (os.getenv('USER'), os.getenv('DISPLAY')))

Offline

Board footer

Powered by FluxBB