Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: HOWTO Make Gnome Keyboard Indicator Show Country Flags

  1. #1
    Join Date
    Oct 2005
    Beans
    232
    Distro
    Ubuntu 12.04 Precise Pangolin

    HOWTO Make Gnome Keyboard Indicator Show Country Flags

    This was written with Ubuntu Feisty (Gnome) in mind (See the NOTE in #6 below for a comment on Edgy).

    I found out about this (mostly) on a Russian language Ubuntu site at:
    http://www.nabble.com/%D0%A4%D0%BB%D...-t3639724.html.

    1. If you haven't got a language indicator, right click on a panel and select "Add to Panel", find "Keyboard Indicator" near the bottom of the pop up dialogue, highlight it and click "Add", then "Close".

    2. When the indicator appears on the panel, right click it and choose "Keyboard Preferences". Select the "Layouts" tab and use the "Add" button to choose your languages (Gnome only allows four). Put a check by the language you want as default. Close the dialogue. You should have a language indicator showing some not terribly esthetic text. Click on it to change languages.

    3. Now, you need flag images. The above mentioned site links to two images, one for the US flag and one for the Russian. These are at:

    http://forum.ubuntu.ru/index.php?act....0;attach=1226 - us.png
    http://forum.ubuntu.ru/index.php?act....0;attach=1227 - ru.png

    I don't need Russian, but since these folks had done the work, I downloaded the images to find out the proper sizes. The images are (width) 64 x (height) 43 pixels.

    If you can't find suitable flags, going to Wikipedia and searching for a country name will bring you to a page which includes the country's flag. It can be downloaded by right-click>Save image as... I didn't take these myself, but someone told me he got some there. A brief look at their site didn't seem to reveal any legal problem downloading - especially since it's only for your own desktop. It's even OK for your web site (with acknowledgment of the source [see their page for details]).

    These are much larger images than you need*, so right click the image and select "Open with > the Gimp". When the image opens in the Gimp, right click it and select "Image>Scale Image". In the dialogue box, change the width to 64. The height should take care of itself and come out around 42-47 (as mentioned, theirs are 64x43). Hit the "Scale" button and close.

    Then, in the File menu, choose "Save as..." and, leaving the .png format, name the image according to the standard two letter country code, e.g., us.png, es.png, fr.png etc. (Use the country names as found in the keyboard indicator as in #2 above ... the system recognizes languages by those country names. So, for Spanish, you must use "es.png", not "Spanish.png" or "mx.png", etc... country names - not language names: "us", not "en" [you could use a Mexican flag as long as the image were named "es.png"]). Close the Gimp.

    *Noamr wrote,"You actually don't need all this GIMP stuff. You can just download the SVG file from wikipedia and put it in /usr/share/pixmaps/flags/XX.svg." I haven't tried that but, if it works for you, go for it!

    4. Place your flag images in /usr/share/pixmaps or ~/.icons/flags (I only tried the first). If cut and paste won't work because of permission issues, move them with the command line (example: sudo mv -i Desktop/cn.png /usr/share/pixmaps/cn.png).

    5. Go to Applications>System Tools>Configuration Editor. It seems to ship with Feisty but was not visible in my menu. If that's the case with you, try System>Preferences>Main Menu to open the Menu Editor. Find Applications>System Tools and see if it's there just waiting for you to put a check mark by it (and do that). Then you should see it in the Applications menu. You can also open it from a terminal by typing " gconf-editor" (no quotes). As a last resort, you can install it from Synaptic or apt-get (gconf-editor, gconf2-common, and gconf2).

    6. After you have the Configuration Editor open, go to Desktop>Gnome>Peripherals>Keyboard>Indicator and check the box on the right side that says "showFlags". Close the editor and you should have flags instead of text in your keyboard indicator. (The Russian page cited above gives different instructions, but they seem to be for another keyboard indicator applet).

    NOTE: Nanogeek, posting on the original thread for this howto, found that the above Configuration Editor selection did not work for Edgy, but was able to get the flags working by using this instead: Apps->gswitchit->Applet->showFlags (the selection mentioned on the Russian site). I have not tried this personally.

    When I first did this, the flags appeared quite small. After a reboot, they came back in a better size (maybe refreshing the panel would have done that).

    Also, at one point, my keyboards wouldn't switch. A reboot might have fixed that, but I was in the middle of a download, so I removed the indicator from the panel (AFTER removing all languages but one!). I then added the indicator back to the panel and put back the languages and it's been fine).

    Hope this is of help to someone.
    Last edited by Ingla; August 27th, 2007 at 01:24 PM.

  2. #2
    Join Date
    Jul 2007
    Beans
    10
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Smile Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    Thank you! This is just what I needed

    As for Noamr's tip, I can confirm that that method works great, running Gutsy Gibbon--just googled "svg wiki flag [country name]" and the first result was invariably the one i wanted.

    A simple rename to the two-letter country code was all I need to do before copying to /usr/share/pixmaps/flags/ .

    For those frustrated at finding the correct two-letter combination, this site helped me tremendously, as Gnome uses ISO 3166-1 for its naming scheme.

  3. #3
    Join Date
    Jan 2008
    Beans
    4

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    Thank you! Worked nicely for me.
    I have one more question though. Is there a way to choose different flags/icons for different variants of the same layout?

  4. #4
    Join Date
    May 2007
    Location
    Boston, USA
    Beans
    18
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    excellent!

    quick question though, where are the Keyboard Layout .png's kept? i can't seem to find them in /usr/share

    thanks in advance.
    Last edited by roadrocket13; March 5th, 2008 at 04:17 PM.

  5. #5
    Join Date
    Oct 2005
    Beans
    232
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    Place your flag images in /usr/share/pixmaps or ~/.icons/flags (I only tried the first). If cut and paste won't work because of permission issues, move them with the command line (example: sudo mv -i Desktop/cn.png /usr/share/pixmaps/cn.png).

  6. #6
    Join Date
    Apr 2005
    Location
    My dreams
    Beans
    3,535
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    Thank you for this how-to! Very nice! It works perfectly, even when putting the icons in the ~/.icons/flags folder.

    I used flag icons from this collection at the IconArchive. They are pretty good.

  7. #7
    Join Date
    Aug 2005
    Beans
    795

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    anyone have an idea what i should do for dvorak?
    I switch between a standard us qwerty and the standard us dvorak.
    I have named dvorak us.png and my image shows up nicely I do not know what to name the qwerty image because it cannot also be us. Normally they show up as USA and USA2 with the two as a little subscore.

  8. #8
    Join Date
    Sep 2007
    Location
    Pasadena, California
    Beans
    663
    Distro
    Ubuntu Development Release
    Works great, thank you very much!
    Last edited by iheartubuntu; May 26th, 2008 at 09:10 PM.

  9. #9
    Join Date
    Aug 2005
    Beans
    795

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    It appears that both US english and US dvorak look to the same image for their icon (/usr/share/pixmaps/us.png). I believe then that this method will not work for layouts from the same region.

  10. #10
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Beans
    415
    Distro
    Ubuntu Development Release

    Re: HOWTO Make Gnome Keyboard Indicator Show Country Flags

    Another good collection of flag icons - PNG format. Sizes : 16x16, 24x24, 32x32, 48x48.

    http://www.icondrawer.com/free.php
    Linux user since Slackware 3.4

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •