Update pulseaudio.cpp
This commit is contained in:
parent
82d0c87934
commit
543589a97b
|
@ -200,21 +200,23 @@ const std::string waybar::modules::Pulseaudio::getPortIcon() const {
|
||||||
|
|
||||||
auto waybar::modules::Pulseaudio::update() -> void {
|
auto waybar::modules::Pulseaudio::update() -> void {
|
||||||
auto format = format_;
|
auto format = format_;
|
||||||
std::string format_name = "format";
|
if (!alt_) {
|
||||||
if (monitor_.find("a2dp_sink") != std::string::npos) {
|
std::string format_name = "format";
|
||||||
format_name = format_name + "-bluetooth";
|
if (monitor_.find("a2dp_sink") != std::string::npos) {
|
||||||
label_.get_style_context()->add_class("bluetooth");
|
format_name = format_name + "-bluetooth";
|
||||||
} else {
|
label_.get_style_context()->add_class("bluetooth");
|
||||||
label_.get_style_context()->remove_class("bluetooth");
|
} else {
|
||||||
|
label_.get_style_context()->remove_class("bluetooth");
|
||||||
|
}
|
||||||
|
if (muted_ ) {
|
||||||
|
format_name = format_name + "-muted";
|
||||||
|
label_.get_style_context()->add_class("muted");
|
||||||
|
} else {
|
||||||
|
label_.get_style_context()->remove_class("muted");
|
||||||
|
}
|
||||||
|
format =
|
||||||
|
config_[format_name].isString() ? config_[format_name].asString() : format;
|
||||||
}
|
}
|
||||||
if (muted_ ) {
|
|
||||||
format_name = format_name + "-muted";
|
|
||||||
label_.get_style_context()->add_class("muted");
|
|
||||||
} else {
|
|
||||||
label_.get_style_context()->remove_class("muted");
|
|
||||||
}
|
|
||||||
format =
|
|
||||||
config_[format_name].isString() ? config_[format_name].asString() : format;
|
|
||||||
// TODO: find a better way to split source/sink
|
// TODO: find a better way to split source/sink
|
||||||
std::string format_source = "{volume}%";
|
std::string format_source = "{volume}%";
|
||||||
if (source_muted_ && config_["format-source-muted"].isString()) {
|
if (source_muted_ && config_["format-source-muted"].isString()) {
|
||||||
|
|
Loading…
Reference in New Issue