5

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.

2
  • Fedora 28 has long been unsupported. It's not advisable to continue using it. Commented Aug 15, 2020 at 10:58
  • I tried the same procedure on Fedora 31. No luck also there... If you know the solution to any version, please answer.
    – chris
    Commented Aug 15, 2020 at 11:08

3 Answers 3

0

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"
7
  • I tried them all. None seems to be working... :-(. I found this youtube.com/watch?v=ger3rsRkJ-Y but i don't understand French
    – chris
    Commented Aug 15, 2020 at 10:15
  • Not working means? Nothing happens? Error message? You need to start some kind of editor and then type left-alt+a as a chord to get greek alpha (1st solution). Should add though that I've not used a red hat system for 25 years.... Above is on ubuntu. Also try the examples in the emacs thread I've linked and see if you get APL chars (many straight greek, some math)
    – Rusi
    Commented Aug 15, 2020 at 10:25
  • Basically check first that setxkbmap (instead of localectl) works on your system. Then see how to make it work usefully for you
    – Rusi
    Commented Aug 15, 2020 at 10:31
  • A basic question @chris : Do you have the command setxkbmap on your system? If so what does setxkbmap -print give? ( Before and after above commands)
    – Rusi
    Commented Aug 15, 2020 at 13:02
  • Yes setxkbmap is present. The result of the print command is 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)" }; }; BUT I want to use localectl.
    – chris
    Commented Aug 15, 2020 at 13:26
0

Here's what you can run (restarting the Xorg server or rebooting is required afterwards):

sudo localectl set-x11-keymap "us,gr" pc105 "" grp:alt_shift_toggle,grp:win_space_toggle,grp_led:scroll,terminate:ctrl_alt_bksp,ctrl:nocaps

Left Alt + Shift and Win + Space - will switch the keyboard layout between US and Greek keyboards. Caps Lock will be disabled. Ctrl + Alt + Backspace can be used to kill/restart X.org.

You must disable Gnome specific keyboard configuration to make the above command work properly - it actually edits an X.org configuration file /etc/X11/xorg.conf.d/00-keyboard.conf to be precise.

6
  • @"Artem S. Tashkinow" I tried the command. localectl status nows presents System Locale: LANG=en_US.UTF-8 VC Keymap: us X11 Layout: us,gr X11 Model: pc105 X11 Options: grp:alt_shift_toggle,grp:win_space_toggle,grp_led:scroll,terminate:ctrl_alt_bksp,ctrl:nocaps but when i press super+space or left alt + shift only English characters are typed
    – chris
    Commented Aug 15, 2020 at 13:24
  • It indicates everything works for you. Try rebooting. It does not work on the fly. Commented Aug 15, 2020 at 13:25
  • I rebooted the system. I just forget to write it above
    – chris
    Commented Aug 15, 2020 at 13:28
  • Do you have a Scroll Lock LED? Does it light up when you press Alt + Shift or Win + Space? Again Gnome can redefine keyboard settings, so you may want to stop Gnome from doing that. I've no idea how since I use XFCE. Commented Aug 15, 2020 at 14:20
  • Yes scroll lock is lighting when i press super + space. I redefined toggle input (super +w) but nothing happened! I believe the problem is that there is no language selector in taskbar after I login .
    – chris
    Commented Aug 15, 2020 at 14:42
0

Something like this could work if you don't mind running it on every boot

setxkbmap -layout us, gr -options grp:win_space_toggle

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .