Fix single string case & docs
This commit is contained in:
parent
dec534ce81
commit
2aeda9c5e3
@ -21,6 +21,8 @@ master branch
|
|||||||
* Log file name is now an option (``logfile`` of :py:class:`.Status`)
|
* Log file name is now an option (``logfile`` of :py:class:`.Status`)
|
||||||
* Server used for checking internet connectivity is now an option (``internet_check`` of :py:class:`.Status`)
|
* Server used for checking internet connectivity is now an option (``internet_check`` of :py:class:`.Status`)
|
||||||
* Added double click support for click events
|
* Added double click support for click events
|
||||||
|
* Formatter data is now available with most modules for program callbacks
|
||||||
|
* Added :py:func:`.util.get_module` for advanced callbacks
|
||||||
* :py:mod:`.dota2wins`: Now accepts usernames in place of a Steam ID
|
* :py:mod:`.dota2wins`: Now accepts usernames in place of a Steam ID
|
||||||
* dota2wins: Changed win percentage to be a float
|
* dota2wins: Changed win percentage to be a float
|
||||||
* :py:mod:`.uptime`: Added days, hours, minutes, secs formatters
|
* :py:mod:`.uptime`: Added days, hours, minutes, secs formatters
|
||||||
|
@ -370,6 +370,18 @@ consider creating an `python callback` or execute a script instead.
|
|||||||
on_rightclick = "firefox --new-window https://github.com/enkore/i3pystatus",
|
on_rightclick = "firefox --new-window https://github.com/enkore/i3pystatus",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Most modules provide all the formatter data to program callbacks. The snippet below
|
||||||
|
demonstrates how this could be used, in this case XMessage will display a dialog box
|
||||||
|
showing verbose information about the network interface:
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
status.register("network",
|
||||||
|
interface="eth0",
|
||||||
|
on_leftclick="ip addr show dev {interface} | xmessage -file -"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
.. _hints:
|
.. _hints:
|
||||||
|
|
||||||
Hints
|
Hints
|
||||||
|
@ -104,6 +104,7 @@ class Module(SettingsBase):
|
|||||||
self.__log_button_event(button, cb, args, "External command")
|
self.__log_button_event(button, cb, args, "External command")
|
||||||
if hasattr(self, "data"):
|
if hasattr(self, "data"):
|
||||||
args = [arg.format(**self.data) for arg in args]
|
args = [arg.format(**self.data) for arg in args]
|
||||||
|
cb = cb.format(**self.data)
|
||||||
execute(cb + " " + " ".join(args), detach=True)
|
execute(cb + " " + " ".join(args), detach=True)
|
||||||
|
|
||||||
# Notify status handler
|
# Notify status handler
|
||||||
|
Loading…
Reference in New Issue
Block a user