This is how I solved the problem -- minor and insignificant as it is, there is nothing more frustrating than a feature that used to work perfectly and has been impacted and made useless or absent, by an "upgrade."
Since the legitimate and sensible procedures to display the country flags for the respective keyboard layouts was failing, I thought of manipulating the images that are displaying. After some hunting around I found them in:
/usr/share/icons/ubuntu-mono-dark/status/22
and
/usr/share/icons/ubuntu-mono-light/status/22
In those directories, the image files are named:
indicator-keyboard-En.svg for English
indicator-keyboard-Fr.svg for French
indicator-keyboard-Es.svg for Spanish ... you get the idea. There is one of each in both the "light" and "dark" directories named above. Some of them, like English, will also have the "....En-1.svg" "....En-2.svg" .... "....En-32.svg" -- and ditto for French and Spanish, and most others.
... and yes, Saucy, in its windows-like consistency, sometimes displays the light version, sometimes the dark version, no rhyme or reason to it. So rather than spend an eternity trying to figure it out, since I don't give a flyin'... The matter is of no consequence to me, I edited both versions in both the "light" and "dark" directories.
The editing: An svg image is nothing more than an .xml file, and can be edited with a text editor. That does not mean you can get the flags into it that way.
Example: To display a boring "En" on a boring grey background, Ubuntu uses this xml file: indicator-keyboard-En.svg
Here are the contents of the original file:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="22" xmlns="http://www.w3.org/2000/svg" version="1.1" height="22">
<defs>
<mask id="m">
<rect y="0" x="0" style="fill:#fff" height="22" width="22"/>
<text y="15.5" x="1.5" style="font-size:12;font-family:Ubuntu;font-weight:500;fill:black">En</text>
</mask>
</defs>
<rect style="fill:#3c3c3c" mask="url(#m)" rx="2" height="20" width="20" y="1" x="1"/>
</svg>
As you can tell, there's hardly any graphics elements here, but this is used to draw a couple of letters on a grey background.
To get your own flag image(s) into an SVG file, you'll need to install Inkscape.
If you use the fancy new "Ubuntu Software Center," Don't. It's not your friend. Use it to install "Synaptic" and use Synaptic, a real package management system, to install and manage packages on your machine, but searching for "Inkscape" iin the software center should find you the package and all releted dependencies.
Once you've installed it, you can open your flag image in it, and simply save it AS an SVG file. This will produce an xml file with all the necessary trimmings meeting all the necessary requirements, but most significantly, a long alphanumeric string (inside a properly formatted xml tag), that represents your image.
Make sure your flags are not too large, byte-wise.
Now, for example, if you were trying to make one for the French flag, once you've produced the svg version of your flag, open that file in your favorite editor, along with: /usr/share/icons/ubuntu-mono-light/status/22/indicator-keyboard-Fr.svg. Again, I did it twice, once just like this, and once again for the same file in the "light" directory. Make sure you're opening it as root, because you're going to edit that file (use "gksudo gedit" in the beloved HUD).
Also, make sure you back up the original indicator-keyboard-Fr.svg. If you brick your computer, don't come to me.
What you want to do next, is merge the "image" tag from your flag-svg file with the indicator-keyboard-Fr.svg file, as below:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="30" xmlns="http://www.w3.org/2000/svg" version="1.1" height="18">
<image
width="30"
height="18"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAArCAYAAADIWo5HAAAABHNCSVQICAgIfAhkiAAAAKdJREFU
aIHt0LEJwmAYBuHvD1joEhYZxDqdC7iA+ziDG2SBFBkoYGGKuMQPD8J7AxzHtRpfR/Xks9f8vtd0
u3bVfpe1tsez2uXc1Tt0tf0hGaADNBmgAzQZoAM0GaADNBmgAzQZoAM0GaADNBmgAzQZoAM0GaAD
NBmgAzQZoAM0GaADNBmgAzQZoAM0GaADNBmgAzQZoAM0GaADNBlQR9MNlKHqpBsoPwoXC6lf4Ybf
AAAAAElFTkSuQmCC
"
id="image3028"
x="0"
y="0" />
</svg>
Everything between "<image" and "/>" came from the french flag svg file produced by Inkscape. Everything above and below came from the original indicator-keyboard-Fr.svg file.
Note, that the final "</svg>" properly terminates the "<svg" tag started on line 2. This displays correctly on my panel as the French flag. That long alphanumeric string that begins right after "base64," is the actual "meat" of the image, and this one is the shortest of all the flags (4) I've edited.
I've picked a size of 30 pixels wide by 18 pixels tall for all my flags, they make a pleasing effect and seem to match perfectly the height of other indicator icons on the panel.
As always, your mileage may vary.
I want to offer my sincere thanks to all who offered guidance in this echo-chamber of a thread. And to Canonical, Kudos! Healthcare.gov is finally working! You done good!
Bookmarks