Merge branch 'Alexays:master' into hyprland/windowcount
This commit is contained in:
@ -18,6 +18,9 @@ namespace waybar::modules::hyprland {
|
||||
std::filesystem::path IPC::socketFolder_;
|
||||
|
||||
std::filesystem::path IPC::getSocketFolder(const char* instanceSig) {
|
||||
static std::mutex folderMutex;
|
||||
std::unique_lock lock(folderMutex);
|
||||
|
||||
// socket path, specified by EventManager of Hyprland
|
||||
if (!socketFolder_.empty()) {
|
||||
return socketFolder_;
|
||||
|
||||
@ -191,12 +191,6 @@ void Window::queryActiveWorkspace() {
|
||||
solo_ = true;
|
||||
}
|
||||
|
||||
// Grouped windows have a tab bar and therefore don't look fullscreen or solo
|
||||
if (windowData_.grouped) {
|
||||
fullscreen_ = false;
|
||||
solo_ = false;
|
||||
}
|
||||
|
||||
if (solo_) {
|
||||
soloClass_ = windowData_.class_name;
|
||||
} else {
|
||||
|
||||
@ -69,12 +69,17 @@ auto waybar::modules::Temperature::update() -> void {
|
||||
uint16_t temperature_f = std::round(temperature * 1.8 + 32);
|
||||
uint16_t temperature_k = std::round(temperature + 273.15);
|
||||
auto critical = isCritical(temperature_c);
|
||||
auto warning = isWarning(temperature_c);
|
||||
auto format = format_;
|
||||
if (critical) {
|
||||
format = config_["format-critical"].isString() ? config_["format-critical"].asString() : format;
|
||||
label_.get_style_context()->add_class("critical");
|
||||
} else {
|
||||
} else if (warning) {
|
||||
format = config_["format-warning"].isString() ? config_["format-warning"].asString() : format;
|
||||
label_.get_style_context()->add_class("warning");
|
||||
} else {
|
||||
label_.get_style_context()->remove_class("critical");
|
||||
label_.get_style_context()->remove_class("warning");
|
||||
}
|
||||
|
||||
if (format.empty()) {
|
||||
@ -135,7 +140,12 @@ float waybar::modules::Temperature::getTemperature() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool waybar::modules::Temperature::isWarning(uint16_t temperature_c) {
|
||||
return config_["warning-threshold"].isInt() &&
|
||||
temperature_c >= config_["warning-threshold"].asInt();
|
||||
}
|
||||
|
||||
bool waybar::modules::Temperature::isCritical(uint16_t temperature_c) {
|
||||
return config_["critical-threshold"].isInt() &&
|
||||
temperature_c >= config_["critical-threshold"].asInt();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user