Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ endif

subdir('session')
subdir('xsessions')

if get_option('systemd')
subdir('systemd')
endif
3 changes: 3 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ option('fallback-session', type : 'string', value: 'ubuntu',

option('detect-program-prefixes', type: 'boolean', value: false,
description : 'This is needed for platforms that install packages into individual prefixes (like Guix System or NixOS')

option('systemd', type: 'boolean', value: true,
description : 'Install systemd unit files for managing the Pantheon session with gnome-session systemd support')
22 changes: 22 additions & 0 deletions systemd/gnome-session-x11@pantheon.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=GNOME X11 Session (session: %i)
OnFailure=gnome-session-failed.target
OnFailureJobMode=replace
DefaultDependencies=no
# Start happens explicitly
RefuseManualStart=no
# Stop happens by starting gnome-session-shutdown.target
#RefuseManualStop=yes
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this comments before merging?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These unit files are just direct copies of the ones from gnome-session, just tweaked where necessary to make it run pantheon instead and these lines come from there. It seems nicer to keep them as similar as possible to the gnome-session ones so we can see the diff if necessary.


Conflicts=shutdown.target gnome-session-shutdown.target
PartOf=graphical-session.target

# As this is the main entry point, pull in the other toplevel gnome-session targets
BindsTo=gnome-session@.target
After=gnome-session@.target

BindsTo=pantheon-session-x11.target
After=pantheon-session-x11.target

BindsTo=gnome-session.target
After=gnome-session.target
12 changes: 12 additions & 0 deletions systemd/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dep_systemd = dependency('systemd', required: true)
systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir')

install_data(
'gnome-session-x11@pantheon.target',
install_dir: systemd_userunitdir
)

install_data(
'pantheon-session-x11.target',
install_dir: systemd_userunitdir
)
20 changes: 20 additions & 0 deletions systemd/pantheon-session-x11.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=Pantheon X11 Session
# On X11, try to show the fail screen
OnFailure=gnome-session-failed.target
OnFailureJobMode=replace
# Avoid default After/Before rules
DefaultDependencies=no

Before=gnome-session.target

PartOf=graphical-session.target
RefuseManualStart=yes
RefuseManualStop=yes

# Pull in all X11-specific services the session might depend on
Requires=gnome-session-x11-services.target

# Pull in the correct gala target
BindsTo=gala-x11.target
After=gala-x11.target