diff --git a/bumblebee/modules/progress.py b/bumblebee/modules/progress.py index e111ce9..79396ca 100644 --- a/bumblebee/modules/progress.py +++ b/bumblebee/modules/progress.py @@ -40,7 +40,7 @@ class Module(bumblebee.engine.Module): ) str_format = self.parameter("format", '{bar} {cmd} {arg}') - return " " + str_format.format( + return str_format.format( bar = bar, pid = widget.get("pid"), cmd = widget.get("cmd"), @@ -54,6 +54,8 @@ class Module(bumblebee.engine.Module): return self.parameter("placeholder", 'n/a') def update_progress_info(self, widget): + """Update widget's informations about the copy""" + # These regex extracts following groups: # 1. pid # 2. command @@ -89,3 +91,13 @@ class Module(bumblebee.engine.Module): except Exception: return False + def state(self, widget): + if self._active(): + return "copying" + return "pending" + + def _active(self): + """Checks wether a copy is running or not""" + raw = bumblebee.util.execute("progress -q") + return bool(raw) + diff --git a/themes/icons/awesome-fonts.json b/themes/icons/awesome-fonts.json index 4d43115..699ab21 100644 --- a/themes/icons/awesome-fonts.json +++ b/themes/icons/awesome-fonts.json @@ -138,5 +138,8 @@ }, "taskwarrior": { "prefix": "  " + }, + "progress": { + "copying": { "prefix": "" } } }