AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.77k stars 563 forks source link

Change order of zenity and kdialog in desktop integration script #340

Closed phoerious closed 5 years ago

phoerious commented 7 years ago

The desktop integration script looks for the availability of zenity, kdialog and Xdialog in this order for displaying its prompts.

Having Xdialog as the last fallback appears to be a sensible decision, but kdialog should come before zenity as it is specific to the KDE platform, therefore likely to be only installed when KDE is installed and in that case also the preferred choice.

On my system (Arch Linux), zenity comes as a mandatory dependency for steam, although I run KDE. The desktop integration plugin therefore always uses zenity which doesn't integrate too well with the rest of the desktop. It would be great if kdialog would have higher priority.

probonopd commented 7 years ago

Not sure about the status of kdialog - it seems to be missing even from KDE-centric distributions like KDE neon, because it has not been ported to KF5. At least that was the status when I last asked. So I think it is more or less a legacy fallback?

phoerious commented 7 years ago

I have it on my system (Arch Linux) and would much prefer it over clunky zenity. I don't think it would be an issue to check for it first. Of course, the success rate of matching the more generic options is always higher, but then you also want to reach a certain amount of platform integration and should therefore match the more specific options first (IMHO).

probonopd commented 7 years ago

Perhaps we could make use of environment variables to determine the order? So, if the sessiontype is KDE and kdialog os available, use it as the first choice?

On Ubuntu 14.04:

$ echo $SESSIONTYPE
gnome-session

$ echo $XDG_CURRENT_DESKTOP
Unity

$ echo $DESKTOP_SESSION
ubuntu

What is yours? Seems not so straightforward...

phoerious commented 7 years ago

I don't think that variable exists everywhere. At least on my system, it isn't defined.

What I have is:

KDE_FULL_SESSION=true
KDE_SESSION_VERSION=5
XDG_CURRENT_DESKTOP=KDE
XDG_SESSION_DESKTOP=KDE
probonopd commented 7 years ago

Check all of the envs mentioned above, I updated the post above.

phoerious commented 7 years ago

I updated mine, too. :-)

Additionally to those mentioned above I also have

DESKTOP_SESSION=/usr/share/xsessions/plasma
probonopd commented 7 years ago

Perhaps "if [ env | grep KDE_ ] ; then if kdialog is on the $PATH; then ..."?

phoerious commented 7 years ago

You can test if the command exists anywhere in the $PATH with

command -v kdialog > /dev/null

Returns a non-zero exit code when it isn't.

env | grep KDE is quite unsafe I think, but it may work.

probonopd commented 7 years ago

Will think about it; in the meantime feel free to change the desktopintegration script for your AppImage.

phoerious commented 7 years ago

Thanks! I don't think the issue is very critical, by it would be nicer to have a more native dialog.

darealshinji commented 7 years ago

Writing your own tiny dialog programs instead of relying on zenity & co being present might be an option. A fallback dialog tool using FLTK might also be a solution (as I suggested here). For better KDE detection you could take a look at screenFetch or similar tools. But I think checking for the environment variable KDE_FULL_SESSION should normally be enough.

probonopd commented 7 years ago

Would accept a PR if it would come fully tested on KDE, GNOME, XFCE, Mate, Elementary, etc.

azubieta commented 5 years ago

Desktop integration scripts are no longer used. The issue will be closed, please reopen it if something else comes up.