|
|
@ -1,4 +1,4 @@ |
|
|
|
From 9f5afbaa94f7a6b466d0bfb2be257187cfc4cc18 Mon Sep 17 00:00:00 2001 |
|
|
|
From cacaa4836243264b1d8be579eed591a7dbe10d5f Mon Sep 17 00:00:00 2001 |
|
|
|
From: Rui Matos <tiagomatos@gmail.com> |
|
|
|
From: Rui Matos <tiagomatos@gmail.com> |
|
|
|
Date: Thu, 31 Aug 2017 17:32:43 +0200 |
|
|
|
Date: Thu, 31 Aug 2017 17:32:43 +0200 |
|
|
|
Subject: [PATCH] housekeeping: Add a GPU memory usage notification |
|
|
|
Subject: [PATCH] housekeeping: Add a GPU memory usage notification |
|
|
@ -6,62 +6,83 @@ Subject: [PATCH] housekeeping: Add a GPU memory usage notification |
|
|
|
Only works on supported nvidia GPUs and nvidia binary driver |
|
|
|
Only works on supported nvidia GPUs and nvidia binary driver |
|
|
|
combinations. |
|
|
|
combinations. |
|
|
|
--- |
|
|
|
--- |
|
|
|
plugins/housekeeping/Makefile.am | 10 +- |
|
|
|
meson.build | 1 + |
|
|
|
plugins/housekeeping/gsd-gpu-mem.c | 261 ++ |
|
|
|
plugins/housekeeping/gsd-gpu-mem.c | 261 + |
|
|
|
plugins/housekeeping/gsd-gpu-mem.h | 33 + |
|
|
|
plugins/housekeeping/gsd-gpu-mem.h | 33 + |
|
|
|
plugins/housekeeping/gsd-housekeeping-manager.c | 7 + |
|
|
|
.../housekeeping/gsd-housekeeping-manager.c | 7 + |
|
|
|
plugins/housekeeping/nvml/include/nvml.h | 4447 +++++++++++++++++++++++ |
|
|
|
plugins/housekeeping/meson.build | 7 +- |
|
|
|
5 files changed, 4754 insertions(+), 4 deletions(-) |
|
|
|
plugins/housekeeping/nvml/include/nvml.h | 4447 +++++++++++++++++ |
|
|
|
|
|
|
|
6 files changed, 4754 insertions(+), 2 deletions(-) |
|
|
|
create mode 100644 plugins/housekeeping/gsd-gpu-mem.c |
|
|
|
create mode 100644 plugins/housekeeping/gsd-gpu-mem.c |
|
|
|
create mode 100644 plugins/housekeeping/gsd-gpu-mem.h |
|
|
|
create mode 100644 plugins/housekeeping/gsd-gpu-mem.h |
|
|
|
create mode 100644 plugins/housekeeping/nvml/include/nvml.h |
|
|
|
create mode 100644 plugins/housekeeping/nvml/include/nvml.h |
|
|
|
|
|
|
|
|
|
|
|
diff --git a/plugins/housekeeping/Makefile.am b/plugins/housekeeping/Makefile.am |
|
|
|
diff --git a/meson.build b/meson.build |
|
|
|
index 3841edf4..b01666ca 100644 |
|
|
|
index 5c66be4d..6067ec2e 100644 |
|
|
|
--- a/plugins/housekeeping/Makefile.am |
|
|
|
--- a/meson.build |
|
|
|
+++ b/plugins/housekeeping/Makefile.am |
|
|
|
+++ b/meson.build |
|
|
|
@@ -1,6 +1,8 @@ |
|
|
|
@@ -76,60 +76,61 @@ endif |
|
|
|
plugin_name = housekeeping |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_FILES = \ |
|
|
|
# Workaround for meson's bug |
|
|
|
+ gsd-gpu-mem.c \ |
|
|
|
# https://github.com/mesonbuild/meson/pull/1896 |
|
|
|
+ gsd-gpu-mem.h \ |
|
|
|
if get_option('b_ndebug') == true |
|
|
|
gsd-disk-space.c \ |
|
|
|
common_flags += ['-DG_DISABLE_ASSERT'] |
|
|
|
gsd-disk-space.h \ |
|
|
|
endif |
|
|
|
gsd-disk-space-helper.h \ |
|
|
|
|
|
|
|
@@ -11,20 +13,20 @@ noinst_PROGRAMS = gsd-disk-space-test gsd-empty-trash-test gsd-purge-temp-test |
|
|
|
|
|
|
|
gsd_disk_space_test_SOURCES = \ |
|
|
|
|
|
|
|
gsd-disk-space-test.c \ |
|
|
|
|
|
|
|
$(COMMON_FILES) |
|
|
|
|
|
|
|
-gsd_disk_space_test_LDADD = $(HOUSEKEEPING_LIBS) |
|
|
|
|
|
|
|
+gsd_disk_space_test_LDADD = $(HOUSEKEEPING_LIBS) -lm -ldl |
|
|
|
|
|
|
|
gsd_disk_space_test_CFLAGS = \ |
|
|
|
|
|
|
|
$(HOUSEKEEPING_CFLAGS) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gsd_empty_trash_test_SOURCES = \ |
|
|
|
add_project_arguments(common_flags + compiler_flags, language: 'c') |
|
|
|
gsd-empty-trash-test.c \ |
|
|
|
|
|
|
|
$(COMMON_FILES) |
|
|
|
|
|
|
|
-gsd_empty_trash_test_LDADD = $(HOUSEKEEPING_LIBS) |
|
|
|
|
|
|
|
+gsd_empty_trash_test_LDADD = $(HOUSEKEEPING_LIBS) -lm -ldl |
|
|
|
|
|
|
|
gsd_empty_trash_test_CFLAGS = $(HOUSEKEEPING_CFLAGS) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gsd_purge_temp_test_SOURCES = \ |
|
|
|
colord_dep = dependency('colord', version: '>= 1.0.2') |
|
|
|
gsd-purge-temp-test.c \ |
|
|
|
geocode_glib_dep = dependency('geocode-glib-1.0', version: '>= 3.10.0') |
|
|
|
$(COMMON_FILES) |
|
|
|
gio_dep = dependency('gio-2.0', version: '>= 2.53.0') |
|
|
|
-gsd_purge_temp_test_LDADD = $(HOUSEKEEPING_LIBS) |
|
|
|
gio_unix_dep = dependency('gio-unix-2.0') |
|
|
|
+gsd_purge_temp_test_LDADD = $(HOUSEKEEPING_LIBS) -lm -ldl |
|
|
|
gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 3.11.1') |
|
|
|
gsd_purge_temp_test_CFLAGS = $(HOUSEKEEPING_CFLAGS) |
|
|
|
gsettings_desktop_dep = dependency('gsettings-desktop-schemas', version: '>= 3.23.3') |
|
|
|
|
|
|
|
gtk_dep = dependency('gtk+-3.0', version: '>= 3.15.3') |
|
|
|
|
|
|
|
gtk_x11_dep = dependency('gtk+-x11-3.0') |
|
|
|
|
|
|
|
gweather_dep = dependency('gweather-3.0', version: '>= 3.9.5') |
|
|
|
|
|
|
|
lcms_dep = dependency('lcms2', version: '>= 2.2') |
|
|
|
|
|
|
|
libcanberra_gtk_dep = dependency('libcanberra-gtk3') |
|
|
|
|
|
|
|
libgeoclue_dep = dependency('libgeoclue-2.0', version: '>= 2.3.1') |
|
|
|
|
|
|
|
libnotify_dep = dependency('libnotify', version: '>= 0.7.3') |
|
|
|
|
|
|
|
libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', version: '>= 2.0') |
|
|
|
|
|
|
|
pango_dep = dependency('pango', version: '>= 1.20.0') |
|
|
|
|
|
|
|
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.103') |
|
|
|
|
|
|
|
upower_glib_dep = dependency('upower-glib', version: '>= 0.99.0') |
|
|
|
|
|
|
|
x11_dep = dependency('x11') |
|
|
|
|
|
|
|
xtst_dep = dependency('xtst') |
|
|
|
|
|
|
|
|
|
|
|
libexec_PROGRAMS = gsd-housekeeping |
|
|
|
m_dep = cc.find_library('m') |
|
|
|
@@ -51,7 +53,7 @@ gsd_housekeeping_CFLAGS = \ |
|
|
|
+dl_dep = cc.find_library('dl') |
|
|
|
gsd_housekeeping_LDADD = \ |
|
|
|
|
|
|
|
$(top_builddir)/gnome-settings-daemon/libgsd.la \ |
|
|
|
# ALSA integration (default enabled) |
|
|
|
$(top_builddir)/plugins/common/libcommon.la \ |
|
|
|
enable_alsa = get_option('alsa') |
|
|
|
- $(HOUSEKEEPING_LIBS) |
|
|
|
assert(enable_alsa or not host_is_linux, 'ALSA is not optional on Linux platforms') |
|
|
|
+ $(HOUSEKEEPING_LIBS) -lm -ldl |
|
|
|
|
|
|
|
|
|
|
|
libgvc = subproject( |
|
|
|
|
|
|
|
'gvc', |
|
|
|
|
|
|
|
default_options: [ |
|
|
|
|
|
|
|
'static=true', |
|
|
|
|
|
|
|
'alsa=' + enable_alsa.to_string() |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
libgvc_dep = libgvc.get_variable('libgvc_dep') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# GUdev integration (default enabled) |
|
|
|
|
|
|
|
enable_gudev = get_option('gudev') |
|
|
|
|
|
|
|
if enable_gudev |
|
|
|
|
|
|
|
assert(enable_gudev, 'GUdev is not optional on Linux platforms') |
|
|
|
|
|
|
|
gudev_dep = dependency('gudev-1.0') |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
config_h.set('HAVE_GUDEV', enable_gudev) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check for libwayland-client |
|
|
|
|
|
|
|
enable_wayland = get_option('wayland') |
|
|
|
|
|
|
|
if enable_wayland |
|
|
|
|
|
|
|
assert(enable_gudev, 'GUDev support is required for wayland support.') |
|
|
|
|
|
|
|
wayland_client_dep = dependency('wayland-client') |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
config_h.set10('HAVE_WAYLAND', enable_wayland) |
|
|
|
|
|
|
|
|
|
|
|
desktopdir = $(sysconfdir)/xdg/autostart |
|
|
|
|
|
|
|
desktop_in_files = org.gnome.SettingsDaemon.Housekeeping.desktop.in |
|
|
|
|
|
|
|
diff --git a/plugins/housekeeping/gsd-gpu-mem.c b/plugins/housekeeping/gsd-gpu-mem.c |
|
|
|
diff --git a/plugins/housekeeping/gsd-gpu-mem.c b/plugins/housekeeping/gsd-gpu-mem.c |
|
|
|
new file mode 100644 |
|
|
|
new file mode 100644 |
|
|
|
index 00000000..a76579b6 |
|
|
|
index 00000000..a76579b6 |
|
|
@ -372,7 +393,32 @@ diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeep |
|
|
|
index 2c94e35d..5efb0aaa 100644 |
|
|
|
index 2c94e35d..5efb0aaa 100644 |
|
|
|
--- a/plugins/housekeeping/gsd-housekeeping-manager.c |
|
|
|
--- a/plugins/housekeeping/gsd-housekeeping-manager.c |
|
|
|
+++ b/plugins/housekeeping/gsd-housekeeping-manager.c |
|
|
|
+++ b/plugins/housekeeping/gsd-housekeeping-manager.c |
|
|
|
@@ -26,6 +26,7 @@ |
|
|
|
@@ -1,89 +1,92 @@ |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* Copyright (C) 2008 Michael J. Chudobiak <mjc@avtechpulse.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 <gio/gio.h> |
|
|
|
|
|
|
|
#include <glib/gstdio.h> |
|
|
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
#include <libnotify/notify.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "gnome-settings-profile.h" |
|
|
|
#include "gnome-settings-profile.h" |
|
|
|
#include "gsd-housekeeping-manager.h" |
|
|
|
#include "gsd-housekeeping-manager.h" |
|
|
|
#include "gsd-disk-space.h" |
|
|
|
#include "gsd-disk-space.h" |
|
|
@ -380,7 +426,31 @@ index 2c94e35d..5efb0aaa 100644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* General */ |
|
|
|
/* General */ |
|
|
|
@@ -57,6 +58,8 @@ struct GsdHousekeepingManagerPrivate { |
|
|
|
#define INTERVAL_ONCE_A_DAY 24*60*60 |
|
|
|
|
|
|
|
#define INTERVAL_TWO_MINUTES 2*60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Thumbnail cleaner */ |
|
|
|
|
|
|
|
#define THUMB_PREFIX "org.gnome.desktop.thumbnail-cache" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define THUMB_AGE_KEY "maximum-age" |
|
|
|
|
|
|
|
#define THUMB_SIZE_KEY "maximum-size" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GSD_HOUSEKEEPING_DBUS_PATH "/org/gnome/SettingsDaemon/Housekeeping" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const gchar introspection_xml[] = |
|
|
|
|
|
|
|
"<node>" |
|
|
|
|
|
|
|
" <interface name='org.gnome.SettingsDaemon.Housekeeping'>" |
|
|
|
|
|
|
|
" <method name='EmptyTrash'/>" |
|
|
|
|
|
|
|
" <method name='RemoveTempFiles'/>" |
|
|
|
|
|
|
|
" </interface>" |
|
|
|
|
|
|
|
"</node>"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct GsdHousekeepingManagerPrivate { |
|
|
|
|
|
|
|
GSettings *settings; |
|
|
|
|
|
|
|
guint long_term_cb; |
|
|
|
|
|
|
|
guint short_term_cb; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GDBusNodeInfo *introspection_data; |
|
|
|
GDBusConnection *connection; |
|
|
|
GDBusConnection *connection; |
|
|
|
GCancellable *bus_cancellable; |
|
|
|
GCancellable *bus_cancellable; |
|
|
|
guint name_id; |
|
|
|
guint name_id; |
|
|
@ -389,7 +459,61 @@ index 2c94e35d..5efb0aaa 100644 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
#define GSD_HOUSEKEEPING_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_HOUSEKEEPING_MANAGER, GsdHousekeepingManagerPrivate)) |
|
|
|
#define GSD_HOUSEKEEPING_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_HOUSEKEEPING_MANAGER, GsdHousekeepingManagerPrivate)) |
|
|
|
@@ -411,6 +414,8 @@ gsd_housekeeping_manager_start (GsdHousekeepingManager *manager, |
|
|
|
|
|
|
|
|
|
|
|
static void gsd_housekeeping_manager_class_init (GsdHousekeepingManagerClass *klass); |
|
|
|
|
|
|
|
static void gsd_housekeeping_manager_init (GsdHousekeepingManager *housekeeping_manager); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GsdHousekeepingManager, gsd_housekeeping_manager, G_TYPE_OBJECT) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static gpointer manager_object = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
|
|
|
|
glong now; |
|
|
|
|
|
|
|
glong max_age; |
|
|
|
|
|
|
|
goffset total_size; |
|
|
|
|
|
|
|
goffset max_size; |
|
|
|
|
|
|
|
} PurgeData; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
|
|
|
|
time_t mtime; |
|
|
|
|
|
|
|
char *path; |
|
|
|
|
|
|
|
glong size; |
|
|
|
|
|
|
|
} ThumbData; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
|
|
thumb_data_free (gpointer data) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
@@ -384,101 +387,105 @@ gsd_housekeeping_manager_start (GsdHousekeepingManager *manager, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
gchar *dir; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_debug ("Starting housekeeping manager"); |
|
|
|
|
|
|
|
gnome_settings_profile_start (NULL); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Create ~/.local/ as early as possible */ |
|
|
|
|
|
|
|
(void) g_mkdir_with_parents(g_get_user_data_dir (), 0700); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Create ~/.local/share/applications/, see |
|
|
|
|
|
|
|
* https://bugzilla.gnome.org/show_bug.cgi?id=703048 */ |
|
|
|
|
|
|
|
dir = g_build_filename (g_get_user_data_dir (), "applications", NULL); |
|
|
|
|
|
|
|
(void) g_mkdir (dir, 0700); |
|
|
|
|
|
|
|
g_free (dir); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gsd_ldsm_setup (FALSE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
manager->priv->settings = g_settings_new (THUMB_PREFIX); |
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (manager->priv->settings), "changed", |
|
|
|
|
|
|
|
G_CALLBACK (settings_changed_callback), manager); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Clean once, a few minutes after start-up */ |
|
|
|
|
|
|
|
do_cleanup_soon (manager); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Clean periodically, on a daily basis. */ |
|
|
|
|
|
|
|
manager->priv->long_term_cb = g_timeout_add_seconds (INTERVAL_ONCE_A_DAY, |
|
|
|
|
|
|
|
(GSourceFunc) do_cleanup, |
|
|
|
manager); |
|
|
|
manager); |
|
|
|
g_source_set_name_by_id (manager->priv->long_term_cb, "[gnome-settings-daemon] do_cleanup"); |
|
|
|
g_source_set_name_by_id (manager->priv->long_term_cb, "[gnome-settings-daemon] do_cleanup"); |
|
|
|
|
|
|
|
|
|
|
@ -398,7 +522,41 @@ index 2c94e35d..5efb0aaa 100644 |
|
|
|
gnome_settings_profile_end (NULL); |
|
|
|
gnome_settings_profile_end (NULL); |
|
|
|
|
|
|
|
|
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
@@ -452,6 +457,8 @@ gsd_housekeeping_manager_stop (GsdHousekeepingManager *manager) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
gsd_housekeeping_manager_stop (GsdHousekeepingManager *manager) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GsdHousekeepingManagerPrivate *p = manager->priv; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_debug ("Stopping housekeeping manager"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (manager->priv->name_id != 0) { |
|
|
|
|
|
|
|
g_bus_unown_name (manager->priv->name_id); |
|
|
|
|
|
|
|
manager->priv->name_id = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_clear_object (&p->bus_cancellable); |
|
|
|
|
|
|
|
g_clear_pointer (&p->introspection_data, g_dbus_node_info_unref); |
|
|
|
|
|
|
|
g_clear_object (&p->connection); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p->short_term_cb) { |
|
|
|
|
|
|
|
g_source_remove (p->short_term_cb); |
|
|
|
|
|
|
|
p->short_term_cb = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p->long_term_cb) { |
|
|
|
|
|
|
|
g_source_remove (p->long_term_cb); |
|
|
|
|
|
|
|
p->long_term_cb = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Do a clean-up on shutdown if and only if the size or age |
|
|
|
|
|
|
|
limits have been set to paranoid levels (zero) */ |
|
|
|
|
|
|
|
if ((g_settings_get_int (p->settings, THUMB_AGE_KEY) == 0) || |
|
|
|
|
|
|
|
(g_settings_get_int (p->settings, THUMB_SIZE_KEY) == 0)) { |
|
|
|
|
|
|
|
do_cleanup (manager); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
g_clear_object (&p->settings); |
|
|
|
g_clear_object (&p->settings); |
|
|
|
gsd_ldsm_clean (); |
|
|
|
gsd_ldsm_clean (); |
|
|
@ -407,9 +565,86 @@ index 2c94e35d..5efb0aaa 100644 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
|
|
|
|
|
gsd_housekeeping_manager_finalize (GObject *object) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
gsd_housekeeping_manager_stop (GSD_HOUSEKEEPING_MANAGER (object)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gsd_housekeeping_manager_parent_class)->finalize (object); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
|
|
gsd_housekeeping_manager_class_init (GsdHousekeepingManagerClass *klass) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object_class->finalize = gsd_housekeeping_manager_finalize; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notify_init ("gnome-settings-daemon"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_type_class_add_private (klass, sizeof (GsdHousekeepingManagerPrivate)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
|
|
gsd_housekeeping_manager_init (GsdHousekeepingManager *manager) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
manager->priv = GSD_HOUSEKEEPING_MANAGER_GET_PRIVATE (manager); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GsdHousekeepingManager * |
|
|
|
|
|
|
|
gsd_housekeeping_manager_new (void) |
|
|
|
|
|
|
|
diff --git a/plugins/housekeeping/meson.build b/plugins/housekeeping/meson.build |
|
|
|
|
|
|
|
index 5ac2455e..8582d10c 100644 |
|
|
|
|
|
|
|
--- a/plugins/housekeeping/meson.build |
|
|
|
|
|
|
|
+++ b/plugins/housekeeping/meson.build |
|
|
|
|
|
|
|
@@ -1,40 +1,43 @@ |
|
|
|
|
|
|
|
common_files = files( |
|
|
|
|
|
|
|
'gsd-disk-space.c', |
|
|
|
|
|
|
|
- 'gsd-disk-space-helper.c' |
|
|
|
|
|
|
|
+ 'gsd-disk-space-helper.c', |
|
|
|
|
|
|
|
+ 'gsd-gpu-mem.c' |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sources = common_files + files( |
|
|
|
|
|
|
|
'gsd-housekeeping-manager.c', |
|
|
|
|
|
|
|
'main.c' |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deps = plugins_deps + [ |
|
|
|
|
|
|
|
gtk_dep, |
|
|
|
|
|
|
|
- libnotify_dep |
|
|
|
|
|
|
|
+ libnotify_dep, |
|
|
|
|
|
|
|
+ m_dep, |
|
|
|
|
|
|
|
+ dl_dep |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
executable( |
|
|
|
|
|
|
|
'gsd-' + plugin_name, |
|
|
|
|
|
|
|
sources, |
|
|
|
|
|
|
|
include_directories: [top_inc, common_inc], |
|
|
|
|
|
|
|
dependencies: deps, |
|
|
|
|
|
|
|
c_args: cflags, |
|
|
|
|
|
|
|
install: true, |
|
|
|
|
|
|
|
install_rpath: gsd_pkglibdir, |
|
|
|
|
|
|
|
install_dir: gsd_libexecdir |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
programs = [ |
|
|
|
|
|
|
|
'gsd-disk-space-test', |
|
|
|
|
|
|
|
'gsd-empty-trash-test', |
|
|
|
|
|
|
|
'gsd-purge-temp-test' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach program: programs |
|
|
|
|
|
|
|
executable( |
|
|
|
|
|
|
|
program, |
|
|
|
|
|
|
|
common_files + [program + '.c'], |
|
|
|
|
|
|
|
include_directories: top_inc, |
|
|
|
|
|
|
|
dependencies: deps |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
endforeach |
|
|
|
diff --git a/plugins/housekeeping/nvml/include/nvml.h b/plugins/housekeeping/nvml/include/nvml.h |
|
|
|
diff --git a/plugins/housekeeping/nvml/include/nvml.h b/plugins/housekeeping/nvml/include/nvml.h |
|
|
|
new file mode 100644 |
|
|
|
new file mode 100644 |
|
|
|
index 00000000..778b4bfb |
|
|
|
index 00000000..f151007e |
|
|
|
--- /dev/null |
|
|
|
--- /dev/null |
|
|
|
+++ b/plugins/housekeeping/nvml/include/nvml.h |
|
|
|
+++ b/plugins/housekeeping/nvml/include/nvml.h |
|
|
|
@@ -0,0 +1,4447 @@ |
|
|
|
@@ -0,0 +1,4447 @@ |
|
|
@ -4861,5 +5096,5 @@ index 00000000..778b4bfb |
|
|
|
+ |
|
|
|
+ |
|
|
|
+#endif |
|
|
|
+#endif |
|
|
|
-- |
|
|
|
-- |
|
|
|
2.14.2 |
|
|
|
2.17.0 |
|
|
|
|
|
|
|
|
|
|
|