Add color settings for muted/unmuted to pulseaudio plugin
This commit is contained in:
parent
5470d7460c
commit
16c6979ca9
@ -988,6 +988,8 @@ Settings:
|
|||||||
:format_muted: optional format string to use when muted (default: ``None``)
|
:format_muted: optional format string to use when muted (default: ``None``)
|
||||||
:muted: (default: ``M``)
|
:muted: (default: ``M``)
|
||||||
:unmuted: (default: ````)
|
:unmuted: (default: ````)
|
||||||
|
:color_muted: (default: ``#FF0000``)
|
||||||
|
:color_unmuted: (default: ``#FFFFFF``)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,13 +18,16 @@ class PulseAudio(Module):
|
|||||||
settings = (
|
settings = (
|
||||||
"format",
|
"format",
|
||||||
("format_muted", "optional format string to use when muted"),
|
("format_muted", "optional format string to use when muted"),
|
||||||
"muted", "unmuted"
|
"muted", "unmuted",
|
||||||
|
"color_muted", "color_unmuted"
|
||||||
)
|
)
|
||||||
|
|
||||||
muted = "M"
|
muted = "M"
|
||||||
unmuted = ""
|
unmuted = ""
|
||||||
format = "♪: {volume}"
|
format = "♪: {volume}"
|
||||||
format_muted = None
|
format_muted = None
|
||||||
|
color_muted = "#FF0000"
|
||||||
|
color_unmuted = "#FFFFFF"
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
"""Creates context, when context is ready context_notify_cb is called"""
|
"""Creates context, when context is ready context_notify_cb is called"""
|
||||||
@ -98,6 +101,7 @@ class PulseAudio(Module):
|
|||||||
volume_db = int(volume_db)
|
volume_db = int(volume_db)
|
||||||
|
|
||||||
muted = self.muted if sink_info.mute else self.unmuted
|
muted = self.muted if sink_info.mute else self.unmuted
|
||||||
|
color = self.color_muted if sink_info.mute else self.color_unmuted
|
||||||
|
|
||||||
if muted and self.format_muted is not None:
|
if muted and self.format_muted is not None:
|
||||||
output_format = self.format_muted
|
output_format = self.format_muted
|
||||||
@ -105,6 +109,7 @@ class PulseAudio(Module):
|
|||||||
output_format = self.format
|
output_format = self.format
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
|
"color": color,
|
||||||
"full_text": output_format.format(
|
"full_text": output_format.format(
|
||||||
muted=muted,
|
muted=muted,
|
||||||
volume=volume_percent,
|
volume=volume_percent,
|
||||||
|
2
setup.py
2
setup.py
@ -3,7 +3,7 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(name="i3pystatus",
|
setup(name="i3pystatus",
|
||||||
version="3.30",
|
version="3.31",
|
||||||
description="Like i3status, this generates status line for i3bar / i3wm",
|
description="Like i3status, this generates status line for i3bar / i3wm",
|
||||||
url="http://github.com/enkore/i3pystatus",
|
url="http://github.com/enkore/i3pystatus",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
|
Loading…
Reference in New Issue
Block a user