Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Pol Rivero
2025-02-06 12:19:57 +01:00
4 changed files with 30 additions and 12 deletions

6
flake.lock generated
View File

@ -18,11 +18,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1735471104,
"narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=",
"lastModified": 1738142207,
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4",
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
"type": "github"
},
"original": {

View File

@ -59,9 +59,9 @@ Addressed by *hyprland/language*
```
"hyprland/language": {
"format": "Lang: {long}"
"format-en": "AMERICA, HELL YEAH!"
"format-tr": "As bayrakları"
"format": "Lang: {long}",
"format-en": "AMERICA, HELL YEAH!",
"format-tr": "As bayrakları",
"keyboard-name": "at-translated-set-2-keyboard"
}
```

View File

@ -56,18 +56,35 @@ auto Window::update() -> void {
windowData_.title = windowName;
std::string label_text;
if (!format_.empty()) {
label_.show();
label_.set_markup(waybar::util::rewriteString(
label_text = waybar::util::rewriteString(
fmt::format(fmt::runtime(format_), fmt::arg("title", windowName),
fmt::arg("initialTitle", windowData_.initial_title),
fmt::arg("class", windowData_.class_name),
fmt::arg("initialClass", windowData_.initial_class_name)),
config_["rewrite"]));
config_["rewrite"]);
label_.set_markup(label_text);
} else {
label_.hide();
}
if (tooltipEnabled()) {
std::string tooltip_format;
if (config_["tooltip-format"].isString()) {
tooltip_format = config_["tooltip-format"].asString();
}
if (!tooltip_format.empty()) {
label_.set_tooltip_text(fmt::format(fmt::runtime(tooltip_format), fmt::arg("title", windowName),
fmt::arg("initialTitle", windowData_.initial_title),
fmt::arg("class", windowData_.class_name),
fmt::arg("initialClass", windowData_.initial_class_name)));
} else if (!label_text.empty()){
label_.set_tooltip_text(label_text);
}
}
if (focused_) {
image_.show();
} else {

View File

@ -358,10 +358,12 @@ void UPower::resetDevices() {
void UPower::setDisplayDevice() {
std::lock_guard<std::mutex> guard{mutex_};
if (nativePath_.empty() && model_.empty()) {
// Unref current upDevice
if (upDevice_.upDevice != NULL) g_object_unref(upDevice_.upDevice);
if (upDevice_.upDevice != NULL) {
g_object_unref(upDevice_.upDevice);
upDevice_.upDevice = NULL;
}
if (nativePath_.empty() && model_.empty()) {
upDevice_.upDevice = up_client_get_display_device(upClient_);
getUpDeviceInfo(upDevice_);
} else {
@ -386,7 +388,6 @@ void UPower::setDisplayDevice() {
}
// Unref current upDevice if it exists
if (displayDevice.upDevice != NULL) {
if (thisPtr->upDevice_.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);
thisPtr->upDevice_ = displayDevice;
}
},