subprocess.Popen() does not implicitly wait() on the child process.
This leads to transient zombie pactl processes which are only reaped
as new processes are spawned.
Use synchronous subprocess communication to collect child process
return codes immediately and allow them to exit.
Tonight's game was the first time I've seen the API return from a
suspended game. I added a separate format option for it.
I've also fixed date/time detection. The API returns different fields for if
a game ended after midnight eastern, and also different ones when a game
is suspended.
Volume changes may occur externally (e.g. through pactl bound to media
keys) or through mouse interaction. The new volume is received
asynchronously but can only be outputted at the next status poll,
causing a small delay.
Introduce Module.send_output() to allow a module to send its output
without delay. Invoke this method in the Pulseaudio sink info callback.
I had added this to be able to use a different icon for thunderstorms,
which were at the time not even being detected as a weather condition
and were just falling back to the default (i.e. no colorization nor
icon). However, the only thunder/lightning unicode icon that is widely
available is too tall, leading to the entire module's text being
vertically-aligned on a different plane from the rest of the modules in
the status bar.
This commit changes the default icon to the same one used for "Rainy"
conditions, while preserving it as a distinct weather type so that
others can still use their own icon if they so choose.
During the offseason, the context URL which provides params used to
locate information on a given game redirects to the EPL mainpage.
This commit properly catches these cases, and also adds some helpful
logging to the ScoresBackend api_request() function.
Notification summary shows the count
Notification icon is `software-update-available`
notif_body concatenates raw or prepared output from all backends
Backends that don't yet output to notif_body should have harmless empty string
Also, linted according to flake8
Corrected typo
Nothing in imap mail backend reinit the imap connection
when this one is lost, and then the backend always output "socket.error:..."
This change fixes that by cleanup the connection object when
connection is lost so get_connection() will recreate a new one.
This also remove the unless utils.internet() checks already done by
Mail().run()
The win/loss values from the NHL data feed reset in the playoffs, but
don't reflect the current series. Instead, they reflect the current
win/loss total since the beginning of the playoffs.
This commit checks for a key in the API return data indicating that the
game is a playoff game, and if the game is a playoff game the team's
wins will be set to the remainder of the total wins divided by 4 (a team
with 6 overall wins will be assumed to have 2 wins in the current
playoff series).
The team's losses during a playoff series will be set to the amount of
wins for the opposing team.
On timer start timezone is provided to `datetime.now()` call, but on refresh is not.
That cause a bug with wrong time difference (it include timezone diff). Didn't
dig deep enough to figure out why there is inconsistency with timezones so just
pin timezone info as it's not useful anyway.
This module will display the current open file handles and the kernel
setting for max open file handles. This is particularly useful when
running applications that like to grab a lot of file handles to help
monitor if/when your system may run out of available file handles.
This properly colorizes when there is a thunderstorm and the weather.com
API response defines the current weather condition as "T-Storm". No idea
why they decide to do this, it's definitely not for brevity as they have
a "Thunderstorms in the Vicinity" weather condition as well. Just a
weird quirk of their API, I guess.
* 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
* 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
* 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"
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.
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>
* 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>
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.
* 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>
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.
* 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>
* 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>
When a backend-specific formatter (i.e. ``{Pacman}``, ``{Cower}``, etc.)
is used, and the initial "working" status is set, the loop in which the
update totals is compiled has not yet run, leading to a KeyError.
This commit fixes the traceback by setting initial values of "?" for
these formatters before the initial "working" status is set.
This last.fm module will report to the status bar the current track that
is being played. Last.fm requires an API key for access to their APIs,
so the user must provide their own API key which can be easily obtained
for free from http://www.last.fm/api/.
This module provides support for Syncthing [1]. Currently this module
only supports showing the up/down status of Syncthing and it is possible
to start/shutdown Syncthing via click events. A few callback functions
for usage with/without systemd are provided as well.
The module is designed in a generic way (st_get(), st_post()), such that
new features could be add very easily.
[1]: https://syncthing.net