add icon-name

This commit is contained in:
Aylur
2024-07-03 16:12:59 +02:00
parent 952e7331ab
commit c3c807c7e7
+7
View File
@@ -43,6 +43,8 @@ public class PowerProfiles : Object {
var map = (HashTable<string, Variant>)props;
foreach (var key in map.get_keys()) {
notify_property(kebab_case(key));
if (key == "ActiveProfile")
notify_property("icon-name");
}
});
} catch (Error error){
@@ -55,6 +57,10 @@ public class PowerProfiles : Object {
set { proxy.active_profile = value; }
}
public string icon_name {
owned get { return @"power-profile-$active_profile-symbolic"; }
}
public string[] actions {
owned get { return proxy.actions.copy(); }
}
@@ -153,6 +159,7 @@ public class PowerProfiles : Object {
return Json.to_string(new Json.Builder()
.begin_object()
.set_member_name("active_profile").add_string_value(active_profile)
.set_member_name("icon_name").add_string_value(icon_name)
.set_member_name("performance_degraded").add_string_value(performance_degraded)
.set_member_name("performance_inhibited").add_string_value(performance_inhibited)
.set_member_name("actions").add_value(acts.end_array().get_root())