LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fluxbox: Change languages / keyboard layout? (https://www.linuxquestions.org/questions/linux-newbie-8/fluxbox-change-languages-keyboard-layout-393468/)

BaltikaTroika 12-16-2005 02:28 AM

Fluxbox: Change languages / keyboard layout?
 
Under KDE, I had a nice little icon in the taskbar that I could click in order to change languages (from English to Russian). Is there an easy way to do this under fluxbox?

So far, I love fluxbox, but since I need to type in two languages, it's not incredibly useful yet. There's nothing I can find about this in either the faq or other documentation.

Any ideas are appreciated,
Baltika

fouldsy 12-16-2005 12:50 PM

System apps like gKrellM have plugins such as xkb which allows you to switch between different keyboard maps, but you might not want all the functionality of gKrellM (worth looking at though!).

You may well find something on http://dockapps.org/ that will run in the corner of your fluxbox desktop and allow you do what you wish, but since I only need the one language I've never tried it.

jonaskoelker 12-16-2005 06:40 PM

Using ~/.fluxbox/keys seems like an easy way to build something decent:
Code:

Mod4 k e :Exec setxkbmap $ENGLISH
Mod4 k r :Exec setxkbmap $RUSSIAN

for, say, ENGLISH=us and RUSSIAN=xyzzy (or plugh, or an actual name of a russian keyboard layout).

However, you probably need to switch X input method, which I don't know how to do (well, I do know how for uim/skk, but that's for japanese).

わたし わ ひほんご お わからない ^_^

hth --Jonas

komofei 09-25-2006 01:43 PM

Try use this little script
 
I create little script to fix problem for switching araound preffered keyboard layouts.
You can map in fluxbox keys file this script:
Shift Control k :execcommand xkbSwitch

1) Copy this script into folder which you have in your $PATH.
2) Create hidden folder ~/.xkbSwitch
3) Create file ~/.xkbSwitch/xkb_layouts and write your preffered layouts (e.g us, de, sk, ...) into file, every layout at new line.

After restart your fluxbox, you can use CTRL+SHIFT+k for araound changing your layouts or execute command xkbSwitch for it.

xkbSwitch script:

#!/bin/sh

LAYOUTS_FILE=~/.xkbSwitch/xkb_layouts
INDEX_FILE=~/.xkbSwitch/index

if [ ! -r $LAYOUTS_FILE ]; then
echo 'File $LAYOUTS does not exist!'
exit 0
else
if [ ! -r $INDEX_FILE ]; then
echo '0' > $INDEX_FILE
fi
read line <$INDEX_FILE
let "INDEX=$line+1"
INNER_INDEX=0
while read line
do
LAYOUTS[$INNER_INDEX]=$line
let "INNER_INDEX +=1"
done <$LAYOUTS_FILE

if [ $INDEX -ge $INNER_INDEX ]; then
let "INDEX -=$INNER_INDEX"
fi
#echo ${LAYOUTS[$INDEX]}
echo $INDEX >$INDEX_FILE
setxkbmap -layout ${LAYOUTS[$INDEX]}
fi
#//// end of script
I'm sorry, but spaces in script are not visible in this reply :(
When you have any problems with script email me: komornik AT linux DOT sk

I hope that I help you.


All times are GMT -5. The time now is 05:06 AM.