Score:0

Okular snap issues: open files /tmp and files in tab

me flag

I installed the latest snap Okular 22.08.2 on Ubuntu 20.04 (x11, gnome). I encountered two problems:

  1. I am tying to open a .pdf attachment from thunderbird with Okular (snap). Following this guide, I created a tmp folder in my home (location accessible by Okular) and mounted the /tmp folder there: mkdir /home/you/tmp sudo mount --bind /tmp /home/you/tmp/. When double-clicking on the attachment, a read-only file is correctly created in /tmp/pid-xxxxx/attachment.pdf, Okular the default application opens, but I get an error message: Could not open file:///tmp/pid-xxxxx/attachment.pdf. Nevertheless, going to the folder /tmp/pid-xxxxx/, I am able to open the created file by simply double-clicking on it. Is it a snap connections problem?
  2. Although I set the "open in tabs" option and restarted the app, upon clicking on .pdf files, they will be opened into different instances instead of in tabs. EDIT: I have just noticed that if a pdf is opened via right click -> open with another application -> Okular, instead of simply double-clicking, the file is actually opened in a tab of the already opened Okular. How is it possible to code this as default behaviour?

I would appreciate any help. Thank you!

EDIT: requested connections output.

$ snap connections okular
Interface                                          Plug                                         Slot                                                                            Notes
audio-playback                                     okular:audio-playback                        :audio-playback                                                                 -
content[icon-themes]                               okular:icon-themes                           gtk-common-themes:icon-themes                                                   -
content[kde-frameworks-5-98-qt-5-15-6-core20-all]  okular:kde-frameworks-5-98-qt-5-15-6-core20  kde-frameworks-5-98-qt-5-15-6-core20:kde-frameworks-5-98-qt-5-15-6-core20-slot  -
content[sound-themes]                              okular:sound-themes                          gtk-common-themes:sound-themes                                                  -
cups-control                                       okular:cups-control                          -                                                                               -
dbus                                               -                                            okular:session-dbus-interface                                                   -
desktop                                            okular:desktop                               :desktop                                                                        -
desktop-legacy                                     okular:desktop-legacy                        :desktop-legacy                                                                 -
home                                               okular:home                                  :home                                                                           -
network                                            okular:network                               :network                                                                        -
network-bind                                       okular:network-bind                          :network-bind                                                                   -
opengl                                             okular:opengl                                :opengl                                                                         -
removable-media                                    okular:removable-media                       :removable-media                                                                -
wayland                                            okular:wayland                               :wayland                                                                        -
x11                                                okular:x11                                   :x11      
user535733 avatar
cn flag
Please edit your question to show the complete output of `snap connection okular`
user535733 avatar
cn flag
It's not a snap connections problem. It's intentional -- snaps are sandboxed by AppArmor, and part of sandboxing means that only directories in specific parts of the tree are allowed. /home is allowed. /tmp is not. If you must use /tmp, then the snap package is not for you.
Gi Na avatar
me flag
is there any workaround? Mounting /tmp within the scope of snap is not giving the wanted behaviour.
Gi Na avatar
me flag
I have just noticed that if a pdf is opened via right click -> open with another application -> Okular, instead of simply double-clicking, the file is actually opened in a tab of the already opened Okular. How is it possible to code this as default behaviour?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.