8

acroread and qpdfview already perform as desired: if an instance of acroread or qpdfview, 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 of okular 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 within okular I see no indicative option in the native settings.

  • Related: http://askubuntu.com/questions/75671/why-does-gedit-keep-randomly-opening-new-instances-when-opening-files-from-nauti – nutty about natty Jun 14 '14 at 10:19
  • This answer may work to distinguish between multiple displays but not workspaces... – nutty about natty Jun 14 '14 at 19:18
  • I 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. – Sparhawk Jun 16 '14 at 05:36
  • acroread has the -openInNewInstance option, qpdfview the --unique option, see the respective man pages and *.desktop files. okular OTOH seems to offer nothing along those lines... (? so either need to go deep into okular code, recompile, etc or apply some other trick (unity, compiz, ...) ?) – nutty about natty Jun 16 '14 at 08:04
  • Okular 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. – Sparhawk Jun 18 '14 at 10:48
  • I'm experiencing the same thing. Hope this gets fixed. – extremeaxe5 Mar 05 '20 at 01:31

1 Answers1

4

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.

  • My question was workspace-related. Your answer and my question don't overlap. – nutty about natty Aug 15 '16 at 14:00
  • @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. – terdon Aug 15 '16 at 14:45
  • @terdon Disagree. See title, tag and content. – nutty about natty Aug 16 '16 at 09:48
  • @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. – terdon Aug 16 '16 at 09:52
  • @terdon edited. – nutty about natty Aug 17 '16 at 21:47