Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,719

    How to change the keyboard layout ?

    > To be a little clearer, if we select French, on the LCD screen it is an
    > AZERTY keyboard that appears.
    > However:
    > In France it is the AZERTY keyboard that is used.
    > In Canada I think it is the QWERTY
    > In Switzerland the QWERTZ (Ich bin auch in der Schweiz!).
    >
    > So I was wondering if it was possible to have these nuances...


    Oh, are you saying that the three examples you mentioned would be what
    you'd expect, while you'd always get AZERTY? Then we agree: yes, that's
    a limitation in Squeezeplay/JiveLite.

  2. #12
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by mherger View Post
    >>> In theory it should be possible to select both of them independent[color=blue][color=green]
    I just tested this again,
    and living in Switzerland, running LMS on a Mac set up with
    German/Switzerland, Squeezeplay set to French would use AZERTY. I'm not
    sure what input PaulH is referring to if he gets QWERTZ.
    I don't have QWERTZ; I would like to have QWERTZ instead of AZERTY on my Pi with LCD display.

  3. #13
    Senior Member
    Join Date
    Dec 2020
    Posts
    256
    Try this:

    Open a (ssh) console and execute the following code block

    Code:
    ## * Create script to override language based automatic keyboard layout selection
    
    cat > /root/slim-set-kbmap.sh <<EOF
    #!/bin/sh
    #
    # script to override the language based automatic keyboard layout selection in SqueezePlay
    # - takes an alpha-2 ISO country code as input
    # - if the input is invalid, empty or unsupported, then the script will restore default behaviour.
    #
    # (c) 2022 gordonb3
    
    
    inputlang="\$1.."
    if [[ "\${inputlang:0:2}" == "\$1" ]]; then
            ISOlang=\$(grep -i -m1 -o "'qwerty_\$1'" /usr/share/jive/jive/ui/Keyboard.lua | grep -i -o \$1)
            newkbdlang="'\${ISOlang}'"
    else
            newkbdlang="locale"
    fi
    
    if \$(grep -q "kbType .. '_' .. \${newkbdlang}" /usr/share/jive/jive/ui/Keyboard.lua); then
            echo "keyboard layout is already set to \${newkbdlang/locale/default}"
    else
            echo "setting keyboard layout to \${newkbdlang/locale/default}"
            sed -e "s/\(local localizedKeyboard\).*$/\\1 = kbType .. '_' .. \${newkbdlang}/" \\
                -i /usr/share/jive/jive/ui/Keyboard.lua
    
            echo -e "\nNote: you must restart SqueezePlay for the change to take effect"
    fi
    EOF
    
    ## * Mark the script as executable
    
    chmod +x /root/slim-set-kbmap.sh
    
    ## * Execute script to set the keyboard map to German (DE)
    
    /root/slim-set-kbmap.sh de
    Last edited by gordonb3; 2022-01-15 at 10:33.

  4. #14
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Thanks Gordon
    I got:

    /root/slim-set-kbmap.sh: line 3: syntax error: unexpected "(" (expecting "fi")

  5. #15
    Senior Member
    Join Date
    Dec 2020
    Posts
    256
    Strange. Line 3 should be a comment line in the created file. Somehow on your system it doesn't appear to generate the correct result. The intended content of /root/slim-set-kbmap.sh is:

    Code:
    #!/bin/sh
    #
    # script to override the language based automatic keyboard layout selection in SqueezePlay
    # - takes an alpha-2 ISO country code as input
    # - if the input is invalid, empty or unsupported, then the script will restore default behaviour.
    #
    # (c) 2022 gordonb3
    
    
    inputlang="$1.."
    if [[ "${inputlang:0:2}" == "$1" ]]; then
            ISOlang=$(grep -i -m1 -o "'qwerty_$1'" /usr/share/jive/jive/ui/Keyboard.lua | grep -i -o $1)
            newkbdlang="'${ISOlang}'"
    else
            newkbdlang="locale"
    fi
    
    if $(grep -q "kbType .. '_' .. ${newkbdlang}" /usr/share/jive/jive/ui/Keyboard.lua); then
            echo "keyboard layout is already set to ${newkbdlang/locale/default}"
    else
            echo "setting keyboard layout to ${newkbdlang/locale/default}"
            sed -e "s/\(local localizedKeyboard\).*$/\1 = kbType .. '_' .. ${newkbdlang}/" \
                  -i /usr/share/jive/jive/ui/Keyboard.lua
    
            echo -e "\nNote: you must restart SqueezePlay for the change to take effect"
    fi
    If you can find your way in the editor (vi) create the file manually instead.

  6. #16
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by gordonb3 View Post
    Strange. Line 3 should be a comment line in the created file. Somehow on your system it doesn't appear to generate the correct result. The intended content of /root/slim-set-kbmap.sh is:

    Code:
    #!/bin/sh
    #
    # script to override the language based automatic keyboard layout selection in SqueezePlay
    # - takes an alpha-2 ISO country code as input
    # - if the input is invalid, empty or unsupported, then the script will restore default behaviour.
    #
    # (c) 2022 gordonb3
    
    
    inputlang="$1.."
    if [[ "${inputlang:0:2}" == "$1" ]]; then
            ISOlang=$(grep -i -m1 -o "'qwerty_$1'" /usr/share/jive/jive/ui/Keyboard.lua | grep -i -o $1)
            newkbdlang="'${ISOlang}'"
    else
            newkbdlang="locale"
    fi
    
    if $(grep -q "kbType .. '_' .. ${newkbdlang}" /usr/share/jive/jive/ui/Keyboard.lua); then
            echo "keyboard layout is already set to ${newkbdlang/locale/default}"
    else
            echo "setting keyboard layout to ${newkbdlang/locale/default}"
            sed -e "s/\(local localizedKeyboard\).*$/\1 = kbType .. '_' .. ${newkbdlang}/" \
                  -i /usr/share/jive/jive/ui/Keyboard.lua
    
            echo -e "\nNote: you must restart SqueezePlay for the change to take effect"
    fi
    If you can find your way in the editor (vi) create the file manually instead.
    Now my file is the same: but I got:
    grep: /usr/share/jive/jive/ui/Keyboard.lua: No such file or directory
    setting keyboard layout to default
    sed: /usr/share/jive/jive/ui/Keyboard.lua: No such file or directory

    and after reboot slim-set-kbmap.sh disappeared (I did however :wq)

    Thanks

  7. #17
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,495
    If you are using piCorePlayer? you have to remember piCore is a very unique Linux distribution. RAM based, minimal system so lots of programs/tools missing, different file structure. Very different to Raspberry Pi OS.

  8. #18
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by Greg Erskine View Post
    If you are using piCorePlayer? you have to remember piCore is a very unique Linux distribution. RAM based, minimal system so lots of programs/tools missing, different file structure. Very different to Raspberry Pi OS.
    Yes, PcP !

  9. #19
    Senior Member
    Join Date
    Dec 2020
    Posts
    256
    Ah... I missed that.

    Don't have a Pi, so I can't really test any of the following. Quick glimpse seems to indicate that in PCP optional packages have been moved from root to /usr/local, so you probably need to prefix the path to Keyboard.lua with that (i.e. /usr/local/usr/share/jive/jive/ui/Keyboard.lua ). If it's not there try the `find` command.

    Another thing, as PCP loads its RAM filesystem from compressed files on the SD card the change you make (if possible) will not persist between boots.

    Edit:
    Seems I'm missing more as PCP does not include SqueezePlay but SqueezeLite which is headless, i.e. does not provide a user interface. So at this point I'm not sure where the GUI you are seeing on your LCD originates from. It seems plausible that this is the LMS web content?
    Last edited by gordonb3; 2022-01-16 at 03:51.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •