説明したように、カスタムコンソールキーマップを作成したいと思います。Arch-Wikiから
これは私のファイルです:
# /usr/local/share/kbd/keymaps/personal.map
include "us"
# swap Caps_Lock and Escape
keycode 1 = Caps_Lock
keycode 58 = Escape
# swap left Alt and Control
keycode 29 = Alt
keycode 56 = Control
# German stuff
keymaps 0-3
keycode 22 = u U udiaeresis Udiaeresis
keycode 24 = o O odiaeresis Odiaeresis
keycode 30 = a A adiaeresis Adiaeresis
keycode 31 = s S ssharp
次のようにロードしようとするとloadkeys /usr/local/share/kbd/keymaps/personal.map
:
cannot open include file us
syntax error, unexpected ERROR
us
localectl list-keymaps
もちろん結果的です。
include "us"
Arch Wikiの例の内容を置き換えると、期待include "linux-with-two-alt-keys"
どおりに機能します。
us
なぜ地図を含めることができないのですか?
答え1
クイックマークは、含めるファイルのディレクトリと現在の作業ディレクトリのみをstrace loadkeys /usr/local/share/kbd/keymaps/personal.map
検索し、次のように確認できます。include
locate
$ sudo updatedb
$ locate -r "keymaps.*\.inc$"
/usr/share/kbd/keymaps/i386/include/azerty-layout.inc
/usr/share/kbd/keymaps/i386/include/compose.inc
/usr/share/kbd/keymaps/i386/include/euro1.inc
/usr/share/kbd/keymaps/i386/include/linux-keys-bare.inc
/usr/share/kbd/keymaps/i386/include/linux-keys-extd.inc
/usr/share/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc
/usr/share/kbd/keymaps/i386/include/linux-with-modeshift-altgr.inc
/usr/share/kbd/keymaps/i386/include/linux-with-two-alt-keys.inc
/usr/share/kbd/keymaps/i386/include/qwerty-layout.inc
/usr/share/kbd/keymaps/i386/include/qwertz-layout.inc
/usr/share/kbd/keymaps/mac/include/apple-a1048-base.inc
/usr/share/kbd/keymaps/mac/include/apple-a1243-fn-reverse.inc
/usr/share/kbd/keymaps/mac/include/apple-a1243-fn.inc
/usr/share/kbd/keymaps/mac/include/mac-azerty-layout.inc
/usr/share/kbd/keymaps/mac/include/mac-linux-keys-bare.inc
/usr/share/kbd/keymaps/mac/include/mac-qwerty-layout.inc
/usr/share/kbd/keymaps/mac/include/mac-qwertz-layout.inc
実際、すべての.incファイルは.incというディレクトリにありますinclude
。
kbd マンページでインクルードメカニズムの説明が見つかりませんでしたが、次の内容を読んでも見つけることができます。ソースコード:
static const char *const include_dirpath0[] = {
"",
NULL
};
static const char *const include_dirpath1[] = {
"",
"../include/",
"../../include/",
NULL
};
static const char *const include_dirpath3[] = {
DATADIR "/" KEYMAPDIR "/include/",
DATADIR "/" KEYMAPDIR "/i386/include/",
DATADIR "/" KEYMAPDIR "/mac/include/",
NULL
};
.inc
サフィックスも表示できます埋め込みファイルに自動的に追加:
static const char *const include_suffixes[] = {
"",
".inc",
NULL
};
したがって、これが機能するには、loadkeys /usr/local/share/kbd/keymaps/personal.map
次のものが必要です。
zcat /usr/share/kbd/keymaps/i386/qwerty/us.map.gz > /usr/local/share/kbd/keymaps/us.inc