[X2Go-Dev] Bug#744: user-local keystrokes.cfg does not work
Horst Schirmeier
horst at schirmeier.com
Thu Jan 15 16:10:46 CET 2015
Package: x2goagent
Version: 2:3.5.0.29-0x2go1~git20150113.557+wheezy.heuler.1
A user-local ~/.nx/config/keystrokes.cfg (as described on
<http://wiki.x2go.org/doku.php/wiki:advanced:nx-keyboard-shortcuts>,
which, btw, still talks about the singular file name "keystroke.cfg") is
not read by nxagent, incapacitating users from overriding system-wide
defaults.
The core reason is the way x2goagent communicates the custom
/etc/x2go/keystrokes.cfg path to nxagent:
NXAGENT_KEYSTROKEFILE=/etc/x2go/keystrokes.cfg
export NXAGENT_KEYSTROKEFILE
In nxagent's keystroke-file search order, this environment variable is
tested for before ~/.nx/config/keystrokes.cfg is looked at. As a simple
remedy, I suggest imitating nxagent's search order in the x2goagent
wrapper script:
---
debian/wrappers/x2goagent | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/debian/wrappers/x2goagent b/debian/wrappers/x2goagent
index 129c7ca..750c651 100644
--- a/debian/wrappers/x2goagent
+++ b/debian/wrappers/x2goagent
@@ -29,7 +29,15 @@ test -x $NX_LIBS/../x2go/bin/$NXAPP && export NX_LIBS=$NX_LIBS
export LD_LIBRARY_PATH
-NXAGENT_KEYSTROKEFILE=/etc/x2go/keystrokes.cfg
-export NXAGENT_KEYSTROKEFILE
+for CONFIG in ~/.x2go/config/keystrokes.cfg ~/.nx/config/keystrokes.cfg \
+ /etc/x2go/keystrokes.cfg /etc/nxagent/keystrokes.cfg
+do
+ if [ -r "$CONFIG" ]
+ then
+ NXAGENT_KEYSTROKEFILE=$CONFIG
+ export NXAGENT_KEYSTROKEFILE
+ break
+ fi
+done
exec $NX_LIBS/../x2go/bin/$NXAPP "$@"
--
PGP-Key 0xD40E0E7A
More information about the x2go-dev
mailing list