diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cefb133 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/gnome-kiosk-40.0.tar.xz diff --git a/.gnome-kiosk.metadata b/.gnome-kiosk.metadata new file mode 100644 index 0000000..3452459 --- /dev/null +++ b/.gnome-kiosk.metadata @@ -0,0 +1 @@ +7299ed3df18e96a6258a22e88b6418dc578ac8bb SOURCES/gnome-kiosk-40.0.tar.xz diff --git a/SOURCES/0001-compositor-Ignore-some-of-the-builtin-keybindings.patch b/SOURCES/0001-compositor-Ignore-some-of-the-builtin-keybindings.patch new file mode 100644 index 0000000..02e3482 --- /dev/null +++ b/SOURCES/0001-compositor-Ignore-some-of-the-builtin-keybindings.patch @@ -0,0 +1,239 @@ +From 28a560fdc1a8571d0e1d34da5cb57f43d2fe1a54 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 11 Aug 2021 14:47:05 -0400 +Subject: [PATCH 1/6] compositor: Ignore some of the builtin keybindings + +Mutter on wayland currently has a bug where it crashes if the run dialog +keybinding is pressed. No one notices the bug for gnome-shell, since +gnome-shell overrides mutters run dialog keybinding. + +This commit makes GNOME Kiosk also override the keybinding to avoid the +crash. At the same time it neuters a few other builtin keybindings that +aren't so useful to GNOME Kiosk. +--- + compositor/kiosk-compositor.c | 90 +++++++++++++++++++++++++++++++++++ + 1 file changed, 90 insertions(+) + +diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c +index 43329c7..2db58ed 100644 +--- a/compositor/kiosk-compositor.c ++++ b/compositor/kiosk-compositor.c +@@ -1,42 +1,43 @@ + #include "config.h" + #include "kiosk-compositor.h" + + #include + #include + + #include + + #include + #include + #include + #include ++#include + #include + #include + #include + + #include + + #include "kiosk-backgrounds.h" + #include "kiosk-input-sources-manager.h" + #include "kiosk-service.h" + + #include "org.gnome.DisplayManager.Manager.h" + + struct _KioskCompositor + { + MetaPlugin parent; + + /* weak references */ + MetaDisplay *display; + ClutterBackend *backend; + ClutterActor *stage; + + /* strong references */ + GCancellable *cancellable; + KioskBackgrounds *backgrounds; + KioskInputSourcesManager *input_sources_manager; + KioskService *service; + }; + + enum { + X_SERVER_EVENT, +@@ -103,82 +104,171 @@ register_with_display_manager (KioskCompositor *self) + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{ss}")); + + gdm_manager_call_register_display_sync (display_manager, + g_variant_builder_end (&builder), + self->cancellable, + &error); + + if (error != NULL) { + g_debug ("KioskCompositor: Could not register with display manager: %s", + error->message); + return; + } + } + + static void + register_with_systemd (KioskCompositor *self) + { + sd_notify (TRUE, "READY=1"); + } + + static void + register_session (KioskCompositor *self) + { + meta_register_with_session (); + + register_with_display_manager (self); + + register_with_systemd (self); + } + ++static void ++on_builtin_keybinding_triggered (MetaDisplay *display, ++ MetaWindow *window, ++ ClutterKeyEvent *event, ++ MetaKeyBinding *binding, ++ KioskCompositor *self) ++{ ++ g_debug ("KioskCompositor: Ignoring '%s' request", ++ meta_key_binding_get_name (binding)); ++} ++ ++static void ++neuter_builtin_keybindings (KioskCompositor *self) ++{ ++ const char *builtin_keybindings[] = { ++ "switch-to-workspace-1", ++ "switch-to-workspace-2", ++ "switch-to-workspace-3", ++ "switch-to-workspace-4", ++ "switch-to-workspace-5", ++ "switch-to-workspace-6", ++ "switch-to-workspace-7", ++ "switch-to-workspace-8", ++ "switch-to-workspace-9", ++ "switch-to-workspace-10", ++ "switch-to-workspace-11", ++ "switch-to-workspace-12", ++ "switch-to-workspace-left", ++ "switch-to-workspace-right", ++ "switch-to-workspace-up", ++ "switch-to-workspace-down", ++ "switch-to-workspace-last", ++ "panel-main-menu", ++ "panel-run-dialog", ++ "set-spew-mark", ++ "switch-monitor", ++ "rotate-monitor", ++ "switch-to-session-1", ++ "switch-to-session-2", ++ "switch-to-session-3", ++ "switch-to-session-4", ++ "switch-to-session-5", ++ "switch-to-session-6", ++ "switch-to-session-7", ++ "switch-to-session-8", ++ "switch-to-session-9", ++ "switch-to-session-10", ++ "switch-to-session-11", ++ "switch-to-session-12", ++ "restore-shortcuts", ++ "activate-window-menu", ++ "toggle-above", ++ "toggle-shaded", ++ "minimize", ++ "toggle-on-all-workspaces", ++ "move-to-workspace-1", ++ "move-to-workspace-2", ++ "move-to-workspace-3", ++ "move-to-workspace-4", ++ "move-to-workspace-5", ++ "move-to-workspace-6", ++ "move-to-workspace-7", ++ "move-to-workspace-8", ++ "move-to-workspace-9", ++ "move-to-workspace-10", ++ "move-to-workspace-11", ++ "move-to-workspace-12", ++ "move-to-workspace-last", ++ "move-to-workspace-left", ++ "move-to-workspace-right", ++ "move-to-workspace-up", ++ "move-to-workspace-down", ++ NULL ++ }; ++ size_t i; ++ ++ g_debug ("KioskCompositor: Neutering builtin keybindings"); ++ ++ for (i = 0; builtin_keybindings[i] != NULL; i++) { ++ meta_keybindings_set_custom_handler (builtin_keybindings[i], ++ (MetaKeyHandlerFunc) ++ on_builtin_keybinding_triggered, ++ self, ++ NULL); ++ } ++} ++ + static void + kiosk_compositor_start (MetaPlugin *plugin) + { + KioskCompositor *self = KIOSK_COMPOSITOR (plugin); + g_autoptr (GError) error = NULL; + + g_set_weak_pointer (&self->display, meta_plugin_get_display (META_PLUGIN (self))); + g_set_weak_pointer (&self->backend, clutter_get_default_backend ()); + g_set_weak_pointer (&self->stage, meta_get_stage_for_display (self->display)); + + clutter_actor_show (self->stage); + + self->cancellable = g_cancellable_new (); + + self->service = kiosk_service_new (self); + kiosk_service_start (self->service, &error); + + if (error != NULL) { + g_debug ("KioskCompositor: Could not start D-Bus service: %s", error->message); + g_clear_error (&error); + } + ++ neuter_builtin_keybindings (self); ++ + self->backgrounds = kiosk_backgrounds_new (self); + self->input_sources_manager = kiosk_input_sources_manager_new (self); + + register_session (self); + } + + static void + kiosk_compositor_minimize (MetaPlugin *plugin, + MetaWindowActor *actor) + { + meta_plugin_minimize_completed (plugin, actor); + } + + static void + kiosk_compositor_unminimize (MetaPlugin *plugin, + MetaWindowActor *actor) + { + meta_plugin_unminimize_completed (plugin, actor); + } + + static void + kiosk_compositor_size_changed (MetaPlugin *plugin, + MetaWindowActor *actor) + { + g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->size_changed == NULL); + } + + static void + kiosk_compositor_size_change (MetaPlugin *plugin, + MetaWindowActor *actor, +-- +2.31.1 + diff --git a/SOURCES/0001-compositor-Support-systemd-user-sessions.patch b/SOURCES/0001-compositor-Support-systemd-user-sessions.patch new file mode 100644 index 0000000..b9823c8 --- /dev/null +++ b/SOURCES/0001-compositor-Support-systemd-user-sessions.patch @@ -0,0 +1,429 @@ +From 00aa37d927c3fd24769bd5c68a8a1ddc9acfb7bd Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 6 Aug 2021 17:51:14 -0400 +Subject: [PATCH 1/2] compositor: Support systemd --user sessions + +This commit adds unit files for supporting starting org.gnome.Kiosk +from systemd --user. +--- + compositor/data/org.gnome.Kiosk.desktop.in.in | 1 + + .../data/systemd/org.gnome.Kiosk.target | 10 ++++++++ + .../org.gnome.Kiosk@wayland.service.in | 20 ++++++++++++++++ + .../systemd/org.gnome.Kiosk@x11.service.in | 20 ++++++++++++++++ + compositor/kiosk-compositor.c | 10 ++++++++ + meson.build | 24 +++++++++++++++++++ + 6 files changed, 85 insertions(+) + create mode 100644 compositor/data/systemd/org.gnome.Kiosk.target + create mode 100644 compositor/data/systemd/org.gnome.Kiosk@wayland.service.in + create mode 100644 compositor/data/systemd/org.gnome.Kiosk@x11.service.in + +diff --git a/compositor/data/org.gnome.Kiosk.desktop.in.in b/compositor/data/org.gnome.Kiosk.desktop.in.in +index bb603c8..cdbbe6a 100644 +--- a/compositor/data/org.gnome.Kiosk.desktop.in.in ++++ b/compositor/data/org.gnome.Kiosk.desktop.in.in +@@ -1,12 +1,13 @@ + [Desktop Entry] + Type=Application + Name=GNOME Kiosk + Comment=Compositor for Kiosk and Single Application deployments + Exec=@bindir@/gnome-kiosk + Categories=GNOME;GTK;Core;System; + OnlyShowIn=GNOME; + NoDisplay=true + X-GNOME-Autostart-Phase=DisplayServer + X-GNOME-Provides=panel;windowmanager; + X-GNOME-Autostart-Notify=true + X-GNOME-AutoRestart=false ++X-GNOME-HiddenUnderSystemd=true +diff --git a/compositor/data/systemd/org.gnome.Kiosk.target b/compositor/data/systemd/org.gnome.Kiosk.target +new file mode 100644 +index 0000000..eb92b4a +--- /dev/null ++++ b/compositor/data/systemd/org.gnome.Kiosk.target +@@ -0,0 +1,10 @@ ++[Unit] ++Description=GNOME Kiosk ++DefaultDependencies=no ++ ++Requisite=gnome-session-initialized.target ++PartOf=gnome-session-initialized.target ++Before=gnome-session-initialized.target ++ ++Wants=org.gnome.Kiosk@wayland.service ++Wants=org.gnome.Kiosk@x11.service +diff --git a/compositor/data/systemd/org.gnome.Kiosk@wayland.service.in b/compositor/data/systemd/org.gnome.Kiosk@wayland.service.in +new file mode 100644 +index 0000000..19cd4a0 +--- /dev/null ++++ b/compositor/data/systemd/org.gnome.Kiosk@wayland.service.in +@@ -0,0 +1,20 @@ ++[Unit] ++Description=GNOME Kiosk on Wayland ++OnFailure=gnome-session-shutdown.target ++OnFailureJobMode=replace-irreversibly ++CollectMode=inactive-or-failed ++RefuseManualStart=on ++RefuseManualStop=on ++After=gnome-session-manager.target ++Requisite=gnome-session-initialized.target ++PartOf=gnome-session-initialized.target ++Before=gnome-session-initialized.target ++ConditionEnvironment=XDG_SESSION_TYPE=%I ++ ++[Service] ++Slice=session.slice ++Type=notify ++ExecStart=/usr/bin/gnome-kiosk ++ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY' ++Restart=no ++TimeoutStopSec=5 +diff --git a/compositor/data/systemd/org.gnome.Kiosk@x11.service.in b/compositor/data/systemd/org.gnome.Kiosk@x11.service.in +new file mode 100644 +index 0000000..291baaa +--- /dev/null ++++ b/compositor/data/systemd/org.gnome.Kiosk@x11.service.in +@@ -0,0 +1,20 @@ ++[Unit] ++Description=GNOME Kiosk on X11 ++OnFailure=gnome-session-failed.target ++OnFailureJobMode=replace ++CollectMode=inactive-or-failed ++RefuseManualStart=on ++RefuseManualStop=on ++After=gnome-session-manager.target ++Requisite=gnome-session-initialized.target ++PartOf=gnome-session-initialized.target ++Before=gnome-session-initialized.target ++ConditionEnvironment=XDG_SESSION_TYPE=%I ++ ++[Service] ++Slice=session.slice ++Type=notify ++ExecStart=/usr/bin/gnome-kiosk ++Restart=always ++RestartSec=0ms ++TimeoutStopSec=5 +diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c +index 6753a87..43329c7 100644 +--- a/compositor/kiosk-compositor.c ++++ b/compositor/kiosk-compositor.c +@@ -1,46 +1,48 @@ + #include "config.h" + #include "kiosk-compositor.h" + + #include + #include + + #include + + #include + #include + #include + #include + #include + #include + #include + ++#include ++ + #include "kiosk-backgrounds.h" + #include "kiosk-input-sources-manager.h" + #include "kiosk-service.h" + + #include "org.gnome.DisplayManager.Manager.h" + + struct _KioskCompositor + { + MetaPlugin parent; + + /* weak references */ + MetaDisplay *display; + ClutterBackend *backend; + ClutterActor *stage; + + /* strong references */ + GCancellable *cancellable; + KioskBackgrounds *backgrounds; + KioskInputSourcesManager *input_sources_manager; + KioskService *service; + }; + + enum { + X_SERVER_EVENT, + NUMBER_OF_SIGNALS + }; + + static guint signals [NUMBER_OF_SIGNALS] = { 0, }; + + G_DEFINE_TYPE (KioskCompositor, kiosk_compositor, META_TYPE_PLUGIN) +@@ -85,66 +87,74 @@ register_with_display_manager (KioskCompositor *self) + } + + display_manager = gdm_manager_proxy_new_sync (system_bus, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + "org.gnome.DisplayManager", + "/org/gnome/DisplayManager/Manager", + self->cancellable, + &error); + + if (error != NULL) { + g_debug ("KioskCompositor: Could not contact display manager: %s", + error->message); + return; + } + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{ss}")); + + gdm_manager_call_register_display_sync (display_manager, + g_variant_builder_end (&builder), + self->cancellable, + &error); + + if (error != NULL) { + g_debug ("KioskCompositor: Could not register with display manager: %s", + error->message); + return; + } + } + ++static void ++register_with_systemd (KioskCompositor *self) ++{ ++ sd_notify (TRUE, "READY=1"); ++} ++ + static void + register_session (KioskCompositor *self) + { + meta_register_with_session (); + + register_with_display_manager (self); ++ ++ register_with_systemd (self); + } + + static void + kiosk_compositor_start (MetaPlugin *plugin) + { + KioskCompositor *self = KIOSK_COMPOSITOR (plugin); + g_autoptr (GError) error = NULL; + + g_set_weak_pointer (&self->display, meta_plugin_get_display (META_PLUGIN (self))); + g_set_weak_pointer (&self->backend, clutter_get_default_backend ()); + g_set_weak_pointer (&self->stage, meta_get_stage_for_display (self->display)); + + clutter_actor_show (self->stage); + + self->cancellable = g_cancellable_new (); + + self->service = kiosk_service_new (self); + kiosk_service_start (self->service, &error); + + if (error != NULL) { + g_debug ("KioskCompositor: Could not start D-Bus service: %s", error->message); + g_clear_error (&error); + } + + self->backgrounds = kiosk_backgrounds_new (self); + self->input_sources_manager = kiosk_input_sources_manager_new (self); + + register_session (self); + } + +diff --git a/meson.build b/meson.build +index 0766f8d..c2988ad 100644 +--- a/meson.build ++++ b/meson.build +@@ -9,60 +9,64 @@ c_compiler = meson.get_compiler('c') + + gnome = import('gnome') + i18n = import('i18n') + + prefix = get_option('prefix') + datadir = join_paths(prefix, get_option('datadir')) + bindir = join_paths(prefix, get_option('bindir')) + localedir = join_paths(datadir, 'locale') + desktop_data_dir = join_paths(datadir, 'applications') + session_dir = join_paths(datadir, 'gnome-session', 'sessions') + xsessions_dir = join_paths(datadir, 'xsessions') + + po_dir = join_paths(meson.current_source_dir(), 'po') + + config_data = configuration_data() + config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name()) + config_data.set_quoted('VERSION', meson.project_version()) + config_data.set_quoted('LOCALEDIR', localedir) + + config_h = configure_file( + input: 'config.h.meson', + output: 'config.h', + configuration: config_data + ) + + meson.add_install_script ('meson/postinstall.py') + + mutter_dependency = dependency('libmutter-8') + mutter_libdir = mutter_dependency.get_pkgconfig_variable('typelibdir') + ++systemd_user_unit_dir = dependency('systemd').get_pkgconfig_variable('systemduserunitdir', ++ define_variable: ['prefix', prefix]) ++systemd_dependency = dependency('libsystemd') ++ + dbus_proxies = [] + dbus_proxies += { + 'prefix': 'org.gnome.DisplayManager', + 'namespace': 'Gdm', + 'interface': 'Manager', + } + + dbus_proxies += { + 'prefix': 'org.freedesktop', + 'namespace': 'Sd', + 'interface': 'locale1', + } + + dbus_proxies += { + 'prefix': 'org.gnome', + 'namespace': 'Gsm', + 'interface': 'SessionManager', + } + + dbus_interface_sources_map = {} + foreach dbus_proxy : dbus_proxies + dbus_interface = dbus_proxy['prefix'] + '.' + dbus_proxy['interface'] + dbus_interface_file = join_paths('dbus-interfaces', dbus_interface + '.xml') + sources = gnome.gdbus_codegen(dbus_interface, dbus_interface_file, + namespace: dbus_proxy['namespace'], + interface_prefix: dbus_proxy['prefix'], + ) + dbus_interface_sources_map += { dbus_interface: sources } + endforeach + +@@ -75,103 +79,123 @@ sources = gnome.gdbus_codegen(dbus_interface, dbus_interface_file, + annotations: [ + [ dbus_interface, 'org.gtk.GDBus.C.Name', 'Service' ], + [ dbus_interface + '.InputSources', 'org.gtk.GDBus.C.Name', 'InputSourcesManager' ], + [ dbus_interface + '.InputSources.InputSource', 'org.gtk.GDBus.C.Name', 'InputSource' ], + ] + ) + dbus_interface_sources_map += { dbus_interface: sources } + + dbus_interface = 'org.gnome.Shell' + dbus_interface_file = join_paths('dbus-interfaces', dbus_interface + '.xml') + sources = gnome.gdbus_codegen(dbus_interface, dbus_interface_file, + namespace: 'Kiosk', + interface_prefix: 'org.gnome', + annotations: [ + [ dbus_interface, 'org.gtk.GDBus.C.Name', 'ShellDBusService' ] + ] + ) + dbus_interface_sources_map += { dbus_interface: sources } + + compositor_dependencies = [] + compositor_dependencies += c_compiler.find_library('m') + compositor_dependencies += dependency('gio-2.0') + compositor_dependencies += dependency('glib-2.0') + compositor_dependencies += dependency('gnome-desktop-3.0') + compositor_dependencies += dependency('gobject-2.0') + compositor_dependencies += dependency('ibus-1.0') + compositor_dependencies += dependency('mutter-cogl-8') + compositor_dependencies += dependency('mutter-cogl-pango-8') + compositor_dependencies += dependency('mutter-clutter-8') + compositor_dependencies += mutter_dependency ++compositor_dependencies += systemd_dependency + + compositor_sources = [] + compositor_sources += 'compositor/kiosk-backgrounds.c' + compositor_sources += 'compositor/kiosk-compositor.c' + compositor_sources += 'compositor/kiosk-dbus-utils.c' + compositor_sources += 'compositor/kiosk-gobject-utils.c' + compositor_sources += 'compositor/kiosk-input-sources-manager.c' + compositor_sources += 'compositor/kiosk-input-engine-manager.c' + compositor_sources += 'compositor/kiosk-input-source-group.c' + compositor_sources += 'compositor/kiosk-service.c' + compositor_sources += 'compositor/kiosk-shell-service.c' + compositor_sources += 'compositor/kiosk-x-keyboard-manager.c' + compositor_sources += 'compositor/main.c' + + foreach dbus_interface, sources: dbus_interface_sources_map + compositor_sources += sources + endforeach + + executable('gnome-kiosk', compositor_sources, + dependencies: compositor_dependencies, + build_rpath: mutter_libdir, + install_rpath: mutter_libdir, + install: true + ) + + desktop_config_data = configuration_data() + desktop_config_data.set('bindir', bindir) + + desktop_file = configure_file( + input: 'compositor/data/org.gnome.Kiosk.desktop.in.in', + output: 'org.gnome.Kiosk.desktop.in', + configuration: desktop_config_data + ) + + i18n.merge_file('desktop', + input: desktop_file, + output: 'org.gnome.Kiosk.desktop', + po_dir: po_dir, + install: true, + install_dir: desktop_data_dir, + type: 'desktop' + ) + ++systemd_service_config_data = configuration_data() ++systemd_service_config_data.set('bindir', bindir) ++ ++systemd_service_files = [] ++systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@wayland.service.in' ++systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@x11.service.in' ++ ++foreach service_file : systemd_service_files ++ configure_file( ++ input: service_file, ++ output: '@BASENAME@', ++ configuration: systemd_service_config_data, ++ install_dir: systemd_user_unit_dir ++ ) ++endforeach ++ ++install_data('compositor/data/systemd/org.gnome.Kiosk.target', ++ install_dir: systemd_user_unit_dir) ++ + session_config_data = configuration_data() + session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;') + + session_file = configure_file( + input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in', + output: 'org.gnome.Kiosk.SearchApp.session.desktop.in', + configuration: session_config_data + ) + + subdir('input-selector') + + i18n.merge_file('desktop', + input: session_file, + output: 'org.gnome.Kiosk.SearchApp.session', + po_dir: po_dir, + install: true, + install_dir: session_dir, + type: 'desktop' + ) + + i18n.merge_file('desktop', + input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in', + output: 'org.gnome.Kiosk.SearchApp.Session.desktop', + po_dir: po_dir, + install: true, + install_dir: xsessions_dir, + type: 'desktop' + ) + + search_app_desktop_file = configure_file( +-- +2.31.1 + diff --git a/SOURCES/0002-Add-a-script-for-simplifying-kiosk-setup.patch b/SOURCES/0002-Add-a-script-for-simplifying-kiosk-setup.patch new file mode 100644 index 0000000..7bb444f --- /dev/null +++ b/SOURCES/0002-Add-a-script-for-simplifying-kiosk-setup.patch @@ -0,0 +1,309 @@ +From db768718666563f5ad9658ba4cc07987122b4e89 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Mon, 9 Aug 2021 10:30:36 -0400 +Subject: [PATCH 2/2] Add a script for simplifying kiosk setup + +This commit adds a new session "Kiosk Script Session" to the login +screen that starts a shell script that starts a gedit window that opens +the shell script. + +It should make it easy to customize the session to use a bespoke +application from within the session itself. +--- + .../org.gnome.Kiosk.Script.desktop.in.in | 4 ++ + kiosk-script/gnome-kiosk-script | 23 +++++++ + .../gnome-session/gnome-kiosk-script.session | 3 + + .../systemd/org.gnome.Kiosk.Script.service.in | 8 +++ + kiosk-script/systemd/session.conf | 3 + + .../gnome-kiosk-script-wayland.desktop.in | 9 +++ + .../gnome-kiosk-script-xorg.desktop.in | 9 +++ + meson.build | 61 ++++++++++++++++++- + 8 files changed, 118 insertions(+), 2 deletions(-) + create mode 100644 kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in + create mode 100755 kiosk-script/gnome-kiosk-script + create mode 100644 kiosk-script/gnome-session/gnome-kiosk-script.session + create mode 100644 kiosk-script/systemd/org.gnome.Kiosk.Script.service.in + create mode 100644 kiosk-script/systemd/session.conf + create mode 100644 kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in + create mode 100644 kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in + +diff --git a/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in +new file mode 100644 +index 0000000..dd562b2 +--- /dev/null ++++ b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in +@@ -0,0 +1,4 @@ ++[Desktop Entry] ++Name=Kiosk Script ++Type=Application ++Exec=gnome-kiosk-script +diff --git a/kiosk-script/gnome-kiosk-script b/kiosk-script/gnome-kiosk-script +new file mode 100755 +index 0000000..b595cd8 +--- /dev/null ++++ b/kiosk-script/gnome-kiosk-script +@@ -0,0 +1,23 @@ ++#!/usr/bin/sh ++ ++if [ ! -e ~/.local/bin/gnome-kiosk-script ]; then ++ mkdir -p ~/.local/bin ~/.config ++ cat > ~/.local/bin/gnome-kiosk-script <<- "EOF" ++ #!/bin/sh ++ # This script is located in ~/.local/bin. ++ # It's provided as an example script to show how ++ # the kiosk session works. At the moment, the script ++ # just starts a text editor open to itself, but it ++ # should get customized to instead start a full screen ++ # application designed for the kiosk deployment. ++ gedit ~/.local/bin/gnome-kiosk-script ++ ++ sleep 1.0 ++ exec "$0" "$@" ++EOF ++ ++ chmod +x ~/.local/bin/gnome-kiosk-script ++ touch ~/.config/gnome-initial-setup-done ++fi ++ ++exec ~/.local/bin/gnome-kiosk-script "$@" +diff --git a/kiosk-script/gnome-session/gnome-kiosk-script.session b/kiosk-script/gnome-session/gnome-kiosk-script.session +new file mode 100644 +index 0000000..3b2cc7b +--- /dev/null ++++ b/kiosk-script/gnome-session/gnome-kiosk-script.session +@@ -0,0 +1,3 @@ ++[GNOME Session] ++Name=Kiosk ++RequiredComponents=org.gnome.Kiosk;org.gnome.Kiosk.Script; +diff --git a/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in +new file mode 100644 +index 0000000..8194f1c +--- /dev/null ++++ b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in +@@ -0,0 +1,8 @@ ++[Unit] ++Description=Kiosk script ++BindsTo=gnome-session.target ++After=gnome-session.target ++ ++[Service] ++ExecStart=@bindir@/gnome-kiosk-script ++Restart=always +diff --git a/kiosk-script/systemd/session.conf b/kiosk-script/systemd/session.conf +new file mode 100644 +index 0000000..a948efb +--- /dev/null ++++ b/kiosk-script/systemd/session.conf +@@ -0,0 +1,3 @@ ++[Unit] ++Requires=org.gnome.Kiosk.target ++Requires=org.gnome.Kiosk.Script.service +diff --git a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in +new file mode 100644 +index 0000000..05e8dea +--- /dev/null ++++ b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in +@@ -0,0 +1,9 @@ ++[Desktop Entry] ++Name=Kiosk Script Session (Wayland Display Server) ++Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script ++Exec=gnome-session --session gnome-kiosk-script ++TryExec=gnome-session ++Type=Application ++DesktopNames=GNOME-Kiosk;GNOME; ++X-GDM-SessionRegisters=true ++ +diff --git a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in b/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in +new file mode 100644 +index 0000000..11dc0cf +--- /dev/null ++++ b/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in +@@ -0,0 +1,9 @@ ++[Desktop Entry] ++Name=Kiosk Script Session (X11 Display Server) ++Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script ++Exec=gnome-session --session gnome-kiosk-script ++TryExec=gnome-session ++Type=Application ++DesktopNames=GNOME-Kiosk;GNOME; ++X-GDM-SessionRegisters=true ++ +diff --git a/meson.build b/meson.build +index c2988ad..1f5a756 100644 +--- a/meson.build ++++ b/meson.build +@@ -1,49 +1,50 @@ + project('gnome-kiosk', 'c', + version: '40.0' + ) + add_project_arguments('-D_GNU_SOURCE', + language: 'c' + ) + + c_compiler = meson.get_compiler('c') + + gnome = import('gnome') + i18n = import('i18n') + + prefix = get_option('prefix') + datadir = join_paths(prefix, get_option('datadir')) + bindir = join_paths(prefix, get_option('bindir')) + localedir = join_paths(datadir, 'locale') + desktop_data_dir = join_paths(datadir, 'applications') + session_dir = join_paths(datadir, 'gnome-session', 'sessions') + xsessions_dir = join_paths(datadir, 'xsessions') ++wayland_sessions_dir = join_paths(datadir, 'wayland-sessions') + + po_dir = join_paths(meson.current_source_dir(), 'po') + + config_data = configuration_data() + config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name()) + config_data.set_quoted('VERSION', meson.project_version()) + config_data.set_quoted('LOCALEDIR', localedir) + + config_h = configure_file( + input: 'config.h.meson', + output: 'config.h', + configuration: config_data + ) + + meson.add_install_script ('meson/postinstall.py') + + mutter_dependency = dependency('libmutter-8') + mutter_libdir = mutter_dependency.get_pkgconfig_variable('typelibdir') + + systemd_user_unit_dir = dependency('systemd').get_pkgconfig_variable('systemduserunitdir', + define_variable: ['prefix', prefix]) + systemd_dependency = dependency('libsystemd') + + dbus_proxies = [] + dbus_proxies += { + 'prefix': 'org.gnome.DisplayManager', + 'namespace': 'Gdm', + 'interface': 'Manager', + } + +@@ -139,62 +140,118 @@ desktop_file = configure_file( + input: 'compositor/data/org.gnome.Kiosk.desktop.in.in', + output: 'org.gnome.Kiosk.desktop.in', + configuration: desktop_config_data + ) + + i18n.merge_file('desktop', + input: desktop_file, + output: 'org.gnome.Kiosk.desktop', + po_dir: po_dir, + install: true, + install_dir: desktop_data_dir, + type: 'desktop' + ) + + systemd_service_config_data = configuration_data() + systemd_service_config_data.set('bindir', bindir) + + systemd_service_files = [] + systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@wayland.service.in' + systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@x11.service.in' + + foreach service_file : systemd_service_files + configure_file( + input: service_file, + output: '@BASENAME@', + configuration: systemd_service_config_data, + install_dir: systemd_user_unit_dir + ) + endforeach + +-install_data('compositor/data/systemd/org.gnome.Kiosk.target', +- install_dir: systemd_user_unit_dir) ++install_data( ++ 'compositor/data/systemd/org.gnome.Kiosk.target', ++ install_dir: systemd_user_unit_dir ++) ++ ++install_data('kiosk-script/gnome-kiosk-script', ++ install_dir: bindir, ++ install_mode: 'rwxr-xr-x' ++) ++ ++desktop_file = configure_file( ++ input: 'kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in', ++ output: 'org.gnome.Kiosk.Script.desktop.in', ++ configuration: desktop_config_data ++) ++ ++i18n.merge_file('desktop', ++ input: desktop_file, ++ output: 'org.gnome.Kiosk.Script.desktop', ++ po_dir: po_dir, ++ install: true, ++ install_dir: desktop_data_dir, ++ type: 'desktop' ++) ++ ++configure_file( ++ input: 'kiosk-script/systemd/org.gnome.Kiosk.Script.service.in', ++ output: '@BASENAME@', ++ configuration: systemd_service_config_data, ++ install_dir: systemd_user_unit_dir ++) ++ ++kiosk_script_systemd_target_dir = join_paths(systemd_user_unit_dir, 'gnome-session@gnome-kiosk-script.target.d') ++install_data('kiosk-script/systemd/session.conf', ++ install_dir: kiosk_script_systemd_target_dir ++) ++ ++install_data('kiosk-script/gnome-session/gnome-kiosk-script.session', ++ install_dir: session_dir, ++) ++ ++i18n.merge_file('desktop', ++ input: 'kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in', ++ output: '@BASENAME@', ++ po_dir: po_dir, ++ install: true, ++ install_dir: xsessions_dir, ++ type: 'desktop' ++) ++ ++i18n.merge_file('desktop', ++ input: 'kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in', ++ output: '@BASENAME@', ++ po_dir: po_dir, ++ install: true, ++ install_dir: wayland_sessions_dir, ++ type: 'desktop' ++) + + session_config_data = configuration_data() + session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;') + + session_file = configure_file( + input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in', + output: 'org.gnome.Kiosk.SearchApp.session.desktop.in', + configuration: session_config_data + ) + + subdir('input-selector') + + i18n.merge_file('desktop', + input: session_file, + output: 'org.gnome.Kiosk.SearchApp.session', + po_dir: po_dir, + install: true, + install_dir: session_dir, + type: 'desktop' + ) + + i18n.merge_file('desktop', + input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in', + output: 'org.gnome.Kiosk.SearchApp.Session.desktop', + po_dir: po_dir, + install: true, + install_dir: xsessions_dir, + type: 'desktop' + ) + +-- +2.31.1 + diff --git a/SOURCES/0002-kiosk-script-Make-sure-desktop-file-for-script-is-hi.patch b/SOURCES/0002-kiosk-script-Make-sure-desktop-file-for-script-is-hi.patch new file mode 100644 index 0000000..ec712de --- /dev/null +++ b/SOURCES/0002-kiosk-script-Make-sure-desktop-file-for-script-is-hi.patch @@ -0,0 +1,31 @@ +From dccfdfa0852cba4b2ccd7d0daa8f9c779af4cb16 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 11 Aug 2021 14:51:22 -0400 +Subject: [PATCH 2/6] kiosk-script: Make sure desktop file for script is hidden + under systemd + +At the moment the kiosk-script session supports both systemd --user +sessions and old school gonme-session-only sessions. Unfortunately, +the desktop file for the Script application is missing the magic line +to make it get ignored when systemd --user is used. + +That leads to the script getting started twice + +This commit adds the magic line. +--- + kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in +index dd562b2..981dbc9 100644 +--- a/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in ++++ b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in +@@ -1,4 +1,5 @@ + [Desktop Entry] + Name=Kiosk Script + Type=Application + Exec=gnome-kiosk-script ++X-GNOME-HiddenUnderSystemd=true +-- +2.31.1 + diff --git a/SOURCES/0003-kiosk-script-Install-session-file-with-fallback-in-m.patch b/SOURCES/0003-kiosk-script-Install-session-file-with-fallback-in-m.patch new file mode 100644 index 0000000..e7218d5 --- /dev/null +++ b/SOURCES/0003-kiosk-script-Install-session-file-with-fallback-in-m.patch @@ -0,0 +1,62 @@ +From 0a9f3dc7cd45bda1fae2e17ab5ef17b1187327a2 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 11 Aug 2021 15:00:20 -0400 +Subject: [PATCH 3/6] kiosk-script: Install session file with fallback in mind + +--- + meson/postinstall.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/meson/postinstall.py b/meson/postinstall.py +index 537fb3f..ace3927 100755 +--- a/meson/postinstall.py ++++ b/meson/postinstall.py +@@ -1,38 +1,44 @@ + #!/usr/bin/env python3 + + import os + import shutil + import subprocess + import sys + + destdir = os.environ.get('DESTDIR', '/') + prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') + datadir = os.path.join(destdir + prefix, 'share') + ++xsessions_dir = os.path.join(datadir, 'xsessions') + wayland_sessions_dir = os.path.join(datadir, 'wayland-sessions') + if not os.path.exists(wayland_sessions_dir): + os.makedirs(wayland_sessions_dir) + +-source_file = os.path.join(datadir, 'xsessions', 'org.gnome.Kiosk.SearchApp.Session.desktop') ++source_file = os.path.join(xsessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop') + destination_file = os.path.join(wayland_sessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop') + shutil.copyfile(source_file, destination_file) + ++source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script-xorg.desktop') ++destination_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop') ++source_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script-wayland.desktop') ++destination_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script.desktop') ++ + # Packaging tools define DESTDIR and this isn't needed for them + if 'DESTDIR' not in os.environ: + print('Updating icon cache...') + icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') + if not os.path.exists(icon_cache_dir): + os.makedirs(icon_cache_dir) + subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) + + print('Updating desktop database...') + desktop_database_dir = os.path.join(datadir, 'applications') + if not os.path.exists(desktop_database_dir): + os.makedirs(desktop_database_dir) + subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) + + print('Compiling GSettings schemas...') + schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas') + if not os.path.exists(schemas_dir): + os.makedirs(schemas_dir) + subprocess.call(['glib-compile-schemas', schemas_dir]) +-- +2.31.1 + diff --git a/SOURCES/0004-kiosk-script-Give-xsession-and-wayland-session-file-.patch b/SOURCES/0004-kiosk-script-Give-xsession-and-wayland-session-file-.patch new file mode 100644 index 0000000..a680739 --- /dev/null +++ b/SOURCES/0004-kiosk-script-Give-xsession-and-wayland-session-file-.patch @@ -0,0 +1,188 @@ +From 2bd27ae9e08d6848ab14cde0a8bf81827df7a98b Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 11 Aug 2021 15:03:38 -0400 +Subject: [PATCH 4/6] kiosk-script: Give xsession and wayland-session file the + same name + +In order for fallback logic to work properly, the two session names +need to be the same. + +This commit fixes that. +--- + .../gnome-kiosk-script.desktop.in} | 2 +- + .../gnome-kiosk-script-wayland.desktop.in | 9 --------- + meson.build | 12 ++---------- + meson/postinstall.py | 5 ++--- + 4 files changed, 5 insertions(+), 23 deletions(-) + rename kiosk-script/{xsessions/gnome-kiosk-script-xorg.desktop.in => sessions/gnome-kiosk-script.desktop.in} (84%) + delete mode 100644 kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in + +diff --git a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in b/kiosk-script/sessions/gnome-kiosk-script.desktop.in +similarity index 84% +rename from kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in +rename to kiosk-script/sessions/gnome-kiosk-script.desktop.in +index 11dc0cf..36f810f 100644 +--- a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in ++++ b/kiosk-script/sessions/gnome-kiosk-script.desktop.in +@@ -1,9 +1,9 @@ + [Desktop Entry] +-Name=Kiosk Script Session (X11 Display Server) ++Name=Kiosk Script Session + Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script + Exec=gnome-session --session gnome-kiosk-script + TryExec=gnome-session + Type=Application + DesktopNames=GNOME-Kiosk;GNOME; + X-GDM-SessionRegisters=true + +diff --git a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in +deleted file mode 100644 +index 05e8dea..0000000 +--- a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in ++++ /dev/null +@@ -1,9 +0,0 @@ +-[Desktop Entry] +-Name=Kiosk Script Session (Wayland Display Server) +-Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script +-Exec=gnome-session --session gnome-kiosk-script +-TryExec=gnome-session +-Type=Application +-DesktopNames=GNOME-Kiosk;GNOME; +-X-GDM-SessionRegisters=true +- +diff --git a/meson.build b/meson.build +index 1f5a756..0faf9fe 100644 +--- a/meson.build ++++ b/meson.build +@@ -181,75 +181,67 @@ desktop_file = configure_file( + input: 'kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in', + output: 'org.gnome.Kiosk.Script.desktop.in', + configuration: desktop_config_data + ) + + i18n.merge_file('desktop', + input: desktop_file, + output: 'org.gnome.Kiosk.Script.desktop', + po_dir: po_dir, + install: true, + install_dir: desktop_data_dir, + type: 'desktop' + ) + + configure_file( + input: 'kiosk-script/systemd/org.gnome.Kiosk.Script.service.in', + output: '@BASENAME@', + configuration: systemd_service_config_data, + install_dir: systemd_user_unit_dir + ) + + kiosk_script_systemd_target_dir = join_paths(systemd_user_unit_dir, 'gnome-session@gnome-kiosk-script.target.d') + install_data('kiosk-script/systemd/session.conf', + install_dir: kiosk_script_systemd_target_dir + ) + + install_data('kiosk-script/gnome-session/gnome-kiosk-script.session', + install_dir: session_dir, + ) + +-i18n.merge_file('desktop', +- input: 'kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in', +- output: '@BASENAME@', +- po_dir: po_dir, +- install: true, +- install_dir: xsessions_dir, +- type: 'desktop' +-) + + i18n.merge_file('desktop', +- input: 'kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in', ++ input: 'kiosk-script/sessions/gnome-kiosk-script.desktop.in', + output: '@BASENAME@', + po_dir: po_dir, + install: true, +- install_dir: wayland_sessions_dir, ++ install_dir: xsessions_dir, + type: 'desktop' + ) + + session_config_data = configuration_data() + session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;') + + session_file = configure_file( + input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in', + output: 'org.gnome.Kiosk.SearchApp.session.desktop.in', + configuration: session_config_data + ) + + subdir('input-selector') + + i18n.merge_file('desktop', + input: session_file, + output: 'org.gnome.Kiosk.SearchApp.session', + po_dir: po_dir, + install: true, + install_dir: session_dir, + type: 'desktop' + ) + + i18n.merge_file('desktop', + input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in', + output: 'org.gnome.Kiosk.SearchApp.Session.desktop', + po_dir: po_dir, + install: true, + install_dir: xsessions_dir, + type: 'desktop' +diff --git a/meson/postinstall.py b/meson/postinstall.py +index ace3927..430ae6c 100755 +--- a/meson/postinstall.py ++++ b/meson/postinstall.py +@@ -1,44 +1,43 @@ + #!/usr/bin/env python3 + + import os + import shutil + import subprocess + import sys + + destdir = os.environ.get('DESTDIR', '/') + prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') + datadir = os.path.join(destdir + prefix, 'share') + + xsessions_dir = os.path.join(datadir, 'xsessions') + wayland_sessions_dir = os.path.join(datadir, 'wayland-sessions') + if not os.path.exists(wayland_sessions_dir): + os.makedirs(wayland_sessions_dir) + + source_file = os.path.join(xsessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop') + destination_file = os.path.join(wayland_sessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop') + shutil.copyfile(source_file, destination_file) + +-source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script-xorg.desktop') +-destination_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop') +-source_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script-wayland.desktop') ++source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop') + destination_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script.desktop') ++shutil.copyfile(source_file, destination_file) + + # Packaging tools define DESTDIR and this isn't needed for them + if 'DESTDIR' not in os.environ: + print('Updating icon cache...') + icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') + if not os.path.exists(icon_cache_dir): + os.makedirs(icon_cache_dir) + subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) + + print('Updating desktop database...') + desktop_database_dir = os.path.join(datadir, 'applications') + if not os.path.exists(desktop_database_dir): + os.makedirs(desktop_database_dir) + subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) + + print('Compiling GSettings schemas...') + schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas') + if not os.path.exists(schemas_dir): + os.makedirs(schemas_dir) + subprocess.call(['glib-compile-schemas', schemas_dir]) +-- +2.31.1 + diff --git a/SOURCES/0005-kiosk-script-Add-a-hint-about-using-firefox-to-the-k.patch b/SOURCES/0005-kiosk-script-Add-a-hint-about-using-firefox-to-the-k.patch new file mode 100644 index 0000000..12dbb96 --- /dev/null +++ b/SOURCES/0005-kiosk-script-Add-a-hint-about-using-firefox-to-the-k.patch @@ -0,0 +1,46 @@ +From eeb5eb5688fd55fad3bb7e07c250cdd1f580b5ca Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 11 Aug 2021 15:05:22 -0400 +Subject: [PATCH 5/6] kiosk-script: Add a hint about using firefox to the kiosk + script + +Many kiosk deployments are going to use a web browser, so it makes +sense to give a hint about how to do that. + +This commit suggests firefox --kiosk in the script comment +--- + kiosk-script/gnome-kiosk-script | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kiosk-script/gnome-kiosk-script b/kiosk-script/gnome-kiosk-script +index b595cd8..989af41 100755 +--- a/kiosk-script/gnome-kiosk-script ++++ b/kiosk-script/gnome-kiosk-script +@@ -1,23 +1,24 @@ + #!/usr/bin/sh + + if [ ! -e ~/.local/bin/gnome-kiosk-script ]; then + mkdir -p ~/.local/bin ~/.config + cat > ~/.local/bin/gnome-kiosk-script <<- "EOF" + #!/bin/sh + # This script is located in ~/.local/bin. + # It's provided as an example script to show how + # the kiosk session works. At the moment, the script + # just starts a text editor open to itself, but it + # should get customized to instead start a full screen + # application designed for the kiosk deployment. ++ # e.g., firefox --kiosk https://www.google.com + gedit ~/.local/bin/gnome-kiosk-script + + sleep 1.0 + exec "$0" "$@" + EOF + + chmod +x ~/.local/bin/gnome-kiosk-script + touch ~/.config/gnome-initial-setup-done + fi + + exec ~/.local/bin/gnome-kiosk-script "$@" +-- +2.31.1 + diff --git a/SOURCES/0006-kiosk-script-Send-SIGHUP-to-script-at-shutdown-time.patch b/SOURCES/0006-kiosk-script-Send-SIGHUP-to-script-at-shutdown-time.patch new file mode 100644 index 0000000..99071b9 --- /dev/null +++ b/SOURCES/0006-kiosk-script-Send-SIGHUP-to-script-at-shutdown-time.patch @@ -0,0 +1,28 @@ +From 3e9a6ea82edc0bbd57c0d3088186c30823b956ec Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 11 Aug 2021 15:06:42 -0400 +Subject: [PATCH 6/6] kiosk-script: Send SIGHUP to script at shutdown time + +Since the kiosk script is a shell script, it ignores SIGTERM. +We should send it a hang up signal first to make it comply. +--- + kiosk-script/systemd/org.gnome.Kiosk.Script.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in +index 8194f1c..e4da546 100644 +--- a/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in ++++ b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in +@@ -1,8 +1,9 @@ + [Unit] + Description=Kiosk script + BindsTo=gnome-session.target + After=gnome-session.target + + [Service] + ExecStart=@bindir@/gnome-kiosk-script + Restart=always ++SendSIGHUP=true +-- +2.31.1 + diff --git a/SPECS/gnome-kiosk.spec b/SPECS/gnome-kiosk.spec new file mode 100644 index 0000000..119b598 --- /dev/null +++ b/SPECS/gnome-kiosk.spec @@ -0,0 +1,157 @@ +%global tarball_version %%(echo %{version} | tr '~' '.') +%global major_version %(echo -n %{tarball_version} | sed 's/[.].*//') + +%global gettext_version 0.19.6 +%global gnome_desktop_version 40~rc +%global glib2_version 2.68.0 +%global gtk4_version 3.24.27 +%global mutter_version 40.0 +%global gsettings_desktop_schemas_version 40~rc +%global ibus_version 1.5.24 +%global gnome_settings_daemon_version 40~rc + +Name: gnome-kiosk +Version: 40.0 +Release: 4%{?dist} +Summary: Window management and application launching for GNOME + +License: GPLv2+ +URL: https://gitlab.gnome.org/halfline/gnome-kiosk +Source0: https://download.gnome.org/sources/%{name}/%{major_version}/%{name}-%{tarball_version}.tar.xz + +Provides: firstboot(windowmanager) = %{name} + +BuildRequires: desktop-file-utils +BuildRequires: gcc +BuildRequires: gettext >= %{gettext_version} +BuildRequires: git +BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} +BuildRequires: pkgconfig(gobject-2.0) >= %{glib2_version} +BuildRequires: pkgconfig(gio-2.0) >= %{glib2_version} +BuildRequires: pkgconfig(gnome-desktop-3.0) >= %{gnome_desktop_version} +BuildRequires: pkgconfig(gtk4) >= %{gtk4_version} +BuildRequires: pkgconfig(ibus-1.0) >= %{ibus_version} +BuildRequires: pkgconfig(libmutter-8) >= %{mutter_version} +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libGL-devel +BuildRequires: meson + +Requires: gnome-settings-daemon%{?_isa} >= %{gnome_settings_daemon_version} +Requires: gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas_version} + +Patch10001: 0001-compositor-Support-systemd-user-sessions.patch +Patch10002: 0002-Add-a-script-for-simplifying-kiosk-setup.patch + +Patch20001: 0001-compositor-Ignore-some-of-the-builtin-keybindings.patch +Patch20002: 0002-kiosk-script-Make-sure-desktop-file-for-script-is-hi.patch +Patch20003: 0003-kiosk-script-Install-session-file-with-fallback-in-m.patch +Patch20004: 0004-kiosk-script-Give-xsession-and-wayland-session-file-.patch +Patch20005: 0005-kiosk-script-Add-a-hint-about-using-firefox-to-the-k.patch +Patch20006: 0006-kiosk-script-Send-SIGHUP-to-script-at-shutdown-time.patch + +%description +GNOME Kiosk provides a desktop enviroment suitable for fixed purpose, or +single application deployments like wall displays and point-of-sale systems. + +%package search-appliance +Summary: Example search application application that uses GNOME Kiosk +License: GPLv2+ +Requires: %{name} = %{version}-%{release} +Requires: firefox +Requires: gnome-session +BuildArch: noarch + +%description search-appliance +This package provides a full screen firefox window pointed to google. + +%package script-session +Summary: Basic session used for running kiosk application from shell script +License: GPLv2+ +Requires: %{name} = %{version}-%{release} +Recommends: gedit +Requires: gnome-session +BuildArch: noarch + +%description script-session +This package generates a shell script and the necessary scaffolding to start that shell script within a kiosk session. + +%prep +%autosetup -S git -n %{name}-%{tarball_version} + +%build +%meson +%meson_build + +%install +%meson_install + +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.SearchApp.desktop + +%files +%license COPYING +%doc README.md +%{_bindir}/gnome-kiosk +%{_datadir}/applications/org.gnome.Kiosk.desktop +%{_userunitdir}/org.gnome.Kiosk.target +%{_userunitdir}/org.gnome.Kiosk@wayland.service +%{_userunitdir}/org.gnome.Kiosk@x11.service + +%files -n gnome-kiosk-script-session +%{_bindir}/gnome-kiosk-script +%{_userunitdir}/gnome-session@gnome-kiosk-script.target.d/session.conf +%{_userunitdir}/org.gnome.Kiosk.Script.service +%{_datadir}/applications/org.gnome.Kiosk.Script.desktop +%{_datadir}/gnome-session/sessions/gnome-kiosk-script.session +%{_datadir}/wayland-sessions/gnome-kiosk-script.desktop +%{_datadir}/xsessions/gnome-kiosk-script.desktop + +%files -n gnome-kiosk-search-appliance +%{_datadir}/applications/org.gnome.Kiosk.SearchApp.desktop +%{_datadir}/gnome-session/sessions/org.gnome.Kiosk.SearchApp.session +%{_datadir}/xsessions/org.gnome.Kiosk.SearchApp.Session.desktop +%{_datadir}/wayland-sessions/org.gnome.Kiosk.SearchApp.Session.desktop + +%changelog +* Wed Aug 11 2021 Ray Strode - 40.0-4 +- Fix crash when hitting alt-f2 +- Various fixes to the script-session + Related: #1965338 + +* Mon Aug 09 2021 Mohan Boddu - 40.0-3 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Aug 06 2021 Ray Strode - 40.0-2 +- Support systemd --user sessions +- Add script-session subpackage + Related: #1965338 + +* Mon May 17 2021 Ray Strode - 40.0-1 +- Update to 40.0 + Related: #1950042 + +* Tue Apr 27 2021 Ray Strode - 40~alpha-7 +- Fix desktop file + Resolves: #1954285 + +* Fri Apr 23 2021 Ray Strode - 40~alpha-6 +- Add vprovides so initial-setup can use this + +* Wed Apr 21 2021 Ray Strode - 40~alpha-5 +- Fix keyboard layouts getting out of sync in anaconda + +* Tue Apr 20 2021 Ray Strode - 40~alpha-4 +- Fix infinite loop + +* Mon Apr 19 2021 Ray Strode - 40~alpha-3 +- Fix crash + +* Sun Apr 18 2021 Ray Strode - 40~alpha-2 +- Work with 3rd party keyboard layout selectors +- Be less aggressive about fullscreening windows + +* Mon Apr 12 2021 Ray Strode - 40~alpha-1 +- Initial import +