-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include a systemd.service file #240
Include a systemd.service file #240
Conversation
Including (and installing) these changes triggers calls to `org.freedesktop.Notifications` to start a systemd user service with mako. This is pretty much how similar daemons (eg: dunst) behave. It allows the service to be auto-started on demand, and also ties it to the graphical session. This also makes is trivial to restart `mako` like any other user service, by just running `systemd --user restart mako`. Users not running systemd (if that's supported) shouldn't be affected.
Have you seen #188? |
@emersion Nope 🤦♂️ |
This PR does cover your comment regarding extra steps when setting up. |
Maybe we could use |
The actual trigger that starts his is still dbus activation.
This fails the same way mako currently fails now; it fails and exits.
|
So systemd doesn't check for |
It doesn't look like variable expansion works on |
In any case, this
The end result is still the same, and the difference is just under the hood (a logged service startup failure). |
@xdbob Thoughts on |
LGTM otherwise. |
One last thing: can we move this service file to I'll merge once @xdbob gives positive feedback. :) |
No problem, we aren't in a hurry. |
Co-Authored-By: Дамјан Георгиевски <gdamjan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still feel like using ExecCondition
is a hack (at best a failsafe) but I don't have anything better, yet.
LGTM (but please squash the commits :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let's merge this. Thanks everyone!
You could open a systemd issue to improve this ( |
Thanks for all your patience! :) |
|
Yes, I will ask to |
mako.systemd.service.in
Outdated
@@ -6,7 +6,7 @@ PartOf=graphical-session.target | |||
[Service] | |||
Type=dbus | |||
BusName=org.freedesktop.Notifications | |||
ExecCondition=/bin/sh -c '[ "$XDG_SESSION_TYPE" == "wayland" ]' | |||
ExecCondition=/bin/sh -c '[ -z $WAYLAND_DISPLAY ] && exit 1 || exit 0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cleaner way do this in systemd v246 and later is to use ConditionEnvironment=WAYLAND_DISPLAY
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Care to make a PR with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. #319
Including (and installing) these changes triggers calls to
org.freedesktop.Notifications
to start a systemd user service with mako.This is pretty much how similar daemons (eg: dunst) behave. It allows the service to be auto-started on demand, and also ties it to the graphical session.
This also makes is trivial to restart
mako
like any other user service, by just runningsystemd --user restart mako
.Users not running systemd (if that's supported) shouldn't be affected.