Commit Graph

1294 Commits

Author SHA1 Message Date
enkore
ff63d95737 Merge pull request #358 from grimpy/nowplaying_tolerant
Now playing: be more tolerant for mpris properties
2016-04-09 12:33:04 +02:00
Jo De Boeck
be83476aef Now playing: be more tolerant for mpris properties
Some mpris clients dont implement all properties
2016-04-08 13:23:53 +02:00
Erik Johnson
7cb2dcc255 Fix improper usage of time.tzset() (#347)
* Fix improper usage of time.tzset()

time.tzname is a tuple containing the non-daylight-savings and
daylight-savings timezone abbreviations. However, when the TZ
environment variable is set to just the daylight-savings timezone (as
the clock module was changed to do in e31c58f), time.tzset() will break
time.tzname by setting both elements of the tuple to that timezone,
causing the effective timezone to fallback to UTC:

>>> time.tzname
('CST', 'CDT')
>>> time.localtime().tm_hour
1
>>> os.environ.putenv('TZ', 'CST')
>>> time.tzset()
>>> time.tzname
('CST', 'CST')
>>> # ^^^ This is broken
...
>>> time.localtime().tm_hour
6
>>> os.environ.putenv('TZ', 'CST+06:00CDT')
>>> time.tzset()
>>> time.tzname
('CST', 'CDT')
>>> time.localtime().tm_hour
1

This fixes this incorrect behavior by building a proper TZ environment
variable to set localtime.

* Use time.timezone instead of time.altzone

* Make _get_local_tz a static method
2016-04-07 23:21:23 +02:00
Maximiliano
c0cdfae1f8 mod bitcoin: multiple exchange support (#353)
* mod bitcoin: add 'volume_percent'

* mod bitcoin: Fix exception on url opening (#304)

Calling user_open as a 'Python callback' raises an exception because
this function doesn't expects 'self'.
Wrote a wrapper function as a 'Member callback' to filter it out.

* mod bitcoin: add specific exchange support

* mod bitcoin: add request age attribute

* mod bitcoin: refactor

* mod bitcoin: btc volume divisor

* bitcoin: Deal with diffrent locales

* Fixing PEP8

* mod bitcoin: Updated docs
2016-04-07 23:20:37 +02:00
Jindřich Pilař
c93bfe16b6 Taskwarrior module (#354)
* Taskwarrior module

* Taskwarrior - sort by urgency

* Taskwarrior - filter with multiple constraints
2016-04-07 23:19:59 +02:00
enkore
d9f5950eaa Merge pull request #355 from Xenopathic/master
Properly set MPD filename if no title
2016-04-07 23:19:17 +02:00
Erik Johnson
01395c6b39 Catch "Showers" as "Rainy" weather condition (#356)
* Catch "Showers" as "Rainy" weather condition

Weather.com has a "Showers in the Vicinity" weather condition that I
just happened to see this morning. This commit assigns this condition as
"Rainy" so it is properly colorized.

* Make "Clear / Windy" map to "Fair" weather condition

Another odd weather condition from the weather.com API

* Reverse icons for Fair and Sunny

"Sunny" should have a filled-in sun icon as it implies a brighter weather
condition than "Fair" does.

* Properly detect "Sunny / Windy" as "Sunny" weather condition

Also, do not check for similarly-named conditions if an exact match is
found.

* Properly detect "Fair / Windy" as "Fair"
2016-04-07 23:18:39 +02:00
Robin McCorkell
e3194147fa Properly set MPD filename if no title 2016-04-01 13:07:49 +01:00
enkore
ad2f08e89b Merge pull request #351 from terminalmage/google-calendar
google_calendar: make number of days for event search configurable
2016-03-31 11:08:14 +02:00
enkore
c858c289e7 Merge pull request #350 from terminalmage/issue232
Improve documentation for battery module
2016-03-31 11:06:26 +02:00
enkore
07c70b0ac8 Merge pull request #348 from hasB4K/pullrequest-ping
ping: Add ping module
2016-03-31 11:05:33 +02:00
enkore
11861a500a Merge pull request #349 from terminalmage/wunderground
Add generic weather module
2016-03-31 11:05:02 +02:00
Erik Johnson
0fafb1a652 Identify more kinds of cloudy weather 2016-03-30 13:19:38 -05:00
Erik Johnson
2ac7c6af3d Support more types of "rain" conditions 2016-03-30 11:40:30 -05:00
Erik Johnson
7c25dff1a1 Let color default to i3bar color 2016-03-29 23:39:43 -05:00
Erik Johnson
f30b929752 Make number of days for event search configurable 2016-03-29 23:27:59 -05:00
Erik Johnson
97600454ed Improve documentation for battery module
This adds a mention and usage example for ``formatp`` to hide the status
icon when the battery is full.

Resolves #232.
2016-03-29 09:22:18 -05:00
Erik Johnson
66bc56b7a4 Add reference to weather module to the formatp documentation 2016-03-29 01:14:56 -05:00
Erik Johnson
0ec2bf7b53 Add docs/_build to .gitignore 2016-03-29 01:14:56 -05:00
Erik Johnson
19af608312 Add i3pystatus.weather to packages list 2016-03-29 01:14:56 -05:00
Erik Johnson
f3f2b59c5b Rework wunderground module as a backend of i3pystatus.weather 2016-03-29 01:14:56 -05:00
Erik Johnson
abf5b6ad1c update docs for weathercom 2016-03-29 01:14:56 -05:00
Erik Johnson
c32e458514 Rework weather.com
This alters the weather.com forecast code such that it is a backend for
the new generalized weather module.
2016-03-29 01:14:56 -05:00
Erik Johnson
099ddc795c Rename weather.py to weathercom.py
With the addition of wunderground.py, this makes the naming of this
module less general.
2016-03-29 01:14:56 -05:00
Erik Johnson
7f5338d772 Move weather.py, wunderground.py to i3pystatus.weather 2016-03-29 01:14:56 -05:00
Erik Johnson
f0d19aacec Initial commit of general weather module 2016-03-29 01:14:56 -05:00
Erik Johnson
dbfa267236 Link to weather backends 2016-03-29 01:14:56 -05:00
Erik Johnson
8d1646e92c Add myself to CONTRIBUTORS 2016-03-29 01:14:56 -05:00
Erik Johnson
3c955ac897 Use ob_url instead of forecast_url, it is more accurate 2016-03-29 01:14:56 -05:00
Erik Johnson
048fd8f83d Add link to PWS stations 2016-03-29 01:14:56 -05:00
Erik Johnson
23747d8181 Add wunderground module
This module tries to use as much of the same variable naming conventions
that the ``weather`` module uses as possible, to make transitioning
easier in the future in case we decide to make a base class for all
modules which provide weather data.

An API key is required to use this module, information on obtaining one
can be found in the docstring.
2016-03-29 01:14:56 -05:00
Mathis FELARDOS
38c56616d8 ping: add ping module
This module allow an user to display the current ping value between
himself and another host. It can be useful for:

* Testing your connection all the time
* Checking if one of your server is alive

Signed-off-by: Mathis FELARDOS <mathis.felardos@gmail.com>
2016-03-28 16:07:57 +02:00
enkore
9e3e7a6bc6 Merge pull request #345 from facetoe/pulseaudio-sinks
Fix sink selection bug.
2016-03-28 09:29:26 +02:00
facetoe
b111fd62f1 Clean up code. 2016-03-28 08:46:25 +08:00
enkore
f8c5fdbf45 Merge pull request #346 from facetoe/praw-updates
Disable update check that breaks everything
2016-03-27 11:21:36 +02:00
facetoe
0c17b6f435 Disable update check that breaks everything 2016-03-27 12:16:15 +08:00
facetoe
3422469df0 Fix sink selection bug.
A sink in the SUSPENDED state would never be selected. Not sure if this
solution is correct...
2016-03-27 09:58:45 +08:00
enkore
cf8ae97a43 Merge pull request #341 from grimpy/nowplaying_activatable
Now Playing: Check for mpris service in activatable services
2016-03-26 21:25:51 +01:00
enkore
e60051bdc5 Merge pull request #342 from terminalmage/updates-color
Change color_no_updates to None to default to i3bar color
2016-03-26 21:25:28 +01:00
enkore
832061c426 Merge pull request #343 from rscholer/dpms_format
dpms: Allow a different format string when DPMS is disabled.
2016-03-26 21:22:59 +01:00
enkore
a645bb74eb Merge pull request #340 from grimpy/pulse_auto_sink
Pulseaudio: Display/control active sink
2016-03-26 21:22:16 +01:00
enkore
8400d1a53a Merge pull request #339 from hasB4K/pullrequest-mouse_pos
core: Change command_endpoint and on_click for supporting i3bar mouse positions
2016-03-26 21:20:44 +01:00
Mathis FELARDOS
f26a9f9d1d core: Improve the support of other button
* This commit fix #259
* Change 'unhandled' callback by 'other'
* Add the an optional parameter 'button_id' for all callbacks

Signed-off-by: Mathis FELARDOS <mathis.felardos@gmail.com>
2016-03-25 22:27:33 +01:00
Raphael Scholer
bf71e78e23 dpms: Allow a different format string when DPMS is disabled.
Substitution of {status} is still possible, for backwards compatibility.
2016-03-25 18:05:42 +01:00
Erik Johnson
4867afeda1 Change color_no_updates to None to default to i3bar color
If ``statusline`` is not set in ``~/.config/i3/config``, it defaults to
``#ffffff`` (white). Therefore, the default behavior of the updates
module in this case is to show white for both ``color_no_updates``
(system is up-to-date) and ``color_working`` (update check in progress).

However, if one sets ``statusline`` in their ``~/.config/i3/config``,
then the color will be white when the system is up-to-date, forcing the
user to manually set ``color_no_updates`` if they would prefer it match
their default i3bar color.

This commit changes the default value of ``color_no_updates`` to
``None`` so that it matches the default i3bar unless overridden.
2016-03-25 00:29:19 -05:00
Mathis FELARDOS
95f625cd6b core: Add the middle click support and unhandled button support
* This commit fix #259
* Support of middle click button
* Add an unhandled click events for all button that will not be handled
* Remove the return type of on_click: it became useless now
* Fix the unique call of on_click in CommandEndpoint

Signed-off-by: Mathis FELARDOS <mathis.felardos@gmail.com>
2016-03-25 04:32:29 +01:00
Jo De Boeck
6161d591d2 Now Playing: Check for mpris service in activatable services 2016-03-24 21:25:27 +02:00
Jo De Boeck
b711ba96ed Pulseaudio: Display/control active sink
Make sink a property which checks which sink is currently active.
Use pactl to control volumes which gets standard insalled with libpulse
which is already a requirement.
2016-03-23 20:46:04 +02:00
Mathis FELARDOS
98e8a1cc04 core: handle callbacks that are not functions on Python 3.3
* Fix inspect.getargspec issue for non functions callbacks by creating
  an empty ArgSpec. There for we ignore all kwargs parameters.

Signed-off-by: Mathis FELARDOS <mathis.felardos@gmail.com>
2016-03-23 10:14:20 +01:00
Mathis FELARDOS
d15b3173f1 core: Change command_endpoint and on_click for supporting i3bar mouse positions
* command_endpoint: get the position from the mouse when the click
  occured. Parameters names are set here: pos_x pos_y.
  Positions are passed to on_click through keyword arguments.
* Module:
  - change __log_button_event, __button_callback_handler and on_click
    methods for handling keyword arguments.
  - "Member", "Method" and "Python" callbacks are handled by detecting
    if they have pos_x or pos_y as parameters, or if they have a
    keyword arguments. The special case of wrapped callbacks (made with
    get_module decorator for example) is handled in a similar way.
  - "External command" is handled by considering the position as a
    format dictionary. Actually no distinctions are made of how
    self.data and the new keyword argument are treated on this.
  - the parameter kwargs as been added to the doc string of on_click.
* MultiClickHandler: now handle keyword arguments.

Signed-off-by: Mathis FELARDOS <mathis.felardos@gmail.com>
2016-03-23 08:36:11 +01:00