Can I edit the script that launches the pdf document reader ?

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
User avatar
cobaka
Posts: 519
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 49 times

Can I edit the script that launches the pdf document reader ?

Post by cobaka »

Привет & woof to all!

Using the ROX file manager, I can click on a *.pdf document and the file manager will open it for me.

Great!

Is this process controlled by a script (somewhere)?
Can I modify the script so that the pdf reader opens it at a different magnification (or just to the width of a page?)
Can I specify the size of the page on the screen? (I think "yes", but how?)

Please, if you know where this magic happens, tell me!
Thank you, fellow woofsters!

Собака

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

williwaw
Posts: 1567
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 143 times
Been thanked: 283 times

Re: Can I edit the script that launches the pdf document reader ?

Post by williwaw »

you may be able to find a pdf viewer that allows you to set some view preferences.

if your preferred pdf viewer is not the one that opens when you click on a pdf in rox. it can be made to do so

do you have menu > setup > default applications chooser?

User avatar
cobaka
Posts: 519
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 49 times

Re: Can I edit the script that launches the pdf document reader ?

Post by cobaka »

Thank you @williwaw
Yes, I have that application. (Location in uPupBB is desktop -> Applications -> Setup -> Default Applications Chooser.

The application for viewing documents is: Evince (or maybe evince). Yes, evince.
I found /usr/bin/evince/
So - have the executable (evince), but I suspect it is run via a script.
I suspect there is a command line that runs evince - and that the default viewing magnification is set by passing parameters in the command-line script. I hope my explanation is both concise and can be understood.
I suspect that script is selected/run from another script in the application "chooser" and (I suspect) that is setup somewhere in ROX.

But (as you can see) I know nothing about Linux - all this is guess-work on my part.
I'm doing 2 things here. I'm learning how Linux runs and I'm making one of the applications I often use (the pdf viewer) a little more convenient. I spend a lot of time dragging out spec sheets for integrated circuits (and so on) and every time I increase the viewing magnification from 70% to page-width or 100% (or something). Definitely something. Never nothing. I want to set a different default magnification - that's all.

Собака
(more - I mean 'more' not 'less'.)
I found this: https://linuxsoftware.moncerbae.com/evi ... wer-linux/
Problem: Lacks description of invoking from the command line.

I found a better page that describes how to open evince in full-screen mode.
Link: https://help.gnome.org/users/evince/sta ... ne.html.en
Therefore all I need now is to know where to add this parameter to the invoking routine. (I'm getting there).

Final comment Configuring Linux appears to be systematic and easy to understand.
If I wanted to do this in Windows (I don't) - would it be possible to learn how?

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
cobaka
Posts: 519
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 49 times

Re: Can I edit the script that launches the pdf document reader ?

Post by cobaka »

G'day to all:
Silly me. Silly silly silly me.
I have the answer; with williwaw's help I found that the pdf view is called 'evince'.
With that knowledge I quickly found /usr/bin/evince
With that knowledge I found the answer: evince --help
I can open the viewer in full screen mode, using the -f switch, but other magnifications are not available (via the command line).

Thank you williwaw

Собака

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: Can I edit the script that launches the pdf document reader ?

Post by williams2 »

Rox may be configured to use the script defaultpdfviewer in /usr/local/bin/

the contents of my defaultpdfviewer script is:
XDG_RUNTIME_DIR=/tmp/runtime-root exec qpdfview "$@"

qpdfview --help does not list any options for default magnification or full screen, etc.

but you can configure your preferences in the menu (Edit -> Settings)

which should save your preferences to the text file /root/.config/qpdfview/qpdfview.conf

Also, qpdfview has extensive help in /usr/share/qpdfview/help.html
For example, there are keyboard shortcuts to "Fit to width" etc etc.

evince may be similar.

williwaw
Posts: 1567
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 143 times
Been thanked: 283 times

Re: Can I edit the script that launches the pdf document reader ?

Post by williwaw »

williams2 wrote: Thu Oct 14, 2021 7:52 pm

evince may be similar.

fwiw: my evince in easy has Edit > Save current settings as default Ctrl+ T
but it doesn't save any window adjustments

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: Can I edit the script that launches the pdf document reader ?

Post by williams2 »

my evince in easy ... doesn't save any window adjustments

If you are running evince in a container in EasyOS, that may be why it won't save.

With Puppy and qpdfview you could probably save 1 or more settings in /root/.config/qpdfview/qpdfview.conf

For example, you could have scripts named pdf1, pdf2, etc etc that would copy conf files with different preferences to /root/.config/ before starting qpdfview.

With EasyOS that might not work. Maybe if the evince .conf file is copied from a shared dir?

williwaw
Posts: 1567
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 143 times
Been thanked: 283 times

Re: Can I edit the script that launches the pdf document reader ?

Post by williwaw »

williams2 wrote: Thu Oct 14, 2021 8:59 pm

With EasyOS that might not work. Maybe if the evince .conf file is copied from a shared dir?

not in a container, but not the full blown evince document reader. seems to be a cut down named
Evince PDF viewer 2.32.0

User avatar
cobaka
Posts: 519
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 49 times

Re: Can I edit the script that launches the pdf document reader ?

Post by cobaka »

Hello all:
I am running uPupBB32 (the most beautiful of all Puppies!)[ Rev 19.03.
My default pdf editor is evince. That is found (so far as I can see) in /usr/local/bin.
The content of defaultpdfviewer (from that directory) is:

Code: Select all

#!/bin/sh
exec evince "$@" 

Adding the switch '-f' before "$@" has no effect
Similarly, -> edit -> ctrl+T has no effect.
I'm stuck, it seem, with opening every document at 70% magnification.

However, using the cli (or bash/terminal)

evince -f filename.pdf does open the file in full screen.
Ah, well - life is good.

Woof to all

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

HerrBert
Posts: 329
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 17 times
Been thanked: 110 times

Re: Can I edit the script that launches the pdf document reader ?

Post by HerrBert »

You can try to set the run action for .pdf in ROX by rightclicking a .pdf file, select Set run action... and add the -f option to the shown command (which will probably be defaultpdfviewer "$@")

Trapster
Posts: 138
Joined: Sat Aug 01, 2020 7:44 pm
Has thanked: 1 time
Been thanked: 37 times

Re: Can I edit the script that launches the pdf document reader ?

Post by Trapster »

If that puppy version has gsettings, try these in a console, then try evince.

Code: Select all

# gsettings set org.gnome.Evince.Default sizing-mode free

# gsettings set org.gnome.Evince.Default zoom 1.35

This works in Slacko-7

User avatar
cobaka
Posts: 519
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 49 times

Re: Can I edit the script that launches the pdf document reader ?

Post by cobaka »

Thank you @Trapster

Tried this in uPupBB32. Reported:

# which gsettings
/usr/bin/gsettings
# gsettings set org.gnome.Evince.Default zoom 1.35
No such key “zoom”

Also:

# gsettings set org.gnome.evince.Default zoom 1.35
No such schema “org.gnome.evince.Default”
# which evince
/usr/bin/evince

I'm going to give this minor problem a break
I'm trying to learn "C" from cold. Experiencing some difficulties. Need to focus energy on this latest disasterrrrr.

Собака

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
mikewalsh
Moderator
Posts: 5533
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 560 times
Been thanked: 1665 times

Re: Can I edit the script that launches the pdf document reader ?

Post by mikewalsh »

@cobaka :-

Just so that you know for the future, Les, there's a couple of ways of modifying/setting default apps like this.

  • - You can either bring up the Default Applications Chooser in Menu->Setup. Select 'All" from the mini-GUI that appears. When launched, this will present you with a whole bunch of fields, each of which has a drop-down box. If the application you want to use is listed, just select it & hit 'Apply'. If it isn't listed, you can always add the path directly into the drop-down box yourself......again, followed by hitting 'Apply'.

    These fields directly modify the appropriate 'defaultwhatever' script in /usr/local/bin.

  • - Or, you can simply edit the appropriate 'defaultwhatever' script in /usr/local/bin yourself, using Geany or whatever your preferred text editor is.

Hope that helps.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Adam Li
Posts: 72
Joined: Mon Aug 03, 2020 3:16 pm
Location: Warsaw / Poland
Has thanked: 12 times
Been thanked: 5 times

Re: Can I edit the script that launches the pdf document reader ?

Post by Adam Li »

Hi cobaka

Over a year ago I wrote about the same problems with Evince without happy end. I suppose, that problem is "build in Evince", not to be repaired by scripts.

If You have Wine use Sumatra PDF, it is Master of Art in document viewers category. Some years ago I also used Foxit Reader for Windows and for Linux.

Have a nice day to all
Adam Li

Laptop Core2 Duo CPU T6400 @ 2.00GHz / 3GB / GeForce 9300M GS
BionicPup32-8 19.03 / Precise 5.7.1 - Both Frugal Instal on HDD
Sorry for possible mistakes - English is not my mother tongue.

Post Reply

Return to “Beginners Help”