Commit Graph

258 Commits

Author SHA1 Message Date
enkore
7999cc453b Added file "template" for backlight info
This is 100pct. the same functionality as a complete module before :-)

But still,  have to come up with some better way to manage these "templates".
And a place to stash them.
2013-02-24 05:25:29 +01:00
enkore
20da1dbb08 Remove backlight module, add file module (kinda overpowered :-) 2013-02-24 05:20:35 +01:00
enkore
a5bcf9bfa2 backlight module
Probably I'll discard these as soon as I come up with a nice
generic way of reading multiple files, converting values etc.
2013-02-24 02:12:32 +01:00
enkore
bde56dfdec made battery module much more flexible
So I can have my old representation back... indeed you can
do pretty much anything now with it:

status.register(battery,
    format="{consumption:.2f}W {percentage:.2f}% [{percentage_design:.2f}%] {remaining_hm}"
)
2013-02-24 01:36:56 +01:00
enkore
ed003c123f temp module 2013-02-24 00:34:16 +01:00
enkore
a0fc9eb492 load module 2013-02-24 00:02:35 +01:00
enkore
c4db62d2a4 Some small changes 2013-02-23 23:50:50 +01:00
enkore
3677ffc852 Rewrote SettingsBase 2013-02-23 23:48:48 +01:00
enkore
4e06a9c2ee batterychecker → battery 2013-02-23 23:46:33 +01:00
enkore
8fba0b69a3 Fixed thunderbird
(deeeeeep recursion)
2013-02-23 23:00:28 +01:00
enkore
9e6af3661a Mail 2013-02-23 23:00:14 +01:00
enkore
3f46ab24c6 flying-sheep via GS 2013-02-23 21:05:27 +01:00
enkore
c96410e92d Automagic name attribute in JSON output
If name is not set by the module, it's set automatically to the
fully qualified python dotted path to the module :-)
2013-02-23 20:52:07 +01:00
enkore
13c684860d Actualize clock once per second 2013-02-23 20:43:38 +01:00
enkore
dd7b5ef346 i3bar has some issues with locale-handling I guess.
It reliably crashes i3pystatus, but only if started by i3bar. Meh.
I can't tell if this locale issue is local (ha-ha) or everyone is affected.
2013-02-23 20:41:42 +01:00
enkore
ebe3d718e3 Reworked exceptions 2013-02-23 20:15:20 +01:00
enkore
70155b2f18 Fixed clock (my bad) 2013-02-23 19:05:57 +01:00
enkore
f6e5530468 ~rough refactoring 2013-02-23 18:59:48 +01:00
enkore
163662a633 README 2013-02-23 18:45:05 +01:00
enkore
60be03126d Docstrings 2013-02-23 18:41:53 +01:00
enkore
9dc7041997 First draft of a doc generator for this
(Already supports multiple Modules per python module)
2013-02-23 18:41:33 +01:00
enkore
d31fe9a62d Moving code around a bit 2013-02-23 18:40:59 +01:00
enkore
1cdc722f46 SettingsBase 2013-02-23 17:40:35 +01:00
enkore
040341021c modsde uses .format now 2013-02-23 17:40:23 +01:00
enkore
9d5c516d68 Renamed IMAP mail checker to … imap 2013-02-23 15:19:25 +01:00
enkore
eb1ce22610 IMAP mailchecker 2013-02-23 15:19:11 +01:00
enkore
761034dd01 Thunderbird 2013-02-23 15:18:56 +01:00
enkore
93b7ba9af9 Ported notmuchmail (needs testing) 2013-02-23 15:16:53 +01:00
enkore
7fceb73ff3 Mail checkers
Mail checkers are not separate modules anymore; there is only one
mail checker module (called mail) that can make use of various backends
, which were formerly modules on their own.

This greatly simplifies code and reduces redundance.

This commit only contains the base classes for this.
2013-02-23 15:16:23 +01:00
enkore
7c8fcb8758 Refactored the "find appropiate class" part a bit 2013-02-23 15:03:21 +01:00
enkore
efb2b31ee8 StandaloneIO 2013-02-23 14:09:23 +01:00
enkore
26cc3ff27a . 2013-02-23 14:06:55 +01:00
enkore
341d2cf34e Readme 2013-02-23 14:00:10 +01:00
enkore
a1b84b74d2 Fixed issue with standalone usage 2013-02-23 13:54:35 +01:00
enkore
a354a8288e Configuration shortcut
You can now pass a module (the Python thing, e.g. modsde) into register
and it will just "do the right thing" (find a class derived from Module
in that module and instanciate it with any extra arguments)
2013-02-23 13:53:54 +01:00
enkore
612faaaa4e Adopted modules to new settings system
Btw. nothing has changed for the config files. You can pass into
__init__ a dict as before, or you can use keyword arguments.

Either way, a module defines the settings that can be specified
and those which are required. __init__ basically checks that all
required options are set and that no invalid options are used.
2013-02-23 00:12:45 +01:00
enkore
c967cdecb2 Settings system. Now is probably the right moment to tell if you don't like it :) 2013-02-23 00:11:02 +01:00
enkore
bf3b77ddbd Code cleanup 2013-02-22 23:21:53 +01:00
enkore
2625de19dc Readme 2013-02-22 21:29:56 +01:00
enkore
5474980b11 Support for standalone operation
Specify standalone=True to the I3statushandler constructor
to run i3pystatus without i3status in the background.
i3pystatus won't read input from stdin or any other
file object specified with input_stream.

The keyword argument interval specifies how often output should
be generated. The default is 1 (second).


Sorry guys for changing the way i3pystatus "way of operation"
is set so often. If you're want the "self-contained" mode
(you execute i3pystatus, i3pystatus automatically starts
i3status), don't set the file attribute, but pass the file
descriptor of the pipe as input_stream like this:

process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE, universal_newlines=True)
status = i3pystatus(input_stream=process.stdout)

On a side note:
The main class name has been changed to i3pystatus, but I3statusHandler
is still available as an alias. Use whichever you prefer :-)
(Linux is about choice after all)
2013-02-22 21:23:58 +01:00
enkore
4c5dfbe429 Using uevent instead of the separate files reduces I/O...
...and makes the code a bit cleaner.

Didn't touch much of the class logic, except that it just
displays the charge if the state is "Unknown".
2013-02-22 21:04:33 +01:00
enkore
62b59db8d6 Fixed issue #9
Notmuch checker does not work in this state
NotmuchMailChecker does not work because of a conflict between the notmuch Python API and the file for NotmuchMailChecker which is also named notmuch.

I suggest to rename i3pystatus/notmuch.py to i3pystatus/notmuchchecker.py and modify main.py.dist appropriately.

Reported by mjepronk

Also removed some superfluous whitespace
2013-02-22 18:16:39 +01:00
enkore
8a1041ac0e Merge branch 'master' of https://github.com/janoliver/i3pystatus 2013-02-22 18:14:05 +01:00
Jan Oliver Oelerich
e44770ef14 Merge pull request #8 from mjepronk/master
Two new modules (battery status and clock)
2013-02-22 08:52:43 -08:00
Matthias Pronk
400d639e31 register_module has been renamed to register 2013-02-22 14:15:14 +01:00
Matthias Pronk
0adbc0ad28 remove unused import 2013-02-22 14:11:05 +01:00
Matthias Pronk
fdadd3f143 clock added 2013-02-22 13:59:28 +01:00
Matthias Pronk
c72363092d battery checker added 2013-02-22 13:56:37 +01:00
Jan Oliver Oelerich
e9b1976e1e Merge pull request #7 from enkore/master
Mailchecker, regex
2013-02-21 14:50:18 -08:00
enkore
4966f90775 .dist 2013-02-21 16:08:52 +01:00