Subject: Bug#750: Update keystrokes.cfg docs for nx-libs 3.5.0.29

From: Mihai Moldovan <[email-masked]>
Date: Sun, 23 Aug 2015 17:22:54 +0200

Control: close -1

Closing this as I've heard no objections.

Mihai

---

From: [email-masked] (X2Go Bug Tracking System)
Date: Sun, 23 Aug 2015 15:25:02 +0000

This is an automatic notification regarding your Bug report
which was filed against the wiki.x2go.org package:

#750: Update keystrokes.cfg docs for nx-libs 3.5.0.29

It has been closed by Mihai Moldovan <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mihai Moldovan <[email-masked]> by
replying to this email.

-- 
750: http://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=750
X2Go Bug Tracking System
Contact [email-masked] with problems

Subject: Update keystrokes.cfg docs for nx-libs 3.5.0.29
From: Mihai Moldovan <[email-masked]>
To: [email-masked]
Date: Sun, 23 Aug 2015 17:22:54 +0200

Control: close -1

Mihai

Subject: user-local keystrokes.cfg does not work
From: Horst Schirmeier <[email-masked]>
To: [email-masked]
Date: Thu, 15 Jan 2015 16:10:46 +0100

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