Fedora – Add second keyboard layout with localectl

fedorakeyboard-layout

I am using Fedora 28 workstation with Gnome.

My current layout status with localectl status is

System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us

I am using

localectl set-x11-keymap "us,gr" "" ","

in order to add second (greek) layout. New localectl status result is

System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us,gr
     X11 Variant: ,

but when I press super(key) + space, no greek characters are displayed.

How can I add a second keyboard layout with command line?

I have a fresh install of Fedora 28 Workstation. Selected language and keyboard layout are "US".

I am trying to add a second language in the keyboard but not from Gnome (i.e. Settings->Region & Language-> Input Source), but from the command line.

I am using localectl; when I use set-keymap, I can write greek characters on the login screen but not in a terminal.

I am trying set-x11-keymap and I can't write greek characters — only US.

When I enter the simple command

localectl set-x11-keymap us,gr

in the login screen the language selector is present. But AFTER I log in, there is no language selector in the taskbar!?!?!

I then made a clean install.

Step 1: before I make anything, I execute setxkbmap -print and I get

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+inet(evdev)" };
    xkb_geometry  { include "pc(pc105)" };
};

Step 2: I execute the following command

setxkbmap -layout "us,gr" -option "grp:win_space_toggle"

Step 3: now I am trying to press win+space keys but I can't print greek characters.

Step 4: the output of setxkbmap -print is now

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+gr:2+inet(evdev)+group(win_space_toggle)"};
    xkb_geometry  { include "pc(pc105)" };
};

I logged out and there is no language selector on login screen. Also: after I log in, I can write only English characters.

Best Answer

Disclaimer

From phone now and memory. IOW I've not tried these below suggestions though I've tried v similar.
See this old thread of mine replacing "apl" by "gr" http://emacs.1067599.n8.nabble.com/APL-mode-td299716i40.html

Use setxkbmap

chord-based using alt

  $ setxkbmap -layout "us,gr" -option "grp:switch"

Using ralt

Leave lalt alone

   $ setxkbmap -layout "us,gr"  -option "grp:rswitch"

Toggle based solution

alt-shift switching to gr and back

   $ setxkbmap -layout "us,gr" -option "grp:alt_shift_toggle"
Related Question