If we look at the sources, in NEWS we find
Evince 45.alpha
- Remove loading and saving of custom accels file
so I don't think that is supported anymore.
Also in the sources, we have the code in ev-application.c
ev_application_startup (GApplication *gapplication)
const gchar *action_accels[] = {
"win.open", "<Ctrl>O", NULL,
"win.open-copy", "<Ctrl>N", NULL,
...
for (it = action_accels; it[0]; it += g_strv_length ((gchar **)it) + 1)
gtk_application_set_accels_for_action (GTK_APPLICATION (application), it[0], &it[1]);
where we see the fixed bindings being set up.
To change or remove a binding we can edit this code and recompile the
application, or more simply we can interpose a shim between the application
and the dynamically loaded gtk library. The shim could, for example, not
call the gtk_application_set_accels_for_action() function for win.open,
and so remove the binding <Ctrl>O for that action.
Or we could change the binding to make <Ctrl>Z work instead.
Here's a suitable file shim_gtk.c:
/*
* capture calls to a routine and replace with your code
* gcc -Wall -O2 -fpic -shared -ldl -o shim_gtk.so shim_gtk.c
* LD_PRELOAD=/.../shim_gtk.so /bin/evince
* https://unix.stackexchange.com/q/787459/119298
*/
#define _GNU_SOURCE /* needed to get RTLD_NEXT defined in dlfcn.h */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
void gtk_application_set_accels_for_action(char *app, char *action, char **accels){
static char *(*real_fn)(char *app, char *action, char **accels) = NULL;
if (!real_fn) {
real_fn = dlsym(RTLD_NEXT, "gtk_application_set_accels_for_action");
char *error = dlerror();
if (error != NULL) {
fprintf(stderr, "%s\n", error);
exit(1);
}
}
#if 0
if(strcmp(action, "win.open")==0){
fprintf(stderr, "not calling for %s\n", action);
}else{
fprintf(stderr, "doing call for %s\n", action);
real_fn(app, action, accels);
}
#endif
#if 1
if(strcmp(action, "win.open")==0){
fprintf(stderr, "binding for %s\n", action);
static char *mybinding[] = { "<Ctrl>Z", 0 }; // nul terminated utf8
real_fn(app, action, mybinding);
}else{
real_fn(app, action, accels);
}
#endif
}
Here the #if 0 is used to disable some code, and #if 1 to enable some
other example code to do as described above. Compile with
gcc -Wall -O2 -fpic -shared -ldl -o shim_gtk.so shim_gtk.c
and run with
LD_PRELOAD=/.../shim_gtk.so /bin/evince ...
replacing ... appropriately.
You should remove the debugging fprintf() calls as they might interfere with the
real use of stderr by the application.