Hi all,

Looking for a way to switch off the monitor with my remote, I've written a
little plugin with which you can define your own events to call a script,
and then associate them to a key.

This is my first plugin, so don't expect a great piece of software...

BTW, I think this is the feature requested in
http://www.mail-archive.com/[email protected]/msg12856.html.

Eduardo
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# newevents.py - Plugin for creating new events
# -----------------------------------------------------------------------

from os import system

import config
import plugin
import rc

class PluginInterface(plugin.DaemonPlugin):
    """
    A plugin to create and control new events, specially
    events associated to a script.
    
    To activate it, put the following in local_conf.py:
    
    plugin.activate('newevents')
    NEW_EVENTS = [
        ('WWW', 'firefox &'),
        ('SWITCH_OFF_TV', 'xset dpms force off'),
    ]
    
    EVENTS['global']['q'] = Event('SWITCH_OFF_TV')
    EVENTS['global']['t'] = Event('WWW')
    """

    def __init__(self):
        plugin.DaemonPlugin.__init__(self)

    def eventhandler(self, event=None, menuw=None, arg=None):
        """
        eventhandler to handle the new events
        """
	for r in config.NEW_EVENTS:
	    if event == r[0]:
	        system(r[1])
	        return True
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to