OK, there is a language indicator/selector at top of Unity (I am on Ubuntu 12.04).

And I was thinking that text cursor color could be a nice way of current language indication. I'm using three languages, and while typing in Gmail or somewhere, we look at the text cursor. So for convenience reasons it would be a nice way to adapt separate color (or text cursor form) for each language.

I don't know if this is already implemented. Would be nice to use this feature. Would appreciate if you can point me in right direction.

As I said, this is not about mouse cursor/pointer, this is about the cursor in text fields.

  • 1
    (Commenting until I get more info). This might have an option for editing the text cursor colour. Then it would be a matter of connecting this to a dectection in the currently selected IME language. Oct 5, 2015 at 23:42
  • Text bar/cursor itself cannot change because it's bound to the color of whatever text box it is part of. Would it be a satisfactory solution if Unity launcher changed according to language ? Mar 20, 2016 at 2:51

1 Answer 1


Make a shell script that tests weather how your language ($LANG) is set. Then, it output a value of a colored prompt accordingly.

In .bashrc, you would then set the promptvars shell option, and then set the bash prompt to the output of that shell script, like this:

PS1="`/full/path/your-script.sh`\$ "

That way, your script will be invoked each and every time you get a command prompt and it will generate the corresponding prompt string according to how LANG is set.

How do you generate a colored prompt? It will imposible for me to describe it without transcribing a color table... However, the easy way is to go to http://ezprompt.net/ and have it generate it for you on either case, and then just copy the generated colorized prompts on each particular case.

  • 1
    That's a good idea, but it will be limited to bash only, and only terminal window. OP wanted cursor set per GUI window, e.g. firefox + english -> cursor red, Libreoffice + german -> green. Nov 30, 2015 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.