diff options
Diffstat (limited to 'modules/current-title.py')
| -rw-r--r-- | modules/current-title.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/current-title.py b/modules/current-title.py index 1f0822d..d8cf383 100644 --- a/modules/current-title.py +++ b/modules/current-title.py @@ -15,6 +15,7 @@ CONFIG: If payload from server contains wierd utf-8 (for example one window have something bad in title) - plugin will give empty output UNTIL this window will be closed. I can't fix or workaround that in PLUGIN, problem is in i3-py library. """ +POSITION = 0 MAX_WIDTH = 120 CACHED_TIME = 0.5 @@ -36,7 +37,7 @@ class Py3status: self.text = "" super(Py3status).__init__(*args, **kwargs) - def currentTitle(self, json, i3status_config): + def currentTitle(self, i3_status_output_json, i3status_config): window = find_focused(i3.get_tree()) transformed = False @@ -44,8 +45,9 @@ class Py3status: self.text = len(window["name"]) > MAX_WIDTH and "..." + window["name"][-(MAX_WIDTH-3):] or window["name"] transformed = True - return (0, {'full_text': self.text, - 'transformed': transformed, - 'name': 'current-title', - 'cached_until': time.time() + CACHED_TIME, - }) + return (POSITION, { + 'full_text': self.text, + 'transformed': transformed, + 'name': 'current-title', + 'cached_until': time.time() + CACHED_TIME, + }) |
