Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 579418

Summary: app-office/lyx-2.1.4: okular is opened always by default if present
Product: Gentoo Linux Reporter: Pacho Ramos <pacho>
Component: Current packagesAssignee: Alexis Ballier <aballier>
Status: RESOLVED FIXED    
Severity: normal CC: 89q1r14hd, aballier, freedesktop-bugs, jstein, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Pacho Ramos gentoo-dev 2016-04-09 10:03:03 UTC
It seems that lyx relies on a hardcoded list of viewers and, then, once okular is installed, it's opened instead of the default viewer in my setup (evince).

I think it's because of this hardcoded values:
lib/configure.py:    checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview --unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf', \


Maybe it could RDEPEND on xdg-utils and run "xdg-open" as a first option in that list to solve this

Thanks
Comment 1 pavel sanda 2016-04-13 17:10:55 UTC
> It seems that lyx relies on a hardcoded list of viewers

I just quickly checked what happens if I run default xdg-open on my system and got gimp for opening postscript (gv is ready on my system) and fbreader for html (firefox is ready on my system). 

Not saying it is xdg-open mistake, it's often using configs set up by default elsewhere, but the above does not speak strong for replacing the current lyx list of viewers, at least here.
Comment 2 Pacho Ramos gentoo-dev 2016-04-16 10:21:54 UTC
Umm, xdg-open works fine on my case (and it's also the "official" way of opening the default app under desktops honoring XDG specs...) opening the pdf viewer I have set at as default. What desktop are you running? Did you set a default viewer for PDFs?
Comment 3 pavel sanda 2016-04-17 05:56:52 UTC
> What desktop are you running?

enlightenment 1.0.17
Comment 4 Pacho Ramos gentoo-dev 2016-04-18 15:18:52 UTC
I don't know if enlightenment provides any app to configure the default apps... from commandline you should be able to run something like:

xdg-mime default evince.desktop application/pdf 

(or the app you want to use by default from all the apps blaming to support pdf)
Comment 5 Pacho Ramos gentoo-dev 2020-07-27 08:16:10 UTC
Other distributions like Fedora and Debian are also using xdg-utils when possible as first option
https://salsa.debian.org/debian/lyx/-/blob/master/debian/patches/0001-Prefer-xdg-open.patch
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-26 22:17:55 UTC
(In reply to Pacho Ramos from comment #5)
> Other distributions like Fedora and Debian are also using xdg-utils when
> possible as first option
> https://salsa.debian.org/debian/lyx/-/blob/master/debian/patches/0001-Prefer-
> xdg-open.patch

I’d go for it
Comment 7 Larry the Git Cow gentoo-dev 2021-05-20 13:07:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6876b52c5c009fbb5db4e5c5c23a46551741501c

commit 6876b52c5c009fbb5db4e5c5c23a46551741501c
Author:     Pacho Ramos <pacho@gentoo.org>
AuthorDate: 2021-05-20 13:06:58 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2021-05-20 13:07:12 +0000

    app-office/lyx: Prefer xdg-open over hardcoded tools
    
    Closes: https://bugs.gentoo.org/579418
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>

 app-office/lyx/files/lyx-prefer-xdg-open.patch |  60 +++++++++
 app-office/lyx/lyx-2.3.6.1-r1.ebuild           | 179 +++++++++++++++++++++++++
 2 files changed, 239 insertions(+)