diff --git a/REUSE.toml b/REUSE.toml index e917c8f6..768f7a7d 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -15,7 +15,13 @@ SPDX-FileCopyrightText = [ SPDX-License-Identifier = "CC-BY-SA-4.0" [[annotations]] -path = ["**.json.in", "**.desktop.in", "**.gschema.override"] +path = [ + "**.json.in", + "**.desktop.in", + "**.gschema.override", + "**.session", + "**.session.conf", +] SPDX-FileCopyrightText = "Florian Müllner " SPDX-License-Identifier = "GPL-2.0-or-later" diff --git a/data/gnome-classic.desktop.in b/data/gnome-classic.desktop.in index 269f131d..1a30f7d1 100644 --- a/data/gnome-classic.desktop.in +++ b/data/gnome-classic.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Name=GNOME Classic Comment=This session logs you into GNOME Classic -Exec=env GNOME_SHELL_SESSION_MODE=classic gnome-session +Exec=gnome-session --session gnome-classic TryExec=gnome-session Type=Application DesktopNames=GNOME-Classic;GNOME; diff --git a/data/gnome-classic.session b/data/gnome-classic.session new file mode 100644 index 00000000..33553721 --- /dev/null +++ b/data/gnome-classic.session @@ -0,0 +1,2 @@ +[GNOME Session] +Name=GNOME Classic \ No newline at end of file diff --git a/data/gnome-classic.session.conf b/data/gnome-classic.session.conf new file mode 100644 index 00000000..441525fc --- /dev/null +++ b/data/gnome-classic.session.conf @@ -0,0 +1,3 @@ +[Unit] +Requires=gnome-session-services.target +Requires=org.gnome.Shell@classic.service \ No newline at end of file diff --git a/data/meson.build b/data/meson.build index 51a2bac7..a4fab5d7 100644 --- a/data/meson.build +++ b/data/meson.build @@ -31,3 +31,13 @@ configure_file( classic_override = '00_org.gnome.shell.extensions.classic.gschema.override' install_data(classic_override, install_dir: schemadir) + +install_data( + 'gnome-classic.session', + install_dir: sessiondir, +) + +install_data( + 'gnome-classic.session.conf', + install_dir: systemd_userunitdir / 'gnome-session@gnome-classic.target.d', +) \ No newline at end of file diff --git a/meson.build b/meson.build index 7b866b8b..d905c049 100644 --- a/meson.build +++ b/meson.build @@ -25,6 +25,13 @@ schemadir = join_paths(datadir, 'glib-2.0', 'schemas') sessiondir = join_paths(datadir, 'gnome-session', 'sessions') wlsessiondir = join_paths(datadir, 'wayland-sessions') +systemd_dep = dependency('systemd', required: false) +systemd_userunitdir = systemd_dep.get_variable( + pkgconfig: 'systemduserunitdir', + pkgconfig_define: ['prefix', get_option('prefix')], + default_value: get_option('prefix') / 'lib' / 'systemd' / 'user', +) + ver_arr = meson.project_version().split('.') shell_version = ver_arr[0]