Commit Graph

43 Commits

Author SHA1 Message Date
Lukáš Mandák
d802c7d3de Merge branch 'Master' into hints
# Conflicts:
#	i3pystatus/core/modules.py
2015-06-18 21:05:54 +02:00
Lukáš Mandák
0267454557 Module: Add hyperlinks to hints docstring. 2015-06-18 20:39:28 +02:00
enkore
7df811b9a1 Add callbacks chapter 2015-06-17 18:11:40 +02:00
Lukáš Mandák
3d0142b74d Module: Added docs for hints.
Module: All modules now set `"markup": "none"` by default to prevent from #181.
Module: is now replacing ampersands with "&" if output is to be parsed by pango.
2015-06-12 17:38:34 +02:00
Lukáš Mandák
040b765b5d Module: Replaced list comprehension for better code readability. 2015-06-06 18:17:38 +02:00
Lukáš Mandák
8d80b375a3 Module: Added hints setting that allows the user to add additional i3bar protocol blocks to module's output. 2015-06-06 14:15:48 +02:00
enkore
41003ef702 Remove unnecessary metaclass from IntervalModule 2015-06-06 12:49:13 +02:00
enkore
e41d12079f Fix missing documentation of inherited settings 2015-06-06 12:37:51 +02:00
Matthieu Coudron
c5933a3b26 This commit adds a basic test to check callbacks work.
This can also serve as an exemple.
2014-12-21 13:31:40 +01:00
Matthieu Coudron
12546736a6 Fix in documentation 2014-12-20 15:46:34 +01:00
Matthieu Coudron
d31cc380ef Follow up of https://github.com/enkore/i3pystatus/pull/149#issuecomment-67712619 .
This commit removes and replaces all the old methods 'on_*' by settings
with the same name. The old methods were renamed into more explicit names that can be used for the callbacks like "next_song","mute" etc...
For instance, you can test with:
status.register("clock",
	format=[
	    ("Format 0",'Europe/London'),
	    ("%a %-d Format 1",'Europe/Dublin'),
	    "%a %-d %b %X format 2",
	    ("%a %-d %b %X format 3", 'Europe/Paris'),
	],
	on_leftclick= ["urxvtc"] , # launch urxvtc on left click
	on_rightclick= ["scroll_format", 2] , # update format by steps of 2
	log_level=logging.DEBUG,
	)

This way much code could be removed from other modules, though I did it only for the clock module here.
2014-12-20 15:30:41 +01:00
Matthieu Coudron
98e46ac3d6 Updated alsa & clock modules with new mechanism 2014-12-19 22:04:49 +01:00
Matthieu Coudron
14c0528be5 This commit introduces a skeleton that allows personalized callbacks in
a backwards compatible way. Settings 'on_lclick','on_rclick',
'on_scrollup','on_scrolldown' are inherited by all modules.
These parameters should be a string. Then when a matching action is
detected (ie mouseclick, scrolling), the module check if this string
corresponds to a:
1/ python callable
2/ module method,
In cases 1 and 2, it calls the python function with the module as the
first parameter. Otherwise it considers the string is an external command and launches it via run_through_shell
2014-12-19 18:52:15 +01:00
enkore
b2b34ad81a PEP 8 (I'm bored): core/modules 2014-10-14 16:50:40 +02:00
Matthieu Coudron
000bdc6978 i3 next branch send click events on mouse wheel up/down. This patch allows to change the alsa volume with the mousewheel when hovering the alsa indicator 2014-08-30 00:13:57 +02:00
enkore
6de38c933f Confirmed #74 fixed, close #74 2014-08-04 18:21:16 +02:00
enkore
c0da4fce06 Possible fix for #74 2014-07-26 21:39:52 +02:00
enkore
f06a76ad52 PEP8 2014-04-30 14:51:41 +02:00
Łukasz Jędrzejewski
5fe6d049d2 Configurable interval for every IntervalModule
settings attribute for every class inheriting from IntervalModule are
automatically extended by interval setting if it does not exist.

A function to flatten settings in SettingsBase was extracted and added
as a static method.
2014-03-10 17:06:40 +01:00
enkore
467339e905 Remove __repr__ from Module 2013-10-23 21:36:12 +02:00
enkore
135915ac96 Remove call_start_hooks and START_HOOKS #27 2013-10-23 21:08:49 +02:00
enkore
266084801d Delete Module.test() #27 2013-10-23 21:06:31 +02:00
enkore
3d484694bd Remove unneeded stuff 2013-10-23 17:16:04 +02:00
enkore
5c0d994006 Remove import 2013-10-23 17:04:32 +02:00
enkore
ead0285ecc Remove trivial & single-usage chain decorator 2013-10-23 16:55:10 +02:00
enkore
78c01dd3e5 PEP8 2013-10-01 15:22:09 +02:00
enkore
3394aa56ea Change relative to absolute imports (style) 2013-08-04 17:56:04 +02:00
enkore
42ab76dd3a Invocation changed
-t/--test run test
-c/--config specify config file
2013-07-31 01:31:13 +02:00
enkore
c5413c4243 Module.move should return self 2013-03-23 22:02:46 +01:00
enkore
1171a1d0ae Change Module.test API to something more intuitive
(I mean, what the hell has crossed my mind to name a method *test*
and let it return FALSE if successful? :D)
2013-03-16 12:58:01 +01:00
enkore
0e90cbfceb Merge branch 'master' of github.com:enkore/i3pystatus 2013-03-16 12:40:21 +01:00
enkore
b662d8797e Add Module.test 2013-03-16 12:39:17 +01:00
philipdexter
60c475d6e6 Add the option of specifying python-ish negative array indices to the move method 2013-03-15 21:34:45 -04:00
philipdexter
ecb6c54052 Add the ability to change the position of a module in the i3bar
Create a method `move' in modules.py to insert the module's json in a different position than the default 0.
2013-03-15 21:20:24 -04:00
enkore
b42cd6aa15 3.12: Move code around 2013-03-10 21:22:58 +01:00
enkore
c8c8e2226f Improved UX a bit: all threads are immediately started;
no more slow starting of modules.

Although I'm highly unsatisfied with the current implementation
(SoC, you hear me!?)
2013-03-10 02:11:58 +01:00
enkore
375ba3af7b Support for the 3rd version of the i3bar-onclick-patch 2013-03-10 01:27:23 +01:00
enkore
657bdb826a Add preliminary(!) support for bidirectional communication with i3bar
Novelty use only.
2013-03-09 21:23:36 +01:00
enkore
03d96ad0ea Some internal code butchering again. 2013-03-05 17:26:10 +01:00
enkore
3cac448f6e Change process title of threads to something meaningful, if setproctitle is installed. 2013-03-02 20:05:41 +01:00
enkore
3ebcbec4e1 i3pystatus.core.threads ; some smaller changes. 2013-03-02 17:34:32 +01:00
enkore
901dd4319f New self-organizing/self-optimising threading model (no API changes)
Using a simple, hysteresis based approach… currently in this first
version the optimizer recursively moves modules out of a thread until a
certain timing target is reached; the "modules moved out" just mentioned
are then partitioned into new threads according to their latest time profile.

Very simple, but very effective.
Todo: Implement merging threads with (again) good behaving workloads.
2013-02-28 00:14:51 +01:00
enkore
a892a09581 Moving some code around. 2013-02-24 21:00:16 +01:00