On Tue, 6 Oct 2009, Kris Maglione wrote:
On Wed, Sep 30, 2009 at 03:09:43PM -0400, Kris Maglione wrote:Well, to start with, you don't need to import all of those modules. Aside from that, you bring up a good point: key bindings are interpolated from events.keydefs when they're defined. You're changing them after that point. I'll see what I can do before the next snapshot. It will be fixed before 3.9 is released. For now, just copy wmiirc.py to ~/.wmii and edit that.This is fixed in tip. events.keydefs can be changed in wmiirc_local.py and the changes will be applied when the event loop starts.
Thanks for this. But other issues occur:- pygmi has to be imported into wmiirc_local.py. This should be documented somewhere.
- Color definitions in wmiir_local.py are only partially applied.- Cannot undefine monitor functions defined in wmiirc.py. Or am I missing something? I don't want to see the load.
Find attached my wmiirc_local.py and a screenshot showing the odd colors.The clock is now properly updating, but I don't know whether pulling it into wmiirc_loca.py or pulling the import line out of the function fixed it.
I'd be glad if you could also have a look at issue 132, which is kind of annoying.
-- Thomas Dahms
<<attachment: screen.png>>
import pygmi
from pygmi import *
from pygmi import events
# Keys
events.keydefs = dict(
mod='Mod4',
left='Left',
down='Down',
up='Up',
right='Right')
# Theme
background = '#333333'
floatbackground='#222222'
wmii['font'] = '-*-clean-medium-r-*-*-12-*-*-*-*-*-iso10646-*'
wmii['normcolors'] = '#888888', '#222222', '#333333'
wmii['focuscolors'] = '#ffffff', '#285577', '#4c7899'
terminal = 'wmiir', 'setsid', 'uxterm'
@defmonitor
def battery(self):
for line in open('/proc/acpi/battery/BAT1/state','r'):
if len(line.split()) >= 3 and line.split()[0] == 'remaining':
return line.split()[2] + 'mAh'
return 'no battery info'
@defmonitor
def netz(self):
return call('iwgetid', '-r')
from datetime import datetime
@defmonitor
def time(self):
return datetime.now().strftime('%a %d %b %T')
wmii.tagrules = (
('MPlayer|VLC', '~'),
('Conkeror|Firefox|Opera|Shiretoko|Claws Mail|Sylpheed', 'netz'),
)
