You are not logged in.
The way in the wiki to have a non-us keyboard layout is through hal and 10-keymap.fdi, but how do I set it to have layout switching in openbox by pressing alt+shift?
Offline
Hi!
I'm not familiar with openbox, but if you have something that lets you define keyboard shortcuts, you can make it run
setxkbmap -layout [layout]
on different key combinations or do a small toggle script if you only want one key.
Offline
Putting that in ~/.xinitrc? Would the key combination be "setxkboptions"?
Offline
Putting that in ~/.xinitrc? Would the key combination be "setxkboptions"?
i have this in my menu.xml for switching keyboard layouts:
<menu id="keyboard-menu" label="tastatur">
<item label="de-kbd">
<action name="Execute"><command>setxkbmap de</command></action>
</item>
<item label="us-kbd">
<action name="Execute"><command>setxkbmap us</command></action>
</item>
</menu>
or in your rc.xml use smth like:
<keybind key="A-S-e">
<action name="Execute">
<command>setxkbmap us</command>
</action>
</keybind>
<keybind key="A-S-d">
<action name="Execute">
<command>setxkbmap de</command>
</action>
</keybind>
alt-shift alone does not work. both are modifiers
Offline
Shouldn't there be tools included with xorg to fetch the currently used layout and do a simple toggle script? I don't know how, but some "one-liner" like...:
[pseydocode! me no bash, me not know where to get current layout from]
if $(getxkbmap -layout) == us; do setxkbmap -layout de; else do setxkbmap -layout us; done
[/yes, this is no working code! ]
... that you "openbox-people" can write directly into your rc.xml - thing?
Last edited by whoops (2009-05-07 11:29:36)
Offline
Shouldn't there be tools included with xorg to fetch the currently used layout and do a simple toggle script? I don't know how, but some "one-liner" like...:
[pseydocode! me no bash, me not know where to get current layout from]
if $(getxkbmap -layout) == us; do setxkbmap -layout de; else do setxkbmap -layout us; done
[/yes, this is no working code! ]
... that you "openbox-people" can write directly into your rc.xml - thing?
eg:
<keybind key="A-S-<key>">
<action name="Execute">
<command>bash -c "if $(getxkbmap -layout) == us; do setxkbmap -layout de; else do setxkbmap -layout us; done"</command>
</action>
</keybind>
Offline
But since I'm not using xorg, wouldn't whoops' method be invalid?
The menu and rc.xml ideas are great, though.
Offline
Found that:
if [ `setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}'` = us ] ;then setxkbmap de ; else setxkbmap us ; fi
here: http://bbs.archlinux.org/viewtopic.php?id=46581
works fine (with compiz), don't know if there's a better way to get the current layout's code, so:
<keybind key="A-S-<key>">
<action name="Execute">
<command>bash -c "if [ `setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}'` = us ] ;then setxkbmap de ; else setxkbmap us ; fi"</command>
</action>
</keybind>
... might maybe do the trick for openbox.
But since I'm not using xorg
Are you not using xorg or not using the xorg.conf? What xserver do you use or can openbox run without? I don't get it... does the (if [ `setxkbmap -pri.....-) line above do anything pasted in a terminal?
Last edited by whoops (2009-05-07 12:57:06)
Offline
Sorry. I'm not using xorg.conf, I meant.
Terminal output:
[gary@Belkadan ~]$ bash -c "if [ `setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}'` = us ] ;then setxkbmap de ; else setxkbmap us ; fi"
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `if [ us(dvorak) = us ] ;then setxkbmap de ; else setxkbmap us ; fi'
Offline
You just need to cut off the brace in "us(dvorak)" expression:
$ bash -c "if [ `setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}' | awk -F"(" '{print $1}'` = us ] ;then setxkbmap de ; else setxkbmap us ; fi"
However I guess you would like to change it to dvorak, so try:
$ bash -c "if [ `setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}' | awk -F"(" '{print $1}'` = us ] ;then setxkbmap de ; else setxkbmap us dvorak ; fi"
Offline
The way in the wiki to have a non-us keyboard layout is through hal and 10-keymap.fdi, but how do I set it to have layout switching in openbox by pressing alt+shift?
Here is part of my 10-keymap.fdi:
<merge key="input.xkb.layout" type="string">ee,ru</merge>
<merge key="input.xkb.options" type="string">grp:alt_shift_toggle,grp_led:scroll</merge>
Works like a charm
Xyne wrote:
"We've got Pacman. Wacka wacka, bitches!"
Offline