質問: すべての有効なkbdレイアウト、バリアント、トグルオプションをリストします(setxkbmapで使用します) コマンドラインから、使用可能なすべてのキーボードレイアウトと相対バリアントのリストを取得する方法はありますか?次に、setxkbmapから、使用するすべての有効なレイアウト/バリアントの選択肢をリストする必要があります。レイアウト切り替えオプションについても、利用可能なすべての選択肢のリストを取得する方法があります(例:grp:shift_caps_toggle、...)私はそれを知っていますsetxkbmap -query 現在のリストを取得しましたが、オプションのリスト全体が必要です。更新:コマンドについて聞いたman xkeyboard-config コマンドラインにすべての情報を提供します。さらに、man -p cat xkeyboard-config 出力はstdoutに送られ、スクリプトまたはcコードで解析できます
回答: そのファイル/usr/share/x11/xkb/rules/evdev.lstでリストを取得できますデンマーク語のバリアントのみを検索するsedを使用してバリアントを取得する例sed '/! variant/,/^$/!d;/danish/!d' < /usr/share/x11/xkb/rules/evdev.lst nodeadkeys dk: danish (eliminate dead keys) winkeys dk: danish (winkeys) mac dk: danish (macintosh) mac_nodeadkeys dk: danish (macintosh, eliminate dead keys) dvorak dk: danish (dvorak) 編集:完全なリストを追加します! layout us usa ad andorra af afghanistan ara arabic al albania am armenia az azerbaijan by belarus be belgium bd bangladesh in india ba bosnia and herzegovina br brazil bg bulgaria ma morocco mm myanmar ca canada cd congo, democratic republic of the cn china hr croatia cz czechia dk denmark nl netherlands bt bhutan ee estonia ir iran iq iraq fo faroe islands fi finland fr france gh ghana gn guinea ge georgia de germany gr greece hu hungary is iceland il israel it italy jp japan kg kyrgyzstan kh cambodia kz kazakhstan la laos latam latin american lt lithuania lv latvia mao maori me montenegro mk macedonia mt malta mn mongolia no norway pl poland pt portugal ro romania ru russia rs serbia si slovenia sk slovakia es spain se sweden ch switzerland sy syria tj tajikistan lk sri lanka th thailand tr turkey tw taiwan ua ukraine gb united kingdom uz uzbekistan vn vietnam kr korea, republic of nec_vndr/jp japan (pc-98xx series) ie ireland pk pakistan mv maldives za south africa epo esperanto np nepal ng nigeria et ethiopia sn senegal brai braille tm turkmenistan ml mali tz tanzania ! variant chr us: cherokee euro us: with eurosign on 5 intl us: international (with dead keys) alt-intl us: alternative international (former us_intl) colemak us: colemak dvorak us: dvorak dvorak-intl us: dvorak international dvorak-l us: left handed dvorak dvorak-r us: right handed dvorak dvorak-classic us: classic dvorak dvp us: programmer dvorak rus us: russian phonetic mac us: macintosh altgr-intl us: international (altgr dead keys) olpc2 us: group toggle on multiply/divide key srp us: serbian ps af: pashto uz af: southern uzbek olpc-ps af: olpc pashto olpc-fa af: olpc dari olpc-uz af: olpc southern uzbek azerty ara: azerty azerty_digits ara: azerty/digits digits ara: digits qwerty ara: qwerty qwerty_digits ara: qwerty/digits buckwalter ara: buckwalter phonetic am: phonetic phonetic-alt am: alternative phonetic eastern am: eastern western am: western eastern-alt am: alternative eastern cyrillic az: cyrillic legacy by: legacy latin by: latin oss be: alternative oss_latin9 be: alternative, latin-9 only oss_sundeadkeys be: alternative, sun dead keys iso-alternate be: iso alternate nodeadkeys be: eliminate dead keys sundeadkeys be: sun dead keys wang be: wang model 724 azerty probhat bd: probhat ben in: bengali ben_probhat in: bengali probhat guj in: gujarati guru in: gurmukhi jhelum in: gurmukhi jhelum kan in: kannada mal in: malayalam mal_lalitha in: malayalam lalitha ori in: oriya tam_unicode in: tamil unicode tam_keyboard_with_numerals in: tamil keyboard with numerals tam_tab in: tamil tab typewriter tam_tscii in: tamil tscii typewriter tam in: tamil tel in: telugu urd-phonetic in: urdu, phonetic urd-phonetic3 in: urdu, alternative phonetic urd-winkeys in: urdu, winkeys bolnagri in: hindi bolnagri hin-wx in: hindi wx alternatequotes ba: use guillemets for quotes unicode ba: use bosnian digraphs unicodeus ba: us keyboard with bosnian digraphs us ba: us keyboard with bosnian letters nodeadkeys br: eliminate dead keys dvorak br: dvorak nativo br: nativo nativo-us br: nativo for usa keyboards nativo-epo br: nativo for esperanto phonetic bg: traditional phonetic bas_phonetic bg: new phonetic french ma: french tifinagh ma: tifinagh tifinagh-alt ma: tifinagh alternative tifinagh-alt-phonetic ma: tifinagh alternative phonetic tifinagh-extended ma: tifinagh extended tifinagh-phonetic ma: tifinagh phonetic tifinagh-extended-phonetic ma: tifinagh extended phonetic fr-dvorak ca: french dvorak fr-legacy ca: french (legacy) multix ca: multilingual multi ca: multilingual, first part multi-2gr ca: multilingual, second part ike ca: inuktitut shs ca: secwepemctsin kut ca: ktunaxa eng ca: english tib cn: tibetan tib_asciinum cn: tibetan (with ascii numerals) alternatequotes hr: use guillemets for quotes unicode hr: use croatian digraphs unicodeus hr: us keyboard with croatian digraphs us hr: us keyboard with croatian letters bksl cz: with &lt;\|&gt; key qwerty cz: qwerty qwerty_bksl cz: qwerty, extended backslash ucw cz: ucw layout (accented letters only) dvorak-ucw cz: us dvorak with cz ucw support nodeadkeys dk: eliminate dead keys mac dk: macintosh mac_nodeadkeys dk: macintosh, eliminate dead keys dvorak dk: dvorak sundeadkeys nl: sun dead keys mac nl: macintosh std nl: standard nodeadkeys ee: eliminate dead keys dvorak ee: dvorak us ee: us keyboard with estonian letters pes_keypad ir: persian, with persian keypad ku ir: kurdish, latin q ku_f ir: kurdish, (f) ku_alt ir: kurdish, latin alt-q ku_ara ir: kurdish, arabic-latin ku iq: kurdish, latin q ku_f iq: kurdish, (f) ku_alt iq: kurdish, latin alt-q ku_ara iq: kurdish, arabic-latin nodeadkeys fo: eliminate dead keys nodeadkeys fi: eliminate dead keys smi fi: northern saami classic fi: classic mac fi: macintosh nodeadkeys fr: eliminate dead keys sundeadkeys fr: sun dead keys oss fr: alternative oss_latin9 fr: alternative, latin-9 only oss_nodeadkeys fr: alternative, eliminate dead keys oss_sundeadkeys fr: alternative, sun dead keys latin9 fr: (legacy) alternative latin9_nodeadkeys fr: (legacy) alternative, eliminate dead keys latin9_sundeadkeys fr: (legacy) alternative, sun dead keys bepo fr: bepo, ergonomic, dvorak way bepo_latin9 fr: bepo, ergonomic, dvorak way, latin-9 only dvorak fr: dvorak mac fr: macintosh bre fr: breton oci fr: occitan geo fr: georgian azerty tskapo generic gh: multilingual akan gh: akan ewe gh: ewe fula gh: fula ga gh: ga hausa gh: hausa ergonomic ge: ergonomic mess ge: mess ru ge: russian os ge: ossetian deadacute de: dead acute deadgraveacute de: dead grave acute nodeadkeys de: eliminate dead keys ro de: romanian keyboard with german letters ro_nodeadkeys de: romanian keyboard with german letters, eliminate dead keys dvorak de: dvorak sundeadkeys de: sun dead keys neo de: neo 2 mac de: macintosh mac_nodeadkeys de: macintosh, eliminate dead keys dsb de: lower sorbian dsb_qwertz de: lower sorbian (qwertz) qwerty de: qwerty simple gr: simple extended gr: extended nodeadkeys gr: eliminate dead keys polytonic gr: polytonic standard hu: standard nodeadkeys hu: eliminate dead keys qwerty hu: qwerty 101_qwertz_comma_dead hu: 101/qwertz/comma/dead keys 101_qwertz_comma_nodead hu: 101/qwertz/comma/eliminate dead keys 101_qwertz_dot_dead hu: 101/qwertz/dot/dead keys 101_qwertz_dot_nodead hu: 101/qwertz/dot/eliminate dead keys 101_qwerty_comma_dead hu: 101/qwerty/comma/dead keys 101_qwerty_comma_nodead hu: 101/qwerty/comma/eliminate dead keys 101_qwerty_dot_dead hu: 101/qwerty/dot/dead keys 101_qwerty_dot_nodead hu: 101/qwerty/dot/eliminate dead keys 102_qwertz_comma_dead hu: 102/qwertz/comma/dead keys 102_qwertz_comma_nodead hu: 102/qwertz/comma/eliminate dead keys 102_qwertz_dot_dead hu: 102/qwertz/dot/dead keys 102_qwertz_dot_nodead hu: 102/qwertz/dot/eliminate dead keys 102_qwerty_comma_dead hu: 102/qwerty/comma/dead keys 102_qwerty_comma_nodead hu: 102/qwerty/comma/eliminate dead keys 102_qwerty_dot_dead hu: 102/qwerty/dot/dead keys 102_qwerty_dot_nodead hu: 102/qwerty/dot/eliminate dead keys sundeadkeys is: sun dead keys nodeadkeys is: eliminate dead keys mac is: macintosh dvorak is: dvorak lyx il: lyx phonetic il: phonetic biblical il: biblical hebrew (tiro) nodeadkeys it: eliminate dead keys mac it: macintosh us it: us keyboard with italian letters geo it: georgian kana jp: kana oadg109a jp: oadg 109a mac jp: macintosh phonetic kg: phonetic ruskaz kz: russian with kazakh kazrus kz: kazakh with russian basic la: laos stea la: laos - stea (proposed standard layout) nodeadkeys latam: eliminate dead keys deadtilde latam: include dead tilde sundeadkeys latam: sun dead keys std lt: standard us lt: us keyboard with lithuanian letters ibm lt: ibm (lst 1205-92) lekp lt: lekp lekpa lt: lekpa apostrophe lv: apostrophe (') variant tilde lv: tilde (~) variant fkey lv: f-letter (f) variant cyrillic me: cyrillic cyrillicyz me: cyrillic, z and zhe swapped latinunicode me: latin unicode latinyz me: latin qwerty latinunicodeyz me: latin unicode qwerty cyrillicalternatequotes me: cyrillic with guillemets latinalternatequotes me: latin with guillemets nodeadkeys mk: eliminate dead keys us mt: maltese keyboard with us layout nodeadkeys no: eliminate dead keys dvorak no: dvorak smi no: northern saami smi_nodeadkeys no: northern saami, eliminate dead keys mac no: macintosh mac_nodeadkeys no: macintosh, eliminate dead keys qwertz pl: qwertz dvorak pl: dvorak dvorak_quotes pl: dvorak, polish quotes on quotemark key dvorak_altquotes pl: dvorak, polish quotes on key 1 csb pl: kashubian ru_phonetic_dvorak pl: russian phonetic dvorak dvp pl: programmer dvorak nodeadkeys pt: eliminate dead keys sundeadkeys pt: sun dead keys mac pt: macintosh mac_nodeadkeys pt: macintosh, eliminate dead keys mac_sundeadkeys pt: macintosh, sun dead keys nativo pt: nativo nativo-us pt: nativo for usa keyboards nativo-epo pt: nativo for esperanto cedilla ro: cedilla std ro: standard std_cedilla ro: standard (cedilla) winkeys ro: winkeys crh_f ro: crimean tatar (turkish f) crh_alt ro: crimean tatar (turkish alt-q) crh_dobruca1 ro: crimean tatar (dobruca-1 q) crh_dobruca2 ro: crimean tatar (dobruca-2 q) phonetic ru: phonetic phonetic_winkeys ru: phonetic winkeys typewriter ru: typewriter legacy ru: legacy typewriter-legacy ru: typewriter, legacy tt ru: tatar os_legacy ru: ossetian, legacy os_winkeys ru: ossetian, winkeys cv ru: chuvash cv_latin ru: chuvash latin udm ru: udmurt kom ru: komi sah ru: yakut xal ru: kalmyk dos ru: dos srp ru: serbian bak ru: bashkirian yz rs: z and zhe swapped latin rs: latin latinunicode rs: latin unicode latinyz rs: latin qwerty latinunicodeyz rs: latin unicode qwerty alternatequotes rs: with guillemets latinalternatequotes rs: latin with guillemets alternatequotes si: use guillemets for quotes us si: us keyboard with slovenian letters bksl sk: extended backslash qwerty sk: qwerty qwerty_bksl sk: qwerty, extended backslash nodeadkeys es: eliminate dead keys deadtilde es: include dead tilde sundeadkeys es: sun dead keys dvorak es: dvorak ast es: asturian variant with bottom-dot h and bottom-dot l cat es: catalan variant with middle-dot l mac es: macintosh nodeadkeys se: eliminate dead keys dvorak se: dvorak rus se: russian phonetic rus_nodeadkeys se: russian phonetic, eliminate dead keys smi se: northern saami mac se: macintosh svdvorak se: svdvorak legacy ch: legacy de_nodeadkeys ch: german, eliminate dead keys de_sundeadkeys ch: german, sun dead keys fr ch: french fr_nodeadkeys ch: french, eliminate dead keys fr_sundeadkeys ch: french, sun dead keys fr_mac ch: french (macintosh) de_mac ch: german (macintosh) syc sy: syriac syc_phonetic sy: syriac phonetic ku sy: kurdish, latin q ku_f sy: kurdish, (f) ku_alt sy: kurdish, latin alt-q legacy tj: legacy tam_unicode lk: tamil unicode tam_tab lk: tamil tab typewriter tis th: tis-820.2538 pat th: pattachote f tr: (f) alt tr: alt-q sundeadkeys tr: sun dead keys ku tr: kurdish, latin q ku_f tr: kurdish, (f) ku_alt tr: kurdish, latin alt-q intl tr: international (with dead keys) crh tr: crimean tatar (turkish q) crh_f tr: crimean tatar (turkish f) crh_alt tr: crimean tatar (turkish alt-q) indigenous tw: indigenous saisiyat tw: saisiyat phonetic ua: phonetic typewriter ua: typewriter winkeys ua: winkeys legacy ua: legacy rstu ua: standard rstu rstu_ru ua: standard rstu on russian layout homophonic ua: homophonic crh ua: crimean tatar (turkish q) crh_f ua: crimean tatar (turkish f) crh_alt ua: crimean tatar (turkish alt-q) extd gb: extended - winkeys intl gb: international (with dead keys) dvorak gb: dvorak dvorakukp gb: dvorak (uk punctuation) mac gb: macintosh colemak gb: colemak latin uz: latin crh uz: crimean tatar (turkish q) crh_f uz: crimean tatar (turkish f) crh_alt uz: crimean tatar (turkish alt-q) kr104 kr: 101/104 key compatible clogaelach ie: clogaelach unicodeexpert ie: unicodeexpert ogam ie: ogham ogam_is434 ie: ogham is434 urd-crulp pk: crulp urd-nla pk: nla ara pk: arabic legacy epo: displaced semicolon and quote (obsolete) igbo ng: igbo yoruba ng: yoruba hausa ng: hausa left_hand brai: left hand right_hand brai: right hand alt tm: alt-q fr-oss ml: français (france alternative) us-mac ml: english (usa macintosh) us-intl ml: english (usa international)