aboutsummaryrefslogtreecommitdiff
path: root/hardinfo/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'hardinfo/info.c')
-rw-r--r--hardinfo/info.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/hardinfo/info.c b/hardinfo/info.c
index 6209bc69..c54775ed 100644
--- a/hardinfo/info.c
+++ b/hardinfo/info.c
@@ -160,7 +160,7 @@ void info_set_reload_interval(struct Info *info, int setting)
info->reload_interval = setting;
}
-static void flatten_group(GString *output, const struct InfoGroup *group)
+static void flatten_group(GString *output, const struct InfoGroup *group, guint group_count)
{
guint i;
@@ -173,6 +173,9 @@ static void flatten_group(GString *output, const struct InfoGroup *group)
field = g_array_index(group->fields, struct InfoField, i);
+ if (field.icon)
+ g_string_append_printf(output, "$ITEM%d-%d$", group_count, i);
+
g_string_append_printf(output, "%s=%s\n", field.name, field.value);
if (field.free_value_on_flatten)
@@ -183,7 +186,7 @@ static void flatten_group(GString *output, const struct InfoGroup *group)
}
}
-static void flatten_shell_param(GString *output, const struct InfoGroup *group)
+static void flatten_shell_param(GString *output, const struct InfoGroup *group, guint group_count)
{
guint i;
@@ -199,6 +202,11 @@ static void flatten_shell_param(GString *output, const struct InfoGroup *group)
g_string_append_printf(output, "UpdateInterval$%s=%d\n",
field.name, field.update_interval);
}
+
+ if (field.icon) {
+ g_string_append_printf(output, "Icon$ITEM%d-%d$=%s\n",
+ group_count, i, field.icon);
+ }
}
}
@@ -247,8 +255,8 @@ gchar *info_flatten(struct Info *info)
struct InfoGroup group =
g_array_index(info->groups, struct InfoGroup, i);
- flatten_group(values, &group);
- flatten_shell_param(shell_param, &group);
+ flatten_group(values, &group, i);
+ flatten_shell_param(shell_param, &group, i);
if (group.fields)
g_array_free(group.fields, TRUE);