Is there a way to customize keyboard shortcuts for Evince, the GNOME document viewer?
-
1Have 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 Answers
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 :)
- 2,639
- 9
- 12
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.
- 12,032
- 1
- 18
- 35
-
I don't have a file at ~/.config/evince/accels. Is there supposed to be something there? – Jonathan Oct 16 '19 at 02:58
-
It might be distribution/window manager dependent. It is there in Debian 9 + Xfce4. It is created automatically by evince if it does not exist. – Eduardo Trápani Oct 16 '19 at 12:12
-
Do I have to copy it over from some place in the filesystem, like `/usr/...evince`? I can't find it anywhere – Jonathan Oct 16 '19 at 15:38
-
It should be there. What is your system, its version and the the Evince version? – Eduardo Trápani Oct 16 '19 at 16:03
-
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.
- 101
- 1