Commit 3bb63e64 authored by Julian Sparber's avatar Julian Sparber
Browse files

debian: add autostart patches

parent 9a456a19
From 97269915558801d1da745adf366cc9e0693fa155 Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Thu, 3 Dec 2020 22:54:42 +0100
Subject: [PATCH 1/2] add option to start hidden
---
src/application.vala | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/application.vala b/src/application.vala
index 2e67046..6104aef 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -21,6 +21,7 @@ namespace Clocks {
public class Application : Gtk.Application {
const OptionEntry[] OPTION_ENTRIES = {
{ "version", 'v', 0, OptionArg.NONE, null, N_("Print version information and exit"), null },
+ { "hidden", 0, 0, OptionArg.NONE, null, N_("Start without showing a window"), null },
{ (string) null }
};
@@ -36,6 +37,7 @@ public class Application : Gtk.Application {
private World.ShellWorldClocks world_clocks;
private uint world_clocks_id = 0;
private Window? window;
+ private bool start_hidden = false;
private List<string> system_notifications;
private Window ensure_window () ensures (window != null) {
@@ -96,7 +98,11 @@ public class Application : Gtk.Application {
base.activate ();
var win = ensure_window ();
- win.present ();
+ if (!start_hidden) {
+ win.present ();
+ } else {
+ start_hidden = false;
+ }
win.focus_in_event.connect (() => {
withdraw_notifications ();
@@ -142,6 +148,9 @@ public class Application : Gtk.Application {
print ("%s %s\n", (string) Environment.get_application_name (), Config.VERSION);
return 0;
}
+ if (options.contains("hidden")) {
+ start_hidden = true;
+ }
return -1;
}
@@ -155,6 +164,7 @@ public class Application : Gtk.Application {
win.show_world ();
win.present ();
+
var world = GWeather.Location.get_world ();
if (world != null) {
// The result is actually nullable
--
2.29.2
From 90e7b1783e2da8ee804a43f0c5516aacf7edc87d Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Fri, 27 Nov 2020 18:47:34 +0100
Subject: [PATCH 2/2] autostart gnome-clocks
---
data/meson.build | 10 +++++++++-
data/org.gnome.clocks-daemon.desktop.in | 16 ++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 data/org.gnome.clocks-daemon.desktop.in
diff --git a/data/meson.build b/data/meson.build
index c0817fd..497b3be 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -46,6 +46,15 @@ if desktop_file_validate.found()
endif
+desktop_daemon_file = i18n.merge_file(
+ input : 'org.gnome.clocks-daemon.desktop.in',
+ output : '@0@-daemon.desktop'.format(app_id),
+ type : 'desktop',
+ po_dir : '../po',
+ install : true,
+ install_dir : join_paths(get_option('sysconfdir'), 'xdg/autostart')
+)
+
dbusconf = configuration_data()
dbusconf.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
dbusconf.set('name', app_id)
@@ -113,4 +122,3 @@ if glib_compile_schemas.found()
]
)
endif
-
diff --git a/data/org.gnome.clocks-daemon.desktop.in b/data/org.gnome.clocks-daemon.desktop.in
new file mode 100644
index 0000000..49187ca
--- /dev/null
+++ b/data/org.gnome.clocks-daemon.desktop.in
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=Clocks
+GenericName=Clocks
+X-GNOME-FullName=GNOME Clocks
+Comment=Clocks for world times, plus alarms, stopwatch and a timer
+# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
+Keywords=time;timer;alarm;world clock;stopwatch;time zone;
+Exec=gnome-clocks --hidden
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
+Icon=@icon@
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;Utility;Clock;
+StartupNotify=false
+NoDisplay=true
+X-GNOME-AutoRestart=true
--
2.29.2
......@@ -31,3 +31,6 @@
# Don't show numpad when setting a new alarm/timer:
# https://gitlab.gnome.org/GNOME/gnome-clocks/-/merge_requests/150
0001-Don-t-show-numpad-when-setting-a-new-alarm-timer.patch
# Autostart Clocks
0001-add-option-to-start-hidden.patch
0002-autostart-gnome-clocks.patch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment