View previous topic :: View next topic |
Author |
Message |
ecko Tux's lil' helper
Joined: 04 Jul 2010 Posts: 102
|
Posted: Thu Jun 06, 2013 5:34 pm Post subject: [solved]Which config file passes "%i -caption %c" |
|
|
I use fluxbox and okular, and I have a strange behaviour when calling pdf files from some applications (app-misc/recoll and app-misc/zim). Other softwares like firefox do fine.
When I open a pdf through app-misc/recoll or app-misc/zim, the following happens:
- a first okular window opens with the file.
- a second okular windows opens with a small error window saying "Impossible to open "/[path]/%i". The title of this window is "%c". I have to close this one manually and I do not like this.
The console says :
Code: | START /usr/bin/okular "/[path]/file_in_question.pdf" %i -caption "%c" |
I looked into x11-misc/xdg-utils to find if there is a setting passing strange parameters
Code: |
$ xdg-settings --list
Known properties:
default-url-scheme-handler Default handler for URL scheme
default-web-browser Default web browser
|
So apparently xdg knows nothing of pdfs, but more probably I am no querying the good thing. So I looked into all files of ~ to find if some hidden configuration file creates the problem.
Code: | find ~ -exec grep -l -I "%i" '{}' \; |
I scanned ~ and /usr/share (but this was huge so could not read it all), I did not find a relevant file.
I clearly overlooked something but could you help me finding what?
Thanks, ecko.
Last edited by ecko on Sun Jun 09, 2013 9:14 pm; edited 1 time in total |
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
Posted: Sun Jun 09, 2013 7:01 am Post subject: |
|
|
Hi,
Maybe you already found it, but it seems to me that it is executing this file:
Code: | /usr/share/applications/kde4/okular.desktop |
-- Cheers |
|
Back to top |
|
|
ecko Tux's lil' helper
Joined: 04 Jul 2010 Posts: 102
|
Posted: Sun Jun 09, 2013 9:14 pm Post subject: |
|
|
lost+found wrote: |
it seems to me that it is executing this file:
Code: | /usr/share/applications/kde4/okular.desktop |
|
Thank you, I never understood what these files were for before, and I understand better how it all works until now… So for future reference and other people reading this thread, here is the documentation : http://standards.freedesktop.org/desktop-entry-spec/latest/index.html (in particular the paragraph “The Excec key”).
To be specific there is a series of files Code: | /usr/share/applications/kde4/okularApplication_*.desktop | which belong to =kde-base/okular-4.10.4 and they are all wrong. I don't know how I am the only one to have this problem.
The files read Code: | Exec=okular %U %i -caption "%c" | where they should read Code: | Exec=okular %U -icon %i -caption "%c" |
One can as well remove everything after %U, which is what I did in the end. I prefer okular to always use the same icon, if not I never know which icon to expect in the taskbar.
Thanks for the help.
ecko. |
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
Posted: Mon Jun 10, 2013 5:11 pm Post subject: |
|
|
ecko wrote: | ...
To be specific there is a series of files Code: | /usr/share/applications/kde4/okularApplication_*.desktop | which belong to =kde-base/okular-4.10.4 and they are all wrong. I don't know how I am the only one to have this problem.
...
One can as well remove everything after %U... |
I didn't look into it that much, but now I see there are even more Okular mime-type specific desktop files, as you mentioned. I use KDE most of the time, in which it is working fine. But in WindowMaker I see the same kind of problem you describe: if I open a local pdf in Opera, then "xdg-open" starts 2 Okular windows, but one is empty with an error box "Error - %c": "Could not open /home/dir/%i". These KDE desktop files need some modification under other window managers.
Code: | $ cp /usr/share/applications/kde4/okular*.desktop ~/.local/share/applications/
$ sed -i -e 's:\[Desktop Entry\]:\[Desktop Entry\]\nOnlyShowIn=wmaker:;s: %i -caption "%c"::' ~/.local/share/applications/okular*.desktop |
Valid values for the OnlyShowIn field are $DESKTOP_SESSION variables (like wmaker in my case). |
|
Back to top |
|
|
|