#!/bin/bash
# USAGE
# flirc_key converter
# flirc_key converter keys
FLIRC_UTIL_FILE="$HOME/.flirc/flirc_util" # modify this path to the 'flirc_util' utility
usage()
{
echo " usage: `basename $0` <OPTIONAL ARGUMENT>"
echo
echo " -h,--help Display help information"
echo " -k,--keys Print and convert the keys stored in flirc"
echo ""
echo " (if no argument is passed to the script, it'll ask you what char(s) you want to convert)"
exit 1
}
if [ -z "$1" ]; then # no argument passed to the script
echo -ne "String to convert: "; read STRING
STRING_LENGTH=${#STRING}
for (( i=0; i<=$((STRING_LENGTH-1)); i++ ))
do
echo "'${STRING:$i:1}' becomes '$(echo "${STRING:$i:1}" | sed 'y/aAqQwWzZ,?;.:mM/qQaAzZwWmM,<.;:/' | sed "y/ù'/'4/" | sed 'y/!\//\/>/' | sed 'y/&é"(-è_çà)°1234567890^¨$£\*µ%§/123567890-_!@#$%^&*()[{]}\\|"?/')' on flirc's US virtual keyboard" # escaping '\' to '\\' is necessary so '\*' becomes '\\'
done
elif [ "$1" == "-k" ] || [ "$1" == "--keys" ]; then # argument passed to the script is 'keys'
$FLIRC_UTIL_FILE keys | grep -v '\-\-\-' | grep -v "key" | awk '{print $3}' | sed '/^[[:space:]]*$/d' | while read line
do
size=${#line}
[[ $size -gt 1 ]] && continue
LINE="$(echo "$line" | sed 'y/aAqQwWzZ,?;.:mM/qQaAzZwWmM,<.;:/' | sed "y/ù'/'4/" | sed 'y/!\//\/>/' | sed 'y/&é"(-è_çà)°1234567890^¨$£\*µ%§/123567890-_!@#$%^&*()[{]}\\|"?/')" # escaping '\' to '\\' is necessary so '\*' becomes '\\'
[[ "$line" == "$LINE" ]] && continue
echo "'$line' becomes '$LINE' on flirc's US virtual keyboard"
done
elif [ "$1" == "help" ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
usage
else
echo "Invalid argument"
usage
fi
I use it to know what to type on Flirc's US Full Keyboard controller
flirc_key_converter
String to convert: azerty*,;:!
'a' becomes 'q' on flirc's US virtual keyboard
'z' becomes 'w' on flirc's US virtual keyboard
'e' becomes 'e' on flirc's US virtual keyboard
'r' becomes 'r' on flirc's US virtual keyboard
't' becomes 't' on flirc's US virtual keyboard
'y' becomes 'y' on flirc's US virtual keyboard
'*' becomes '\' on flirc's US virtual keyboard
',' becomes 'm' on flirc's US virtual keyboard
';' becomes ',' on flirc's US virtual keyboard
':' becomes '.' on flirc's US virtual keyboard
'!' becomes '/' on flirc's US virtual keyboard
How to setup from a french keyboard
in How To
Posted
This is a bash script to convert the keys:
I use it to know what to type on Flirc's US Full Keyboard controller
Feel free to use it