Author Topic: Keyboard layout switching shortcut  (Read 6060 times)

Offline palace123

  • New Friend
  • *
  • Posts: 4
Keyboard layout switching shortcut
« on: August 10, 2011, 12:30:48 PM »
Hello all.

I have a possibly silly question and apologies if this has been answered before. I used 'Xfce 4 Settings Manager -> Keyboard -> Layout' to add a new keyboard layout. Unfortunately I don't see a way to define a keyboard shortcut to actually switch to that layout, which renders it rather useless.

In previous versions of Xfce there used to be a plugin that would allow you to add an icon to a panel and set a keyboard shortcut to switch between layouts - xfce4-xkb-plugin (http://goodies.xfce.org/projects/panel-plugins/xfce4-xkb-plugin). This does not seem available if I try to add a new item to the current panel, nor can I find it through synaptic.

My question - so is this or a similar plugin available, or is there an easy means of setting a keyboard shortcut to switch between keyboard layouts (preferably with an indicator of some sorts that is available on the panel, rather than, say, the lighting up of the numlock LED).

Thank you in advance for any responses, and, once again, apologies if this has been answered before. Take care.

P.S.: This is my greatest hindrance to installing Phoenix on my office PC, where I currently run the KDE version of PCLinuxOS. Being a rather puny representative of the computer world, however, it chugs along rather unenviably.

Offline Sproggy

  • Hero Member
  • *****
  • Posts: 1484
Re: Keyboard layout switching shortcut
« Reply #1 on: August 10, 2011, 01:48:11 PM »
that plugin would not build against the latest xfce 4.8 ... setting your keyboard through the XFCE settings and restarting X should be enough

Offline palace123

  • New Friend
  • *
  • Posts: 4
Re: Keyboard layout switching shortcut
« Reply #2 on: August 11, 2011, 01:46:29 AM »
Hello Sproggy,

Thank you for responding. I did actually try to build this myself, although I just followed the instructions, installed missing but required packages, etc., and of course failed.

I can define a new keyboard layout the way you advise, but that is not really the issue. The problem is I need to define a keyboard shortcut (e.g. alt+shift) to switch between the two keyboard layouts I have.

The current workaround I used is I created a file '~/.Xkbmap' containing the following line:

Code: [Select]
-option grp:alt_shift_toggle,grp_led:scroll us,bg
And when I press 'alt+shift' layout changes and the scroll light indicates the change. It's a solution from the LXDE forum.

But if you have better approaches to offer, I am open to :) suggestions! Thank you all!

Offline Sproggy

  • Hero Member
  • *****
  • Posts: 1484
Re: Keyboard layout switching shortcut
« Reply #3 on: August 11, 2011, 06:41:34 AM »
im no0t on my home pc at the moment but later i will show you how to set up keyboard shortcuts ...

Offline palace123

  • New Friend
  • *
  • Posts: 4
Re: Keyboard layout switching shortcut
« Reply #4 on: August 12, 2011, 01:07:34 AM »
That would be great, much appreciated {:

Offline GermanTux

  • Hero Member
  • *****
  • Posts: 693
Re: Keyboard layout switching shortcut
« Reply #5 on: August 12, 2011, 09:03:30 AM »
That would be great, much appreciated {:

Palace just so I have everything correctly in my head, under Windows Manager->Keyboard you want to create a shortcut to switch keyboard layouts, then apply a keystroke combination to it, correct? 

Offline palace123

  • New Friend
  • *
  • Posts: 4
Re: Keyboard layout switching shortcut
« Reply #6 on: August 12, 2011, 12:17:31 PM »
Hey GermanTux! You are mostly correct, although I don't believe you can do that through Window Manager -> Keyboard as in there you can only set up Window Manager key combination bindings. But I assume you mean the shortcuts you can set up through the Keyboard page.

I guess I could set up a keyboard shortcut directly from there, although I surmise it would do much the same thing that the line in the ~/.Xkbmap does. It is less than optimal for me, as it lights up the 'Scroll Lock' LED, rather than switching a flag icon on the taskbar or something (as the xfce4-xkb-plugin did before). And another thing is that with the ~/.Xkbmap file method (given above) the keyboard layout switch is global, i.e. I cannot set it per window, per application, etc.

Nonetheless, if there is not other option, I am quite happy the way it is - meaning it does the job  :) And hopefully there are others who can find this useful.
---

Will just await till the XFCE team add this, I guess!  :) I have grown somewhat comfortable with how things are at the moment and it is not much of an inconvenience, as job still gets done.
Happy Friday!!  ;)
« Last Edit: August 25, 2011, 04:55:22 AM by palace123 »

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1916
  • Certified Windows Hater
Re: Keyboard layout switching shortcut
« Reply #7 on: September 17, 2011, 06:36:26 PM »
that plugin would not build against the latest xfce 4.8 ... setting your keyboard through the XFCE settings and restarting X should be enough

I've used 2 other distros based on xfce 4.8 and they both had this keyboard indicator.  ???

Anyway palace123's tip works for me (although I don't have a spare led to use as an indicator  :D)
For the whole world, you are someone.
For someone, you are the whole world.

Offline sohlside

  • New Friend
  • *
  • Posts: 1
Re: Keyboard layout switching shortcut
« Reply #8 on: April 24, 2012, 10:19:04 AM »
I know this is an old thread, but it still works and I've been using PCLOS for ALMOST 24 hours.

Offline marcin82

  • Full Member
  • ***
  • Posts: 128
  • Jest wirek - jest impreza ;]
Re: Keyboard layout switching shortcut
« Reply #9 on: April 24, 2012, 11:38:54 AM »
In urgent cases keyboard layout can always be changed by command:
Code: [Select]
setxkbmap XXwhere XX is for example:
Quote
pl for polish keyboard layout
marcin'82

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10665
  • MLUs Forever!
Re: Keyboard layout switching shortcut
« Reply #10 on: April 24, 2012, 11:39:20 AM »
I know this is an old thread, but it still works and I've been using PCLOS for ALMOST 24 hours.

 ;D  ;D

Welcome aboard!

:D  :D
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT