diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2014-12-30 10:45:46 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2014-12-30 10:45:46 +0100 |
| commit | d2acf830167fc8a04827741e46a647854caea7d0 (patch) | |
| tree | 98a42cac8a8022797078e6b8ff4e3412453886c9 | |
| parent | b55f546bf6e2d7584ec988534c0be31baf5a5bc4 (diff) | |
handle i3status volume module guessing thx to @btall
| -rwxr-xr-x | py3status/__init__.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/py3status/__init__.py b/py3status/__init__.py index 7a110a9..1dd0001 100755 --- a/py3status/__init__.py +++ b/py3status/__init__.py @@ -580,6 +580,22 @@ class Events(Thread): ): instance = k.split(' ', 1)[1] break + + # volume default.Master.0 + elif name == 'volume': + device, mixer, mixer_idx = instance.split('.') + for k, v in self.i3s_config.items(): + if ( + k.startswith('volume') + and isinstance(v, dict) + and v.get('device') == device + and v.get('mixer') == mixer + and str(v.get('mixer_idx')) == mixer_idx + ): + instance = k.split(' ', 1)[1] + break + else: + instance = 'master' except: pass finally: |
