Librem5 - A custom squeekboard keyboard tutorial

Hi Steve,

There are many ways to share files, but I was thinking more in the line of sharing them here.
I have no idea what the total size will be of the layouts you have made.
Maybe Purism can jump on board and offer a solution.

OK, I suppose I can paste them into a comment. There will be three files.

There are a couple of things I want to debug first…I modified the function keys layout some and introduced an issue there, and also I discoved my dummy spacer keys register a keypress if you hit them accidentally (no key ends up in your file, but if you did a latch shift (the kind that only holds for the next character), and hit one of these by mistake, it’s enough to do an “un-shift”.

Again, these are set up to replace the us keyboard. I’ll explain that when I upload them.

Great and again thank you.

You’ve convinced me that actual spacers are necessary.

Actually, just being able to define a key action that is “do absolutely nothing” would cover it.

I’m going to go right now and try to see what happens if the text is an empty string. (I doubt it will work but it’s worth a shot.)

OK, THIS is us.yaml. It needs to go into ~/.local/share/squeekboard/keyboards.
If you want it to be your terminal keyboard as well (wait until after you’re sure it works for you before doing this) also copy it to ~/.local/share/squeekboard/keyboards/terminal.

This will NOT color any keys (including the dummy spacers, which will be visible instead of black-on-black-on-black) by itself.

---
outlines:
    default:         { width: 48,  height: 52 }
    default_punct:   { width: 48,  height: 52 }
    default_foreign: { width: 48,  height: 52 }
    default_calc:    { width: 48,  height: 52 }
    default_prgm:    { width: 48,  height: 52 }
    default_curr:    { width: 48,  height: 52 }
    default_misc:    { width: 48,  height: 52 }
    sp1_3:           { width: 16,  height: 52 }
    sp2_3:           { width: 32,  height: 52 }
    action:          { width: 64,  height: 52 }
    wide:            { width: 80,  height: 52 }
    sp5_3:           { width: 80,  height: 45 }
    action_short:    { width: 64,  height: 45 }
    altline:         { width: 80,  height: 45 }
    spaceline:       { width: 244, height: 45 }
    special:         { width: 60,  height: 45 }
    return_bsp:      { width: 64,  height: 45 }
    vert_spacer:     { width: 100, height: 10 }

views:
    base:
        - "Shift_b_ls Ctrl Alt ↑  ↓  ←  →  BackSpace"
        - "      1  2  3  4  5  6  7  8  9  0  -"
        - "sp1_3  q  w  e  r  t  y  u  i  o  p     sp2_3"
        - "sp2_3   a  s  d  f  g  h  j  k  l  ;    sp1_3"
        - "      '  z  x  c  v  b  n  m  ,  .  ?"
        - "Shift_L preferences space  show_actions Return"
        - "vert_spacer"
    upper:
        - "Shift_u_us Ctrl Alt ↑  ↓  ←  →  BackSpace"
        - "      !  @  #  $  %  ^  &  *  (  )  _"
        - "sp1_3  Q  W  E  R  T  Y  U  I  O  P     sp2_3"
        - "sp2_3   A  S  D  F  G  H  J  K  L  :    sp1_3"
        - "     \"  Z  X  C  V  B  N  M  <  >  /"
        - "Shift_L preferences space  show_actions Return"
        - "vert_spacer"
    lsyms:
        - "Shift_b_ls Ctrl Alt ↑  ↓  ←  →  BackSpace"
        - "      `  à  â  á  é  î  ü  ô  ö  û  ó"
        - "sp1_3  þ  ð  č  ĵ  š  ž  ǧ  ß  ʒ  ğ     sp2_3"
        - "sp2_3   θ  μ  π  σ  τ  φ  =  ·  +  minus    sp1_3"
        - "      \\ |  bang  pct  amp  caret  mulsplat  divslash  √  ×  ÷"
        - "Shift_S preferences space  show_actions Return"
        - "vert_spacer"
    usyms:
        - "Shift_u_us Ctrl Alt ↑  ↓  ←  →  BackSpace"
        - "      ~  À  Â  Á  É  Î  Ü  Ô  Ö  Û  Ó"
        - "sp1_3  Þ  Đ  Č  Ĵ  Š  Ž  Ǧ  ʃ  Ʒ  Ğ     sp2_3"  
        - "sp2_3   «  »  Σ  Δ  hash  °  ®  ©  dollar  £    sp1_3"
        - "      lst  gtt  lparen  rparen  [  ]  {  }  ¶  €  ¥"
        - "Shift_S preferences space  show_actions Return"
        - "vert_spacer"
    actions:
        - "sp5_3     Ctrl   Alt    ↑       ↓     ←       →  BackSpace"
        - "show_lower     F1     F2     F3     F4     Insert Home   PgUp"
        - "show_upper     F5     F6     F7     F8     Del    End    PgDn"
        - "show_lsyms     F9     F10    F11    F12    Esc    Up     Pause"
        - "show_usyms     Menu   Esc    Tab    Break  Left   Down   Right"
        - "sp5_3     preferences space show_actions Return"
        - "vert_spacer"

buttons:


    sp1_3:
        outline: "sp1_3"
        keysym: " "
        text: " "
    sp2_3:
        outline: "sp2_3"
        keysym: " "
        text: " "
    sp5_3:
        outline: "sp5_3"
        keysym: " "
        text: " "
    vert_spacer:
        outline: "vert_spacer"
        text: " "
        keysym: " " 


    Shift_L:
        action:
            locking:
                lock_view: "upper"
                unlock_view: "base"
        outline: "altline"
        icon: "key-shift"
    Shift_S:
        action:
            locking:
                lock_view: "usyms"
                unlock_view: "lsyms"
        outline: "altline"
        icon: "key-shift"
    Shift_b_ls:
        action:
            locking:
                lock_view: "lsyms"
                unlock_view: "base"
        outline: "altline"
        label: "àτ÷"
    Shift_u_us:
        action:
            locking:
                lock_view: "usyms"
                unlock_view: "upper"
        outline: "altline"
        label: "ÀΣ€"             
    show_actions:
        action:
            locking:
                lock_view: "actions"
                unlock_view: "base"
        outline: "altline"
        label: "Fn"



    preferences:
        action: "show_prefs"
        outline: "special"
        icon: "keyboard-mode-symbolic"
    space:
        outline: "spaceline"
        text: " "
    Return:
        outline: "return_bsp"
        icon: "key-enter"
        keysym: "Return"
    BackSpace:
        outline: "return_bsp"
        icon: "edit-clear-symbolic"
        action: erase




    Ctrl:
        modifier: "Control"
        outline: "action_short"
        label: "Ctrl"
    Alt:
        modifier: "Alt"
        outline: "action_short"
        label: "Alt"
    "↑":
        outline: "action_short"
        keysym: "Up"
    "↓":
        outline: "action_short"
        keysym: "Down"
    "←":
        outline: "action_short"
        keysym: "Left"
    "→":
        outline: "action_short"
        keysym: "Right"



    "-":
        outline: "default_punct"
    ";":
        outline: "default_punct"
    "'":
        outline: "default_punct"
    ",":
        outline: "default_punct"
    ".":
        outline: "default_punct"
    "?":
        outline: "default_punct"


    "!":
        outline: "default_punct"
    "@":
        outline: "default_punct"
    "#":
        outline: "default_punct"
    "$":
        outline: "default_punct"
    "%":
        outline: "default_punct"
    "^":
        outline: "default_punct"
    "&":
        outline: "default_punct"
    "*":
        outline: "default_punct"
    "(":
        outline: "default_punct"
    ")":
        outline: "default_punct"
    "_":
        outline: "default_punct"
    ":":
        outline: "default_punct"
    "\"":
        outline: "default_punct"
    "<":
        outline: "default_punct"
    ">":
        outline: "default_punct"
    "/":
        outline: "default_punct"


    "`":
        outline: "default_punct"
    "à":
        outline: "default_foreign"
    "â":
        outline: "default_foreign"
    "á":
        outline: "default_foreign"
    "é":
        outline: "default_foreign"
    "î":
        outline: "default_foreign"
    "ü":
        outline: "default_foreign"
    "ô":
        outline: "default_foreign"
    "ö":
        outline: "default_foreign"
    "û":
        outline: "default_foreign"
    "ó":
        outline: "default_foreign"
    "þ":
        outline: "default_foreign"
    "ð":
        outline: "default_foreign"
    "č":
        outline: "default_foreign"
    "ĵ":
        outline: "default_foreign"
    "š":
        outline: "default_foreign"
    "ž":
        outline: "default_foreign"
    "ǧ":
        outline: "default_foreign"
    "ß":
        outline: "default_foreign"
    "ʒ":
        outline: "default_foreign"
    "ğ":
        outline: "default_foreign"
    "θ":
        outline: "default_foreign"
    "μ":
        outline: "default_foreign"
    "π":
        outline: "default_foreign"
    "σ":
        outline: "default_foreign"
    "τ":
        outline: "default_foreign"
    "φ":
        outline: "default_foreign"
    "=":
        outline: "default_calc"
    "·":
        outline: "default_calc"
    "+":
        outline: "default_calc"
    minus:
        outline: "default_calc"
        text: "-"
    "\\":
        outline: "default_prgm"
    "|":
        outline: "default_prgm"
    bang:
        outline: "default_prgm"
        text: "!"
    pct:
        outline: "default_prgm"
        text: "%"
    amp:
        outline: "default_prgm"
        text: "&"
    caret:
        outline: "default_prgm"
        text: "^"
    mulsplat:
        outline: "default_calc"
        text: "*"
    divslash:
        outline: "default_calc"
        text: "/"
    "√":
        outline: "default_calc"
    "×":
        outline: "default_calc"
    "÷":
        outline: "default_calc"


    "~":
        outline: "default_punct"
    "À":
        outline: "default_foreign"
    "Â":
        outline: "default_foreign"
    "Á":
        outline: "default_foreign"
    "É":
        outline: "default_foreign"
    "Î":
        outline: "default_foreign"
    "Ü":
        outline: "default_foreign"
    "Ô":
        outline: "default_foreign"
    "Ö":
        outline: "default_foreign"
    "Û":
        outline: "default_foreign"
    "Ó":
        outline: "default_foreign"
    "Þ":
        outline: "default_foreign"
    "Đ":
        outline: "default_foreign"
    "Č":
        outline: "default_foreign"
    "Ĵ":
        outline: "default_foreign"
    "Š":
        outline: "default_foreign"
    "Ž":
        outline: "default_foreign"
    "Ǧ":
        outline: "default_foreign"
    "ʃ":
        outline: "default_foreign"
    "Ʒ":
        outline: "default_foreign"
    "Ğ":
        outline: "default_foreign"
    "Σ":
        outline: "default_foreign"
    "Δ":
        outline: "default_foreign"
    "«":
        outline: "default_foreign"
    "»":
        outline: "default_foreign"
    hash:
        outline: "default_prgm"
        text: "#"
    "°":
        outline: "default_misc"
    "®":
        outline: "default_misc"
    "©":
        outline: "default_misc"
    dollar:
        outline: "default_curr"
        text: "$"
    "£":
        outline: "default_curr"
    lst:
        outline: "default_prgm"
        text: "<"
    gtt:
        outline: "default_prgm"
        text: ">"
    lparen:
        label: "("
        outline: "default_prgm"
        text: "("
    rparen:
        outline: "default_prgm"
        text: ")"  
    "[":
        outline: "default_prgm"
    "]":
        outline: "default_prgm"
    "{":
        outline: "default_prgm"
    "}":
        outline: "default_prgm"
    "¶":
        outline: "default_misc"
    "€":
        outline: "default_curr"
    "¥":
        outline: "default_curr"









    show_lower:
        action:
            set_view: "base"
        outline: "wide"
        label: "abc"
    show_upper:
        action:
            set_view: "upper"
        outline: "wide"
        label: "ABC"
    show_lsyms:
        action:
            set_view: "lsyms"
        outline: "wide"
        label: "àτ÷"
    show_usyms:
        action:
            set_view: "usyms"
        outline: "wide"
        label: "ÀΣ€"
    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: "action"
        keysym: "Home"
    End:
        outline: "action"
        keysym: "End"
    PgUp:
        outline: "action"
        keysym: "Page_Up"
    PgDn:
        outline: "action"
        keysym: "Page_Down"
    Up:
        label: "↑"
        outline: "action"
        keysym: "Up"
    Left:
        label: "←"
        outline: "action"
        keysym: "Left"
    Down:
        label: "↓"
        outline: "action"
        keysym: "Down"
    Right:
        label: "→"
        outline: "action"
        keysym: "Right"
1 Like

This is us_wide.yaml. Paste it into the same locations as us.yaml

---
outlines:
    default:         { width: 48,  height: 52 }
    default_punct:   { width: 48,  height: 52 }
    default_foreign: { width: 48,  height: 52 }
    default_calc:    { width: 48,  height: 52 }
    default_prgm:    { width: 48,  height: 52 }
    default_curr:    { width: 48,  height: 52 }
    default_misc:    { width: 48,  height: 52 }
    sp1_3:           { width: 16,  height: 52 }
    sp2_3:           { width: 32,  height: 52 }
    sp4_3:           { width: 64,  height: 52 }
    action:          { width: 64,  height: 52 }
    altline:         { width: 80,  height: 52 }
    double:          { width: 96,  height: 52 }
    wide5:           { width: 80,  height: 52 }
    spaceline:       { width: 212, height: 52 }
    widespaceline:   { width: 292, height: 52 }
    special:         { width: 60,  height: 52 }

views:
    base:
        - "q  w  e  r  t  y  u  i  o  p  [  ]  BackSpace  sp2_3  Insert  Home  PgUp  sp2_3  7  8  9  minus  ="
        - "sp1_3   a  s  d  f  g  h  j  k  l  ;  '  Return  sp2_3  Del  End  PgDn  sp2_3  4  5  6  +  ·"
        - "      sp2_3  z  x  c  v  b  n  m  ,  .  /  `  \\ sp2_3  sp2_3  sp4_3  ↑  sp4_3 sp2_3  1  2  3  ÷  √"
        - "Shift_L preferences Ctrl space  Alt Shift_b_ls  show_actions sp2_3  ←  ↓  →  sp2_3  Zero  DecimalPt  ×  percent"
    upper:
        - "Q  W  E  R  T  Y  U  I  O  P  {  }  BackSpace  sp2_3  Insert  Home  PgUp  sp2_3  7  8  9  minus  ="
        - "sp1_3   A  S  D  F  G  H  J  K  L  :  \"  Return  sp2_3  Del  End  PgDn  sp2_3  4  5  6  +   ·"
        - " sp2_3  Z  X  C  V  B  N  M  <  >  ?  ~  |  sp2_3  sp2_3  sp4_3  ↑  sp4_3  sp2_3  1  2  3  ÷  √"
        - "Shift_L preferences Ctrl space  Alt Shift_u_us  show_actions sp2_3  ←  ↓  →  sp2_3  Zero  DecimalPt  ×  percent"
    lsyms:
        - "à  â  á  é  î  ü  ô  ö  û  ó  &  *  BackSpace  sp2_3  Insert  Home  PgUp  sp2_3  7  8  9  minus  ="
        - "sp1_3  þ  ð  č  ĵ  š  ž  ǧ  ß  ʒ  ğ  -  Return  sp2_3  Del  End  PgDn  sp2_3  4  5  6  +   ·"
        - "sp2_3   θ  μ  π  σ  τ  φ  !  @  #  $  %  ^   sp2_3  sp2_3  sp4_3  ↑  sp4_3  sp2_3  1  2  3  ÷  √"
        - "Shift_S preferences Ctrl space  Alt Shift_b_ls show_actions sp2_3  ←  ↓  →  sp2_3  Zero  DecimalPt  ×  percent"
    usyms:
        - "À  Â  Á  É  Î  Ü  Ô  Ö  Û  Ó  (  )  BackSpace  sp2_3  Insert  Home  PgUp  sp2_3  7  8  9  minus  ="
        - "sp1_3  Þ  Đ  Č  Ĵ  Š  Ž  Ǧ  ʃ  Ʒ  Ğ  _  Return  sp2_3  Del  End  PgDn  sp2_3  4  5  6  +   ·"  
        - "sp2_3   «  »  Σ  Δ  ¶  °  ®  ©  dollar  £  €  ¥    sp2_3  sp2_3  sp4_3  ↑  sp4_3  sp2_3  1  2  3  ÷  √"
        - "Shift_S preferences Ctrl space Alt  Shift_u_us  show_actions sp2_3  ←  ↓  →  sp2_3  Zero  DecimalPt  ×  percent"
    actions:
        - "show_lower  sp1_3 Esc  sp2_3  F1     F2     F3     F4     sp2_3 WideBackSpace  sp2_3  Insert  Home  PgUp  sp2_3  7  8  9  minus  ="
        - "show_upper  sp1_3 Tab sp2_3 F5     F6   F7   F8    sp2_3  Pause   sp2_3  Del  End  PgDn  sp2_3  4  5  6  +   ·"
        - "show_lsyms  sp1_3   Menu  sp2_3  F9  F10  F11  F12   sp2_3  Break  sp2_3  sp4_3  ↑      sp4_3  sp2_3  1  2  3  ÷  √"
        - "show_usyms preferences Ctrl widespace Alt  show_actions  sp2_3  ←  ↓  →  sp2_3  Zero  DecimalPt  ×  percent"

buttons:



    sp1_3:
        outline: "sp1_3"
        keysym: " "
        text: " "
    sp2_3:
        outline: "sp2_3"
        keysym: " "
        text: " "
    sp4_3:
        outline: "sp4_3"
        keysym: " "
        text: " "



    Shift_L:
        action:
            locking:
                lock_view: "upper"
                unlock_view: "base"
        outline: "altline"
        icon: "key-shift"
    Shift_S:
        action:
            locking:
                lock_view: "usyms"
                unlock_view: "lsyms"
        outline: "altline"
        icon: "key-shift"
    Shift_b_ls:
        action:
            locking:
                lock_view: "lsyms"
                unlock_view: "base"
        outline: "altline"
        label: "àτ÷"
    Shift_u_us:
        action:
            locking:
                lock_view: "usyms"
                unlock_view: "upper"
        outline: "altline"
        label: "ÀΣ€"             
    show_actions:
        action:
            locking:
                lock_view: "actions"
                unlock_view: "base"
        outline: "altline"
        label: "Fn"






    preferences:
        action: "show_prefs"
        outline: "special"
        icon: "keyboard-mode-symbolic"
    space:
        outline: "spaceline"
        text: " "
    widespace:
        outline: "widespaceline"
        text: " "
    Return:
        outline: "double"
        icon: "key-enter"
        keysym: "Return"
    BackSpace:
        outline: "action"
        icon: "edit-clear-symbolic"
        action: erase



    Ctrl:
        modifier: "Control"
        outline: "action"
        label: "Ctrl"
    Alt:
        modifier: "Alt"
        outline: "action"
        label: "Alt"
    "↑":
        outline: "action"
        keysym: "Up"
    "↓":
        outline: "action"
        keysym: "Down"
    "←":
        outline: "action"
        keysym: "Left"
    "→":
        outline: "action"
        keysym: "Right"





    "-":
        outline: "default_punct"
    ";":
        outline: "default_punct"
    "'":
        outline: "default_punct"
    ",":
        outline: "default_punct"
    ".":
        outline: "default_punct"
    "?":
        outline: "default_punct"


    "!":
        outline: "default_punct"
    "@":
        outline: "default_punct"
    "#":
        outline: "default_punct"
    "$":
        outline: "default_punct"
    "%":
        outline: "default_punct"
    "^":
        outline: "default_punct"
    "&":
        outline: "default_punct"
    "*":
        outline: "default_punct"
    "(":
        outline: "default_punct"
    ")":
        outline: "default_punct"
    "_":
        outline: "default_punct"
    ":":
        outline: "default_punct"
    "\"":
        outline: "default_punct"
    "<":
        outline: "default_punct"
    ">":
        outline: "default_punct"
    "/":
        outline: "default_punct"


    "`":
        outline: "default_punct"
    "à":
        outline: "default_foreign"
    "â":
        outline: "default_foreign"
    "á":
        outline: "default_foreign"
    "é":
        outline: "default_foreign"
    "î":
        outline: "default_foreign"
    "ü":
        outline: "default_foreign"
    "ô":
        outline: "default_foreign"
    "ö":
        outline: "default_foreign"
    "û":
        outline: "default_foreign"
    "ó":
        outline: "default_foreign"
    "þ":
        outline: "default_foreign"
    "ð":
        outline: "default_foreign"
    "č":
        outline: "default_foreign"
    "ĵ":
        outline: "default_foreign"
    "š":
        outline: "default_foreign"
    "ž":
        outline: "default_foreign"
    "ǧ":
        outline: "default_foreign"
    "ß":
        outline: "default_foreign"
    "ʒ":
        outline: "default_foreign"
    "ğ":
        outline: "default_foreign"
    "θ":
        outline: "default_foreign"
    "μ":
        outline: "default_foreign"
    "π":
        outline: "default_foreign"
    "σ":
        outline: "default_foreign"
    "τ":
        outline: "default_foreign"
    "φ":
        outline: "default_foreign"
    "=":
        outline: "default_calc"
    "·":
        outline: "default_calc"
    "+":
        outline: "default_calc"
    minus:
        outline: "default_calc"
        text: "-"
    percent:
        outline: "default_calc"
        text: "%"
    "\\":
        outline: "default_punct"
    "|":
        outline: "default_punct"
    bang:
        outline: "default_punct"
        text: "!"
    pct:
        outline: "default_punct"
        text: "%"
    amp:
        outline: "default_punct"
        text: "&"
    caret:
        outline: "default_punct"
        text: "^"
    mulsplat:
        outline: "default_calc"
        text: "*"
    divslash:
        outline: "default_calc"
        text: "/"
    "√":
        outline: "default_calc"
    "×":
        outline: "default_calc"
    "÷":
        outline: "default_calc"


    "~":
        outline: "default_punct"
    "À":
        outline: "default_foreign"
    "Â":
        outline: "default_foreign"
    "Á":
        outline: "default_foreign"
    "É":
        outline: "default_foreign"
    "Î":
        outline: "default_foreign"
    "Ü":
        outline: "default_foreign"
    "Ô":
        outline: "default_foreign"
    "Ö":
        outline: "default_foreign"
    "Û":
        outline: "default_foreign"
    "Ó":
        outline: "default_foreign"
    "Þ":
        outline: "default_foreign"
    "Đ":
        outline: "default_foreign"
    "Č":
        outline: "default_foreign"
    "Ĵ":
        outline: "default_foreign"
    "Š":
        outline: "default_foreign"
    "Ž":
        outline: "default_foreign"
    "Ǧ":
        outline: "default_foreign"
    "ʃ":
        outline: "default_foreign"
    "Ʒ":
        outline: "default_foreign"
    "Ğ":
        outline: "default_foreign"
    "Σ":
        outline: "default_foreign"
    "Δ":
        outline: "default_foreign"
    "«":
        outline: "default_foreign"
    "»":
        outline: "default_foreign"
    hash:
        outline: "default_punct"
        text: "#"
    "°":
        outline: "default_misc"
    "®":
        outline: "default_misc"
    "©":
        outline: "default_misc"
    dollar:
        outline: "default_curr"
        text: "$"
    "£":
        outline: "default_curr"
    lst:
        outline: "default_punct"
        text: "<"
    gtt:
        outline: "default_punct"
        text: ">"
    lparen:
        label: "("
        outline: "default_punct"
        text: "("
    rparen:
        outline: "default_punct"
        text: ")"  
    "[":
        outline: "default_punct"
    "]":
        outline: "default_punct"
    "{":
        outline: "default_punct"
    "}":
        outline: "default_punct"
    "¶":
        outline: "default_misc"
    "€":
        outline: "default_curr"
    "¥":
        outline: "default_curr"









    show_lower:
        action:
            set_view: "base"
        outline: "altline"
        label: "abc"
    show_upper:
        action:
            set_view: "upper"
        outline: "altline"
        label: "ABC"
    show_lsyms:
        action:
            set_view: "lsyms"
        outline: "altline"
        label: "àτ÷"
    show_usyms:
        action:
            set_view: "usyms"
        outline: "altline"
        label: "ÀΣ€"
    F1:
        outline: "wide5"
        keysym: "F1"
    F2:
        outline: "wide5"
        keysym: "F2"
    F3:
        outline: "wide5"
        keysym: "F3"
    F4:
        outline: "wide5"
        keysym: "F4"
    F5:
        outline: "wide5"
        keysym: "F5"
    F6:
        outline: "wide5"
        keysym: "F6"
    F7:
        outline: "wide5"
        keysym: "F7"
    F8:
        outline: "wide5"
        keysym: "F8"
    F9:
        outline: "wide5"
        keysym: "F9"
    F10:
        outline: "wide5"
        keysym: "F10"
    F11:
        outline: "wide5"
        keysym: "F11"
    F12:
        outline: "wide5"
        keysym: "F12"
    Esc:
        outline: "wide5"
        keysym: "Escape"
    WideBackSpace:
        outline: "wide5"
        icon: "edit-clear-symbolic"
        action: erase
    Tab:
        outline: "wide5"
        keysym: "Tab"
    Del:
        outline: "action"
        keysym: "Delete"
    Insert:
        outline: "action"
        keysym: "Insert"
    Menu:
        outline: "wide5"
        keysym: "Menu"
    Pause:
        outline: "wide5"
        keysym: "Pause"
    Break:
        outline: "wide5"
        keysym: "Break"
    Home:
        outline: "action"
        keysym: "Home"
    End:
        outline: "action"
        keysym: "End"
    PgUp:
        outline: "action"
        keysym: "Page_Up"
    PgDn:
        outline: "action"
        keysym: "Page_Down"
    Up:
        label: "↑"
        outline: "action"
        keysym: "Up"
    Left:
        label: "←"
        outline: "action"
        keysym: "Left"
    Down:
        label: "↓"
        outline: "action"
        keysym: "Down"
    Right:
        label: "→"
        outline: "action"
        keysym: "Right"
    Zero:
        outline: "double"
        text: "0"
    DecimalPt:
        text: "."



    period:
        outline: "altline"
        text: "."
    colon:
        text: ":"

Finally, this is gtk.css

Paste it into ~/.config/gtk-3.0

You will need to restart your phone for it to take effect. (The others, you just need to switch keyboards to another keyboard, then come back. If there’s something wrong with the keyboard files, you’ll just get the default (built in) keyboard.)

sq_button.sp1_3,
sq_button.sp2_3,
sq_button.sp4_3,
sq_button.sp5_3,
sq_button.vert_spacer,
sq_button.sp1_3:active,
sq_button.sp2_3:active,
sq_button.sp4_3:active,
sq_button.sp5_3:active,
sq_button.vert_spacer
{
    background: #000000;
    border-color: #000000;
    color: #000000;
}

sq_button.default_punct,
sq_button.default_punct:active
{
    color: mix(@theme_fg_color, #FFFF00, 0.5);
    border-color: mix(@borders, #FFFF00, 0.5);
    background: mix(@theme_bg_color, #FFFF00, 0.2);
}

sq_button.default_foreign,
sq_button.default_foreign:active
{
    color: mix(@theme_fg_color, #00FF00, 0.5);
    border-color: mix(@borders, #00FF00, 0.5);
    background: mix(@theme_bg_color, #00FF00, 0.3);
}

sq_button.default_calc,
sq_button.default_calc:active
{
    color: mix(@theme_fg_color, #FF8000, 0.5);
    border-color: mix(@borders, #FF8000, 0.5);
    background: mix(@theme_bg_color, #FF8000, 0.3);
}

sq_button.default_prgm,
sq_button.default_prgm:active
{
    color: mix(@theme_fg_color, #00FFFF, 0.5);
    border-color: mix(@borders, #00FFFF, 0.5);
    background: mix(@theme_bg_color, #00FFFF, 0.3);
}

sq_button.default_curr,
sq_button.default_curr:active
{
    color: mix(@theme_fg_color, #0000FF, 0.5);
    border-color: mix(@borders, #0000FF, 0.5);
    background: mix(@theme_bg_color, #0000FF, 0.3);
}

sq_button.default_misc,
sq_button.default_misc:active
{
    color: mix(@theme_fg_color, #FF00FF, 0.5);
    border-color: mix(@borders, #FF00FF, 0.5);
    background: mix(@theme_bg_color, #FF00FF, 0.3);
}

sq_button.locked
{
    color: @theme_fg_color;
    background: @theme_selected_bg_color;
}

sq_button.latched
{
    background: @theme_fg_color;
    color: @theme_bg_color;
}
1 Like

Hi Steve,

I’ve copied all data and are going to try them.
It will be later this day before I can give some feedback.
I really appreciate your effort and time. :+1:

I’ve just made a first attempt but without success.

These are the steps I’ve taken:

  • I’ve copied the text for us.yaml into a file named stevec.yaml and placed it in /home/purism/.local/share/squeekboard/keyboards

  • Same action taken for us_wide.yaml and stored into stevec_wide.yaml located in /home/purism/.local/share/squeekboard/keyboards

Remark: That folder did not exist, I had to create /home/purism/.local/share/squeekboard/keyboards/

  • The third file (gtk.css) was copied and placed into /home/purism/.config/gtk-3.0 (same name used).

  • Next I have edited the file evdev.xml in /usr/share/X11/xkb/rules
    As explained in the message from ktmr I added a new layout section in that xml file.
    and doing so I’ve managed to add the new keyboard into the list of available keyboards.

For both views the layout remained unchanged (default layout was shown).

Obviously something isn’t OK.
I wonder what encoding is needed. I stored them as UTF8.

EDIT
I forgot to mention that I did reboot the L5 after making these changes.

Well, I know I didn’t bother with your last step (trying to register a new layout). I simply used us.yaml (and us_wide.yaml), overriding the normal US keyboards.

If you somehow messed that step up ( and I don’t have any way to know that one way or the other; I’ve never done it), then of course you can’t select the keyboards.

Try just changing the name of the wide keyboard back, and see if it shows up when the wide keyboard should. (the change should take effect the next time you switch to the regular US keyboard). Also (and incidentally), my US keyboard is labeled “US, Intl, with dead keys” and you might need that specific keyboard to get mine to show up even with the file named us_wide.yaml

OK, I’ve just renamed everything, rebooted the L5 and used English (US) as keyboard.
That didn’t work.

(You shouldn’t have to reboot when all you’ve done is change the yaml files. There it’s sufficient to select some other keyboard, then go back to the one you were editing. If something’s wrong with the file, you’ll just get the default.)

The only thing I can think of at this point is to go into the keyboard settings and make sure that your US keyboard is international with dead keys. That one, I know is tied to us.yaml and us_wide.yaml.

And just in case, try using the text editor app. For all I know, the private browsing might have a hint associated with it (like Terminal does). A hint means it will look elsewhere for the file.

I was using “English (US)” keyboard layout, but have added the “English (US), int., with dead keys)” and switched to it.
Too bad, that was not the solution.
FYI: I used the text editor app to test things as you recommended.

I’m going to dive into the squeekboard doc’s. Maybe there is something I’m not doing right.
One question remains though: What text encoding format have you been using?

I have no idea what text encoding it is…I’ve been using gedit, and there’s no dang menu on it to speak of (the hamburger doesn’t have a settings option on it. So I’d have to say it’s whatever the default is.

(I just got this phone, and one of my recurring frustrations with it is apps that have no controls…the file manager, just for instance, doesn’t have a button to go up a folder or go back to the previous folder, though sometimes I can get the dropdown next to the name of the current folder to do something useful. I at least DID get it to not open a file I was trying to select for a copy operation! (Who set single click to open as the default?!?!?))

One more thought…if in copying and pasting the text, spaces got replaced by tabs that will bung up the yaml files. They cannot have tabs in them. I don’t know how fussy it is about the indent levels, but the files I started from had four spaces per indent level, and I stuck with that. Try to preserve the indents I showed and never, ever use tabs.

I know the feeling and recognize the frustration.
I tossed the def. file-manager and installed Dolphin as file manager.
Not an ideal solution either, but opening files and browsing through folders works as I’m used to.

I’m going to parse through the .yaml files and check if there are tabs to be found.
I’ll keep you posted.

Hi @shopping4purism.
In your screenshots I see that your custom Language is stevec_test (top right of your status bar, next to the battery icon.
Your .yaml files need to match this value exactly.
stevec_test.yaml and stevec_test_wide.yaml

Try that and the layouts should update when you select your new keyboard.

2 Likes

Checked and renamed where needed, but that didn’t cause the problem.
I’m going to check if there are “tabs” in the files like SteveC suggested.

Thanks anyway. :slightly_smiling_face:

Looks like UTF 8 (current locale)