sidevesh / Luminance

A simple GTK application to control brightness of displays including external displays supporting DDC/CI
GNU General Public License v3.0
103 stars 6 forks source link

Publish as Flatpak #4

Open sidevesh opened 1 year ago

sidevesh commented 1 year ago

Probably not possible since ddcutil itself can't work from inside flatpak without installing the udev files, this project also requires the udev file to get permission to modify the /sys/class/backlight entries on top of the ddcutil one.

askaakura commented 1 year ago

I came from Reddit, tried to install the software and was searching for flatpak. @sidevesh is this the only issue with flatpak or same goes for snap too?

sidevesh commented 1 year ago

Snap has the same issue sadly, I will investigate into flatpak packaging (don't use snap and don't intend to) once ddcutil figures out flatpak packaging

askaakura commented 1 year ago

Sorry, but I was also not requesting you for snap. But, I have read people discussing in linux subs as cli tools can also be packaged as snaps. I am no expert on the basis of that, I was just asking because of not knowing. I like flatpaks and will be watching the project for future releases.

sidevesh commented 1 year ago

Its not about this being a cli tool, ddcutil needs access to i2c devices that normally only root can access, but ddcutil installs a udev rule that gives access to those devices for non root users too, along with that, this app also needs access to backlight class devices and for that this installs another udev rule, flatpak packages can't do that. As I understand, flatpak packaging of this can work if the user themselves installs the udev rule and then gives access to those files via something like flatseal manually, but by then the sandbox model of flatpak is broken and this many manual steps means most users won't be able to do it and would lead to unnecessary issue reports, not to mention immutable distros won't be able to use it either. Something like this is better kept as a native package I think

sonnyp commented 1 year ago

Not ideal but for now you can use the host ddcutil from inside the Flatpak using flatpak-spawn --host. You could show an explainer into how to install ddcutil in case it's not available on the host.

sidevesh commented 1 year ago

This uses the ddcbc C library to interface with ddcutil and make the changes, using ddcutil from cmd would change things quite a bit in how the app works, also I found the current setup to work best for controlling monitors reliably, have had issues in the past using ddcutil from cmd although that might have improved now.