Merge remote-tracking branch 'upstream/master'
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@ -18,11 +18,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735471104,
|
"lastModified": 1738142207,
|
||||||
"narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=",
|
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4",
|
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -59,9 +59,9 @@ Addressed by *hyprland/language*
|
|||||||
|
|
||||||
```
|
```
|
||||||
"hyprland/language": {
|
"hyprland/language": {
|
||||||
"format": "Lang: {long}"
|
"format": "Lang: {long}",
|
||||||
"format-en": "AMERICA, HELL YEAH!"
|
"format-en": "AMERICA, HELL YEAH!",
|
||||||
"format-tr": "As bayrakları"
|
"format-tr": "As bayrakları",
|
||||||
"keyboard-name": "at-translated-set-2-keyboard"
|
"keyboard-name": "at-translated-set-2-keyboard"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -56,18 +56,35 @@ auto Window::update() -> void {
|
|||||||
|
|
||||||
windowData_.title = windowName;
|
windowData_.title = windowName;
|
||||||
|
|
||||||
|
std::string label_text;
|
||||||
if (!format_.empty()) {
|
if (!format_.empty()) {
|
||||||
label_.show();
|
label_.show();
|
||||||
label_.set_markup(waybar::util::rewriteString(
|
label_text = waybar::util::rewriteString(
|
||||||
fmt::format(fmt::runtime(format_), fmt::arg("title", windowName),
|
fmt::format(fmt::runtime(format_), fmt::arg("title", windowName),
|
||||||
fmt::arg("initialTitle", windowData_.initial_title),
|
fmt::arg("initialTitle", windowData_.initial_title),
|
||||||
fmt::arg("class", windowData_.class_name),
|
fmt::arg("class", windowData_.class_name),
|
||||||
fmt::arg("initialClass", windowData_.initial_class_name)),
|
fmt::arg("initialClass", windowData_.initial_class_name)),
|
||||||
config_["rewrite"]));
|
config_["rewrite"]);
|
||||||
|
label_.set_markup(label_text);
|
||||||
} else {
|
} else {
|
||||||
label_.hide();
|
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_) {
|
if (focused_) {
|
||||||
image_.show();
|
image_.show();
|
||||||
} else {
|
} else {
|
||||||
|
@ -358,10 +358,12 @@ void UPower::resetDevices() {
|
|||||||
void UPower::setDisplayDevice() {
|
void UPower::setDisplayDevice() {
|
||||||
std::lock_guard<std::mutex> guard{mutex_};
|
std::lock_guard<std::mutex> guard{mutex_};
|
||||||
|
|
||||||
if (nativePath_.empty() && model_.empty()) {
|
if (upDevice_.upDevice != NULL) {
|
||||||
// Unref current upDevice
|
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_);
|
upDevice_.upDevice = up_client_get_display_device(upClient_);
|
||||||
getUpDeviceInfo(upDevice_);
|
getUpDeviceInfo(upDevice_);
|
||||||
} else {
|
} else {
|
||||||
@ -386,7 +388,6 @@ void UPower::setDisplayDevice() {
|
|||||||
}
|
}
|
||||||
// Unref current upDevice if it exists
|
// Unref current upDevice if it exists
|
||||||
if (displayDevice.upDevice != NULL) {
|
if (displayDevice.upDevice != NULL) {
|
||||||
if (thisPtr->upDevice_.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);
|
|
||||||
thisPtr->upDevice_ = displayDevice;
|
thisPtr->upDevice_ = displayDevice;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user