diff --git a/CHANGELOG b/CHANGELOG index fe5ac340..d6e88930 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ -2024-09-29: [RELEASE] v0.23.0 released - compatible with qtile 0.23.0 +2023-10-01: [BREAKING CHANGE] Update `PulseVolume` and `PulseVolumeExtra` to reflect updates pushed to qtile. + Needs latest qtile git version. +2023-09-29: [RELEASE] v0.23.0 released - compatible with qtile 0.23.0 2023-09-18: [FEATURE] Add experimental support for `GlobalMenu` in Wayland. 2023-09-17: [TESTS] Check decorations are rendered correctly during test suite 2023-09-16: [FEATURE] Add more popup templates for `Mpris2` widget diff --git a/qtile_extras/widget/pulse_extra.py b/qtile_extras/widget/pulse_extra.py index 30a184dd..e711b81c 100644 --- a/qtile_extras/widget/pulse_extra.py +++ b/qtile_extras/widget/pulse_extra.py @@ -53,37 +53,10 @@ def __init__(self, **config): _Volume.__init__(self, **config) self._variable_defaults = {**defaults, **self._variable_defaults} - # We need a flag to ensure we only try to connect to the Pulse server once - self._connection_requested = False - def _configure(self, qtile, bar): PulseVolume._configure(self, qtile, bar) _Volume._configure(self, qtile, bar) - async def _config_async(self): - if not self._connection_requested: - self._connection_requested = True - await PulseVolume._config_async(self) - - def update(self): - """Modified version of PulseVolume.update to set variables.""" - length = self.length - - if not self.pulse.connected or not self.default_sink: - vol = -1 - mute = False - else: - vol = self.get_volume() - mute = self.default_sink.mute - if vol != self.volume or mute != self.muted: - self.volume = vol - self.muted = mute - self.hidden = False - if length == self.length: - self.draw() - else: - self.bar.draw() - @expose_command() def volume_up(self, value=None): """Increase volume.""" @@ -94,4 +67,9 @@ def volume_down(self, value=None): """Decrease volume.""" self.decrease_vol(value) - get_volume = PulseVolume.get_volume + def no_op(self): + pass + + get_vals = _Volume.status_change + set_refresh_timer = no_op + refresh = no_op diff --git a/qtile_extras/widget/pulse_volume.py b/qtile_extras/widget/pulse_volume.py index 9af0a6f8..38095b7d 100644 --- a/qtile_extras/widget/pulse_volume.py +++ b/qtile_extras/widget/pulse_volume.py @@ -21,6 +21,7 @@ from libqtile.command.base import expose_command from libqtile.utils import create_task from libqtile.widget.pulse_volume import PulseVolume as QPulseVolume +from libqtile.widget.pulse_volume import pulse from qtile_extras.popup.menu import PopupMenuItem from qtile_extras.widget.mixins import MenuMixin @@ -43,16 +44,16 @@ def __init__(self, **config): self.add_callbacks({"Button2": self.select_sink}) async def set_sink(self, sink): - if not self.pulse.connected: + if not pulse.pulse.connected: return - await self.pulse.default_set(sink) + await pulse.pulse.default_set(sink) async def show_sinks(self): - if not self.pulse.connected: + if not pulse.pulse.connected: return - sinks = await self.pulse.sink_list() + sinks = await pulse.pulse.sink_list() if not sinks: return