Use only Terminal Keyboard?

For Phosh, I usually find the touchscreen “english” keyboard to be a nuisance when it the default for an application, as opposed to the “terminal” keyboard, that I like much more. I looked in the keyboard settings, but I did not see a way to enable only the terminal keyboard, disabling the “english” keyboard. Is this possible?

1 Like

Several existing discussions. Search is your friend e.g. Squeekboard set default layout to terminal

I have myself mused that I would prefer it to default to “terminal” and I am not the only one. There may not be a sane, straightforward way to change this right now but seemingly it can be changed.

1 Like

You could add the terminal layout named as the standard one on /home/purism/.local/share/squeekboard/keyboards/en (or your language code) this way the keyboard will use this instead of the default one.
I did it with a symbolic link, so if I edit my terminal layout this one changes as well.
I just realized that I didn’t do it with the link as it wasn’t working.

2 Likes

Sweet…
I created the squeekboard/keyboards path in .local/share, then downloaded this file: https://source.puri.sm/Librem5/squeekboard/-/blob/master/data/keyboards/terminal/us.yaml`, placing it in my keyboards directory. (It’s labeled “us,” but it’s actually terminal layout.)

Everything now defaults to terminal-style keyboard, although it still shows English (US) as selected, just like it already showed by default when opening Terminal, even though the layout is obviously “Terminal.”

Thanks for the tip,@uzanto.

EDIT: FYI, the L5’s original English (US) (*) keyboard won’t be available for use while the above version exists within .local, if that’s a concern. But you could always just remove the personal version, or temporarily rename it, if you want to revert to the original.

(*) …or whichever language your default keyboard version uses

EDIT, AGAIN: I just realized that you also need to add us_wide.yaml (in addition to us.yaml) to .local/share/squeekboard/keyboards, if you want the terminal-style board in landscape view as well.
(Meaning the us.yaml and us_wide.yaml files that the contributor uploaded as terminal-style versions in data/keyboards/terminal at https://source.puri.sm/Librem5/squeekboard/-/blob/master/data/keyboards/terminal/fr_wide.yaml )

4 Likes

Awesome! That is just what I am looking for. Can’t wait to try it after work (:

Actually, I should have been clearer … I want the terminal emulator to default to the Terminal layout but I don’t necessarily want any other applications to default to the Terminal layout. They can default to the system default layout.

Is it even possible to have a different layout depending on the application?

As other discussion has said, this is definitely what you want, not just per application but per context within an application.

Entering an email address? Hiding @ away and not having .com is a hindrance and want easy access to dot. Entering a SIM PIN? Only needs numbers (I think). Entering a URL? Want easy access to / and maybe : and dot. None of those needs up and down arrow. Email addresses and URLs could benefit from left and right arrow. Sitting in the shell? Want all four arrow keys and want easy access to characters like - | & ; ( ) as well as /. You get the idea.

Indeed. That’s why I suggested that a user would want something that is sane and straightforward.

Still it’s great that there is at least some means of changing the layout.

3 Likes

This is the current behavior for some time now. Everything else defaults to the non-Terminal style, unless you make a change like I did.

But it would be good to have per-app options.

1 Like

Could you do some fancy (and potentially dangerous) .desktop exec instructions?

1 Like

I’m thinking that new phone setting app would be perfect for something like this. It already has similar feature with setting the size per app - why not keyboard layout as well?

And just ot be clear, that terminal keyboard is US-layout for the rest of us. I’d like to have the additional terminal keys along with my language keyboard, not as a separate keyboard.

I don’t think, based on the way keyboard assignment is done, that it would work on a default-per-app basis. Currently, that is.

In this link (which for some strange reason redirects itself up to the main directory instead of the sub-directory I intended), if you look in the data/terminal sub-directory, there is already a fr.yaml terminal-style file, as well as the us.yaml. I think all one has to do is to copy the particular language layout, copy the terminal extra keys, merge them into one, and then save as whateverlanguage.yaml in .local/share/squeekboard/keyboards.

1 Like

By the way, it’s certainly possible to add additional language keyboards from Settings - Region & Language. That makes it possible to use a non-Terminal-style keyboard again.

But oddly, adding English (UK) or English (Canada) doesn’t effect a change to non-Terminal-style, while adding French, for example, does. I guess my modified English (US)+ Terminal keys prevents that.

EDIT: You can also have more than one personal .yaml in .local/share/squeekboard/keyboards and switch between them. If you have, say, both us.yaml and fr.yaml, and your region/lanuage is set to English-US, the following happens:
. Keyboard defaults to terminal style, but English (US) is shown as selected when you tap the globe icon.
. It’s not possible to see/use the original non-terminal-style English (US) keyboard.
. Selecting French displays a non-terminal-style keyboard in French layout.
. Then selecting Terminal displays the terminal-style keyboard with French layout.

In case anyone is wondering, if you change the personal us.yaml (in .local/share/squeekboard/keyboards) to terminal.yaml, it doesn’t help; the regular/original keyboard behavior takes over again, i.e. it doesn’t default to terminal-style everywhere anymore. The personal terminal.yaml is ignored.

1 Like

FYI, the Italian keyboard has a similar qwerty layout to the default English (US) keyboard.

This doesn’t seem to work for me like it used to. Are you still disabling the non-terminal keyboard?

1 Like

Yes. Haven’t changed anything since back then. In other words, my “English US” keyboard is still actually redesigned as the “Terminal” layout, just with the “English US” label.

2 Likes

/home/purism/.local/share/squeekboard/keyboards

contains my two files:
us.yaml

---
outlines:
    default: { width: 35.33, height: 46 }
    action:  { width: 59,    height: 46 }
    altline: { width: 52.67, height: 46 }
    wide: { width: 59, height: 46 }
    spaceline: { width: 140, height: 46 }
    special: { width: 44, height: 46 }
    small: { width: 59, height: 22 }

views:
    base:
        - "Ctrl Alt ↑ ↓ ← →"
        - "q w e r t y u i o p"
        - "a s d f g h j k l"
        - "Shift_L   z x c v b n m  BackSpace"
        - "show_numbers preferences      space        show_actions Return"
    upper:
        - "Ctrl Alt PgUp PgDn Home End"
        - "Q W E R T Y U I O P"
        - "A S D F G H J K L"
        - "Shift_L   Z X C V B N M  BackSpace"
        - "show_numbers preferences      space        show_actions Return"
    numbers:
        - "Ctrl Alt ↑ ↓ ← →"
        - "1 2 3 4 5 6 7 8 9 0"
        - "* # $ / & - _ + ( )"
        - "show_symbols   , \" ' colon ; ! ?  BackSpace"
        - "show_letters preferences         space        period Return"
    symbols:
        - "Ctrl Alt ↑ ↓ ← →"
        - "~ ` | · √ π τ ÷ × ¶"
        - "© ® £ € ¥ ^ ° @ { }"
        - "show_numbers_from_symbols   \\ % < > = [ ]  BackSpace"
        - "show_letters preferences         space        period Return"
    actions:
        - "Ctrl Alt PgUp PgDn Home End"
        - "F1  F2  F3  F4  F5  F6"
        - "F7  F8  F9  F10 F11 F12"
        - "Esc Tab Pause Insert Up Del"
        - "show_letters Menu Break Left Down Right"

buttons:
    Shift_L:
        action:
            locking:
                lock_view: "upper"
                unlock_view: "base"
        outline: "altline"
        icon: "key-shift"
    BackSpace:
        outline: "altline"
        icon: "edit-clear-symbolic"
        action: erase
    preferences:
        action: "show_prefs"
        outline: "special"
        icon: "keyboard-mode-symbolic"
    show_numbers:
        action:
            set_view: "numbers"
        outline: "wide"
        label: "123"
    show_numbers_from_symbols:
        action:
            set_view: "numbers"
        outline: "altline"
        label: "123"
    show_letters:
        action:
            set_view: "base"
        outline: "wide"
        label: "ABC"
    show_symbols:
        action:
            set_view: "symbols"
        outline: "altline"
        label: "τ=\\"
    show_actions:
        action:
            set_view: "actions"
        outline: "altline"
        label: ">_"
    period:
        outline: "altline"
        text: "."
    space:
        outline: "spaceline"
        text: " "
    Return:
        outline: "wide"
        icon: "key-enter"
        keysym: "Return"
    colon:
        text: ":"
    F1:
        outline: "action"
        keysym: "F1"
    F2:
        outline: "action"
        keysym: "F2"
    F3:
        outline: "action"
        keysym: "F3"
    F4:
        outline: "action"
        keysym: "F4"
    F5:
        outline: "action"
        keysym: "F5"
    F6:
        outline: "action"
        keysym: "F6"
    F7:
        outline: "action"
        keysym: "F7"
    F8:
        outline: "action"
        keysym: "F8"
    F9:
        outline: "action"
        keysym: "F9"
    F10:
        outline: "action"
        keysym: "F10"
    F11:
        outline: "action"
        keysym: "F11"
    F12:
        outline: "action"
        keysym: "F12"
    Esc:
        outline: "action"
        keysym: "Escape"
    Tab:
        outline: "action"
        keysym: "Tab"
    Del:
        outline: "action"
        keysym: "Delete"
    Insert:
        outline: "action"
        keysym: "Insert"
    Menu:
        outline: "action"
        keysym: "Menu"
    Pause:
        outline: "action"
        keysym: "Pause"
    Break:
        outline: "action"
        keysym: "Break"
    Home:
        outline: "small"
        keysym: "Home"
    End:
        outline: "small"
        keysym: "End"
    PgUp:
        outline: "small"
        keysym: "Page_Up"
    PgDn:
        outline: "small"
        keysym: "Page_Down"
    "↑":
        outline: "small"
        keysym: "Up"
    "↓":
        outline: "small"
        keysym: "Down"
    "←":
        outline: "small"
        keysym: "Left"
    "→":
        outline: "small"
        keysym: "Right"
    Up:
        label: "↑"
        outline: "action"
        keysym: "Up"
    Left:
        label: "←"
        outline: "action"
        keysym: "Left"
    Down:
        label: "↓"
        outline: "action"
        keysym: "Down"
    Right:
        label: "→"
        outline: "action"
        keysym: "Right"
    Ctrl:
        modifier: "Control"
        outline: "small"
        label: "Ctrl"
    Alt:
        modifier: "Alt"
        outline: "small"
        label: "Alt"

and:
us_wide.yaml

---
outlines:
    default:   { width: 54,   height: 37 }
    action:    { width: 90,   height: 37 }
    altline:   { width: 81,   height: 37 }
    wide:      { width: 90,   height: 37 }
    spaceline: { width: 225,  height: 37 }
    special:   { width: 54,   height: 37 }
    small:     { width: 67.4, height: 22 }

views:
    base:
        - "EscSmall TabSmall Ctrl Alt ↑ ↓ ← →"
        - "q w e r t y u i o p"
        - "a s d f g h j k l"
        - "Shift_L   z x c v b n m  BackSpace"
        - "show_numbers preferences      space        show_actions Return"
    upper:
        - "EscSmall TabSmall Ctrl Alt PgUp PgDn Home End"
        - "Q W E R T Y U I O P"
        - "A S D F G H J K L"
        - "Shift_L   Z X C V B N M  BackSpace"
        - "show_numbers preferences      space        show_actions Return"
    numbers:
        - "EscSmall TabSmall Ctrl Alt ↑ ↓ ← →"
        - "1 2 3 4 5 6 7 8 9 0"
        - "* # $ / & - _ + ( )"
        - "show_symbols   , \" ' colon ; ! ?  BackSpace"
        - "show_letters preferences         space        period Return"
    symbols:
        - "EscSmall TabSmall Ctrl Alt ↑ ↓ ← →"
        - "~ ` | · √ π τ ÷ × ¶"
        - "© ® £ € ¥ ^ ° @ { }"
        - "show_numbers_from_symbols   \\ % < > = [ ]  BackSpace"
        - "show_letters preferences         space        period Return"
    actions:
        - "EscSmall TabSmall Ctrl Alt PgUp PgDn Home End"
        - "F1  F2  F3  F4  F5  F6"
        - "F7  F8  F9  F10 F11 F12"
        - "Esc Tab Pause Insert Up Del"
        - "show_letters Menu Break Left Down Right"

buttons:
    Shift_L:
        action:
            locking:
                lock_view: "upper"
                unlock_view: "base"
        outline: "altline"
        icon: "key-shift"
    BackSpace:
        outline: "altline"
        icon: "edit-clear-symbolic"
        action: erase
    preferences:
        action: "show_prefs"
        outline: "special"
        icon: "keyboard-mode-symbolic"
    show_numbers:
        action:
            set_view: "numbers"
        outline: "wide"
        label: "123"
    show_numbers_from_symbols:
        action:
            set_view: "numbers"
        outline: "altline"
        label: "123"
    show_letters:
        action:
            set_view: "base"
        outline: "wide"
        label: "ABC"
    show_symbols:
        action:
            set_view: "symbols"
        outline: "altline"
        label: "τ=\\"
    show_actions:
        action:
            set_view: "actions"
        outline: "altline"
        label: ">_"
    period:
        outline: "altline"
        text: "."
    space:
        outline: "spaceline"
        text: " "
    Return:
        outline: "wide"
        icon: "key-enter"
        keysym: "Return"
    colon:
        text: ":"
    F1:
        outline: "action"
        keysym: "F1"
    F2:
        outline: "action"
        keysym: "F2"
    F3:
        outline: "action"
        keysym: "F3"
    F4:
        outline: "action"
        keysym: "F4"
    F5:
        outline: "action"
        keysym: "F5"
    F6:
        outline: "action"
        keysym: "F6"
    F7:
        outline: "action"
        keysym: "F7"
    F8:
        outline: "action"
        keysym: "F8"
    F9:
        outline: "action"
        keysym: "F9"
    F10:
        outline: "action"
        keysym: "F10"
    F11:
        outline: "action"
        keysym: "F11"
    F12:
        outline: "action"
        keysym: "F12"
    Esc:
        outline: "action"
        keysym: "Escape"
    EscSmall:
        outline: "small"
        keysym: "Escape"
        label: "Esc"
    Tab:
        outline: "action"
        keysym: "Tab"
    TabSmall:
        outline: "small"
        keysym: "Tab"
        label: "Tab"
    Del:
        outline: "action"
        keysym: "Delete"
    Insert:
        outline: "action"
        keysym: "Insert"
    Menu:
        outline: "action"
        keysym: "Menu"
    Pause:
        outline: "action"
        keysym: "Pause"
    Break:
        outline: "action"
        keysym: "Break"
    Home:
        outline: "small"
        keysym: "Home"
    End:
        outline: "small"
        keysym: "End"
    PgUp:
        outline: "small"
        keysym: "Page_Up"
    PgDn:
        outline: "small"
        keysym: "Page_Down"
    "↑":
        outline: "small"
        keysym: "Up"
    "↓":
        outline: "small"
        keysym: "Down"
    "←":
        outline: "small"
        keysym: "Left"
    "→":
        outline: "small"
        keysym: "Right"
    Up:
        label: "↑"
        outline: "action"
        keysym: "Up"
    Left:
        label: "←"
        outline: "action"
        keysym: "Left"
    Down:
        label: "↓"
        outline: "action"
        keysym: "Down"
    Right:
        label: "→"
        outline: "action"
        keysym: "Right"
    Ctrl:
        modifier: "Control"
        outline: "small"
        label: "Ctrl"
    Alt:
        modifier: "Alt"
        outline: "small"
        label: "Alt"

As I recall, I simply downloaded the “Terminal” keyboard files, placed them in that directory, renamed them to “us.yaml” and “us_wide.yaml” (to make the L5 apply them as if they were the actual US layout files used in non-terminal applications), so that my preferred layout (terminal) would be used as default everywhere.

1 Like

I suppose one could create an ad hoc script (with desktop launcher) that, could deactivate the personal layout files by, say, simply renaming /home/purism/.local/share/squeekboard/keyboards to cause it to be ignored, e.g. /home/purism/.local/share/squeekboard/Xkeyboards. That lets the default behavior take over, as testing confirms.

Taking that a step further, one could probably create persistent rules to apply the script on a per app basis, right?

EDIT: Here’s a script and launcher to change keyboards at will, assuming you’ve created the personal squeekboard layout files:

1. Save this script as SwitchKeyboard.sh (- I have it in my home folder -), then make it executable with: chmod u+x SwitchKeyboard.sh:

#!/bin/bash

# Apply default or personalized squeekboard layout via home screen app launcher.

# Use default squeekboard layout:

if [ -d /home/purism/.local/share/squeekboard/keyboards ]; then

    mv /home/purism/.local/share/squeekboard/keyboards /home/purism/.local/share/squeekboard/Xkeyboards

# Use personalized squeekboard layout:

elif [ -d /home/purism/.local/share/squeekboard/Xkeyboards ]; then

    mv /home/purism/.local/share/squeekboard/Xkeyboards /home/purism/.local/share/squeekboard/keyboards

fi

2- Place an appropriate icon in /home/purism/.local/share/icons and name it SwitchKeyboard.png. (Here’s one I made):

3- Create SwitchKeyboard.desktop containing this:

[Desktop Entry]
Name=SwitchKeyboard
Exec=gnome-terminal -x "./SwitchKeyboard.sh"
StartupNotify=true
Terminal=false
Type=Application
Categories=Utilities;
Icon=/home/purism/.local/share/icons/SwitchKeyboard.png

and save the file to /home/purism/.local/share/applications.

Now you can change between personal layout and the default squeekboard layout/behavior by launching the script from the app grid.

P.S. The script doesn’t affect the keyboard inside the terminal, which will use the “Terminal” layout by default, regardless.

2 Likes