Xfce4 keyboard layout switcher

I am having a strange issue with setting up xfce4 on my fathers' laptop. Every time I switch the keyboard layout, the x terminal emulator start acting weird:
[jarda-wien@primator ~]$ whoami
jarda-wien
[jarda-wien@primator ~]$ echo hello
bash: echo hello: command not found
[jarda-wien@primator ~]$ ping www.google.com
bash: ping www.google.com: command not found
[jarda-wien@primator ~]$ echo $PATH
bash: echo /bin:/usr/bin:/sbin:/usr/sbin:/opt/java/jre/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin: No such file or directory
Before switching the keyboard, everything works fine... As this doesn't happen on virtual terminal, it may be an xorg/xfce issue. What do you make of it?

ok so I've made a workaround for that... The problem seems to be not only xfce4 related as the same behavior can be seen on yakuake running on xfce4 and every other terminal emulator I have tried, as well as on openbox and all the terminals. Anyway, here's the fix:
Remove any
Option "XkbLayout" "us,cz"
Option "XkbOptions" "grp:alt_shift_toggle"
and install xbindkeys from extra.
Next edit and save the following script somewhere:
#!/bin/bash
# Put your desired layouts, space separated, between the brackets
layout=(us de cz)
# Main code, do not change, unless you know what you're doing
current=$( setxkbmap -print | grep -o 'pc+[a-zA-Z0-9_-/]*' | sed 's/pc+//' )
num=${#layout[@]}
i=0
for use in ${layout[@]} ; do
i=$[ i + 1 ]
if [[ $current = $use ]] ; then
if [[ $i -eq $num ]] ; then
setxkbmap ${layout[0]}
break
else
setxkbmap ${layout[$i]}
break
fi
fi
done
exit $?
Make the script executable and try it! It should cycle through the specified layouts. The next step is to map the script to a keyboard shortcut in .xbindkeysrc (look up how in the wiki...)
Everything works now, even after switching the layout!!!

Similar Messages

  • Keyboard layout switching not working

    i use xfce4 and i created /etc/X11/xorg.conf
    Section "InputClass"
        Identifier             "Keyboard Defaults"
        MatchIsKeyboard        "yes"
        Option                 "XkbLayout" "us, ar"
        Option                 "XkbOptions" "grp:alt_shift_toggle"
    EndSection
    but it's not working.
    xfce4 has a program called Keyboard in settings menu, i used it it gives the ability to add another language but it doesnt has a switching capability.

    I don't use keyboard layout switch through xorg.conf because it stops to work sometimes(if i use setxkbmap for example).
    So i am using setxkbmap in .xinitrc.
    setxkbmap -model pc105 \
    -layout "de,ru" \
    -variant "basic,phonetic" \
    -option -option "grp:sclk_toggle, grp_led:scroll, terminate:ctrl_alt_bksp, caps:none"
    and "kbdd" for remembering layout for each window.
    Change it to your needs or check the arch wiki about xorg.conf.d .

  • [SOLVED] Keyboard layout switching

    Hello,
    I have a problem with keyboard layout switching key.
    Just notice it not working anymore...
    here is my key setting in xorg.conf
    Section "InputDevice"
    Identifier "Keyboard"
    Driver "kbd"
    Option "XkbLayout" "us,th"
    Option "XkbOptions" "grp:alt_shift_toggle"
    EndSectionp
    Last edited by xcession (2008-11-05 13:23:57)

    bender02 wrote:
    xcession wrote:EndSectionp
    extra p?
    Seriously though, it looks fine to me. There's a wiki article http://wiki.archlinux.org/index.php/Con … youts_in_X
    I'd try adding
    Option "XkbRules" "xorg"
    although that could be automatic.
    Oops! it's my typo when posting that post...
    Added Option "XkbRules" "xorg"
    but still doesn't work...:(

  • Keyboard layout switching does not work if I connect a second keyboard

    When I connect an external keyboard (a very ordinary Dell keyboard, no extra keys or something unusual) to my laptop, XFCE keyboard layout switcher disappears from a the and keyboard shortkut meant to switch also does not work. Rebooting with the keyboard initially attached does not help. Any ideas how to fix?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Windows is forgetting shortcuts designated for keyboard layout switching after waking up from sleep

    I have a configuration of Ctrl+1,2,3,4,5 shortcuts for switching keyboard layouts on Windows 8.1. Once I boot up my laptop they work just fine and the layouts shortcuts setup window looks like this if I open it:However now when I close my laptop, putting it into sleep mode, and then open it again, the keyboard shortcuts stop working and if I open the aforementioned setup window, it also looks as if I have none configured: To get my shortcuts back after sleep mode I have either to reboot the laptop, or assign the shortcuts again manually. This is a problem I've experienced before on this same machine (Lenovo Yoga 13) with Windows 8 (before the 8.1 update) and I guess at that time it dissapeared after some editing of the list of layouts I use.
    But now I've added some layouts to the list, and then removed some of them and so on and here is what I get again.Maybe there is some branch of Windows Registry involved with the layouts and keyboard-shortcuts messed up and I could simply remove the registry branch and start with a clean slate?  

    I have never seen this Windows before, I unfortunately do not understand Russian.
    Here is the Russian community:
    https://forums.lenovo.com/t5/Сообщество-Lenovo/ct-p/Community-RU

  • Smart keyboard layout switching

    Unfortunately the Arch team has rejected the patch https://bugs.archlinux.org/task/26490
    Quote:
    ""...By default xorg switches keyboard layout on keys press (but it SHOULD do that when keys are released). For example, if we have ctrl+shift to change layout and ctrl+shift+tab to navigate to previous tab then we are unable to use second shortcut..."
    What are possible legal Arch ways to get this functionality?
    Last edited by student975 (2014-02-19 21:50:20)

    student975 wrote:What are possible legal Arch ways to get this functionality?
    Make your own PKGBUILD and apply the patch yourself. It does come with the disadvantage that you will need to compile the xorg-server yourself every-time there is an update.

  • Hotplugging Keyboard Layout Switching Problem

    With a recent update, my keyboard configuration got a bit hosed. The super key stopped working, I couldn't use shifts to swap keyboard layouts, and ctrl/caps swap reverted back. Instead of troubleshooting that, I decided to give hotplugging a try. I disabled the keyboard configuration in xong.conf and enabled hotplugging.
    Everything is working fine with one exception. If I list more than one keyboard layout in the .fdi, the keyboard reverts back to 'us'. As far as I can tell (and other posts have verified this) this is pretty close to copy/paste from xorg.conf. If I use just a single layout, that layout works.
    Any advice?
    <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
    <deviceinfo version="0.2">
    <device>
    <match key="info.capabilities" contains="input.keymap">
    <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>
    <match key="info.capabilities" contains="input.keys">
    <merge key="input.xkb.rules" type="string">base</merge>
    <!-- If we're using Linux, we use evdev by default (falling back to
    keyboard otherwise). -->
    <merge key="input.xkb.model" type="string">keyboard</merge>
    <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
    string="Linux">
    <merge key="input.xkb.model" type="string">evdev</merge>
    </match>
    <merge key="input.xkb.layout" type="string">dvorak,us</merge>
    <merge key="input.xkb.variant" type="string" />
    <merge key="input.xkb.options" type="string">grp:shifts_toggle,ctrl:swapcaps</merge>
    </match>
    </device>
    </deviceinfo>
    Last edited by elegua (2009-02-14 15:20:28)

    elegua wrote:
    Of course I get it figured out a little bit after asking.
    It seems that the update killed the ability to use dvorak layout with anything else in setxkbmap. The following works for me now.
    <merge key="input.xkb.layout" type="string">us,us</merge>
    <merge key="input.xkb.variant" type="string">dvorak,basic</merge>
    elegua, where did you ask your questions? I've got a very similar problem, tried this (pure guesswork):
    <merge key="input.xkb.layout" type="string">us,ru</merge>
    <merge key="input.xkb.variant" type="string">basic,winkeys</merge>
    But it won't wash ...

  • Keyboard layout switcher Gnome panel

    Hi guys,
    Am using US altgr-intl as default.
    The icon US keyboard pops up everytime I start the system though I removed the layout a couple of times through system->prefs.
    It's not a big deal but starts to irritate me.
    Anyone an idea how to either disable the popup of the panel icon or remove the US layout permanently ?
    Tks

    Thanks, did so, like this. Didn't help though.
    <!-- If we're using Linux, we use evdev by default (falling back to
               keyboard otherwise). -->
          <merge key="input.xkb.model" type="string">keyboard</merge>
          <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
                 string="Linux">
            <merge key="input.xkb.model" type="string">evdev</merge>
          </match>
          <merge key="input.xkb.layout" type="string">us altgr-intl</merge>
          <merge key="input.xkb.variant" type="string" />

  • How do I - with Swiss German Keyboard Layout - switch between several windows of the same application, what is the shortcut

    can anyone pls help me with this. plus anbody explain me how this very basic feature that millions of people are using billions of times every day can be that hard to find on a mac?? there is hundreds of posts about this, but nothing for the swiss german keyboard. and apple: can you please make this just that simple and great as all the rest. thank you so much.

    Hi Kappy,
    well what you are saying is obvious to me. This is not the point for me and not what I wanted to know. But I think you answered my question anyway: OS X is unable to switch between windows of the same application as I mentioned in my example.
    WHY NOT???
    Every other OS is able to differentiate between windows and not just applications.
    Another example: The Mail application and an Email editor window. When you are writing an Email and you want to switch to the main window of the Mail application to read something you must again use the mouse!
    I mean Apple seems to be "somehow" using FreeBSD in the background and even in FreeBSD's window manager it is possible to switch between windows of the same application.
    Well, in the Apple world it is always the pour user who is not intelligent enough to understand Apple's philosophy ;-(
    To me this is not modern, it is simply a weakness of the OS.
    Cheers
    Quartz84

  • Keyboard layout switching does not work properly when set to switch per document

    Hello,
    I have two input languages (U.S. / Bulgarian - Phonetic) and I am having problems when using the "Automatically switch to a document's input source" option (available in the Input Sources prefs pane).
    The problem is that when I switch applications (using CMD + Tab) the input is not changed to the correct one, until an input field in the new application is selected. If I don't manually select an input field, the language will remain whatever it was with the previous application I used. As a consequence, none of my shortcuts work, as they are defined in the U.S language, and not in Bulgarian.

    Hi,
    does this problem appear immediately after buying the machine? Maybe its a good idea to recover the machine, perhaps it could be a software issue.
    On the other side it sounds a little bit like a hardware related problem so if the recovery doesnt brought you joy then you should contact a local service partner for help.
    Here you can find the nearest ASP in your country (just click on the link and you will find some):
    http://eu.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/generic_content.jsp?service=EU&ID=ASP_SUPPORT
    Nice weekend
    Cheers

  • Assign keyboard layout switch hotkey not listed in the keyboard applet

    I found some old tutorial to assign left alt+shift to 1st layout and right alt+shift to 2nd layout. How to adapt it to the modern hal way?
    Here it is:
    create $XKBROOT/mysym :
    partial modifier_keys xkb_symbols "shift_ctrl_1" {
    key <LFSH> {
    type="PC_BREAK",
    symbols[Group1]= [ Shift_L, ISO_First_Group ]
    key <RTSH> {
    type ="PC_BREAK",
    symbols[Group1]= [ Shift_R, ISO_Last_Group ]
    key <LCTL> { [ Control_L, ISO_First_Group ] };
    key <RCTL> { [ Control_R, ISO_Last_Group ] };
    add 1 line to $XKBROOT/rules/xorg (after "! option    =    symbols"):
    ! option = symbols
    myshiftctrl1 = +mysym(shift_ctrl_1)
    add option to xorg.conf :
    ! option = symbols
    Section "InputDevice"
    Option "XkbOptions" "myshiftctrl1"
    EndSection

    Found a temporary solution. Unfortunately It resets other options set in the corresponding gnome applet;
    Instead of alt+shift it sets shift+alt to change layout. I tried to swap the key names in 'mysym' file, but it has no effect.
    #!/bin/sh
    xkbdir="`mktemp -d`" || exit $?
    mkdir "$xkbdir/symbols"
    cat>"$xkbdir/symbols/mysym" <<EOF
    partial modifier_keys xkb_symbols "alt_shift_1" {
    key <LALT> {
    type="PC_BREAK",
    symbols[Group1]= [ Alt_L, ISO_First_Group ]
    key <RALT> {
    type ="PC_BREAK",
    symbols[Group1]= [ Alt_R, ISO_Last_Group ]
    key <LFSH> { [ Shift_L, ISO_First_Group ] };
    key <RTSH> { [ Shift_R, ISO_Last_Group ] };
    EOF
    setxkbmap -symbols "pc+us+ru:2+inet(evdev)+mysym(alt_shift_1)" -print | xkbcomp -w0 -I -I"$xkbdir" -I/usr/share/X11/xkb - $DISPLAY && rm -rf "$xkbdir"

  • Keyboard layout switch per application

    I use two Layouts (us,bg(phonetic)) and I really like to have a separate layout for every application:
    For example I'm typing in cyrillic in Skype and when I alt+tab or start urxvt I have the US layout there without needing to change it manually. There is such feature in gnome/kde but now I tried openbox and I really liked it and that's the only thing that I need to fix in order to use it.
    Any suggestions?

    ありがとうございます
    (Translation: Thank you very much!)

  • TestStand 2010 SP1 - Expression switches the keyboard layout

    Hello,
    we are switching from TestStand 2010 to TestStand 2010 SP1, and today I noticed the follow behavior.
    If I place the cursor in an Expression of a step, the keyboard layout switches from german (DE) to englisch (US).
    You can imagine that's very unfavorable to program.The problem occurs on several machine running WindowsXP.
    Funnily enough on a pc with Win7, all is looking good. Furthermore I can't discover such behavior on previous versions of TestStand.
    Has somebody an idea?
    Thanks in advance
    Carsten
    Solved!
    Go to Solution.

    Hi Manooch
    Thanks for pointing out this workaround.
    This is working well on TS4.5.1  XP maschines
    Regards
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    WorkaroundKeyboard.seq ‏5 KB

  • [SOLVED] keyboard layout no longer exists?

    Hi there,
    I noticed my keyboard layout switched back from azerty to qwerty. Also, latest upgrade shows my keyboard layout can't be opened
    upgrading linux [##################################################################] 100%
    >>> Updating module dependencies. Please wait ...
    >>> Generating initial ramdisk, using mkinitcpio. Please wait...
    ==> Building image from preset: 'default'
    -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
    ==> Starting build: 3.8.3-2-ARCH
    -> Running build hook: [base]
    -> Running build hook: [udev]
    -> Running build hook: [autodetect]
    ==> WARNING: Hook 'pata' is deprecated. Replace it with 'block' in your config
    -> Running build hook: [block]
    -> Running build hook: [keymap]
    cannot open file fr_latin9
    -> Running build hook: [filesystems]
    ==> Generating module dependencies
    ==> Creating gzip initcpio image: /boot/initramfs-linux.img
    ==> Image generation successful
    I suppose this is related. Has fr_latin9 been removed?
    Last edited by brazzmonkey (2013-03-20 08:44:33)

    I don't see it in /usr/share/kbd/consolefonts, so I guess that means yes.  Maybe you can see if you can pull an old kbd package from the Arch Rollback Machine and stick the layout in there (and maybe the font too... not sure how that works).

  • Hotplugging: no kbd layout switching any more

    Hi,
    After the most recent upgrade (xf86-input-evdev, xf86-input-keyboard, etc.) no keyboard layout switching for me any more.
    Present configuration:
    (1) KDEmod 3, Keyboard Layout: Evdev-managed keyboard (as it used to be)
    (2) No fdi files updated, either in /etc/hal/fdi or in /usr/share/hal/fdi
    (3) /etc/hal/fdi/policy/10-keymap.fdi:
    <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
    <deviceinfo version="0.2">
      <device>
        <match key="info.capabilities" contains="input.keymap">
          <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
        </match>
        <match key="info.capabilities" contains="input.keys">
          <merge key="input.xkb.rules" type="string">base</merge>
          <!-- If we're using Linux, we use evdev by default (falling back to
               keyboard otherwise). -->
          <merge key="input.xkb.model" type="string">keyboard</merge>
          <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
                 string="Linux">
            <merge key="input.xkb.model" type="string">evdev</merge>
          </match>
          <merge key="input.xkb.layout" type="string">us,ru</merge>
          <merge key="input.xkb.variant" type="string" />
          <merge key="input.xkb.options" type="string">grp:caps_toggle</merge>
        </match>
      </device>
    </deviceinfo>
    (4) /etc/hal/fdi/policy/11-x11-synaptics.fdi:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <deviceinfo version="0.2">
      <device>
        <match key="info.capabilities" contains="input.touchpad">
          <match key="info.product" contains="Synaptics TouchPad">
            <merge key="input.x11_driver" type="string">synaptics</merge>
        <!-- Arbitrary options can be passed to the driver using
             the input.x11_options property since xorg-server-1.5. -->
        <!-- EXAMPLE:
        <merge key="input.x11_options.LeftEdge" type="string">120</merge>
        -->       
            <merge key="input.x11_options.AlwaysCore" type="string">true</merge>
            <merge key="input.x11_options.Protocol" type="string">auto-dev</merge>
            <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
            <merge key="input.x11_options.SHMConfig" type="string">false</merge>
            <merge key="input.x11_options.LeftEdge" type="string">1700</merge>
            <merge key="input.x11_options.RightEdge" type="string">5300</merge>
            <merge key="input.x11_options.TopEdge" type="string">1700</merge>
            <merge key="input.x11_options.BottomEdge" type="string">4200</merge>
            <merge key="input.x11_options.FingerLow" type="string">25</merge>
            <merge key="input.x11_options.FingerHigh" type="string">30</merge>
            <merge key="input.x11_options.MaxTapTime" type="string">180</merge>
            <merge key="input.x11_options.VertEdgeScroll" type="string">true</merge>
            <merge key="input.x11_options.HorizEdgeScroll" type="string">true</merge>
            <merge key="input.x11_options.CornerCoasting" type="string">true</merge>
            <merge key="input.x11_options.CoastingSpeed" type="string">0.30</merge>
            <merge key="input.x11_options.VertScrollDelta" type="string">100</merge>
            <merge key="input.x11_options.HorizScrollDelta" type="string">100</merge>
            <merge key="input.x11_options.MinSpeed" type="string">0.10</merge>
            <merge key="input.x11_options.MaxSpeed" type="string">0.60</merge>
            <merge key="input.x11_options.AccelFactor" type="string">0.0050</merge>
            <merge key="input.x11_options.VertTwoFingerScroll" type="string">true</merge>
            <merge key="input.x11_options.HorizTwoFingerScroll" type="string">true</merge>
            <merge key="input.x11_options.TapButton1" type="string">1</merge>
            <merge key="input.x11_options.TapButton2" type="string">2</merge>
            <merge key="input.x11_options.TapButton3" type="string">3</merge>
          </match>
          <match key="info.product" contains="AlpsPS/2 ALPS">
            <merge key="input.x11_driver" type="string">synaptics</merge>
          </match>
          <match key="info.product" contains="appletouch">
            <merge key="input.x11_driver" type="string">synaptics</merge>
          </match>
          <match key="info.product" contains="bcm5974">
            <merge key="input.x11_driver" type="string">synaptics</merge>
          </match>
        </match>
      </device>
    </deviceinfo>
    CapsLock works as usual, layout icon toggles as it's supposed to, but I'm having only English characters, regardless.
    Any ideas?
    Last edited by Llama (2009-05-09 18:23:30)

    Here they discuss the same thing.
    This, too, sounds familiar, though the perceived cause is different.
    rocknice, do you mean that the problem is recognized, the but reports filed, etc.?
    Last edited by Llama (2009-02-16 10:25:39)

Maybe you are looking for

  • Error while creating Db DataSource - Attempt to operate 'activate' on null

    Hi All, I am trying to create a new Datasource for Db Adapter in weblogic - SOA 11g, when i clicked on finish its getting created, but its not getting activated. Below is the error thrown. An error occurred during activation of changes, please see th

  • Screen switch for presentations not working

    Embarrassing when you're all hooked up and no-where to go! Sat down in a meeting to present and the screen switch did not work! Fortunately it came on automatically when I opened PPT. Good heavens! HP. You can do better than that. FFS

  • Hr payroll reconciliation report

    Hello All, i have a Hr reconciliation payroll report and requirement is like After Payroll Monthly Run, Payroll Admin and FI needs to fetch detail report on employees actual and to be paid monthly earning components. Report will be used to analyze pa

  • WPC - Custom Web Form - Cannot render container

    Hello! I've created custom web form for WPC (wpc_utg_sitelink) and gone through customizing provided in [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2041eb17-6001-2b10-b08d-b95ce55fa9b7&overridelayout=true] It looks fine at designtime. In

  • Spry Accordion No Highlight Upon Selection

    Im working with the spry accordion and when ever i click on a tab the entire outline of the accordion gets highlighted in blue (ie,chrome) or gets a marquee kind of selection around entire outside ( firefox ) is there a way to turn this off so it jus