This is my favourite PDF-viewer and as such I have in my mimeinfo.cache the entry "application/pdf=kpdf.desktop". Works perfect....until I update libreoffice-draw or google-chrome. At that moment the kpdf-entry gets erased and instead of it 'draw' or 'chrome' appears or even both. And I have to correct this entry manually again and again. Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
Regards, Peter.
Anno domini 2021 Sat, 6 Feb 13:48:52 +0100 phiebie@drei.at scripsit:
This is my favourite PDF-viewer and as such I have in my mimeinfo.cache the entry "application/pdf=kpdf.desktop". Works perfect....until I update libreoffice-draw or google-chrome. At that moment the kpdf-entry gets erased and instead of it 'draw' or 'chrome' appears or even both. And I have to correct this entry manually again and again. Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
Regards, Peter.
You can add a oneliner to your .xinitrc or .xsessionrc, e.g:
sed "s#(application/pdf=).*$#\1kpdf.desktop#' -i .local/share/applications/mimeinfo.cache
Nik
Anno domini 2021 Sat, 6 Feb 17:45:02 +0100 phiebie@drei.at scripsit:
Hi Dr. Nikolaus Klepp,
Am 06.Feb.2021 um 14:31 schrieben Sie:
sed "s#(application/pdf=).*$#\1kpdf.desktop#' -i .local/share/applications/mimeinfo.cache"
sed: -e expression #1, char 85: unterminated `s' command
Oh my, copy & paste :)
sed 's#(application/pdf=).*$#\1kpdf.desktop#' -i \ ~/.local/share/applications/mimeinfo.cache
Am Samstag, 6. Februar 2021 schrieb phiebie@drei.at:
This is my favourite PDF-viewer and as such I have in my mimeinfo.cache the entry "application/pdf=kpdf.desktop".
Where is this file located on your system that you edit manually?
On my system (Devuan Beowulf) it is in
/usr/share/applications/mimeinfo.cache ~/.local/share/applications/mimeinfo.cache
$ grep pdf /usr/share/applications/mimeinfo.cache application/pdf=atril.desktop;libreoffice-draw.desktop; application/x-bzpdf=atril.desktop; application/x-gzpdf=atril.desktop; application/x-xzpdf=atril.desktop; image/pdf=display-im6.q16.desktop; $ grep pdf ~/.local/share/applications/mimeinfo.cache [no output]
BTW, most of the time kpdf opens all PDF-files on my system, though, for Midnight Commander I had to configure that manually. That means there has to be another config layer in TDE to make that happen, because my system obviously is configured to use "atril" by default.
Works perfect....until I update libreoffice-draw or google-chrome. At that moment the kpdf-entry gets erased and instead of it 'draw' or 'chrome' appears or even both. And I have to correct this entry manually again and again.
If the line "application/pdf=kpdf.desktop" is in mimeinfo.cache under $HOME it should override the entry in the systemwide mimeinfo.cache and not be changed by installation nor upgrade of packages, no?!
Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
What would be achieved by that? You'd have to reinstall or dpkg-reconfigure kpdf every time after libreoffice-draw or google-chrome got upgraded on your system.
HTH
Kind regards, Stefan
Hi Stefan,
Am 06.Feb.2021 um 14:43 schriebst Du:
Where is this file located on your system that you edit manually?
(Debian testing, TDE PSB, both up to date) /usr/share/applications/mimeinfo.cache
$ grep pdf /usr/share/applications/mimeinfo.cache application/pdf=atril.desktop;libreoffice-draw.desktop;
there has to be another config layer in TDE to make that happen, because my system obviously is configured to use "atril" by default.
Very interesting. No entry in the cache but kpdf comes out of the dark.
If the line "application/pdf=kpdf.desktop" is in mimeinfo.cache under $HOME it should override the entry in the systemwide mimeinfo.cache
I'll give that a try.
Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
What would be achieved by that? You'd have to reinstall or dpkg-reconfigure kpdf
No. See your entry above. Atril has somewhere somehow a mechanism, that withstands the attack of libreoffice to get deleted! And that same mechanism would be very welcome in kpdf.
Regards, Peter.
Hallo Peter,
Am Samstag, 6. Februar 2021 schrieb phiebie@drei.at:
Am 06.Feb.2021 um 14:43 schriebst Du:
there has to be another config layer in TDE to make that happen, because my system obviously is configured to use "atril" by default.
Very interesting. No entry in the cache but kpdf comes out of the dark.
This works from inside kmail, krusader, konqueror and probably all TDE apps. It is configured in TDE Control Center -> TDE Components -> File Associations …
If the line "application/pdf=kpdf.desktop" is in mimeinfo.cache under $HOME it should override the entry in the systemwide mimeinfo.cache
I'll give that a try.
It's "should" like: "I think it should", concluded from the UNIX principle that configs in $HOME override configs in /etc/*. I haven't tested that.
Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
What would be achieved by that? You'd have to reinstall or dpkg-reconfigure kpdf
No. See your entry above. Atril has somewhere somehow a mechanism, that withstands the attack of libreoffice to get deleted! And that same mechanism would be very welcome in kpdf.
ACK. The pre- and post-install scripts need to be investigated…
Cheers, Stefan
Hi Stefan,
Am 07.Feb.2021 um 12:11 schriebst Du:
It's "should" like: "I think it should", concluded from the UNIX principle that configs in $HOME override configs in /etc/*. I haven't tested that.
Indeed, it overrides the general settings. Tks for the hint. And also tks to Dr. Klepp for his solution to ensure, that this file stays pristine. It took so long time to answer, because there wasn't an update of libreoffice available earlier.
Kind regards, Peter.
Hi!
Anno domini 2021 Thu, 11 Mar 14:46:45 +0100 phiebie@drei.at scripsit:
Hi Stefan,
Am 07.Feb.2021 um 12:11 schriebst Du:
It's "should" like: "I think it should", concluded from the UNIX principle that configs in $HOME override configs in /etc/*. I haven't tested that.
Indeed, it overrides the general settings. Tks for the hint. And also tks to Dr. Klepp for his solution to ensure, that this file stays pristine. It took so long time to answer, because there wasn't an update of libreoffice available earlier.
What version of libreoffice do you use now? I had 7.1 from the repos, but that was not able to produce valid PDF nor print correctly. Now I have the appimage with 7.2, which works.
Nik
Kind regards, Peter. ____________________________________________________ tde-users mailing list -- users@trinitydesktop.org To unsubscribe send an email to users-leave@trinitydesktop.org Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@trinitydeskto...
Hi Nik,
Am 11.Mar.2021 um 16:06 schriebst Du:
What version of libreoffice do you use now? I had 7.1 from the repos, but that was not able to produce valid PDF nor print correctly. Now I have the appimage with 7.2, which works.
I always download LO from the official website. That Debian-tinkering with programs to fulfill their strict "free source" annoyed me already years and yers ago. My version is 7.1.1.2/Libreoffice Community. Saving a writer-document to PDF worked flawlesssly (opened with kpdf), original odt-size increased from 19.281 to 27.351 PDF-Bytes however. Sorry, no time right now to actually print, but the print-preview leaves nothing to doubt on actual printing.
Kind regards, Peter.
Am Donnerstag, 11. März 2021 schrieb phiebie@drei.at:
Hi Stefan,
Am 07.Feb.2021 um 12:11 schriebst Du:
It's "should" like: "I think it should", concluded from the UNIX principle that configs in $HOME override configs in /etc/*. I haven't tested that.
Indeed, it overrides the general settings. Tks for the hint. And also tks to Dr. Klepp for his solution to ensure, that this file stays pristine. It took so long time to answer, because there wasn't an update of libreoffice available earlier.
Good! You're welcome.
Cheers, Stefan
On Sat, 6 Feb 2021, Peter, phiebie@drei.at wrote:
This is my favourite PDF-viewer and as such I have in my mimeinfo.cache the entry "application/pdf=kpdf.desktop". Works perfect....until I update libreoffice-draw or google-chrome. At that moment the kpdf-entry gets erased and instead of it 'draw' or 'chrome' appears or even both. And I have to correct this entry manually again and again. Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
One hack is to make that config file Read-Only. It's the sort of hack I use from time-to-time. Your choice, of course.
HTH, Jonesy
On 2021-02-06 08:32:38 Marvin Jones via tde-users wrote:
On Sat, 6 Feb 2021, Peter, phiebie@drei.at wrote:
This is my favourite PDF-viewer and as such I have in my mimeinfo.cache the entry "application/pdf=kpdf.desktop". Works perfect....until I update libreoffice-draw or google-chrome. At that moment the kpdf-entry gets erased and instead of it 'draw' or 'chrome' appears or even both. And I have to correct this entry manually again and again. Is there a possibility to add in the installscript of kpdf the same mechanism as in chrome and draw - a delete/replace statement?
One hack is to make that config file Read-Only. It's the sort of hack I use from time-to-time. Your choice, of course.
HTH, Jonesy
Even better, make it immutable.
Leslie -- openSUSE Leap 15.2 x86_64 Qt: 3.5.0 TDE: R14.0.9 tde-config: 1.0
On Sat, Feb 06, 2021 at 02:11:05PM -0600, J Leslie Turriff wrote:
On 2021-02-06 08:32:38 Marvin Jones via tde-users wrote:
One hack is to make that config file Read-Only. It's the sort of hack I use from time-to-time. Your choice, of course.
HTH, Jonesy
Even better, make it immutable.
What is the difference between immutable and read-only, and how do you make a file immutable?
I know how to make a file read-only: `chmod a-w file`.
What does immutability give us that removing write permission doesn't?
On 2021-02-06 17:08:29 Steven D'Aprano via tde-users wrote:
On Sat, Feb 06, 2021 at 02:11:05PM -0600, J Leslie Turriff wrote:
On 2021-02-06 08:32:38 Marvin Jones via tde-users wrote:
One hack is to make that config file Read-Only. It's the sort of hack I use from time-to-time. Your choice, of course.
HTH, Jonesy
Even better, make it immutable.
What is the difference between immutable and read-only, and how do you make a file immutable?
I know how to make a file read-only: `chmod a-w file`.
What does immutability give us that removing write permission doesn't?
From info chattr:
| A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, | no link can be created to this file and no data can be written to the file. | Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can | set or clear this attribute.
Leslie -- openSUSE Leap 15.2 x86_64 Qt: 3.5.0 TDE: R14.0.9 tde-config: 1.0