6

Is there a way to customize keyboard shortcuts for Evince, the GNOME document viewer?

Jonathan
  • 1,210
  • 4
  • 23
  • 41
  • 1
    Have you tried these? https://askubuntu.com/questions/136062/permanent-custom-keyboard-shortcuts-for-evince-document-viewer https://askubuntu.com/questions/555401/how-to-customize-add-keyboard-shortcuts-for-evince/899956#899956 – 15 Volts Oct 15 '19 at 05:03

3 Answers3

0

I downloaded the source code of evince (source code provided by Debian 9.9, evince 3.22.1) and since every shortcuts are written "as-is" in internationalization files (.po), i guess they are hardcoded.

For example:

help/fr/fr.po:msgid "<keyseq><key>Ctrl</key><key>R</key></keyseq>"
help/fr/fr.po:msgstr "<keyseq><key>Ctrl</key><key>R</key></keyseq>"

I'm trying to dig more, but the way evince manage shortcut is quite ... strange :)

binarym
  • 2,639
  • 9
  • 12
0

You can edit them in the source code, where they are defined, and rebuild the package:

In theory, evince should read the accels file at init time and merge with the ones it has, so you can also change the accels file, in ~/.config/evince/accels. Keep in mind that it gets overwritten if there are syntax errors.

Eduardo Trápani
  • 12,032
  • 1
  • 18
  • 35
0

I resigned to customize keyboard shortcut for Gnome Program. I can not use accels file. I wrote patch for source code in old by portage. However, I gave up because the source code changes frequently.

In now, I use mooz/xkeysnail: Yet another keyboard remapping tool for X environment.

I write config file.

define_keymap(re.compile("Evince"), {
    # t
    K("k"): K("r"),
}, "Evince")

One caution is required, and if you touch a key without a modifier key, it will be converted when you enter it in the search form.

ncaq
  • 101
  • 1