-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Improved portability #467
Improved portability #467
Conversation
nice |
Thanks a lot for improving this, it is an area that definitely needed some attention. I just discovered NixOS, but I guess applications get installed into its own prefix? Pretty cool concept by the way, is like using a Docker container for your desktop. I need to review the changes with more detail once they are ready, but so far there are 2 thinks that are going to be problematic: The first one is the service file. In Ubuntu 18 (and I believe this is the case for Debian) there is no I have no idea about how NixOS works, so I might be asking something stupid, but, where is Touchégg default config ( |
Good point, this one is more complicated thanks to the different set(SYSTEMD_SYSTEM_UNIT_DIR "/lib/systemd/system" CACHE STRING "Path to systemd system unit dir")
It would get installed to something like Would it be possible instead to detect if the systemd service is available? E.g. by checking the return code of |
Cool, I didn't know about that. I will test it to make sure it works on Ubuntu/Fedora/Arch and if so we can go with this option. It is cleaner that adding an extra config flag and way cleaner than the current hardcoded value.
I don't think I can do that from a Flatpak container. Also, I need to read the file to use it as default configuration. Some distros patch it to ship their own gestures, so I can't fallback to upstream config. Anyway, this is already broken in Touché/X11 Gestures on NixOS, so it shouldn't be an stopper for this pull request since every officially supported package installs on the I need to find a way to get the path of the default config file in the other 2 projects 🤔 Would it be possible to create a symbolic link on NixOS in |
We do not have |
How does reading the config file work in Flatpak container? Or does it have full file system access? Though, I would expect that at least a presence of a DBus service could be detected. For example, Piper seems to pass this to Flatpak:
Alternatives would be
|
Yes, it has read access to system files.
I don't think this will work building for Flathub, as it is executed in their servers in a clean environment... But it is definitely not going to work with the GNOME Shell extension, as it is not even built, it is just a zip file with JavaScript that gets extracted in a directory.
I already export a D-Bus interface over Unix socket, so I think this is proper way of doing it. However, there are some cons:
This might be the simplest solution and I don't find any cons. It doesn't require any extra Flatpak permissions and a very little change in code. |
Yeah, it would have to be built and installed in the flatpak manifest, which sounds like too much work for this.
Is there any benefit to using separate unix socket over the system bus? Either way, the presence of the socket could be used instead of availability of DBus service for checking if the service is available.
I do not see why it would need any different permission than it already uses for the communication with the socket.
Yeah, that sounds annoying.
It could allow centralizing the decisions in the service, which could end up with less code after the transitory period. But yeah, it would be an extra work.
A disadvantage is that it would somewhat distort the usual semantics. Typically, We could also add configure/CMake flag to touché so we could adjust the default config location when building the package, and for the extension, just patch the code. That would leave |
Here you go JoseExposito/touche#15
Not really, Touché doesn't use the D-Bus service at all, it just needs a system level config file to fallback when the config in home is not present. @Hvassaa the PR look solid, I'm going to generate and test packages for a couple of distros and I'll let you know how it goes 😄 |
Sounds great! Crossing my fingers 😎 |
Perfect, good to hear. And yes, I will let you know 😄 |
I tried to improve portability by removing hardcoded paths and configure files in CMake where needed.
This makes it possible to build and use on non-FHS distros such as NixOS (discussion here).