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.


------------------------------------------------------------------------
gordonb3's Profile: http://forums.slimdevices.com/member.php?userid=71050
View this thread: http://forums.slimdevices.com/showthread.php?t=115763

_______________________________________________
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss

Reply via email to