Skip to content
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

[Feature]: Add pkexec if /dev/i2c is not accessible on invocation #39

Open
stdedos opened this issue Apr 8, 2022 · 8 comments
Open
Labels
enhancement New feature or request

Comments

@stdedos
Copy link

stdedos commented Apr 8, 2022

It might be useful to add a ddcui.desktop entry for ddcui, as well as a pkexec entry - since I am to understand that it "most likely" cannot work otherwise (quick example here https://askubuntu.com/a/1184444/645458)

@rockowitz
Copy link
Owner

File ddcui.desktop is in the top level package directory, and should be installed by the ddcui installation program. Did you install ddcui using the ppa on launchpad, or using command sudo make install?

Re pkexec, any user can make changes using ddcui if they have RW permissions to the /dev/i2c devices. Typically this is granted by adding the user to group i2c. All this is discussed in the ddcutil documentation, but I'll grant that most users will likely not have read it. As to distributing a version of ddcui.desktop with pkexec specified in its .desktop file, I'll have to consult with the Debian gurus to see if that is acceptable.

@stdedos
Copy link
Author

stdedos commented Apr 10, 2022

File ddcui.desktop is in the top level package directory, and should be installed by the ddcui installation program. Did you install ddcui using the ppa on launchpad, or using command sudo make install?

I used the ppa ofc (I like pre-compiled stuff and clean uninstall processes 😛)
Idk what to tell you, but it's not the case that ddcui is on the Activities view 😕

Re pkexec, any user can make changes using ddcui if they have RW permissions to the /dev/i2c devices. Typically this is granted by adding the user to group i2c. All this is discussed in the ddcutil documentation, but I'll grant that most users will likely not have read it.

Didn't know that, but that's good to know! In that case, I think you need to "catch" that behavior, and inform the user about it (this-and-that happened, sudo usermod ... or sudo ddcui, [read more man ddcui])

As to distributing a version of ddcui.desktop with pkexec specified in its .desktop file, I'll have to consult with the Debian gurus to see if that is acceptable.

If you can auto-detect this and self-elevate, that cannot hurt either (or use a wrapper caller?)

@rockowitz rockowitz added the enhancement New feature or request label Apr 12, 2022
@rockowitz
Copy link
Owner

By Activities view, I assume you're referring to gnome.

File ddcui.desktop is installed in /usr/share/applications as per the freedesktop spec. I don't normally use gnome, but more steps are required to add an application to Activities. In my own case, only a handful of applications appear. There are instructions online for using Gnome Tweak Tool to add applications (https://www.lifewire.com/how-to-create-desktop-app-launchers-in-linux-4685137), but I haven't found documentation on how to add an application as part of the installation program. I'll continue to look.

Re lack of permissions, I'll look at replacing the "No displays detected" dialog box with something more informative.

@stdedos
Copy link
Author

stdedos commented Apr 13, 2022

The only think I've seen e.g. in codium deb package, is:

# Install the desktop entry
if hash update-desktop-database 2>/dev/null; then
	update-desktop-database
fi

but, btw, I don't see anything here for me:

$ ls -lah /usr/share/applications/ | grep dd
$ grep -Trin ddcui /usr/share/applications/      
$  sudo ddcui
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
$ 

image

I mean, I can see that I am running an older version

$ apt-cache policy ddcui
ddcui:
  Installed: 0.1.2-3
  Candidate: 0.1.2-3
  Version table:
 *** 0.1.2-3 500
        500 http://ppa.launchpad.net/rockowitz/ddcutil/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

but idk what to do about it. Building from sources is not really what I want; nor IMHO what would help with this ticket.

@rockowitz
Copy link
Owner

Launchpad makes it difficult to publish a package for other than the latest Ubuntu version. However, the deb files for Impish should work for any recent Ubuntu release.

It may be easier to use the OBS repos, as packages there are built for multiple Ubuntu versions. To add the repo see here. You'll want to install packages ddcutil, libddcutil4, and ddcui.

Re update-desktop-database, per the man page it builds the cache database of MIME types handled by desktop files, so isn't relevant.

@stdedos
Copy link
Author

stdedos commented Apr 14, 2022

Re update-desktop-database, per the man page it builds the cache database of MIME types handled by desktop files, so isn't relevant.

Yeah - I did read that as well. Idk; I find it very weird that "simply adding that file there" does not work.
But it can be that the package I have is simply too outdated.

Launchpad makes it difficult to publish a package for other than the latest Ubuntu version.

So, even if "everything works alright", you cannot do updates? 😕 that's sad

@stdedos
Copy link
Author

stdedos commented Apr 14, 2022

Oh - now I noticed! You are the same person that does the blivet-gui? :-D

That's a very awesome addition - thank you so much for all the trouble you are going through with it :-D

@stdedos
Copy link
Author

stdedos commented Apr 14, 2022

Good stuff - so the .desktop is actually coming up on the latest versions via the https://software.opensuse.org/download/package?package=ddcutil&project=home%3Arockowitz!

However, the

Didn't know that, but that's good to know! In that case, I think you need to "catch" that behavior, and inform the user about it (this-and-that happened, sudo usermod ... or sudo ddcui, [read more man ddcui])

stuff needs to be addressed somehow. And since ddcui is a UI application, also the "info" must be in UI as well.

@stdedos stdedos changed the title [Feature]: Create a .desktop file for ddcui, add pkexec [Feature]: Add pkexec if /dev/i2c is not accessible on invocation Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants