summaryrefslogtreecommitdiffstats
path: root/panels/info-overview
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:45:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:45:20 +0000
commitae1c76ff830d146d41e88d6fba724c0a54bce868 (patch)
tree3c354bec95af07be35fc71a4b738268496f1a1c4 /panels/info-overview
parentInitial commit. (diff)
downloadgnome-control-center-ae1c76ff830d146d41e88d6fba724c0a54bce868.tar.xz
gnome-control-center-ae1c76ff830d146d41e88d6fba724c0a54bce868.zip
Adding upstream version 1:43.6.upstream/1%43.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'panels/info-overview')
-rw-r--r--panels/info-overview/cc-info-overview-panel.c993
-rw-r--r--panels/info-overview/cc-info-overview-panel.h31
-rw-r--r--panels/info-overview/cc-info-overview-panel.ui232
-rw-r--r--panels/info-overview/gnome-control-center-print-renderer.c65
-rw-r--r--panels/info-overview/gnome-info-overview-panel.desktop.in.in22
-rw-r--r--panels/info-overview/gnome-logo-text-dark.svg137
-rw-r--r--panels/info-overview/gnome-logo-text.svg134
-rw-r--r--panels/info-overview/icons/meson.build4
-rw-r--r--panels/info-overview/icons/scalable/org.gnome.Settings-about-symbolic.svg4
-rw-r--r--panels/info-overview/info-cleanup.c130
-rw-r--r--panels/info-overview/info-cleanup.h23
-rw-r--r--panels/info-overview/info-overview.gresource.xml6
-rw-r--r--panels/info-overview/meson.build76
13 files changed, 1857 insertions, 0 deletions
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
new file mode 100644
index 0000000..1ae5c7a
--- /dev/null
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -0,0 +1,993 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2019 Purism SPC
+ * Copyright (C) 2017 Mohammed Sadiq <sadiq@sadiqpk.org>
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <config.h>
+
+#include "cc-hostname-entry.h"
+#include "shell/cc-object-storage.h"
+
+#include "cc-info-overview-resources.h"
+#include "info-cleanup.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <gio/gunixmounts.h>
+#include <gio/gdesktopappinfo.h>
+
+#include <glibtop/fsusage.h>
+#include <glibtop/mountlist.h>
+#include <glibtop/mem.h>
+#include <glibtop/sysinfo.h>
+#include <udisks/udisks.h>
+#include <gudev/gudev.h>
+
+#include <gdk/gdk.h>
+
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/wayland/gdkwayland.h>
+#endif
+#ifdef GDK_WINDOWING_X11
+#include <gdk/x11/gdkx.h>
+#endif
+
+#include "cc-list-row.h"
+#include "cc-info-overview-panel.h"
+
+struct _CcInfoOverviewPanel
+{
+ CcPanel parent_instance;
+
+ GtkEntry *device_name_entry;
+ GtkWidget *rename_button;
+ CcListRow *disk_row;
+ CcListRow *gnome_version_row;
+ CcListRow *graphics_row;
+ CcListRow *hardware_model_row;
+ GtkDialog *hostname_editor;
+ CcHostnameEntry *hostname_entry;
+ CcListRow *hostname_row;
+ CcListRow *memory_row;
+ GtkPicture *os_logo;
+ CcListRow *os_name_row;
+ CcListRow *os_build_row;
+ CcListRow *os_type_row;
+ CcListRow *processor_row;
+ AdwActionRow *software_updates_row;
+ CcListRow *virtualization_row;
+ CcListRow *windowing_system_row;
+};
+
+G_DEFINE_TYPE (CcInfoOverviewPanel, cc_info_overview_panel, CC_TYPE_PANEL)
+
+static char *
+get_renderer_from_session (void)
+{
+ g_autoptr(GDBusProxy) session_proxy = NULL;
+ g_autoptr(GVariant) renderer_variant = NULL;
+ char *renderer;
+ g_autoptr(GError) error = NULL;
+
+ session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.gnome.SessionManager",
+ "/org/gnome/SessionManager",
+ "org.gnome.SessionManager",
+ NULL, &error);
+ if (error != NULL)
+ {
+ g_warning ("Unable to connect to create a proxy for org.gnome.SessionManager: %s",
+ error->message);
+ return NULL;
+ }
+
+ renderer_variant = g_dbus_proxy_get_cached_property (session_proxy, "Renderer");
+
+ if (!renderer_variant)
+ {
+ g_warning ("Unable to retrieve org.gnome.SessionManager.Renderer property");
+ return NULL;
+ }
+
+ renderer = info_cleanup (g_variant_get_string (renderer_variant, NULL));
+
+ return renderer;
+}
+
+/* @env is an array of strings with each pair of strings being the
+ * key followed by the value */
+static char *
+get_renderer_from_helper (const char **env)
+{
+ int status;
+ char *argv[] = { LIBEXECDIR "/gnome-control-center-print-renderer", NULL };
+ g_auto(GStrv) envp = NULL;
+ g_autofree char *renderer = NULL;
+ g_autoptr(GError) error = NULL;
+
+ g_debug ("About to launch '%s'", argv[0]);
+
+ if (env != NULL)
+ {
+ guint i;
+ g_debug ("With environment:");
+ envp = g_get_environ ();
+ for (i = 0; env != NULL && env[i] != NULL; i = i + 2)
+ {
+ g_debug (" %s = %s", env[i], env[i+1]);
+ envp = g_environ_setenv (envp, env[i], env[i+1], TRUE);
+ }
+ }
+ else
+ {
+ g_debug ("No additional environment variables");
+ }
+
+ if (!g_spawn_sync (NULL, (char **) argv, envp, 0, NULL, NULL, &renderer, NULL, &status, &error))
+ {
+ g_debug ("Failed to get GPU: %s", error->message);
+ return NULL;
+ }
+
+ if (!g_spawn_check_wait_status (status, NULL))
+ return NULL;
+
+ if (renderer == NULL || *renderer == '\0')
+ return NULL;
+
+ return info_cleanup (renderer);
+}
+
+typedef struct {
+ char *name;
+ gboolean is_default;
+} GpuData;
+
+static int
+gpu_data_sort (gconstpointer a, gconstpointer b)
+{
+ GpuData *gpu_a = (GpuData *) a;
+ GpuData *gpu_b = (GpuData *) b;
+
+ if (gpu_a->is_default)
+ return 1;
+ if (gpu_b->is_default)
+ return -1;
+ return 0;
+}
+
+static void
+gpu_data_free (GpuData *data)
+{
+ g_free (data->name);
+ g_free (data);
+}
+
+static char *
+get_renderer_from_switcheroo (void)
+{
+ g_autoptr(GDBusProxy) switcheroo_proxy = NULL;
+ g_autoptr(GVariant) variant = NULL;
+ g_autoptr(GError) error = NULL;
+ GString *renderers_string;
+ guint i, num_children;
+ GSList *renderers, *l;
+
+ switcheroo_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "net.hadess.SwitcherooControl",
+ "/net/hadess/SwitcherooControl",
+ "net.hadess.SwitcherooControl",
+ NULL, &error);
+ if (switcheroo_proxy == NULL)
+ {
+ g_debug ("Unable to connect to create a proxy for net.hadess.SwitcherooControl: %s",
+ error->message);
+ return NULL;
+ }
+
+ variant = g_dbus_proxy_get_cached_property (switcheroo_proxy, "GPUs");
+
+ if (!variant)
+ {
+ g_debug ("Unable to retrieve net.hadess.SwitcherooControl.GPUs property, the daemon is likely not running");
+ return NULL;
+ }
+
+ renderers_string = g_string_new (NULL);
+ num_children = g_variant_n_children (variant);
+ renderers = NULL;
+ for (i = 0; i < num_children; i++)
+ {
+ g_autoptr(GVariant) gpu;
+ g_autoptr(GVariant) name = NULL;
+ g_autoptr(GVariant) env = NULL;
+ g_autoptr(GVariant) default_variant = NULL;
+ const char *name_s;
+ g_autofree const char **env_s = NULL;
+ gsize env_len;
+ g_autofree char *renderer = NULL;
+ GpuData *gpu_data;
+
+ gpu = g_variant_get_child_value (variant, i);
+ if (!gpu ||
+ !g_variant_is_of_type (gpu, G_VARIANT_TYPE ("a{s*}")))
+ continue;
+
+ name = g_variant_lookup_value (gpu, "Name", NULL);
+ env = g_variant_lookup_value (gpu, "Environment", NULL);
+ if (!name || !env)
+ continue;
+ name_s = g_variant_get_string (name, NULL);
+ g_debug ("Getting renderer from helper for GPU '%s'", name_s);
+ env_s = g_variant_get_strv (env, &env_len);
+ if (env_s != NULL && env_len % 2 != 0)
+ {
+ g_autofree char *debug = NULL;
+ debug = g_strjoinv ("\n", (char **) env_s);
+ g_warning ("Invalid environment returned from switcheroo:\n%s", debug);
+ g_clear_pointer (&env_s, g_free);
+ }
+
+ renderer = get_renderer_from_helper (env_s);
+ default_variant = g_variant_lookup_value (gpu, "Default", NULL);
+
+ /* We could give up if we don't have a renderer, but that
+ * might just mean gnome-session isn't installed. We fall back
+ * to the device name in udev instead, which is better than nothing */
+
+ gpu_data = g_new0 (GpuData, 1);
+ gpu_data->name = g_strdup (renderer ? renderer : name_s);
+ gpu_data->is_default = default_variant ? g_variant_get_boolean (default_variant) : FALSE;
+ renderers = g_slist_prepend (renderers, gpu_data);
+ }
+
+ renderers = g_slist_sort (renderers, gpu_data_sort);
+ for (l = renderers; l != NULL; l = l->next)
+ {
+ GpuData *data = l->data;
+ if (renderers_string->len > 0)
+ g_string_append (renderers_string, " / ");
+ g_string_append (renderers_string, data->name);
+ }
+ g_slist_free_full (renderers, (GDestroyNotify) gpu_data_free);
+
+ if (renderers_string->len == 0)
+ {
+ g_string_free (renderers_string, TRUE);
+ return NULL;
+ }
+
+ return g_string_free (renderers_string, FALSE);
+}
+
+static gchar *
+get_graphics_hardware_string (void)
+{
+ g_autofree char *discrete_renderer = NULL;
+ g_autofree char *renderer = NULL;
+
+ renderer = get_renderer_from_switcheroo ();
+ if (!renderer)
+ renderer = get_renderer_from_session ();
+ if (!renderer)
+ renderer = get_renderer_from_helper (NULL);
+ if (!renderer)
+ return g_strdup (_("Unknown"));
+ return g_strdup (renderer);
+}
+
+static char *
+get_os_name (void)
+{
+ g_autofree gchar *name = NULL;
+ g_autofree gchar *version_id = NULL;
+ g_autofree gchar *pretty_name = NULL;
+
+ name = g_get_os_info (G_OS_INFO_KEY_NAME);
+ version_id = g_get_os_info (G_OS_INFO_KEY_VERSION_ID);
+ pretty_name = g_get_os_info (G_OS_INFO_KEY_PRETTY_NAME);
+
+ if (pretty_name)
+ return g_steal_pointer (&pretty_name);
+ else if (name && version_id)
+ return g_strdup_printf ("%s %s", name, version_id);
+ else
+ return g_strdup (_("Unknown"));
+}
+
+static char *
+get_os_build_id (void)
+{
+ char *build_id = NULL;
+
+ build_id = g_get_os_info ("BUILD_ID");
+
+ return build_id;
+}
+
+static char *
+get_os_type (void)
+{
+ if (GLIB_SIZEOF_VOID_P == 8)
+ /* translators: This is the type of architecture for the OS */
+ return g_strdup_printf (_("64-bit"));
+ else
+ /* translators: This is the type of architecture for the OS */
+ return g_strdup_printf (_("32-bit"));
+}
+
+static void
+get_primary_disc_info (CcInfoOverviewPanel *self)
+{
+ g_autoptr(UDisksClient) client = NULL;
+ GDBusObjectManager *manager;
+ g_autolist(GDBusObject) objects = NULL;
+ GList *l;
+ guint64 total_size;
+ g_autoptr(GError) error = NULL;
+
+ total_size = 0;
+
+ client = udisks_client_new_sync (NULL, &error);
+ if (client == NULL)
+ {
+ g_warning ("Unable to get UDisks client: %s. Disk information will not be available.",
+ error->message);
+ cc_list_row_set_secondary_label (self->disk_row, _("Unknown"));
+ return;
+ }
+
+ manager = udisks_client_get_object_manager (client);
+ objects = g_dbus_object_manager_get_objects (manager);
+
+ for (l = objects; l != NULL; l = l->next)
+ {
+ UDisksDrive *drive;
+ drive = udisks_object_peek_drive (UDISKS_OBJECT (l->data));
+
+ /* Skip removable devices */
+ if (drive == NULL ||
+ udisks_drive_get_removable (drive) ||
+ udisks_drive_get_ejectable (drive))
+ {
+ continue;
+ }
+
+ total_size += udisks_drive_get_size (drive);
+ }
+
+ if (total_size > 0)
+ {
+ g_autofree gchar *size = g_format_size (total_size);
+ cc_list_row_set_secondary_label (self->disk_row, size);
+ }
+ else
+ {
+ cc_list_row_set_secondary_label (self->disk_row, _("Unknown"));
+ }
+}
+
+static void
+get_hardware_model (CcInfoOverviewPanel *self)
+{
+ g_autoptr(GDBusProxy) hostnamed_proxy = NULL;
+ g_autoptr(GVariant) vendor_variant = NULL;
+ g_autoptr(GVariant) model_variant = NULL;
+ const char *vendor_string, *model_string;
+ g_autoptr(GError) error = NULL;
+
+ hostnamed_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.freedesktop.hostname1",
+ "/org/freedesktop/hostname1",
+ "org.freedesktop.hostname1",
+ NULL,
+ &error);
+ if (hostnamed_proxy == NULL)
+ {
+ g_debug ("Couldn't get hostnamed to start, bailing: %s", error->message);
+ return;
+ }
+
+ vendor_variant = g_dbus_proxy_get_cached_property (hostnamed_proxy, "HardwareVendor");
+ if (!vendor_variant)
+ {
+ g_debug ("Unable to retrieve org.freedesktop.hostname1.HardwareVendor property");
+ return;
+ }
+
+ model_variant = g_dbus_proxy_get_cached_property (hostnamed_proxy, "HardwareModel");
+ if (!model_variant)
+ {
+ g_debug ("Unable to retrieve org.freedesktop.hostname1.HardwareModel property");
+ return;
+ }
+
+ vendor_string = g_variant_get_string (vendor_variant, NULL),
+ model_string = g_variant_get_string (model_variant, NULL);
+
+ if (vendor_string && g_strcmp0 (vendor_string, "") != 0)
+ {
+ g_autofree gchar *vendor_model = NULL;
+
+ vendor_model = g_strdup_printf ("%s %s", vendor_string, model_string);
+
+ cc_list_row_set_secondary_label (self->hardware_model_row, vendor_model);
+ gtk_widget_set_visible (GTK_WIDGET (self->hardware_model_row), TRUE);
+ }
+}
+
+static char *
+get_cpu_info (const glibtop_sysinfo *info)
+{
+ g_autoptr(GHashTable) counts = NULL;
+ g_autoptr(GString) cpu = NULL;
+ GHashTableIter iter;
+ gpointer key, value;
+ int i;
+ int j;
+
+ counts = g_hash_table_new (g_str_hash, g_str_equal);
+
+ /* count duplicates */
+ for (i = 0; i != info->ncpu; ++i)
+ {
+ const char * const keys[] = { "model name", "cpu", "Processor" };
+ char *model;
+ int *count;
+
+ model = NULL;
+
+ for (j = 0; model == NULL && j != G_N_ELEMENTS (keys); ++j)
+ {
+ model = g_hash_table_lookup (info->cpuinfo[i].values,
+ keys[j]);
+ }
+
+ if (model == NULL)
+ continue;
+
+ count = g_hash_table_lookup (counts, model);
+ if (count == NULL)
+ g_hash_table_insert (counts, model, GINT_TO_POINTER (1));
+ else
+ g_hash_table_replace (counts, model, GINT_TO_POINTER (GPOINTER_TO_INT (count) + 1));
+ }
+
+ cpu = g_string_new (NULL);
+ g_hash_table_iter_init (&iter, counts);
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ g_autofree char *cleanedup = NULL;
+ int count;
+
+ count = GPOINTER_TO_INT (value);
+ cleanedup = info_cleanup ((const char *) key);
+ if (cpu->len != 0)
+ g_string_append_printf (cpu, " ");
+ if (count > 1)
+ g_string_append_printf (cpu, "%s \303\227 %d", cleanedup, count);
+ else
+ g_string_append_printf (cpu, "%s", cleanedup);
+ }
+
+ return g_strdup (cpu->str);
+}
+
+static struct {
+ const char *id;
+ const char *display;
+} const virt_tech[] = {
+ { "kvm", "KVM" },
+ { "qemu", "QEmu" },
+ { "vmware", "VMware" },
+ { "microsoft", "Microsoft" },
+ { "oracle", "Oracle" },
+ { "xen", "Xen" },
+ { "bochs", "Bochs" },
+ { "chroot", "chroot" },
+ { "openvz", "OpenVZ" },
+ { "lxc", "LXC" },
+ { "lxc-libvirt", "LXC (libvirt)" },
+ { "systemd-nspawn", "systemd (nspawn)" }
+};
+
+static void
+set_virtualization_label (CcInfoOverviewPanel *self,
+ const char *virt)
+{
+ const char *display_name;
+ guint i;
+
+ if (virt == NULL || *virt == '\0')
+ {
+ gtk_widget_hide (GTK_WIDGET (self->virtualization_row));
+ return;
+ }
+
+ gtk_widget_show (GTK_WIDGET (self->virtualization_row));
+
+ display_name = NULL;
+ for (i = 0; i < G_N_ELEMENTS (virt_tech); i++)
+ {
+ if (g_str_equal (virt_tech[i].id, virt))
+ {
+ display_name = _(virt_tech[i].display);
+ break;
+ }
+ }
+
+ cc_list_row_set_secondary_label (self->virtualization_row, display_name ? display_name : virt);
+}
+
+static void
+info_overview_panel_setup_virt (CcInfoOverviewPanel *self)
+{
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GDBusProxy) systemd_proxy = NULL;
+ g_autoptr(GVariant) variant = NULL;
+ GVariant *inner;
+
+ systemd_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1",
+ NULL,
+ &error);
+
+ if (systemd_proxy == NULL)
+ {
+ g_debug ("systemd not available, bailing: %s", error->message);
+ set_virtualization_label (self, NULL);
+ return;
+ }
+
+ variant = g_dbus_proxy_call_sync (systemd_proxy,
+ "org.freedesktop.DBus.Properties.Get",
+ g_variant_new ("(ss)", "org.freedesktop.systemd1.Manager", "Virtualization"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+ if (variant == NULL)
+ {
+ g_debug ("Failed to get property '%s': %s", "Virtualization", error->message);
+ set_virtualization_label (self, NULL);
+ return;
+ }
+
+ g_variant_get (variant, "(v)", &inner);
+ set_virtualization_label (self, g_variant_get_string (inner, NULL));
+}
+
+static const char *
+get_windowing_system (void)
+{
+ GdkDisplay *display;
+
+ display = gdk_display_get_default ();
+
+#if defined(GDK_WINDOWING_X11)
+ if (GDK_IS_X11_DISPLAY (display))
+ return _("X11");
+#endif /* GDK_WINDOWING_X11 */
+#if defined(GDK_WINDOWING_WAYLAND)
+ if (GDK_IS_WAYLAND_DISPLAY (display))
+ return _("Wayland");
+#endif /* GDK_WINDOWING_WAYLAND */
+ return C_("Windowing system (Wayland, X11, or Unknown)", "Unknown");
+}
+
+static guint64
+get_ram_size_libgtop (void)
+{
+ glibtop_mem mem;
+
+ glibtop_get_mem (&mem);
+ return mem.total;
+}
+
+static guint64
+get_ram_size_dmi (void)
+{
+ g_autoptr(GUdevClient) client = NULL;
+ g_autoptr(GUdevDevice) dmi = NULL;
+ const gchar * const subsystems[] = {"dmi", NULL };
+ guint64 ram_total = 0;
+ guint64 num_ram;
+ guint i;
+
+ client = g_udev_client_new (subsystems);
+ dmi = g_udev_client_query_by_sysfs_path (client, "/sys/devices/virtual/dmi/id");
+ if (!dmi)
+ return 0;
+ num_ram = g_udev_device_get_property_as_uint64 (dmi, "MEMORY_ARRAY_NUM_DEVICES");
+ for (i = 0; i < num_ram ; i++) {
+ g_autofree char *prop = NULL;
+
+ prop = g_strdup_printf ("MEMORY_DEVICE_%d_SIZE", i);
+ ram_total += g_udev_device_get_property_as_uint64 (dmi, prop);
+ }
+ return ram_total;
+}
+
+static char *
+get_gnome_version (GDBusProxy *proxy)
+{
+ g_autoptr(GVariant) variant = NULL;
+ const char *gnome_version = NULL;
+ if (!proxy)
+ return NULL;
+
+ variant = g_dbus_proxy_get_cached_property (proxy, "ShellVersion");
+ if (!variant)
+ return NULL;
+
+ gnome_version = g_variant_get_string (variant, NULL);
+ if (!gnome_version || *gnome_version == '\0')
+ return NULL;
+ return g_strdup (gnome_version);
+}
+
+static void
+shell_proxy_ready (GObject *source,
+ GAsyncResult *res,
+ CcInfoOverviewPanel *self)
+{
+ g_autoptr(GDBusProxy) proxy = NULL;
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GVariant) variant = NULL;
+ g_autofree char *gnome_version = NULL;
+
+ proxy = cc_object_storage_create_dbus_proxy_finish (res, &error);
+ if (!proxy)
+ {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+ g_warning ("Failed to contact gnome-shell: %s", error->message);
+ }
+
+ gnome_version = get_gnome_version (proxy);
+
+ if (!gnome_version)
+ {
+ /* translators: this is the placeholder string when the GNOME Shell
+ * version couldn't be loaded, eg. “GNOME Version: Not Available” */
+ cc_list_row_set_secondary_label (self->gnome_version_row, _("Not Available"));
+ }
+ else
+ {
+ cc_list_row_set_secondary_label (self->gnome_version_row, gnome_version);
+ }
+}
+
+static void
+info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
+{
+ g_autofree gchar *gnome_version = NULL;
+ guint64 ram_size;
+ const glibtop_sysinfo *info;
+ g_autofree char *memory_text = NULL;
+ g_autofree char *cpu_text = NULL;
+ g_autofree char *os_type_text = NULL;
+ g_autofree char *os_name_text = NULL;
+ g_autofree char *os_build_text = NULL;
+ g_autofree gchar *graphics_hardware_string = NULL;
+
+ cc_object_storage_create_dbus_proxy (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ "org.gnome.Shell",
+ "/org/gnome/Shell",
+ "org.gnome.Shell",
+ cc_panel_get_cancellable (CC_PANEL (self)),
+ (GAsyncReadyCallback) shell_proxy_ready,
+ self);
+
+ get_hardware_model (self);
+
+ ram_size = get_ram_size_dmi ();
+ if (ram_size == 0)
+ ram_size = get_ram_size_libgtop ();
+ memory_text = g_format_size_full (ram_size, G_FORMAT_SIZE_IEC_UNITS);
+ cc_list_row_set_secondary_label (self->memory_row, memory_text);
+
+ info = glibtop_get_sysinfo ();
+
+ cpu_text = get_cpu_info (info);
+ cc_list_row_set_secondary_markup (self->processor_row, cpu_text);
+
+ graphics_hardware_string = get_graphics_hardware_string ();
+ cc_list_row_set_secondary_markup (self->graphics_row, graphics_hardware_string);
+
+ get_primary_disc_info (self);
+
+ os_name_text = get_os_name ();
+ cc_list_row_set_secondary_label (self->os_name_row, os_name_text);
+
+ os_build_text = get_os_build_id ();
+ cc_list_row_set_secondary_label (self->os_build_row, os_build_text);
+ gtk_widget_set_visible (GTK_WIDGET (self->os_build_row), os_build_text != NULL);
+
+ os_type_text = get_os_type ();
+ cc_list_row_set_secondary_label (self->os_type_row, os_type_text);
+
+ cc_list_row_set_secondary_label (self->windowing_system_row, get_windowing_system ());
+}
+
+static gboolean
+does_gnome_software_allow_updates (void)
+{
+ const gchar *schema_id = "org.gnome.software";
+ GSettingsSchemaSource *source;
+ g_autoptr(GSettingsSchema) schema = NULL;
+ g_autoptr(GSettings) settings = NULL;
+
+ source = g_settings_schema_source_get_default ();
+
+ if (source == NULL)
+ return FALSE;
+
+ schema = g_settings_schema_source_lookup (source, schema_id, FALSE);
+
+ if (schema == NULL)
+ return FALSE;
+
+ settings = g_settings_new (schema_id);
+ return g_settings_get_boolean (settings, "allow-updates");
+}
+
+static gboolean
+does_gnome_software_exist (void)
+{
+ g_autofree gchar *path = g_find_program_in_path ("gnome-software");
+ return path != NULL;
+}
+
+static gboolean
+does_gpk_update_viewer_exist (void)
+{
+ g_autofree gchar *path = g_find_program_in_path ("gpk-update-viewer");
+ return path != NULL;
+}
+
+static void
+open_software_update (CcInfoOverviewPanel *self)
+{
+ g_autoptr(GError) error = NULL;
+ gboolean ret;
+ char *argv[3];
+
+ if (does_gnome_software_exist ())
+ {
+ argv[0] = "gnome-software";
+ argv[1] = "--mode=updates";
+ argv[2] = NULL;
+ }
+ else
+ {
+ argv[0] = "gpk-update-viewer";
+ argv[1] = NULL;
+ }
+ ret = g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
+ if (!ret)
+ g_warning ("Failed to spawn %s: %s", argv[0], error->message);
+}
+
+static void
+on_device_name_entry_changed (CcInfoOverviewPanel *self)
+{
+ const gchar *current_hostname, *new_hostname;
+
+ current_hostname = gtk_editable_get_text (GTK_EDITABLE (self->hostname_entry));
+ new_hostname = gtk_editable_get_text (GTK_EDITABLE (self->device_name_entry));
+ gtk_widget_set_sensitive (self->rename_button,
+ g_strcmp0 (current_hostname, new_hostname) != 0);
+}
+
+static void
+update_device_name (CcInfoOverviewPanel *self)
+{
+ const gchar *hostname;
+
+ /* We simply change the CcHostnameEntry text. CcHostnameEntry
+ * listens to changes and updates hostname on change.
+ */
+ hostname = gtk_editable_get_text (GTK_EDITABLE (self->device_name_entry));
+ gtk_editable_set_text (GTK_EDITABLE (self->hostname_entry), hostname);
+}
+
+static void
+on_hostname_editor_dialog_response_cb (GtkDialog *dialog,
+ gint response,
+ CcInfoOverviewPanel *self)
+{
+ if (response == GTK_RESPONSE_APPLY)
+ {
+ update_device_name (self);
+ }
+
+ gtk_window_close (GTK_WINDOW (dialog));
+}
+
+static void
+on_device_name_entry_activated_cb (CcInfoOverviewPanel *self)
+{
+ update_device_name (self);
+ gtk_window_close (GTK_WINDOW (self->hostname_editor));
+}
+
+static void
+open_hostname_edit_dialog (CcInfoOverviewPanel *self)
+{
+ GtkWindow *toplevel;
+ CcShell *shell;
+ const gchar *hostname;
+
+ g_assert (CC_IS_INFO_OVERVIEW_PANEL (self));
+
+ shell = cc_panel_get_shell (CC_PANEL (self));
+ toplevel = GTK_WINDOW (cc_shell_get_toplevel (shell));
+ gtk_window_set_transient_for (GTK_WINDOW (self->hostname_editor), toplevel);
+
+ hostname = gtk_editable_get_text (GTK_EDITABLE (self->hostname_entry));
+ gtk_editable_set_text (GTK_EDITABLE (self->device_name_entry), hostname);
+ gtk_widget_grab_focus (GTK_WIDGET (self->device_name_entry));
+
+ gtk_window_present (GTK_WINDOW (self->hostname_editor));
+
+}
+
+static void
+cc_info_panel_row_activated_cb (CcInfoOverviewPanel *self,
+ AdwActionRow *row)
+{
+ g_assert (CC_IS_INFO_OVERVIEW_PANEL (self));
+ g_assert (ADW_IS_ACTION_ROW (row));
+
+ if (row == ADW_ACTION_ROW (self->hostname_row))
+ open_hostname_edit_dialog (self);
+ else if (row == self->software_updates_row)
+ open_software_update (self);
+}
+
+#if !defined(DISTRIBUTOR_LOGO) || defined(DARK_MODE_DISTRIBUTOR_LOGO)
+static gboolean
+use_dark_theme (CcInfoOverviewPanel *panel)
+{
+ AdwStyleManager *style_manager = adw_style_manager_get_default ();
+
+ return adw_style_manager_get_dark (style_manager);
+}
+#endif
+
+static void
+setup_os_logo (CcInfoOverviewPanel *panel)
+{
+#ifdef DISTRIBUTOR_LOGO
+#ifdef DARK_MODE_DISTRIBUTOR_LOGO
+ if (use_dark_theme (panel))
+ {
+ gtk_picture_set_filename (panel->os_logo, DARK_MODE_DISTRIBUTOR_LOGO);
+ return;
+ }
+#endif
+ gtk_picture_set_filename (panel->os_logo, DISTRIBUTOR_LOGO);
+ return;
+#else
+ GtkIconTheme *icon_theme;
+ g_autofree char *logo_name = g_get_os_info ("LOGO");
+ g_autoptr(GtkIconPaintable) icon_paintable = NULL;
+ g_autoptr(GPtrArray) array = NULL;
+ g_autoptr(GIcon) icon = NULL;
+ gboolean dark;
+
+ dark = use_dark_theme (panel);
+ if (logo_name == NULL)
+ logo_name = g_strdup ("gnome-logo");
+
+ array = g_ptr_array_new_with_free_func (g_free);
+ if (dark)
+ g_ptr_array_add (array, (gpointer) g_strdup_printf ("%s-text-dark", logo_name));
+ g_ptr_array_add (array, (gpointer) g_strdup_printf ("%s-text", logo_name));
+ if (dark)
+ g_ptr_array_add (array, (gpointer) g_strdup_printf ("%s-dark", logo_name));
+ g_ptr_array_add (array, (gpointer) g_strdup_printf ("%s", logo_name));
+
+ icon = g_themed_icon_new_from_names ((char **) array->pdata, array->len);
+ icon_theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
+ icon_paintable = gtk_icon_theme_lookup_by_gicon (icon_theme, icon,
+ 192,
+ gtk_widget_get_scale_factor (GTK_WIDGET (panel)),
+ gtk_widget_get_direction (GTK_WIDGET (panel)),
+ 0);
+ gtk_picture_set_paintable (panel->os_logo, GDK_PAINTABLE (icon_paintable));
+#endif
+}
+
+static void
+cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/info-overview/cc-info-overview-panel.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, device_name_entry);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, disk_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, gnome_version_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, graphics_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, hardware_model_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, hostname_editor);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, hostname_entry);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, hostname_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, memory_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, os_logo);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, os_name_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, os_build_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, os_type_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, processor_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, rename_button);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, software_updates_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, virtualization_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, windowing_system_row);
+
+ gtk_widget_class_bind_template_callback (widget_class, cc_info_panel_row_activated_cb);
+ gtk_widget_class_bind_template_callback (widget_class, on_device_name_entry_changed);
+ gtk_widget_class_bind_template_callback (widget_class, on_device_name_entry_activated_cb);
+ gtk_widget_class_bind_template_callback (widget_class, on_hostname_editor_dialog_response_cb);
+
+ g_type_ensure (CC_TYPE_LIST_ROW);
+ g_type_ensure (CC_TYPE_HOSTNAME_ENTRY);
+}
+
+static void
+cc_info_overview_panel_init (CcInfoOverviewPanel *self)
+{
+ AdwStyleManager *style_manager;
+
+ gtk_widget_init_template (GTK_WIDGET (self));
+
+ g_resources_register (cc_info_overview_get_resource ());
+
+ if ((!does_gnome_software_exist () || !does_gnome_software_allow_updates ()) && !does_gpk_update_viewer_exist ())
+ gtk_widget_hide (GTK_WIDGET (self->software_updates_row));
+
+ info_overview_panel_setup_overview (self);
+ info_overview_panel_setup_virt (self);
+
+ style_manager = adw_style_manager_get_default ();
+ g_signal_connect_swapped (style_manager, "notify::dark", G_CALLBACK (setup_os_logo), self);
+ setup_os_logo (self);
+}
+
+GtkWidget *
+cc_info_overview_panel_new (void)
+{
+ return g_object_new (CC_TYPE_INFO_OVERVIEW_PANEL,
+ NULL);
+}
diff --git a/panels/info-overview/cc-info-overview-panel.h b/panels/info-overview/cc-info-overview-panel.h
new file mode 100644
index 0000000..78a6785
--- /dev/null
+++ b/panels/info-overview/cc-info-overview-panel.h
@@ -0,0 +1,31 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2017 Mohammed Sadiq <sadiq@sadiqpk.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+#include <shell/cc-panel.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_INFO_OVERVIEW_PANEL (cc_info_overview_panel_get_type ())
+G_DECLARE_FINAL_TYPE (CcInfoOverviewPanel, cc_info_overview_panel, CC, INFO_OVERVIEW_PANEL, CcPanel)
+
+GtkWidget *cc_info_overview_panel_new (void);
+
+G_END_DECLS
diff --git a/panels/info-overview/cc-info-overview-panel.ui b/panels/info-overview/cc-info-overview-panel.ui
new file mode 100644
index 0000000..ec2ed27
--- /dev/null
+++ b/panels/info-overview/cc-info-overview-panel.ui
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="CcInfoOverviewPanel" parent="CcPanel">
+ <child type="content">
+ <object class="AdwPreferencesPage">
+ <child>
+ <object class="AdwPreferencesGroup">
+
+ <child>
+ <object class="AdwClamp">
+ <property name="orientation">vertical</property>
+ <property name="maximum-size">192</property>
+ <property name="tightening-threshold">192</property>
+ <property name="child">
+ <object class="GtkPicture" id="os_logo">
+ <property name="can-shrink">False</property>
+ <property name="alternative-text" translatable="yes">System Logo</property>
+ </object>
+ </property>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ <child>
+ <object class="AdwPreferencesGroup">
+
+ <!-- Device name -->
+ <child>
+ <object class="CcListRow" id="hostname_row">
+ <property name="title" translatable="yes">Device Name</property>
+ <property name="secondary-label" bind-source="hostname_entry" bind-property="text" bind-flags="sync-create" />
+ <property name="show-arrow">True</property>
+ <signal name="activated" handler="cc_info_panel_row_activated_cb" swapped="yes"/>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ <child>
+ <object class="AdwPreferencesGroup">
+
+ <!-- Hardware Model -->
+ <child>
+ <object class="CcListRow" id="hardware_model_row">
+ <property name="visible">False</property>
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Hardware Model</property>
+ </object>
+ </child>
+
+ <!-- Memory -->
+ <child>
+ <object class="CcListRow" id="memory_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Memory</property>
+ </object>
+ </child>
+
+ <!-- Processor -->
+ <child>
+ <object class="CcListRow" id="processor_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Processor</property>
+ </object>
+ </child>
+
+ <!-- Graphics -->
+ <child>
+ <object class="CcListRow" id="graphics_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Graphics</property>
+ </object>
+ </child>
+
+ <!-- Disk Capacity -->
+ <child>
+ <object class="CcListRow" id="disk_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Disk Capacity</property>
+ <property name="secondary-label" translatable="yes">Calculating…</property>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ <child>
+ <object class="AdwPreferencesGroup">
+
+ <!-- OS Name -->
+ <child>
+ <object class="CcListRow" id="os_name_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes"
+ comments="translators: this field contains the distro name and version">OS Name</property>
+ </object>
+ </child>
+
+ <!-- OS Build -->
+ <child>
+ <object class="CcListRow" id="os_build_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes"
+ comments="translators: this field contains the distro build ID">OS Build ID</property>
+ </object>
+ </child>
+
+ <!-- OS Type -->
+ <child>
+ <object class="CcListRow" id="os_type_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">OS Type</property>
+ </object>
+ </child>
+
+ <!-- GNOME Version -->
+ <child>
+ <object class="CcListRow" id="gnome_version_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">GNOME Version</property>
+ <property name="secondary-label" translatable="yes"
+ comments="translators: this is a placeholder while the GNOME version is being fetched">Loading…</property>
+ </object>
+ </child>
+
+ <!-- Windowing System -->
+ <child>
+ <object class="CcListRow" id="windowing_system_row">
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Windowing System</property>
+ </object>
+ </child>
+
+ <!-- Virtualization -->
+ <child>
+ <object class="CcListRow" id="virtualization_row">
+ <property name="visible">False</property>
+ <property name="title" translatable="yes">Virtualization</property>
+ <property name="activatable">False</property>
+ </object>
+ </child>
+
+ <!-- Software Updates -->
+ <child>
+ <object class="AdwActionRow" id="software_updates_row">
+ <property name="activatable">True</property>
+ <property name="title" translatable="yes">Software Updates</property>
+ <signal name="activated" handler="cc_info_panel_row_activated_cb" swapped="yes"/>
+ <child type="suffix">
+ <object class="GtkImage">
+ <property name="valign">center</property>
+ <property name="icon-name">adw-external-link-symbolic</property>
+ </object>
+ </child>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ </object>
+ </child>
+ </template>
+
+ <object class="GtkDialog" id="hostname_editor">
+ <property name="visible">False</property>
+ <property name="modal">True</property>
+ <property name="use-header-bar">1</property>
+ <property name="default-height">24</property>
+ <property name="hide-on-close">True</property>
+ <property name="title" translatable="yes">Rename Device</property>
+ <signal name="response" handler="on_hostname_editor_dialog_response_cb" object="CcInfoOverviewPanel" swapped="no" />
+
+ <child>
+ <object class="GtkBox">
+ <property name="margin-top">18</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">18</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="device_name_description">
+ <property name="margin-bottom">18</property>
+ <property name="wrap">True</property>
+ <property name="max-width-chars">35</property>
+ <property name="xalign">0.0</property>
+ <property name="label" translatable="yes">The device name is used to identify this device when it is viewed over the network, or when pairing Bluetooth devices.</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry" id="device_name_entry">
+ <accessibility>
+ <property name="label" translatable="yes">Device name</property>
+ <relation name="described-by">device_name_description</relation>
+ </accessibility>
+ <signal name="changed" handler="on_device_name_entry_changed" swapped="yes"/>
+ <signal name="activate" handler="on_device_name_entry_activated_cb" swapped="yes" />
+ </object>
+ </child>
+ </object>
+ </child>
+
+ <!-- Rename button -->
+ <child type="action">
+ <object class="GtkButton" id="rename_button">
+ <property name="use-underline">True</property>
+ <property name="label" translatable="yes">_Rename</property>
+ </object>
+ </child>
+
+ <!-- Cancel button -->
+ <child type="action">
+ <object class="GtkButton" id="cancel_button">
+ <property name="use-underline">True</property>
+ <property name="label" translatable="yes">_Cancel</property>
+ </object>
+ </child>
+
+ <action-widgets>
+ <action-widget response="apply" default="true">rename_button</action-widget>
+ <action-widget response="cancel">cancel_button</action-widget>
+ </action-widgets>
+ </object>
+
+ <object class="CcHostnameEntry" id="hostname_entry">
+ <property name="visible">0</property>
+ </object>
+
+</interface>
diff --git a/panels/info-overview/gnome-control-center-print-renderer.c b/panels/info-overview/gnome-control-center-print-renderer.c
new file mode 100644
index 0000000..e84a11a
--- /dev/null
+++ b/panels/info-overview/gnome-control-center-print-renderer.c
@@ -0,0 +1,65 @@
+/* -*- mode:c; c-basic-offset: 8; indent-tabs-mode: nil; -*- */
+/* Tool to set the property _GNOME_SESSION_ACCELERATED on the root window */
+/*
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author:
+ * Bastien Nocera <hadess@hadess.net>
+ * Matthias Clasen <mclasen@redhat.com>
+ */
+
+#include <gtk/gtk.h>
+#include <epoxy/gl.h>
+
+static char *
+get_gtk_gles_renderer (void)
+{
+ GdkSurface *surface;
+ GtkNative *native;
+ GtkWidget *win;
+ GdkGLContext *context;
+ char *renderer = NULL;
+
+ win = gtk_window_new ();
+ gtk_widget_realize (win);
+ native = gtk_widget_get_native (win);
+ surface = gtk_native_get_surface (native);
+ context = gdk_surface_create_gl_context (surface, NULL);
+ if (!context)
+ return NULL;
+ gdk_gl_context_make_current (context);
+ renderer = g_strdup ((char *) glGetString (GL_RENDERER));
+ gdk_gl_context_clear_current ();
+ g_object_unref (context);
+
+ return renderer;
+}
+
+int
+main (int argc, char **argv)
+{
+ g_autofree char *renderer_string = NULL;
+
+ gtk_init ();
+
+ renderer_string = get_gtk_gles_renderer ();
+ if (renderer_string) {
+ g_print ("%s", renderer_string);
+ return 0;
+ }
+ return 1;
+}
diff --git a/panels/info-overview/gnome-info-overview-panel.desktop.in.in b/panels/info-overview/gnome-info-overview-panel.desktop.in.in
new file mode 100644
index 0000000..e3cf377
--- /dev/null
+++ b/panels/info-overview/gnome-info-overview-panel.desktop.in.in
@@ -0,0 +1,22 @@
+[Desktop Entry]
+Name=About
+Comment=View information about your system
+Exec=gnome-control-center info-overview
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
+Icon=org.gnome.Settings-about-symbolic
+Terminal=false
+Type=Application
+NoDisplay=true
+StartupNotify=true
+Categories=GNOME;GTK;Settings;X-GNOME-Settings-Panel;X-GNOME-DetailsSettings;
+OnlyShowIn=GNOME;Unity;
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=gnome-control-center
+X-GNOME-Bugzilla-Component=info
+X-GNOME-Bugzilla-Version=@VERSION@
+# Translators: Search terms to find the About panel.
+# Do NOT translate or localize the semicolons!
+# The list MUST also end with a semicolon!
+# "Preferred Applications" is the old name for the preference, so make
+# sure that you use the same "translation" for those keywords
+Keywords=device;system;information;hostname;memory;processor;version;default;application;preferred;cd;dvd;usb;audio;video;disc;removable;media;autorun;
diff --git a/panels/info-overview/gnome-logo-text-dark.svg b/panels/info-overview/gnome-logo-text-dark.svg
new file mode 100644
index 0000000..26e17b8
--- /dev/null
+++ b/panels/info-overview/gnome-logo-text-dark.svg
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="97.966095"
+ height="138.95122"
+ id="svg1903"
+ inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+ sodipodi:docname="gnome-logo-text-dark.svg">
+ <metadata
+ id="metadata24">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1011"
+ id="namedview22"
+ showgrid="false"
+ inkscape:zoom="2.0645911"
+ inkscape:cx="6.1022513"
+ inkscape:cy="68.392751"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg1903"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:document-rotation="0" />
+ <defs
+ id="defs1905">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 244.11613 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="401.74014 : 244.11613 : 1"
+ inkscape:persp3d-origin="200.87007 : 162.74409 : 1"
+ id="perspective26" />
+ </defs>
+ <g
+ transform="matrix(0.30686102,0,0,0.30686102,-57.94673,-76.524295)"
+ id="layer1"
+ style="fill:#ffffff">
+ <g
+ transform="translate(925.8326,120.8762)"
+ id="g3963"
+ style="fill:#ffffff">
+ <g
+ transform="matrix(2.914897,0,0,2.914897,-717.5904,128.5015)"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="g3771">
+ <g
+ style="fill:#ffffff;fill-opacity:1"
+ id="g3773">
+ <path
+ d="M 86.068,0 C 61.466,0 56.851,35.041 70.691,35.041 84.529,35.041 110.671,0 86.068,0 Z"
+ style="fill:#ffffff;fill-opacity:1"
+ id="path3775"
+ inkscape:connector-curvature="0" />
+ <path
+ d="M 45.217,30.699 C 52.586,31.149 60.671,2.577 46.821,4.374 32.976,6.171 37.845,30.249 45.217,30.699 Z"
+ style="fill:#ffffff;fill-opacity:1"
+ id="path3777"
+ inkscape:connector-curvature="0" />
+ <path
+ d="M 11.445,48.453 C 16.686,46.146 12.12,23.581 3.208,29.735 -5.7,35.89 6.204,50.759 11.445,48.453 Z"
+ style="fill:#ffffff;fill-opacity:1"
+ id="path3779"
+ inkscape:connector-curvature="0" />
+ <path
+ d="M 26.212,36.642 C 32.451,35.37 32.793,9.778 21.667,14.369 10.539,18.961 19.978,37.916 26.212,36.642 Z"
+ style="fill:#ffffff;fill-opacity:1"
+ id="path3781"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 58.791,93.913 c 1.107,8.454 -6.202,12.629 -13.36,7.179 C 22.644,83.743 83.16,75.088 79.171,51.386 75.86,31.712 15.495,37.769 8.621,68.553 3.968,89.374 27.774,118.26 52.614,118.26 c 12.22,0 26.315,-11.034 28.952,-25.012 C 83.58,82.589 57.867,86.86 58.791,93.913 Z"
+ style="fill:#ffffff;fill-opacity:1"
+ id="path3783"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <g
+ transform="matrix(1.098291,0,0,1.098291,41.06056,-50.07504)"
+ id="g3956"
+ style="fill:#ffffff">
+ <path
+ d="m -565.99523,509.46063 c -8.08731,0.21792 -14.47394,3.12448 -19.17071,8.69866 -4.86385,5.80101 -7.31024,13.81651 -7.31024,24.03862 0,10.19394 2.44651,18.18745 7.31024,23.98846 4.88761,5.801 11.59815,8.69866 20.15764,8.69866 8.5831,0 15.3105,-2.89766 20.17436,-8.69866 4.86373,-5.80101 7.29358,-13.79452 7.29353,-23.98846 -5e-5,-10.22211 -2.4298,-18.23761 -7.29353,-24.03862 -4.86386,-5.80075 -11.59131,-8.69866 -20.17436,-8.69866 -0.33434,0 -0.6582,-0.009 -0.98693,0 z m 0.60221,11.77669 c 0.12927,-0.003 0.25357,0 0.38472,0 4.21998,0 7.48996,1.8261 9.8028,5.48697 2.31266,3.66086 3.47944,8.82788 3.47949,15.47362 0,6.61757 -1.16692,11.74604 -3.47949,15.40691 -2.31274,3.66086 -5.58286,5.50352 -9.8028,5.50352 -4.19632,0 -7.43983,-1.84266 -9.75257,-5.50352 -2.31274,-3.66087 -3.47944,-8.78934 -3.47949,-15.40691 0,-6.64574 1.16684,-11.81276 3.47949,-15.47362 2.24035,-3.54647 5.35963,-5.37604 9.36785,-5.48697 z"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:148.7px;line-height:125%;font-family:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none"
+ id="path3787"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -657.35432,568.97161 c -7.12362,5.98235 -17.72219,5.91366 -22.13752,5.91366 -8.8932,0 -15.93855,-2.92879 -21.13613,-8.78612 -5.19765,-5.88525 -7.7964,-13.85456 -7.7964,-23.90791 0,-10.16578 2.64646,-18.16325 7.93945,-23.99241 5.293,-5.82892 12.54098,-8.74363 21.74413,-8.74363 3.55245,0 6.94991,0.39433 10.19254,1.18273 3.26638,0.78841 6.34203,1.95706 9.22697,3.50595 l -3.70487,10.9527 c -1.62185,-0.88773 -3.4788,-1.76286 -5.20022,-2.37807 -2.93262,-0.98557 -5.87712,-1.47823 -8.83351,-1.47823 -5.48379,0 -9.71581,1.81623 -12.69601,5.44892 -2.95649,3.60454 -4.4347,8.7718 -4.4347,15.50204 0,6.67415 1.4305,11.82733 4.29167,15.46003 2.86099,3.6327 7.16068,5.44892 12.19522,5.44892 5.11476,0 8.28269,-1.28922 9.97226,-2.64762 v -10.91144 h -11.08087 v -10.89809 h 21.45799"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:148.7px;line-height:125%;font-family:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none"
+ id="path3789"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -528.50252,510.59568 h 17.5241 l 12.15952,39.37066 12.23105,-39.37066 h 14.81181 l 6.69132,63.06461 h -13.01787 l -4.0148,-39.4349 -12.30257,39.62391 h -8.72628 l -12.30263,-40.9623 -4.01479,40.77329 h -13.05365 l 6.69132,-63.06461"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:148.7px;line-height:125%;font-family:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none"
+ id="path3793"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -455.68828,510.59568 h 37.15811 v 12.29183 h -23.38928 v 13.08097 h 17.97969 v 10.95369 h -17.97969 v 14.44629 h 24.17608 v 12.29183 h -37.94491 v -63.06461"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:148.7px;line-height:125%;font-family:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none"
+ id="path3795"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -647.94283,510.59568 h 8.6869 l 27.44915,37.90083 v -37.90083 h 11.71533 v 63.06461 h -8.6869 l -27.4491,-37.90083 v 37.90083 h -11.71538 v -63.06461"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:148.7px;line-height:125%;font-family:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none"
+ id="path3791"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/panels/info-overview/gnome-logo-text.svg b/panels/info-overview/gnome-logo-text.svg
new file mode 100644
index 0000000..b697f06
--- /dev/null
+++ b/panels/info-overview/gnome-logo-text.svg
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="97.966095"
+ height="138.95122"
+ id="svg1903"
+ inkscape:version="0.48.1 r9760"
+ sodipodi:docname="GnomeLogoVerticalMedium.svg">
+ <metadata
+ id="metadata24">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="818"
+ inkscape:window-height="738"
+ id="namedview22"
+ showgrid="false"
+ inkscape:zoom="2.0645911"
+ inkscape:cx="6.1022513"
+ inkscape:cy="68.392751"
+ inkscape:window-x="460"
+ inkscape:window-y="26"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg1903"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <defs
+ id="defs1905">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 244.11613 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="401.74014 : 244.11613 : 1"
+ inkscape:persp3d-origin="200.87007 : 162.74409 : 1"
+ id="perspective26" />
+ </defs>
+ <g
+ transform="matrix(0.30686102,0,0,0.30686102,-57.94673,-76.524295)"
+ id="layer1">
+ <g
+ transform="translate(925.8326,120.8762)"
+ id="g3963">
+ <g
+ transform="matrix(2.914897,0,0,2.914897,-717.5904,128.5015)"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="g3771">
+ <g
+ style="fill:#000000;fill-opacity:1"
+ id="g3773">
+ <path
+ d="M 86.068,0 C 61.466,0 56.851,35.041 70.691,35.041 84.529,35.041 110.671,0 86.068,0 z"
+ style="fill:#000000;fill-opacity:1"
+ id="path3775"
+ inkscape:connector-curvature="0" />
+ <path
+ d="M 45.217,30.699 C 52.586,31.149 60.671,2.577 46.821,4.374 32.976,6.171 37.845,30.249 45.217,30.699 z"
+ style="fill:#000000;fill-opacity:1"
+ id="path3777"
+ inkscape:connector-curvature="0" />
+ <path
+ d="M 11.445,48.453 C 16.686,46.146 12.12,23.581 3.208,29.735 -5.7,35.89 6.204,50.759 11.445,48.453 z"
+ style="fill:#000000;fill-opacity:1"
+ id="path3779"
+ inkscape:connector-curvature="0" />
+ <path
+ d="M 26.212,36.642 C 32.451,35.37 32.793,9.778 21.667,14.369 10.539,18.961 19.978,37.916 26.212,36.642 l 0,0 z"
+ style="fill:#000000;fill-opacity:1"
+ id="path3781"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 58.791,93.913 c 1.107,8.454 -6.202,12.629 -13.36,7.179 C 22.644,83.743 83.16,75.088 79.171,51.386 75.86,31.712 15.495,37.769 8.621,68.553 3.968,89.374 27.774,118.26 52.614,118.26 c 12.22,0 26.315,-11.034 28.952,-25.012 C 83.58,82.589 57.867,86.86 58.791,93.913 l 0,0 z"
+ style="fill:#000000;fill-opacity:1"
+ id="path3783"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <g
+ transform="matrix(1.098291,0,0,1.098291,41.06056,-50.07504)"
+ id="g3956">
+ <path
+ d="m -565.99523,509.46063 c -8.08731,0.21792 -14.47394,3.12448 -19.17071,8.69866 -4.86385,5.80101 -7.31024,13.81651 -7.31024,24.03862 0,10.19394 2.44651,18.18745 7.31024,23.98846 4.88761,5.801 11.59815,8.69866 20.15764,8.69866 8.5831,0 15.3105,-2.89766 20.17436,-8.69866 4.86373,-5.80101 7.29358,-13.79452 7.29353,-23.98846 -5e-5,-10.22211 -2.4298,-18.23761 -7.29353,-24.03862 -4.86386,-5.80075 -11.59131,-8.69866 -20.17436,-8.69866 -0.33434,0 -0.6582,-0.009 -0.98693,0 z m 0.60221,11.77669 c 0.12927,-0.003 0.25357,0 0.38472,0 4.21998,0 7.48996,1.8261 9.8028,5.48697 2.31266,3.66086 3.47944,8.82788 3.47949,15.47362 0,6.61757 -1.16692,11.74604 -3.47949,15.40691 -2.31274,3.66086 -5.58286,5.50352 -9.8028,5.50352 -4.19632,0 -7.43983,-1.84266 -9.75257,-5.50352 -2.31274,-3.66087 -3.47944,-8.78934 -3.47949,-15.40691 0,-6.64574 1.16684,-11.81276 3.47949,-15.47362 2.24035,-3.54647 5.35963,-5.37604 9.36785,-5.48697 z"
+ style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ id="path3787"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -657.35432,568.97161 c -7.12362,5.98235 -17.72219,5.91366 -22.13752,5.91366 -8.8932,0 -15.93855,-2.92879 -21.13613,-8.78612 -5.19765,-5.88525 -7.7964,-13.85456 -7.7964,-23.90791 0,-10.16578 2.64646,-18.16325 7.93945,-23.99241 5.293,-5.82892 12.54098,-8.74363 21.74413,-8.74363 3.55245,0 6.94991,0.39433 10.19254,1.18273 3.26638,0.78841 6.34203,1.95706 9.22697,3.50595 l -3.70487,10.9527 c -1.62185,-0.88773 -3.4788,-1.76286 -5.20022,-2.37807 -2.93262,-0.98557 -5.87712,-1.47823 -8.83351,-1.47823 -5.48379,0 -9.71581,1.81623 -12.69601,5.44892 -2.95649,3.60454 -4.4347,8.7718 -4.4347,15.50204 0,6.67415 1.4305,11.82733 4.29167,15.46003 2.86099,3.6327 7.16068,5.44892 12.19522,5.44892 5.11476,0 8.28269,-1.28922 9.97226,-2.64762 l 0,-10.91144 -11.08087,0 0,-10.89809 21.45799,0"
+ style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ id="path3789"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -528.50252,510.59568 17.5241,0 12.15952,39.37066 12.23105,-39.37066 14.81181,0 6.69132,63.06461 -13.01787,0 -4.0148,-39.4349 -12.30257,39.62391 -8.72628,0 -12.30263,-40.9623 -4.01479,40.77329 -13.05365,0 6.69132,-63.06461"
+ style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ id="path3793"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -455.68828,510.59568 37.15811,0 0,12.29183 -23.38928,0 0,13.08097 17.97969,0 0,10.95369 -17.97969,0 0,14.44629 24.17608,0 0,12.29183 -37.94491,0 0,-63.06461"
+ style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ id="path3795"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -647.94283,510.59568 8.6869,0 27.44915,37.90083 0,-37.90083 11.71533,0 0,63.06461 -8.6869,0 -27.4491,-37.90083 0,37.90083 -11.71538,0 0,-63.06461"
+ style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ id="path3791"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/panels/info-overview/icons/meson.build b/panels/info-overview/icons/meson.build
new file mode 100644
index 0000000..53aac33
--- /dev/null
+++ b/panels/info-overview/icons/meson.build
@@ -0,0 +1,4 @@
+install_data(
+ 'scalable/org.gnome.Settings-about-symbolic.svg',
+ install_dir: join_paths(control_center_icondir, 'hicolor', 'scalable', 'apps')
+)
diff --git a/panels/info-overview/icons/scalable/org.gnome.Settings-about-symbolic.svg b/panels/info-overview/icons/scalable/org.gnome.Settings-about-symbolic.svg
new file mode 100644
index 0000000..bc627c9
--- /dev/null
+++ b/panels/info-overview/icons/scalable/org.gnome.Settings-about-symbolic.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
+ <path d="m 8 0 c -4.421875 0 -8 3.578125 -8 8 s 3.578125 8 8 8 s 8 -3.578125 8 -8 s -3.578125 -8 -8 -8 z m 0 3.875 c 0.621094 0 1.125 0.503906 1.125 1.125 s -0.503906 1.125 -1.125 1.125 s -1.125 -0.503906 -1.125 -1.125 s 0.503906 -1.125 1.125 -1.125 z m -1.523438 3.125 h 2.523438 v 4 h 0.5 c 0.277344 0 0.5 0.222656 0.5 0.5 s -0.222656 0.5 -0.5 0.5 h -2.5 v -4 h -0.5 c -0.277344 0 -0.5 -0.222656 -0.5 -0.5 c 0 -0.269531 0.210938 -0.488281 0.476562 -0.5 z m 0 0" fill="#2e3436"/>
+</svg>
diff --git a/panels/info-overview/info-cleanup.c b/panels/info-overview/info-cleanup.c
new file mode 100644
index 0000000..5c3480c
--- /dev/null
+++ b/panels/info-overview/info-cleanup.c
@@ -0,0 +1,130 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include "info-cleanup.h"
+
+typedef struct
+{
+ char *regex;
+ char *replacement;
+} ReplaceStrings;
+
+static char *
+prettify_info (const char *info)
+{
+ g_autofree char *escaped = NULL;
+ g_autofree gchar *pretty = NULL;
+ int i;
+ static const ReplaceStrings rs[] = {
+ { "Mesa DRI ", ""},
+ { "[(]R[)]", "\302\256"},
+ { "[(](tm|TM)[)]", "\342\204\242"},
+ { "(ATI|EPYC|AMD FX|Radeon|Ryzen|Threadripper|GeForce RTX) ", "\\1\342\204\242 "},
+ { "Gallium \\d+\\.\\d+ on (.*)", "\\1"},
+ { " CPU| Processor| \\S+-Core| @ \\d+\\.\\d+GHz", ""},
+ { " x86|/MMX|/SSE2|/PCIe", ""},
+ { " [(][^)]*(DRM|MESA|LLVM)[^)]*[)]?", ""},
+ { "Graphics Controller", "Graphics"},
+ { ".*llvmpipe.*", "Software Rendering"},
+ };
+
+ if (*info == '\0')
+ return NULL;
+
+ escaped = g_markup_escape_text (info, -1);
+ pretty = g_strdup (g_strstrip (escaped));
+
+ for (i = 0; i < G_N_ELEMENTS (rs); i++)
+ {
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GRegex) re = NULL;
+ g_autofree gchar *new = NULL;
+
+ re = g_regex_new (rs[i].regex, 0, 0, &error);
+ if (re == NULL)
+ {
+ g_warning ("Error building regex: %s", error->message);
+ continue;
+ }
+
+ new = g_regex_replace (re,
+ pretty,
+ -1,
+ 0,
+ rs[i].replacement,
+ 0,
+ &error);
+
+ if (error != NULL)
+ {
+ g_warning ("Error replacing %s: %s", rs[i].regex, error->message);
+ continue;
+ }
+
+ g_free (pretty);
+ pretty = g_steal_pointer (&new);
+ }
+
+ return g_steal_pointer (&pretty);
+}
+
+static char *
+remove_duplicate_whitespace (const char *old)
+{
+ g_autofree gchar *new = NULL;
+ g_autoptr(GRegex) re = NULL;
+ g_autoptr(GError) error = NULL;
+
+ if (old == NULL)
+ return NULL;
+
+ re = g_regex_new ("[ \t\n\r]+", G_REGEX_MULTILINE, 0, &error);
+ if (re == NULL)
+ {
+ g_warning ("Error building regex: %s", error->message);
+ return g_strdup (old);
+ }
+ new = g_regex_replace (re,
+ old,
+ -1,
+ 0,
+ " ",
+ 0,
+ &error);
+ if (new == NULL)
+ {
+ g_warning ("Error replacing string: %s", error->message);
+ return g_strdup (old);
+ }
+
+ return g_steal_pointer (&new);
+}
+
+char *
+info_cleanup (const char *input)
+{
+ g_autofree char *pretty = NULL;
+
+ pretty = prettify_info (input);
+ return remove_duplicate_whitespace (pretty);
+}
diff --git a/panels/info-overview/info-cleanup.h b/panels/info-overview/info-cleanup.h
new file mode 100644
index 0000000..cbc8d54
--- /dev/null
+++ b/panels/info-overview/info-cleanup.h
@@ -0,0 +1,23 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <glib.h>
+
+char *info_cleanup (const char *input);
diff --git a/panels/info-overview/info-overview.gresource.xml b/panels/info-overview/info-overview.gresource.xml
new file mode 100644
index 0000000..6a63f75
--- /dev/null
+++ b/panels/info-overview/info-overview.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/control-center/info-overview">
+ <file preprocess="xml-stripblanks">cc-info-overview-panel.ui</file>
+ </gresource>
+</gresources>
diff --git a/panels/info-overview/meson.build b/panels/info-overview/meson.build
new file mode 100644
index 0000000..45251ab
--- /dev/null
+++ b/panels/info-overview/meson.build
@@ -0,0 +1,76 @@
+panels_list += cappletname
+desktop = 'gnome-@0@-panel.desktop'.format(cappletname)
+
+desktop_in = configure_file(
+ input: desktop + '.in.in',
+ output: desktop + '.in',
+ configuration: desktop_conf
+)
+
+i18n.merge_file(
+ type: 'desktop',
+ input: desktop_in,
+ output: desktop,
+ po_dir: po_dir,
+ install: true,
+ install_dir: control_center_desktopdir
+)
+
+cflags += [
+ '-DDATADIR="@0@"'.format(control_center_datadir),
+ '-DLIBEXECDIR="@0@"'.format(control_center_libexecdir),
+]
+
+sources = files(
+ 'cc-info-overview-panel.c',
+ 'info-cleanup.c'
+)
+
+resource_data = files(
+ 'cc-info-overview-panel.ui'
+)
+
+sources += gnome.compile_resources(
+ 'cc-' + cappletname + '-resources',
+ cappletname + '.gresource.xml',
+ c_name: 'cc_' + cappletname.underscorify (),
+ dependencies: resource_data,
+ export: true
+)
+
+deps = common_deps + [
+ dependency('udisks2', version: '>= 2.8.2'),
+ dependency('libgtop-2.0'),
+ gudev_dep,
+]
+
+info_panel_lib = static_library(
+ cappletname,
+ sources: sources,
+ include_directories: [ top_inc, common_inc ],
+ dependencies: deps,
+ c_args: cflags
+)
+panels_libs += info_panel_lib
+
+print_renderer_deps = [
+ dependency('gtk4'),
+ epoxy_dep
+]
+
+executable(
+ 'gnome-control-center-print-renderer',
+ 'gnome-control-center-print-renderer.c',
+ include_directories: [ top_inc ],
+ dependencies: [ print_renderer_deps ],
+ c_args: cflags,
+ install: true,
+ install_dir: control_center_libexecdir,
+)
+
+install_data(
+ [ 'gnome-logo-text.svg', 'gnome-logo-text-dark.svg' ],
+ install_dir: join_paths(control_center_datadir, 'icons')
+)
+
+subdir('icons')