This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch release/4.0.1.x in repository x2goserver. from 7562177 debian/rules: don't fail if we don't have the systemd addon. new 002c975 x2goserver/bin/x2gosetkeyboard: make compatible with changes in Arctica's nxagent. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 2 ++ x2goserver/bin/x2gosetkeyboard | 53 ++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 20 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.1.x in repository x2goserver. commit 002c975c77c2ee469dfed8f54be6f24bfbed72cf Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Mar 3 12:36:54 2017 +0100 x2goserver/bin/x2gosetkeyboard: make compatible with changes in Arctica's nxagent. Also change to an all-bash algorithm. --- debian/changelog | 2 ++ x2goserver/bin/x2gosetkeyboard | 53 ++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/debian/changelog b/debian/changelog index 42ec0ec..381e652 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium pure bash and let script fail if no display port is available. - x2goserver/sbin/x2gocleansessions: fix syntax error introduced in last change to this file. + - x2goserver/bin/x2gosetkeyboard: make compatible with changes in + Arctica's nxagent. Also change to an all-bash algorithm. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2gosetkeyboard b/x2goserver/bin/x2gosetkeyboard index 4b79f7e..e5961d2 100755 --- a/x2goserver/bin/x2gosetkeyboard +++ b/x2goserver/bin/x2gosetkeyboard @@ -53,15 +53,39 @@ if ! [ -f ${X2GO_CLIENT_KBD_FILE} ]; then exit 0 fi -read_keyboard_file() { - - # retrieve keyboard settings from keyboard file in X2Go session dir - XKB_RULES="$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^rules.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1)" - XKB_MODEL="$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^model.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1)" - XKB_LAYOUT="$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^layout.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1)" - XKB_VARIANT="$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^variant.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1)" - XKB_OPTIONS="$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^options.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1)" +# Used to hold options to setxkbcomp. +typeset -a setxkbcomp_opts +# retrieve keyboard settings from keyboard file in X2Go session dir +read_keyboard_file() { + # Cache file contents. + typeset -a file_content + typeset line='' + while IFS='' read -r line; do + file_content+=("${line}") + done < "${X2GO_CLIENT_KBD_FILE}" + + # Append last line if not terminated by a newline. + [[ "${line}" ]] && file_content+=("${line}") + + for line in "${file_content[@]}"; do + # Extract the keys, their values and add to setxkbcomp_opts. + typeset key='' + for key in "rules" "model" "layout" "variant" "options"; do + typeset regexp='^[[:space]]*'"${key}"'[[:space:]]*=[[:space:]]*"?(.*)"?[[:space:]]*' + if [[ "${line}" =~ ${regexp} ]]; then + typeset value="${BASH_REMATCH[0]}" + + if [ -n "${value}" ]; then + # Handle a special substitution case for evdev-based rules. + # FIXME: find out why that substitution is needed in the first place! + [ "${key}" = 'rules' ] && value="${value//evdev/base}" + + setxkbcomp_opts+=("-${key}" "${value}") + fi + fi + done + done } reset_keymap() { @@ -69,19 +93,8 @@ reset_keymap() { } update_keymap() { - - if [ "$XKB_RULES" = "evdev" ]; then - XKB_RULES="base" - fi - # prepare for setxkbmap call - [ -n "$XKB_RULES" ] && XKB_RULES="-rules $XKB_RULES" - [ -n "$XKB_MODEL" ] && XKB_MODEL="-model $XKB_MODEL" - [ -n "$XKB_LAYOUT" ] && XKB_LAYOUT="-layout $XKB_LAYOUT" - [ -n "$XKB_VARIANT" ] && XKB_VARIANT="-variant $XKB_VARIANT" - [ -n "$XKB_OPTIONS" ] && XKB_OPTIONS="-option $XKB_OPTIONS" - # update keyboard map - setxkbmap $XKB_RULES $XKB_MODEL $XKB_LAYOUT $XKB_VARIANT $XKB_OPTIONS + setxkbmap "${setxkbcomp_opts[@]}" } ### main ### -- Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git