#!/bin/bash STRING="$(ibus read-config | grep -o engines-order:.* | sed 's/engines-order: \[\|\]\|,//g' | awk '{ print $1 }')" if [[ "$STRING" == "'xkb:de::deu'" ]]; then echo "DE" elif [[ "$STRING" == "'anthy'" ]]; then echo "JA" elif [[ "$STRING" == "'xkb:de:ru:rus'" ]]; then echo "RU" fi