Ok, now Im on to something. In kde4 and gnome, the keyboard switcher command looks like this:
Code:
setxkbmap -model pc104 -layout se,se -variant dvorak,
Both layouts in one line. But in kde3 (where it works) I actually get one commandline per layout.
Code:
setxkbmap -model pc104 -layout se -variant dvorak
setxkbmap -model pc104 -layout se -variant basic
Note also that in the above example, the "basic" layout isnt even selectable, so I set that to "default". Which seems to make the variant option empty.

I verified this by manually running the two commands above with the keyboard layout switcher disabled. It works as intended!

So my question now is simple; how do I make the switcher in kde4/gnome work like the one in kde3? I.e. one command per variant, rather than all variants in one command.