def __init__(self, **config): Volume.__init__(self, **config) self.add_defaults(PulseVolume.defaults) self.connected = None self._subscribed = False self.default_sink_name = None self.default_sink = None self.handle = ffi.new_handle(self) self.client_name = ffi.new('char[]', b'Qtile-pulse') self.connect()
def __init__(self, **config): _Volume.__init__(self, **config) self.add_defaults(_Volume.defaults) self.volume = None if self.theme_path: self.length_type = bar.STATIC self.length = 0 self.surfaces = {} self.current_icon = 'volume_off' self.icons = dict([(x, '{0}.png'.format(x)) for x in ( 'volume_down', 'volume_up', 'volume_off', 'volume_mute', )])
def widget_volume(self) -> list[_Widget]: """Widget for displaying the volume. Requirements ------------ - pamixer Returns ------- list[libqtile.widget.base._Widget] The list of widgets. """ # Widget for volume widget_volume = Volume( **self.fonts["Normal"], # Colors foreground=self.colors["cyan"], background=self.colors["background"], # Volume command get_volume_command="/home/juanscr/.config/qtile/" + "get_volume_qtile.sh", mute_command="pamixer -t", volume_down_command="pamixer -d 5", volume_up_command="pamixer -i 5", ) # Icon for volume icon_volume = TextBox(**self.fonts["Icons2"], foreground=self.colors["cyan"], text="", padding=8) return [icon_volume, widget_volume]
), Spacer(length=5, background=gruvbox['blue']), Net(background=gruvbox['blue'], format='{down} ↓↑ {up}'), Spacer(length=5, background=gruvbox['blue']), Spacer( length=1, background=gruvbox['fg'], ), # Volume Spacer( length=1, background=gruvbox['fg'], ), Spacer(length=5, background=gruvbox['green']), Volume(background=gruvbox['green']), Spacer(length=5, background=gruvbox['green']), Spacer( length=1, background=gruvbox['fg'], ), #---------------------------- # Date and Time Spacer( length=1, background=gruvbox['fg'], ), Spacer( length=5, background=gruvbox['cyan'],
def button_press(self, x, y, button): Volume.button_press(self, x, y, button) self.poll()
def finalize(self): lib.pa_context_disconnect(self.context) lib.pa_mainloop_quit(self.loop, 1) lib.pa_context_unref(self.context) lib.pa_mainloop_free(self.loop) Volume.finalize(self)