diff options
Diffstat (limited to 'modules/current-title.py')
| -rw-r--r-- | modules/current-title.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/modules/current-title.py b/modules/current-title.py index f995752..16248d1 100644 --- a/modules/current-title.py +++ b/modules/current-title.py @@ -33,15 +33,12 @@ def find_focused(tree): class Py3status: def currentTitle(self, json, i3status_config): - response = { - 'full_text': 'error', - 'name': 'current-title', - 'cached_until': time.time() + CACHED_TIME - } - window = find_focused(i3.get_tree()) if window and "name" in window: - response["full_text"] = len(window["name"]) > MAX_WIDTH and "..." + window["name"][-(MAX_WIDTH-3):] or window["name"] + text = len(window["name"]) > MAX_WIDTH and "..." + window["name"][-(MAX_WIDTH-3):] or window["name"] - return (0, response) + return (0, {'full_text': text, + 'name': 'current-title', + 'cached_until': time.time() + CACHED_TIME, + }) |
