How to open a *.pdf in an already existing instance of Okular (independent of in which workspace that instance resides)?
I recently wanted to have the same functionality. Here is the simplest solution I could find:
Open Okular GUI. Navigate to Settings > Configure Okular. In General, under Program Features, check the 'Open new files in tabs' option. Click Apply. Click OK.
Then on your terminal, run okular file1.pdf file2.pdf fileN.pdf
.
That code should open all your files in the same Okular window in different tabs. This method works across folders.
Related videos on Youtube
nutty about natty
Updated on September 18, 2022Comments
-
nutty about natty almost 2 years
acroread
andqpdfview
already perform as desired: if an instance ofacroread
orqpdfview
, resp., is already running this instance will open any pdf files, irrespective of the workspace from which these files are "launched".Now here's the catch:
okular
, alas, behaves differently:"launching" (read: opening) a pdf file from a given workspace will create a new instance of
okular
in that workspace, unless that particular workspace already has an instance ofokular
up and running.Anything I can add to
/usr/bin/okular
to do the trick?man okular
doesn't give any hints to this and also from withinokular
I see no indicative option in the native settings.-
Admin about 10 yearsRelated: askubuntu.com/questions/75671/…
-
Admin about 10 yearsThis answer may work to distinguish between multiple displays but not workspaces...
-
Admin about 10 yearsI tested it, and I get the same behaviour. With Settings > Configure Okular… > General > Program Features > Open new files in tabs, I open pdfs in the same instance, unless opening from a different virtual desktop (with Dolphin). However, it works when initiating from a different activity. This sounds like a bug to me.
-
Admin about 10 years
acroread
has the-openInNewInstance
option,qpdfview
the--unique
option, see the respectiveman
pages and*.desktop
files.okular
OTOH seems to offer nothing along those lines... (? so either need to go deep intookular
code, recompile, etc or apply some other trick (unity, compiz, ...) ?) -
Admin about 10 yearsOkular has a global option in its settings though. Like I said, I think it's a bug, since it works fine for pdfs opened in the same virtual desktop.
-
Admin over 4 yearsI'm experiencing the same thing. Hope this gets fixed.
-
-
nutty about natty almost 8 yearsMy question was workspace-related. Your answer and my question don't overlap.
-
terdon almost 8 years@nuttyaboutnatty then please edit your question to make that clear. It does sound like you're trying to open in tabs. You might want to emphasize that your issue is when you're opening something from the file manager and not from okular and that it is about workspaces.
-
nutty about natty almost 8 years@terdon Disagree. See title, tag and content.
-
terdon almost 8 years@nuttyaboutnatty if at least two people have had trouble understanding your question, that's a pretty good indication that it isn't quite as clear as you think it is. Change it or not, it's completely up to you, but you're more likely to get a helpful answer if you do.
-
nutty about natty almost 8 years@terdon edited.