7

I'm trying to pre-configure Okular to add it to my custom Ubuntu image. but I can't seem to find the right config files. I need to edit the main toolbar to add a few more buttons like a fullscreen button that is easy to access with one click. the files in the ~/.config folder(okularrc and okularpartrc) don't seem to store the toolbar settings and can't find the ones that do

user22341
  • 101
  • 1
  • 5
  • Possible duplicate of [Taking KDE config files with me](https://askubuntu.com/questions/167955/taking-kde-config-files-with-me) – mja Nov 05 '18 at 18:24
  • @MarkJ.Adams already read that question, I'm using Lubuntu image as my base and I don't have .kde folder. actually even copying everything in the Home directory doesn't work – user22341 Nov 05 '18 at 18:34
  • Filed a bug at https://bugs.kde.org/show_bug.cgi?id=416729 – Ben Creasy Jan 25 '20 at 09:25

2 Answers2

8

As you've found, neither ~/.config/okularpartrc nor ~/.config/okularrc store information relating to changes made to the main toolbar.

Here's an image of the toolbar I have before adding a couple of buttons:

before

I then used the GUI found in Settings > Configure Toolbars to add a couple of buttons (outlined in red) as seen below:

after

I found that these changes were recorded in ~/.local/share/kxmlgui5/okular/shell.rc, in Kubuntu 18.04.

On running diff on shell.rc before and after the changes I get:

$ diff 0shell.rc 1shell.rc
24a25
>   <Separator weakSeparator="1"/>
58a60,61
>   <Action name="help_contents"/>
>   <Action name="help_about_kde"/>
$ 

Of course, the line numbers maybe different on your system.

You've mentioned that copying the entire home folder doesn't help and I would assume that ~/.local/share/kxmlgui5/okular/shell.rc would be copied as well in which case you should have been able to carry over the changes. It's possible that something else is required but I don't know what that would be.

Edit: I just installed okular on Lubuntu 18.04. The same file, ~/.local/share/kxmlgui5/okular/shell.rc, exists there as well.

DK Bose
  • 41,240
  • 22
  • 121
  • 214
  • It's weird, on Ubuntu 20.04, with a snap installation of Okular, none of the files `/snap/okular/98/usr/share/kxmlgui5/okular/{part.rc, part-viewermode.rc, shell.rc}` are modified when I change the toolbar settings in the GUI... – matthieu Mar 06 '21 at 00:35
  • ah! found it! it's in my home directory path: `~/snap/okular/98/.local/share/kxmlgui5/okular/part.rc`. I guess if I modified the "okular_shell" options in the GUI, I would see the file `~/snap/okular/98/.local/share/kxmlgui5/okular/shell.rc` appear as well. – matthieu Mar 06 '21 at 00:38
  • If ever someone landed here looking for the config files location on *windows*, they reside in ```AppData\Local\okular\``` under your home (profile) directory (generally ```C:\Users\your_login```). – Alain BECKER Oct 30 '22 at 16:46
3

By defining some marker pens and applying sudo find . -atime -1 -type f > ~/q and searching in the result file /q for all occurrences of "okular" I finally found this file for a snap-installed Okular Version 1.7.2 on Xubuntu 18.04, which had the proper atime-stamp:

~/snap/okular/63/.config/okularpartrc

It is a printable file. All annotation marker pen definitions follow the heading

[Reviews]
AnnotationTools=

and follow e.g. this pattern

<tool name="rot 25" id="5" type="highlight"><engine color="#ffff0000" type="TextSelector"><annotation color="#ffff0000" type="Highlight" opacity="0.25"/></engine><shortcut>5</shortcut></tool>
Adalbert Hanßen
  • 593
  • 6
  • 22