The officially official Devuan Forum!

You are not logged in.

#1 2020-08-15 12:17:21

penguin
Member
Registered: 2019-05-05
Posts: 30  

HOW TO: Set up English / Korean keyboard in Xorg

English keyboard layout: Colemak
Korean keyboard layout: 3beol

Install Korean fonts:
fonts-baekmuk, fonts-unfonts-core, fonts-unfonts-extra

Install uim, uim-xim, uim-byeoru packages
It would install the packages:
libuim-custom2, libuim-data, libuim-scm0, libuim8, uim, uim-byeoru, uim-data,
    uim-fep, uim-gtk2.0, uim-gtk2.0-immodule, uim-gtk3, uim-gtk3-immodule,
    uim-plugins, uim-qt5, uim-qt5-immodule, uim-xim               

Set the environment variables for uim in ~/.bashrc

export GTK_IM_MODULE='uim'
export QT_IM_MODULE='uim'
export XMODIFIERS='@im=uim'

Start xfce and open a terminal, run uim-pref-gtk3

$ uim-xim --engine=byeoru &
$ uim-pref-gtk3

On the preference window

[Global settings]
Specify default IM: on
Byeoru: default
Disable other input methods by clicking on the 'edit' button.

[Byeoru] 

Set Korean keyboard layout to 3 beol
Specify the korean/Hanja dictionary that Byeoru will use, and other miscellaneous settings.

[Byeoru Keybinding 1]
Set the hotkey Shift+Space to nable/disable Byeoru.

Add two lines in ~/.config/xfce4/xinitrc
(I do not use slim and use ~/.xinitrc to start Xfce4)

uim-xim --engine=byeoru &
uim-toolbar-gtk3-systray &

exec startxfce4

For duboel (2boel) keyboard layout is de facto standard of Hangul input (Korean alphabet).
Virtually all Korean IME developers assume Qwerty as English keyboard layout and they uses Qwerty key maps.

Qwerty
400px-KB_United_States.svg.png

Dvorak
400px-KB_United_States_Dvorak.svg.png

Colemak
400px-KB_US-Colemak.svg.png

If you are using Dvorak or Colemak for English like me, Korean words will be broken.
uim-byeoru developer was Korean and provided custom keymap solution luckily.
I created a key mapping file for Colemak and 3beol, saved it to ~/.uim file.  uim-byeoru overrides default keymaps of English (Qwerty) and Korean (Dubeol).

;;; byeoru.scm: a Hangul input module for uim.
;;;
;;; Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
;;;
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;; 1. Redistributions of source code must retain the above copyright
;;;    notice, this list of conditions and the following disclaimer.
;;; 2. Redistributions in binary form must reproduce the above copyright
;;;    notice, this list of conditions and the following disclaimer in the
;;;    documentation and/or other materials provided with the distribution.
;;; 3. Neither the name of authors nor the names of its contributors
;;;    may be used to endorse or promote products derived from this software
;;;    without specific prior written permission.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
;;; SUCH DAMAGE.
;;;;

(require-module "byeoru")

(byeoru-define-layout byeoru-layout-strict3final
 ;; Unshifted keys
 ("`" . "*")
 ("1" (jongseong-hieuh       . 1))
 ("2" (jongseong-ssangsios   . 5))
 ("3" (jongseong-bieub       . 1))
 ("4" (jungseong-yo          . 1))
 ("5" (jungseong-yu          . 1))
 ("6" (jungseong-ya          . 1))
 ("7" (jungseong-ye          . 1))
 ("8" (jungseong-ui          . 4))
 ("9" (jungseong-u           . 2))
 ("0" (choseong-kieuk        . 1))
 ("-" . ")")
 ("=" . ">")
 ("q" (jongseong-sios        . 1))
 ("w" (jongseong-rieul       . 1))
 ("f" (jungseong-yeo         . 1))
 ("p" (jungseong-ae          . (1 4)))
 ("g" (jungseong-eo          . (1 4)))
 ("j" (choseong-rieul        . 1))
 ("l" (choseong-digeud       . (3 5)))
 ("u" (choseong-mieum        . 1))
 ("y" (choseong-chieuch      . 1))
 (";" (choseong-pieup        . 1))
 ("[" . "(")
 ("]" . "<")
 ("\\" . ":")
 ("a" (jongseong-ieung       . 1))
 ("r" (jongseong-nieun       . 1))
 ("s" (jungseong-i           . (1 4)))
 ("t" (jungseong-a           . (1 4)))
 ("d" (jungseong-eu          . 1))
 ("h" (choseong-nieun        . 1))
 ("n" (choseong-ieung        . 1))
 ("e" (choseong-giyeog       . (3 5)))
 ("i" (choseong-jieuj        . (3 5)))
 ("o" (choseong-bieub        . (3 5)))
 ("'" (choseong-tieut        . 1))
 ("z" (jongseong-mieum       . 1))
 ("x" (jongseong-giyeog      . 1))
 ("c" (jungseong-e           . (1 4)))
 ("v" (jungseong-o           . 1))
 ("b" (jungseong-u           . 1))
 ("k" (choseong-sios         . (3 5)))
 ("m" (choseong-hieuh        . 1))
 ("/" (jungseong-o           . 2))
 ;; Shifted keys
 ("~" . #x203b)             ; U+203B, REFERENCE MARK
 ("!" (jongseong-ssanggiyeog . 5))
 ("@" (jongseong-rieulgiyeog . 4))
 ("#" (jongseong-jieuj       . 1))
 ("$" (jongseong-rieulpieup  . 4))
 ("%" (jongseong-rieultieut  . 4))
 ("^" . "=")
 ("&" . #x201c)             ; U+201C, LEFT DOUBLE QUOTATION MARK
 ("*" . #x201d)             ; U+201D, RIGHT DOUBLE QUOTATION MARK
 ("(" . "'")
 (")" . "~")
 ("_" . ";")
 ("Q" (jongseong-pieup       . 1))
 ("W" (jongseong-tieut       . 1))
 ("F" (jongseong-nieunjieuj  . 4))
 ("P" (jongseong-rieulhieuh  . 4))
 ("G" (jongseong-rieulsios   . 4))
 ("J" . "5")
 ("L" . "6")
 ("U" . "7")
 ("Y" . "8")
 (":" . "9")
 ("{" . "%")
 ("}" . "/")
 ("|" . "\\")
 ;;     ("|" . #x20a9)           ; U+20A9, WON SIGN
 ("A" (jongseong-digeud      . 1))
 ("R" (jongseong-nieunhieuh  . 4))
 ("S" (jongseong-rieulbieub  . 4))
 ("T" (jongseong-rieulmieum  . 4))
 ("D" (jungseong-yae         . 1))
 ("H" . "0")
 ("N" . "1")
 ("E" . "2")
 ("I" . "3")
 ("O" . "4")
 ("\"" . #x00b7)            ; U+00B7, MIDDLE DOT
 ("Z" (jongseong-chieuch     . 1))
 ("X" (jongseong-bieubsios   . 4))
 ("C" (jongseong-kieuk       . 1))
 ("V" (jongseong-giyeogsios  . 4))
 ("B" . "?")
 ("K" . "-")
 ("M" . "\"")
 ("<" . ",")
 (">" . ".")
 ("?" . "!"))

(byeoru-define-layout byeoru-layout-generous3final
 ;; Unshifted keys
 ("`" . "*")
 ("1" (jongseong-hieuh       . (1 4)))
 ("2" (jongseong-ssangsios   . 5))
 ("3" (jongseong-bieub       . (3 4)))
 ("4" (jungseong-yo          . 1))
 ("5" (jungseong-yu          . 1))
 ("6" (jungseong-ya          . 1))
 ("7" (jungseong-ye          . 1))
 ("8" (jungseong-ui          . 4))
 ("9" (jungseong-u           . 3))
 ("0" (choseong-kieuk        . 1))
 ("-" . ")")
 ("=" . ">")
 ("q" (jongseong-sios        . (3 4 5)))
 ("w" (jongseong-rieul       . 3))
 ("f" (jungseong-yeo         . 1))
 ("p" (jungseong-ae          . (1 4)))
 ("g" (jungseong-eo          . (1 4)))
 ("j" (choseong-rieul        . 1))
 ("l" (choseong-digeud       . (3 5)))
 ("u" (choseong-mieum        . 1))
 ("y" (choseong-chieuch      . 1))
 (";" (choseong-pieup        . 1))
 ("[" . "(")
 ("]" . "<")
 ("\\" . ":")
 ("a" (jongseong-ieung       . 1))
 ("r" (jongseong-nieun       . 3))
 ("s" (jungseong-i           . (1 4)))
 ("t" (jungseong-a           . (1 4)))
 ("d" (jungseong-eu          . 3))
 ("h" (choseong-nieun        . 1))
 ("n" (choseong-ieung        . 1))
 ("e" (choseong-giyeog       . (3 5)))
 ("i" (choseong-jieuj        . (3 5)))
 ("o" (choseong-bieub        . (3 5)))
 ("'" (choseong-tieut        . 1))
 ("z" (jongseong-mieum       . (1 4)))
 ("x" (jongseong-giyeog      . (3 4 5)))
 ("c" (jungseong-e           . (1 4)))
 ("v" (jungseong-o           . 3))
 ("b" (jungseong-u           . 3))
 ("k" (choseong-sios         . (3 5)))
 ("m" (choseong-hieuh        . 1))
 ("/" (jungseong-o           . 3))
 ;; Shifted keys
 ("~" . #x203b)             ; U+203B, REFERENCE MARK
 ("!" (jongseong-ssanggiyeog . 5))
 ("@" (jongseong-rieulgiyeog . 4))
 ("#" (jongseong-jieuj       . (1 4)))
 ("$" (jongseong-rieulpieup  . 4))
 ("%" (jongseong-rieultieut  . 4))
 ("^" . "=")
 ("&" . #x201c)             ; U+201C, LEFT DOUBLE QUOTATION MARK
 ("*" . #x201d)             ; U+201D, RIGHT DOUBLE QUOTATION MARK
 ("(" . "'")
 (")" . "~")
 ("_" . ";")
 ("Q" (jongseong-pieup       . (1 4)))
 ("W" (jongseong-tieut       . (1 4)))
 ("F" (jongseong-nieunjieuj  . 4))
 ("P" (jongseong-rieulhieuh  . 4))
 ("G" (jongseong-rieulsios   . 4))
 ("J" . "5")
 ("L" . "6")
 ("U" . "7")
 ("Y" . "8")
 (":" . "9")
 ("{" . "%")
 ("}" . "/")
 ("|" . "\\")
 ;;     ("|" . #x20a9)      ; U+20A9, WON SIGN
 ("A" (jongseong-digeud      . 1))
 ("R" (jongseong-nieunhieuh  . 4))
 ("S" (jongseong-rieulbieub  . 4))
 ("T" (jongseong-rieulmieum  . 4))
 ("D" (jungseong-yae         . 1))
 ("H" . "0")
 ("N" . "1")
 ("E" . "2")
 ("I" . "3")
 ("O" . "4")
 ("\"". #x00b7)             ; U+00B7, MIDDLE DOT
 ("Z" (jongseong-chieuch     . 1))
 ("X" (jongseong-bieubsios   . 4))
 ("C" (jongseong-kieuk       . 1))
 ("V" (jongseong-giyeogsios  . 4))
 ("B" . "?")
 ("K" . "-")
 ("M" . "\"")
 ("<" . ",")
 (">" . ".")
 ("?" . "!"))

Reference

https://wiki.archlinux.org/index.php/Lo … ut_methods

Last edited by penguin (2020-08-15 12:26:28)

Offline

Board footer