Skip to content

Commit

Permalink
Allow disabling notification via format_notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz committed Aug 20, 2018
1 parent c41fc42 commit 6ce5b94
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions py3status/modules/external_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
cache_timeout: how often we refresh this module in seconds
(default 15)
format: see placeholders below (default '{output}')
format_notification: see placeholders below (default '{output}')
localize: should script output be localized (if available)
(default True)
script_path: script you want to show output of (compulsory)
Expand All @@ -23,7 +24,10 @@
Format placeholders:
{line} number of lines in the output
{output} output of script given by "script_path"
{output} first line of the output of script given by "script_path"
Format notification placeholders:
{output} full output of script given by "script_path"
i3status.conf example:
Expand Down Expand Up @@ -92,7 +96,10 @@ def external_script(self):
def on_click(self, event):
button = event["button"]
if button != self.button_refresh:
self.py3.notify_user(self.output)
if self.format_notification:
self.py3.notify_user(self.py3.safe_format(
self.format_notification, {'output': self.output})
)
self.py3.prevent_refresh()

if __name__ == "__main__":
Expand Down

0 comments on commit 6ce5b94

Please sign in to comment.