Choose style:

Author Topic: Peppermint 7 - Multiple keyboard layout switching, with panel notification.  (Read 3518 times)

0 Members and 1 Guest are viewing this topic.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25659
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Let's say you would like to have the gb (GB English) and us (US English) and es (Spanish) keyboard layouts and be able to switch between them with the keyboard shortcut Left_Alt+Left_Shift and have a panel applet that displays the current layout.

First test layout toggling works, by opening a terminal and running
Code: [Select]
setxkbmap -option grp:lalt_lshift_toggle "gb,us,es"
now test that Alt+Shift switches your keyboard layout.

If it does, we need to autostart that command at login, so back in the terminal run:
Code: [Select]
sudo pluma /etc/xdg/autostart/keyboard-layout-switcher.desktop
when a BLANK file opens, make it read:
Code: [Select]
[Desktop Entry]
Type=Application
Name=Keyboard Layout Switcher
Comment=Toggle between keyboard layouts
Exec=sh -c 'sleep 10 ; setxkbmap -option grp:lalt_lshift_toggle "gb,us,es"'
SAVE the file and exit pluma.

Now we need to add the panel applet to show the currently selected layout .. so back in the terminal run:
Code: [Select]
sudo apt-get install xfce4-xkb-plugin
Now right-click on the panel and select Panel > Panel Preferences > Items (tab), then click the "Add" (+) button .. highlight the "Keyboard Layouts" applet and click the "+Add" button at the bottom, then the "Close" button .. back in the panel items list highlight the "Keyboard Layout"item, and you can now use the up/down arrow buttons to move the applet to where you want it on the panel.

Obviously, you can use other layouts than gb,us,es .. just use whichever you want (and as many as you want as long as they're separated by comma's) ;)





To UNDO

Remove the "Keyboard Layouts" panel applet, then run:
Code: [Select]
sudo rm -v /etc/xdg/autostart/keyboard-layout-switcher.desktop
then reboot.
« Last Edit: October 01, 2016, 08:13:33 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline berliner58

  • Jr. Member
  • **
  • Posts: 66
  • Karma: 4
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 8
Thank you very much for the tutorial.

I need  german und russian keyboard layout and followed your instructions.
The xfce-icon in the panel works fine.
One click on it an it changes to russian flag.

Only problem I noticed:
When I click on the shut-down button in the main menu in order to decide whether to shut-down the PC or to just log out of the session or other options, the options now are not in my german language, but every second option is in russian language.
Only my wife can read russian, so I have to guess what option it could be.

In another preference (don't remember the name of it) I installed russian language.
Maybe that was a mistake ?

I installed Peppermint 7 today and in the installer I chose german language.
Firefox and all the menus are in german, but now I have the problem at logout or shutdown with these russian buttons.
What should I do ?

Here is the info about my PC:
inxi -Fz
inxi -Fz
System:    Host: franz-Inspiron-560 Kernel: 4.4.0-38-generic x86_64 (64 bit)
           Desktop: N/A Distro: Peppermint Seven
Machine:   System: Dell product: Inspiron 560 v: 00
           Mobo: Dell model: 0K83V0 v: A00 Bios: Dell v: A00 date: 10/06/2009
CPU:       Dual core Pentium E5400 (-MCP-) cache: 2048 KB
           clock speeds: max: 2700 MHz 1: 2700 MHz 2: 2003 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Redwood XT [Radeon HD 5670/5690/5730]
           Display Server: X.Org 1.18.3 drivers: ati,radeon (unloaded: fbdev,vesa)
           Resolution: 1280x1024@60.02hz
           GLX Renderer: Gallium 0.4 on AMD REDWOOD (DRM 2.43.0, LLVM 3.8.0)
           GLX Version: 3.0 Mesa 11.2.0
Audio:     Card-1 Advanced Micro Devices [AMD/ATI] Redwood HDMI Audio [Radeon HD 5000 Series]
           driver: snd_hda_intel
           Card-2 Intel 82801JI (ICH10 Family) HD Audio Controller
           driver: snd_hda_intel
           Card-3 Microsoft driver: USB Audio
           Sound: Advanced Linux Sound Architecture v: k4.4.0-38-generic
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169
           IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 320.1GB (5.1% used)
           ID-1: /dev/sda model: WDC_WD3200AAKS size: 320.1GB
Partition: ID-1: / size: 14G used: 4.5G (34%) fs: ext4 dev: /dev/sda12
           ID-2: /home size: 32G used: 616M (3%) fs: ext4 dev: /dev/sda13
           ID-3: swap-1 size: 11.43GB used: 0.00GB (0%) fs: swap dev: /dev/sda7
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 42.0C mobo: N/A gpu: 42.0
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 183 Uptime: 9 min Memory: 709.5/7983.0MB
           Client: Shell (bash) inxi: 2.2.35
[close]
« Last Edit: October 03, 2016, 07:48:16 am by berliner58 »
P8 x64 Desktop Dual core Pentium E5400 (-MCP-) RAM: 8GB

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25659
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Hi berliner58, and welcome to the forum :)

This is a keyboard layout switcher .. it is NOT a language/locale selector.

ONLY the keyboard layout switches, if you want to change the default language/locale you'll have to do that via the peppermint-settings-panel.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline berliner58

  • Jr. Member
  • **
  • Posts: 66
  • Karma: 4
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 8
I see.

I uninstalled the russian language packages.
The keyboard layout switcher does ist job and switches between german and russian.

The shutdown-menu though now shows the buttons in english which were russian before and the rest in german.
I will upload a screenshot as soon as I find out how.

So something is messed up in my new Peppermint installation but I can live with it because I understand some english.



« Last Edit: October 01, 2016, 03:26:47 pm by berliner58 »
P8 x64 Desktop Dual core Pentium E5400 (-MCP-) RAM: 8GB

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25659
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
All I can tell you at this point is I can see no way for the above instructions to have caused that .. they have nothing to do with locale settings.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline berliner58

  • Jr. Member
  • **
  • Posts: 66
  • Karma: 4
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 8
PCNetSpec,
I agree.

Your instructions for implementing a multiple keyboard layout switching work.

My lxsession-logout mixture of  different languages have nothing to do with it, so maybe you just delete my postings in this thread.

Since I can live with the mixture of german and english in menues I won't even spend hours of searching for a solution for it.
Thank you.

Edit:
I have several Distros installed on my PC.  ( Linux Mint 18 Mate,  LMDE 2 Betsy with LXDE Desktop, Sparky Linux and now Peppermint 7 because somebody mentioned it as good in the linuxmintusers - forum )
Just started LMDE2 with LXDE Desktop an guess what ?  The logout menu is identical to the lxsession-logout menu in Peppermint 7 . No big thing an expert would say, but for a newbie like me this is a surprise somehow.

So the mixture of english and german in the session-logout is just LXDE code in action and indeed has nothing to do with Peppermint or the keyboard-switcher of Xfce.
« Last Edit: October 02, 2016, 08:28:00 am by berliner58 »
P8 x64 Desktop Dual core Pentium E5400 (-MCP-) RAM: 8GB

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25659
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
You're welcome :)

PS. I'll leave the contents "as is" for now, just on the off-chance someone else has a similar issue .. then we'll need to look into it.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline gkiritsop

  • nOOb
  • *
  • Posts: 1
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 7
It worked!
Fast and easy.
 :) :)

I was searching inside all the menus,but no luck. I was not sure what was the problem and couldn't find the settings to add the language switcher. I didn't know that I had to write a 'script' to make it run!

Thanks a lot!

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1959
  • Karma: 341
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9

I have several Distros installed on my PC.  ( Linux Mint 18 Mate,  LMDE 2 Betsy with LXDE Desktop, Sparky Linux and now Peppermint 7 because somebody mentioned it as good in the linuxmintusers - forum )
Just started LMDE2 with LXDE Desktop an guess what ?  The logout menu is identical to the lxsession-logout menu in Peppermint 7 .

Are you using the same home partition for different distros?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25659
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
It worked!
Fast and easy.
 :) :)

Great stuff :)

Quote
I didn't know that I had to write a 'script' to make it run!

Ah, but don't you feel a sense of accomplishment :)

There's always a trade-off between "lightness" and "feature packed", but we're looking into a better/easier GUI solution for Peppermint 8 as this is really a pretty basic requirement ;)

Quote
Thanks a lot!

You're most welcome :)
« Last Edit: November 08, 2016, 05:55:52 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline berliner58

  • Jr. Member
  • **
  • Posts: 66
  • Karma: 4
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 8
Re: Peppermint 7 - Multiple keyboard layout switching, with panel notification.
« Reply #10 on: November 10, 2016, 06:55:37 am »
Quote
Are you using the same home partition for different distros?
No.
I tried that a few times and it works, but now each distro has it's own home partition.
P8 x64 Desktop Dual core Pentium E5400 (-MCP-) RAM: 8GB