Can’t switch keyboard layout in the remote application

Forums / NoMachine Terminal Server Products / Can’t switch keyboard layout in the remote application

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18076
    andrey
    Participant

    Hi,

    My server system is Ubuntu 16.04.4 on AWS with NoMachine Workstation Evaluation – Version 6.0.78.

    My client system is Windows 2012 on AWS with NoMachine 6.0.80 free version.

    I’m running IntelliJ Idea Community 2017.3 on my Ubuntu server via NoMachine from my client system (Windows 2012). To do so I created new Special Session and selected to execute command ‘/opt/idea-IC-173.4674.33/bin/idea.sh’ in the floating window. IntelliJ Idea starts correctly, the problem is that I use 2 keyboard layouts: English and Russian. If keyboard layout on my client system is switched to English (before the connection) then in IntelliJ Idea I can type in English, if keyboard layout on my client system is switched to Russian (before the connection) then I can type Russian, but I can’t switch layout in IntelliJ Idea. When I switch keyboard layout on my client system (windows 2012) it stays the same in remote application (IntelliJ Idea). I can switch keyboard layout on my Ubuntu server when I connect to it as to the desktop via nomachine (so proper layouts are installed on the server). But when I run remote application on the same server keyboard layout switching doesn’t work.

    Please help me with this issue. Remote application works much faster and it is much more convenient than desktop.

    #18109
    graywolf
    Moderator

    Create the script /usr/NX/share/AfterSessionStart.sh:

    #!/bin/sh
    
    sessionID=$1
    userName=$2
    sessionType=$3
    displayNumber=$4
    
    HOME=$(getent passwd $userName | awk -F : '{print $6}')
    export HOME
    
    setxkbmap -layout us,ru -option grp:lctrl_lalt_toggle -display :$displayNumber
    
    exit 0

    Make it executable:
    chmod +x /usr/NX/share/AfterSessionStart.sh

    Edit /usr/NX/etc/node.cfg and change the keys UserScriptAfterSessionStart and UserScriptAfterSessionReconnect (if you edit the existing lines remember to remove the heading “#”):
    UserScriptAfterSessionStart "/usr/NX/share/AfterSessionStart.sh"
    UserScriptAfterSessionReconnect "/usr/NX/share/AfterSessionStart.sh"

    Start remote session as usual. You’ll be able to toggle US and Russian layouts just pressing left Ctrl + left Alt combo.

    • This reply was modified 3 years, 5 months ago by graywolf.
    • This reply was modified 3 years, 5 months ago by graywolf.
    • This reply was modified 3 years, 5 months ago by graywolf.
    #18113
    andrey
    Participant

    Thank you. It works. But forum engine removed “code” symbols from your code. The right string is: HOME=`getent passwd $userName | awk -F : '{print $6}'`

Viewing 3 posts - 1 through 3 (of 3 total)

This topic was marked as solved, you can't post.