From 9ca0ee00a7cd12ce4a0ca7ea2b6ca8fcb55b47fa Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Fri, 13 Dec 2013 18:23:23 +0100 Subject: new generic click event handler using the special module file named i3bar_click_events.py which will be forwarded any orphan click event for action. this allows you to take action on clicks made on your i3status modules. --- examples/i3bar_click_events.py | 127 +++++++++++++++++++++++++++++++++++++++++ py3status/__init__.py | 30 ++++++++++ 2 files changed, 157 insertions(+) create mode 100644 examples/i3bar_click_events.py diff --git a/examples/i3bar_click_events.py b/examples/i3bar_click_events.py new file mode 100644 index 0000000..792965c --- /dev/null +++ b/examples/i3bar_click_events.py @@ -0,0 +1,127 @@ +from subprocess import Popen +from time import time + + +class Py3status: + """ + This module allows you to take actions based on click events made on + the i3status modules. For example, thanks to this module you could + launch the wicd GUI when clicking on the ethernet or wireless module + of your i3status output ! + + IMPORTANT: + This module file name is reserved and should NOT be changed if you + want py3status to handle your i3status modules click events ! + + The behavior described above will only work if this file is named + 'i3bar_click_events.py' ! + """ + def __init__(self): + """ + This is where you setup your actions based on your i3status config. + + Configuration: + -------------- + self.actions = { + "": { +