diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:09:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:09:04 +0000 |
commit | 829aea9a4dce048f63c6d9568b50ab4bdb7609e3 (patch) | |
tree | 7c5d5ac80e81dc5186f19649f48387a67df20425 /data | |
parent | Initial commit. (diff) | |
download | gnome-initial-setup-829aea9a4dce048f63c6d9568b50ab4bdb7609e3.tar.xz gnome-initial-setup-829aea9a4dce048f63c6d9568b50ab4bdb7609e3.zip |
Adding upstream version 3.38.4.upstream/3.38.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'data')
-rw-r--r-- | data/20-gnome-initial-setup.rules | 28 | ||||
-rw-r--r-- | data/gnome-initial-setup-copy-worker.desktop.in.in | 10 | ||||
-rw-r--r-- | data/gnome-initial-setup-copy-worker.service.in | 15 | ||||
-rw-r--r-- | data/gnome-initial-setup-first-login.desktop.in.in | 13 | ||||
-rw-r--r-- | data/gnome-initial-setup-first-login.service.in | 19 | ||||
-rw-r--r-- | data/gnome-initial-setup.desktop.in.in | 12 | ||||
-rw-r--r-- | data/gnome-initial-setup.service.in | 13 | ||||
-rw-r--r-- | data/gnome-initial-setup.session.conf.in | 8 | ||||
-rw-r--r-- | data/gnome-initial-setup.session.in | 4 | ||||
-rwxr-xr-x | data/gnome-welcome-tour | 13 | ||||
-rw-r--r-- | data/gnome-welcome-tour.desktop.in.in | 8 | ||||
-rw-r--r-- | data/gnome-welcome-tour.service.in | 12 | ||||
-rw-r--r-- | data/initial-setup.json | 8 | ||||
-rwxr-xr-x | data/meson-add-wants.sh | 30 | ||||
-rw-r--r-- | data/meson.build | 127 |
15 files changed, 320 insertions, 0 deletions
diff --git a/data/20-gnome-initial-setup.rules b/data/20-gnome-initial-setup.rules new file mode 100644 index 0000000..33d7e30 --- /dev/null +++ b/data/20-gnome-initial-setup.rules @@ -0,0 +1,28 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +// +// DO NOT EDIT THIS FILE, it will be overwritten on update. +// +// Allow the gnome-initial-setup user to do certain actions without +// being interrupted by password dialogs + +polkit.addRule(function(action, subject) { + if (subject.user !== 'gnome-initial-setup') + return undefined; + + var actionMatches = (action.id.indexOf('org.freedesktop.hostname1.') === 0 || + action.id.indexOf('org.freedesktop.NetworkManager.') === 0 || + action.id.indexOf('org.freedesktop.locale1.') === 0 || + action.id.indexOf('org.freedesktop.accounts.') === 0 || + action.id.indexOf('org.freedesktop.timedate1.') === 0 || + action.id.indexOf('org.freedesktop.realmd.') === 0 || + action.id.indexOf('com.endlessm.ParentalControls.') === 0); + + if (actionMatches) { + if (subject.local) + return 'yes'; + else + return 'auth_admin'; + } + + return undefined; +}); diff --git a/data/gnome-initial-setup-copy-worker.desktop.in.in b/data/gnome-initial-setup-copy-worker.desktop.in.in new file mode 100644 index 0000000..7e4b2a4 --- /dev/null +++ b/data/gnome-initial-setup-copy-worker.desktop.in.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=GNOME Initial Setup Copy Worker +Type=Application +Exec=@LIBEXECDIR@/gnome-initial-setup-copy-worker +OnlyShowIn=GNOME; +NoDisplay=true +X-GNOME-AutoRestart=false +X-GNOME-Autostart-Phase=EarlyInitialization +AutostartCondition=unless-exists gnome-initial-setup-done +X-GNOME-HiddenUnderSystemd=@systemd_hidden@ diff --git a/data/gnome-initial-setup-copy-worker.service.in b/data/gnome-initial-setup-copy-worker.service.in new file mode 100644 index 0000000..ee3c0d0 --- /dev/null +++ b/data/gnome-initial-setup-copy-worker.service.in @@ -0,0 +1,15 @@ +[Unit] +Description=GNOME Initial Setup Copy Worker + +# Make sure we run really early +Before=gnome-session-pre.target graphical-session-pre.target + +# Never run in GDM +ConditionUser=!@system + +ConditionPathExists=!%E/gnome-initial-setup-done + +[Service] +Type=oneshot +ExecStart=@libexecdir@/gnome-initial-setup-copy-worker +Restart=no diff --git a/data/gnome-initial-setup-first-login.desktop.in.in b/data/gnome-initial-setup-first-login.desktop.in.in new file mode 100644 index 0000000..f3d0df7 --- /dev/null +++ b/data/gnome-initial-setup-first-login.desktop.in.in @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=Initial Setup +# Translators: Do NOT translate or transliterate this text (this is an icon file name)! +Icon=preferences-system +Exec=@LIBEXECDIR@/gnome-initial-setup --existing-user +Terminal=false +Type=Application +StartupNotify=true +Categories=GNOME;GTK;System; +OnlyShowIn=GNOME; +NoDisplay=true +AutostartCondition=unless-exists gnome-initial-setup-done +X-GNOME-HiddenUnderSystemd=@systemd_hidden@ diff --git a/data/gnome-initial-setup-first-login.service.in b/data/gnome-initial-setup-first-login.service.in new file mode 100644 index 0000000..940395a --- /dev/null +++ b/data/gnome-initial-setup-first-login.service.in @@ -0,0 +1,19 @@ +[Unit] +Description=GNOME Initial Setup + +BindsTo=gnome-session.target +After=gnome-session.target + +# Together with Type=oneshot, make sure the welcome tour starts after setup +Before=gnome-welcome-tour.service + +# Never run in GDM +Conflicts=gnome-session@gnome-login.target + +Conflicts=gnome-session@gnome-initial-setup.target +ConditionPathExists=!%E/gnome-initial-setup-done + +[Service] +Type=oneshot +ExecStart=@libexecdir@/gnome-initial-setup --existing-user +Restart=no diff --git a/data/gnome-initial-setup.desktop.in.in b/data/gnome-initial-setup.desktop.in.in new file mode 100644 index 0000000..e7aa666 --- /dev/null +++ b/data/gnome-initial-setup.desktop.in.in @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=Initial Setup +# Translators: Do NOT translate or transliterate this text (this is an icon file name)! +Icon=preferences-system +Exec=@LIBEXECDIR@/gnome-initial-setup +Terminal=false +Type=Application +StartupNotify=true +Categories=GNOME;GTK;System; +OnlyShowIn=GNOME; +NoDisplay=true +X-GNOME-HiddenUnderSystemd=@systemd_hidden@ diff --git a/data/gnome-initial-setup.service.in b/data/gnome-initial-setup.service.in new file mode 100644 index 0000000..bb0af2e --- /dev/null +++ b/data/gnome-initial-setup.service.in @@ -0,0 +1,13 @@ +[Unit] +Description=GNOME Initial Setup +RefuseManualStart=true +RefuseManualStop=true + +BindsTo=gnome-session.target +After=gnome-session.target + +[Service] +Type=simple +ExecStart=@libexecdir@/gnome-initial-setup +ExecStopPost=-@libexecdir@/gnome-session-ctl --shutdown +Restart=no diff --git a/data/gnome-initial-setup.session.conf.in b/data/gnome-initial-setup.session.conf.in new file mode 100644 index 0000000..5c28f74 --- /dev/null +++ b/data/gnome-initial-setup.session.conf.in @@ -0,0 +1,8 @@ +[Unit] +# Must be in sync with @this_component@.session +@wants_required_components@ + +Requires=@requires_component@.target + +# Only difference to a standard GNOME session is the @this_component@ service +Requires=@this_component@.service diff --git a/data/gnome-initial-setup.session.in b/data/gnome-initial-setup.session.in new file mode 100644 index 0000000..e8d1890 --- /dev/null +++ b/data/gnome-initial-setup.session.in @@ -0,0 +1,4 @@ +[GNOME Session] +Name=GNOME Initial Setup +# Must be in sync with gnome-session@@this_component@.target.d/session.conf drop-in +RequiredComponents=@gnome_session_required_components@; diff --git a/data/gnome-welcome-tour b/data/gnome-welcome-tour new file mode 100755 index 0000000..51c9b59 --- /dev/null +++ b/data/gnome-welcome-tour @@ -0,0 +1,13 @@ +#! /bin/sh + +cfgdir=${XDG_CONFIG_DIR:-$HOME/.config} + +# Don't do anything if gnome-tour isn't installed +gnome_tour_path=$(which gnome-tour 2>/dev/null) +if test -z "${gnome_tour_path}"; then + rm -f $cfgdir/run-welcome-tour + exit +fi + +gnome-tour +rm -f $cfgdir/run-welcome-tour diff --git a/data/gnome-welcome-tour.desktop.in.in b/data/gnome-welcome-tour.desktop.in.in new file mode 100644 index 0000000..45d82e5 --- /dev/null +++ b/data/gnome-welcome-tour.desktop.in.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Welcome +Exec=@LIBEXECDIR@/gnome-welcome-tour +AutostartCondition=if-exists run-welcome-tour +OnlyShowIn=GNOME; +NoDisplay=true +X-GNOME-HiddenUnderSystemd=@systemd_hidden@ diff --git a/data/gnome-welcome-tour.service.in b/data/gnome-welcome-tour.service.in new file mode 100644 index 0000000..d958630 --- /dev/null +++ b/data/gnome-welcome-tour.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=GNOME Welcome Tour + +BindsTo=gnome-session.target +After=gnome-session.target + +ConditionPathExists=%E/run-welcome-tour + +[Service] +Type=simple +ExecStart=@libexecdir@/gnome-welcome-tour +Restart=no diff --git a/data/initial-setup.json b/data/initial-setup.json new file mode 100644 index 0000000..d56b03a --- /dev/null +++ b/data/initial-setup.json @@ -0,0 +1,8 @@ +{ + "hasWindows": true, + "components": ["networkAgent"], + "panel": { "left": [], + "center": [], + "right": ["a11y", "keyboard", "aggregateMenu"] + } +} diff --git a/data/meson-add-wants.sh b/data/meson-add-wants.sh new file mode 100755 index 0000000..c33d1b4 --- /dev/null +++ b/data/meson-add-wants.sh @@ -0,0 +1,30 @@ +#!/bin/sh +set -eu + +# Script copied from systemd + +unitdir="$1" +target="$2" +unit="$3" + +case "$target" in + */?*) # a path, but not just a slash at the end + dir="${DESTDIR:-}${target}" + ;; + *) + dir="${DESTDIR:-}${unitdir}/${target}" + ;; +esac + +unitpath="${DESTDIR:-}${unitdir}/${unit}" + +case "$target" in + */) + mkdir -vp -m 0755 "$dir" + ;; + *) + mkdir -vp -m 0755 "$(dirname "$dir")" + ;; +esac + +ln -vfs --relative "$unitpath" "$dir" diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..d9cb272 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,127 @@ +autostart_files = [ + 'gnome-initial-setup-copy-worker.desktop', + 'gnome-initial-setup-first-login.desktop', + 'gnome-welcome-tour.desktop' +] + +gis_shell_component = 'org.gnome.Shell' +gis_gnome_session_required_components = [ + 'org.gnome.SettingsDaemon.A11ySettings', + 'org.gnome.SettingsDaemon.Color', + 'org.gnome.SettingsDaemon.Datetime', + 'org.gnome.SettingsDaemon.Housekeeping', + 'org.gnome.SettingsDaemon.Keyboard', + 'org.gnome.SettingsDaemon.MediaKeys', + 'org.gnome.SettingsDaemon.Power', + 'org.gnome.SettingsDaemon.PrintNotifications', + 'org.gnome.SettingsDaemon.Rfkill', + 'org.gnome.SettingsDaemon.ScreensaverProxy', + 'org.gnome.SettingsDaemon.Sharing', + 'org.gnome.SettingsDaemon.Smartcard', + 'org.gnome.SettingsDaemon.Sound', + 'org.gnome.SettingsDaemon.UsbProtection', + 'org.gnome.SettingsDaemon.Wacom', + 'org.gnome.SettingsDaemon.XSettings', +] + +gis_user_session_wanted_components = gis_gnome_session_required_components + +desktop_conf = configuration_data() +desktop_conf.set('LIBEXECDIR', libexec_dir) +desktop_conf.set('systemd_hidden', enable_systemd ? 'true' : 'false') + +foreach desktop_file: autostart_files + i18n.merge_file( + 'desktop', + input: configure_file( + input: files(desktop_file + '.in.in'), + output: desktop_file + '.in', + configuration: desktop_conf + ), + output: desktop_file, + install_dir: join_paths(get_option('sysconfdir'), 'xdg', 'autostart'), + po_dir: po_dir, + install: true, + type: 'desktop' + ) +endforeach + +i18n.merge_file( + 'desktop', + input: configure_file( + input: files('gnome-initial-setup.desktop.in.in'), + output: 'gnome-initial-setup.desktop.in', + configuration: desktop_conf + ), + output: 'gnome-initial-setup.desktop', + install_dir: join_paths(data_dir, 'gdm', 'greeter', 'applications'), + po_dir: po_dir, + install: true, + type: 'desktop' +) + +if enable_systemd + unitconf = configuration_data() + unitconf.set('libexecdir', libexec_dir) + + unit_files = { + 'gnome-initial-setup-first-login.service' : [ 'gnome-session.target.wants/' ], + 'gnome-initial-setup-copy-worker.service' : [ 'gnome-session.target.wants/' ], + 'gnome-welcome-tour.service' : [ 'gnome-session.target.wants/' ], + } + + foreach unit, wants: unit_files + configure_file( + input: unit + '.in', + output: unit, + configuration: unitconf, + install_dir: systemd_userunitdir + ) + + foreach target: wants + meson.add_install_script('meson-add-wants.sh', systemd_userunitdir, target, unit) + endforeach + endforeach + + gis_user_session_wanted_targets = [] + foreach component: gis_user_session_wanted_components + gis_user_session_wanted_targets += 'Wants=@0@.target'.format(component) + endforeach + + configure_file( + input: '@0@.session.conf.in'.format(meson.project_name()), + output: 'session.conf', + configuration: { + 'this_component': meson.project_name(), + 'requires_component': gis_shell_component, + 'wants_required_components': '\n'.join( + gis_user_session_wanted_targets), + }, + install_dir: systemd_userunitdir / 'gnome-session@@0@.target.d'.format( + meson.project_name()), + ) +endif + + +rules_dir = join_paths(data_dir, 'polkit-1', 'rules.d') +install_data('20-gnome-initial-setup.rules', install_dir: rules_dir) + +session_dir = join_paths(data_dir, 'gnome-session', 'sessions') +configure_file( + input: '@0@.session.in'.format(meson.project_name()), + output: '@BASENAME@', + configuration: { + 'this_component': meson.project_name(), + 'gnome_session_required_components': ';'.join([ + gis_shell_component, + meson.project_name(), + ] + + gis_gnome_session_required_components), + }, + install_dir: session_dir, +) + +mode_dir = join_paths(data_dir, 'gnome-shell', 'modes') +install_data('initial-setup.json', install_dir: mode_dir) + +install_data('gnome-welcome-tour', install_dir: get_option('libexecdir')) |