Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have recieved from a friend a custom-made keyboard layout, designed (as he puts it) to be a "programmer-friendly port of a combination of the two most common Swedish variants of the Dvorak keyboard layout". He is using Mac OSX, so he just zipped the contents of his ~/Library/KeyboardLayouts and sent it to me. Of course, the files don't seem portable to Ubuntu without modification - at least I don't understand how...

Among the files, the file that seems to do the actual work is a file called Svorak.keyboard, which in fact is an XML file defining the keyboard layout. The first section of the file is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/Keyboard.dtd">
<keyboard group="0" id="0" name="Svorak" maxout="2">
        <layouts>
        <layout first="0" last="0" modifiers="28" mapSet="a0"/>
    </layouts>
    <modifierMap id="28" defaultIndex="7">
        <keyMapSelect mapIndex="0">
            <modifier keys="command?"/>
            <modifier keys="anyShift command caps?"/>
        </keyMapSelect>
        <keyMapSelect mapIndex="1">
            <modifier keys="anyShift caps?"/>
        </keyMapSelect>
...
    </modifierMap>
    <keyMapSet id="a0">
        <keyMap index="0">
            <key code="0" action="8"/>
            <key code="1" action="o"/>
            <key code="2" action="e"/>
...

Is there any (easy) way I can take this layout and re-map it into a standard Ubuntu format? I'd like to install it alongside my regular QWERTY layout, so I can switch between them using the applet in the status bar etc - in other words, I want to install it as any other installed keyboard layout in Ubuntu.

Is that possible? How?

share|improve this question
    
To clarify: I don't have a picture of this custom layout, or any real idea of what the changes are, so re-creating it from scratch in another format isn't really an option. The only information I have is what's in this XML file, so I will have to base my work on that... –  Tomas Lycken Jan 7 '12 at 5:32

2 Answers 2

up vote 0 down vote accepted
+50

So the short answer is, "no." The feature you are asking for does not exist.

The XML format you mentioned was introduced in Jaguar and while they published the DTD, that format is specific to Apple. I was not able to find any mention whatsoever of any other operating system importing this XML keyboard format, probably because generally most operating systems come with their own extensive database of keyboard layouts. There are Dvorak layouts bundled with Linux, though they may not be tweaked how your friend tweaked his.

Having said that, if certain features of the layout are important to you, you could try making your own keymap with this tutorial.

I hope this helps.

share|improve this answer

I have never tried this, but I found an article that might help you

https://help.ubuntu.com/community/Howto%3A%20Custom%20keyboard%20layout%20definitions

I know this isn't first hand experience, so I don't know if I should post this as a comment and not an answer, but I'm sure a nice mod will let me know :)

share|improve this answer
    
Sure - I've found that too (pretty high up on Google with some obvious search terms...) However, it doesn't help me at all on how to parse the .keylayout file I have; that's where the problem lies, really. –  Tomas Lycken Feb 14 '12 at 23:15
    
I have gone through a similar exercise and was unable to find a 'conversion' tool to take a Mac layout and convert it to an Ubuntu/*nix layout. I used the link provided by BretD in my case. You will find similarities between the XML file 'modifier keys' as an example but unfortunately, at least in my case, it had to be done manually. Summary, no known tool to accomplish this, but manually possibly by mapping the XML file to an existing file within the /usr/share/X11/xkb/symbols directory. –  kingmilo Feb 17 '12 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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