Keyboard problem

Please post all general support questions for LXDE here.
Locked
dietmarf
Posts: 2
Joined: Wed Dec 21, 2011 9:37 pm

Keyboard problem

Post by dietmarf »

Hi,

I just saw LXDE on a colleague's laptop yesterday and decided to give it a try, since it looked pretty nice to me. I installed it on my Linux mint 11 installation in addition to mint's Gnome-Desktop.

The only two things missing were a network manager applet that works and additional keyboard layouts. I fixed that by adding these two lines to /etc/xdg/lxsession/LXDE/autostart:

@setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll de,ru,si
@nm-applet

My standard layout shall be German, but in Addition to that, I want also Russian and Slovenian. That works so far. BUT:

If I press AltGr while using the German layout, the keyboard setting switches to Russian. It changes back to German when I release AltGr.
If I change the layout to Russian, AltGr makes my keyboard setting change to Slovenian while that key is pressed.
Pressing AltGr while using Slovenian doesn't seem to trigger another layout.

Now my questions:
1) How can I get rid of AltGr switching my keyboard layout?
2) Is there a way to assign a key combination to every keyboard layout (e.g. Alt+Shift+1 German, Alt+Shift+2 Russian, etc)?

looking forward to answers ;-)
best
Dietmar
marmarc
Posts: 15
Joined: Mon Oct 24, 2011 4:38 pm

Re: Keyboard problem

Post by marmarc »

I'm not sure my answer is suitable for your problem with keyboard layout, but in lubuntu you can assign any key combination to any system function - in file '/home/user_name/.config/openbox/lubuntu-rc.xml'
I assigned 'ctr-z' to execute script named 'screensaver-command' by adding this in <keyboard> section

Code: Select all

<keybind key="C-z"><action name="Execute"><command>xscreensaver-command -lock</command></action></keybind>
athlon xp 1800+, ram 768 m, lubuntu 11.10
dietmarf
Posts: 2
Joined: Wed Dec 21, 2011 9:37 pm

Re: Keyboard problem

Post by dietmarf »

thanks marmark,

I think your advice brings me as close as I can get at the moment to what I want.

for my Linux Mint it is ~/.config/openbox/lxde-rc.xml

first I removed the following line from /etc/xdg/lxsession/LXDE/autostart again, since it seemed to do bad things to AltGr-Key combinations:

Code: Select all

@setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll de,ru,si
then I added the following lines to lxde-rc.cml:

Code: Select all

<keybind key="C-A-1">
      <action name="Execute">
         <command>setxkbmap de</command>
      </action>
    </keybind>

    <keybind key="C-A-2">
      <action name="Execute">
         <command>setxkbmap ru</command>
      </action>
    </keybind>

    <keybind key="C-A-3">
      <action name="Execute">
         <command>setxkbmap si</command>
      </action>
    </keybind>
The only cost of this solution is, that I cannot change the keyboard layout any more by clicking on the keyboard-Applet that indicates the current layout. That's a pity, but I can live with that.
Locked