Customise Okular to modify highlight tool properties
I wanted to permanently set the highlighters to a few colors and do away with the green line and polygon stuff. It turns out you can modify what highlighters are available by modifying the tools.xml
file. For me (Okular 0.16.3 from official repository on Ubuntu 13.04), this is located at /usr/share/kde4/apps/okular
. You should be able to divine this by running kde4-config --path data
and appending okular
to the last path (but see update below).
In there, you'll see things like
<tool id="7" name="Stamp" pixmap="tool-stamp-okular">
<tooltip>Put a stamp symbol</tooltip>
<engine type="PickPoint" hoverIcon="okular" size="64" block="true">
<annotation type="Stamp" icon="okular"/>
</engine>
<shortcut>7</shortcut>
</tool>
If you replace it to look like the yellow highlighter's block, you'll get a similar highlighter. In my case:
<tool id="7" name="Magenta Highlighter" pixmap="tool-color-magenta">
<tooltip>Magenta Highlight</tooltip>
<engine type="TextSelector" color="#FF99FF">
<annotation type="Highlight" color="#FF99FF" />
</engine>
<shortcut>7</shortcut>
</tool>
The tool-color-magenta
pixmap is stored in /usr/share/kde4/apps/okular/pics
and you can put a png there.
So now my review toolbar looks like this:
I needed to sudo
to modify these files.
Update: following the periodic software update window in ubuntu, I have upgraded Okular to 0.16.4, which restored the default tools.xml
. It looks like if instead you copy or symlink your customized files to the kde apps okular path under your $HOME
(in my case, $HOME/.kde/share/apps/okular
), it should take precedence over the /usr/share/...
ones and save you some trouble.