0

I would like to start coding in the APL programming language. But for that, I need the right keyboard layout!

Here is the list of behaviors I'm looking for:

  • can be used with other layouts (us, fr...)
  • layout is swapable with the normal shortcut Super + Space
  • ideally can be managed with the native Ubuntu "Region & Language" GUI interface

I already found other StackOverflow answers like this one: APL Keymapping on Linux (GNU APL)

But what happens is that my french keyboard is being replaced with the APL one!

I also found sources saying that I should be able to add it natively with the Ubuntu: https://www.sacrideo.us/configuring-your-apl-keyboard-on-linux/

But I couldn't find it in the language and input: APL missing from Ubuntu region and language input source

Thank you for your help!

Adám
  • 6,573
  • 20
  • 37
RilDev
  • 101
  • 1
  • 8
  • Have you looked at [apl.wiki/Typing_glyphs_on_Linux](https://aplwiki.com/wiki/Typing_glyphs_on_Linux)? – Adám Jun 21 '21 at 09:47
  • @Adám Everything there doesn't follow bullet points 1 and 2. – dzaima Jun 21 '21 at 12:41
  • Thank you @Adám! I tried mutiple options and it's... a little confusion! I got something working for my needs though! As a side note, I find it weird that it's so complicated to simple get the APL layout working! – RilDev Jun 21 '21 at 12:46

3 Answers3

3

I got it working for my needs!

Here is how I did it:

  • I installed 3 keyboard layouts in the "Region & Language" GUI enter image description here The order DOES MATTER as in this example the Braille layout will become the placeholder for the APL layout. This APL layout will be accessible either from the English (US) layout by holding the right Alt keys and it will also be available as a stand-alone keyboard by switching to it with the Super + Space combination and selecting the Braille layout.
  • I ran this command in my terminal: setxkbmap -layout us,apl,fr -variant ,dyalog -option grp:switch, this command maps the us layout to the first layout, the apl layout to the second layout and fr layout to the third layout. It also enables "on press" switch between the a layout and the following layout (so here us -> apl) with the right Alt key, I keep the left one to Alt + Tab.
  • To make the change persistent after reboot, I added this command at the end of my ~/.bashrc file: setxkbmap -layout us,apl,fr -variant ,dyalog -option grp:switch

Now I can type the APL symboles with ease!

enter image description here

Thank you very much for your kind help!

RilDev
  • 101
  • 1
  • 8
1

According to the documentation[1], you can enable some "rarely used keyboard layout variants", using the following command:

gsettings set org.gnome.desktop.input-sources show-all-sources true

Then you can add an APL layout (under English).

Edit: you may want to check https://aplwiki.com/wiki/Typing_glyphs_on_Linux , in particular in Gnome, using the Gnome Tweaks trick I set 'Right Ctrl (while pressed)', which does not require to switch layouts every time you type a special char. Ideally there should be a US APL layout (like in Windows?) and use the AltGr key; but apparently that doesn't exist yet (at least by default).

jp48
  • 1,186
  • 10
  • 17
0

The preinstalled layouts aren't swappable with super+space because they already use layout swapping in their design. It means that there needs to be just one apl layout for monolingual people who are fine with using another separate modifier key for it, but sucks for everyone else.

Your options are to either set up custom keyboard shortcuts to launch one of many setxkbmap commands to swap between the layouts you want (what I do), or manually make a merged single layout of us+apl.

dzaima
  • 388
  • 3
  • 9
  • Thanks for your help @dzaima! I found a way to make it work with `Super + Space` and the `Alt` keys! https://stackoverflow.com/a/68068538/12818567 – RilDev Jun 21 '21 at 13:12