dbus and systemd activation - take 2#7679
Conversation
|
@alaviss this will probably affect the flatpak |
alaviss
left a comment
There was a problem hiding this comment.
Just a few notes. This looks good from Flatpak perspective to me.
tristan957
left a comment
There was a problem hiding this comment.
I'm not convinced that using the full path is right.
I decided to check out my system to look for precedent:
$ rg -F -I -N --no-heading Exec= /usr/share/applications/ | grep -E 'Exec="?/' | wc -l
44
$ rg -F -I -N --no-heading Exec= /usr/share/applications/ | wc -l
166
~25% use the full path. I'm not as knowledgeable as you in this area, so will defer.
mitchellh
left a comment
There was a problem hiding this comment.
Overall fine, there's a couple details I'm not super happy with. Happy to dig in myself but I won't be able to get back to this for probably... a day or two.
I didn't do a full research on this yesterday to know the right answer, but I did find this which notes that systemd units don't do PATH lookup unless its specified in https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html If we can remove the absolute path later I'll take it. For now I think this gets things working, but haven't verified yet. |
This replaces ghostty-org#7433. The improvements are: 1) Install the systemd user service in the proper directory depending on if it's a 'user' install or a 'system' install. This is controlled either by using the `--system` build flag (as most packages will) or by the `-Dsystem-package` flag. 2) Add the absolute path to the `ghostty` binary in the application file, the DBus service, and the systemd user service. This is done so that they do not depend on `ghostty` being in the `PATH` of whatever is launching Ghostty. That `PATH` is not necessarily the same as the `PATH` in a user shell (especially for DBus activation and systemd user services). 3) Adjust the DBus bus name that is expected by the system depending on the optimization level that Ghostty is compiled with.
Replaces ghostty-org#7676 When building as a flatpak, don't install the systemd user services since flatpaks can't use them. Remove references to the systemd service from the DBus service. Also, customize the app metadata depending on the debug mode. Co-authored-by: Leorize <leorize+oss@disroot.org>
5fc9978 to
739b691
Compare
|
Okay I redid the templating part to use cmake format which lets us take advantage of |
|
Oh crap, Zig puts a header at the top that it was generated by the build system and it breaks everything. LOL. |
|
Okay may have to bring back our dedicated binary (rip). But I want to do it in the style of the other refactors I made so let me come back to this this afternoon. Ball is in my court. |
Let no good idea go unpunished! :'( |
|
Okay I kept the config header usage and just use |
|
Did auto-merge merge with failing tests? Computers aren't on my side with this one. Following up now. |
The addition of D-Bus activation and systemd user services in ghostty-org#7679 has made the "default" launching of Ghostty a little more complicated. This PR attempts to document that process works and commands for managing/controlling that process.
This replaces #7433. The improvements are:
Install the systemd user service in the proper directory depending on if it's a 'user' install or a 'system' install. This is controlled either by using the
--systembuild flag (as most packages will) or by the-Dsystem-packageflag.Add the absolute path to the
ghosttybinary in the application file, the DBus service, and the systemd user service. This is done so that they do not depend onghosttybeing in thePATHof whatever is launching Ghostty. ThatPATHis not necessarily the same as thePATHin a user shell (especially for DBus activation and systemd user services).Adjust the DBus bus name that is expected by the system depending on the optimization level that Ghostty is compiled with.