Skip to content

Instantly share code, notes, and snippets.

@ottidmes
Created January 2, 2019 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottidmes/16f1f8a015318f8be413b23e16ab61fe to your computer and use it in GitHub Desktop.
Save ottidmes/16f1f8a015318f8be413b23e16ab61fe to your computer and use it in GitHub Desktop.
# Trust Multimedia Scroll Keyboard, KB-2200
# https://help.ubuntu.com/community/TrustMultimediaScrollKeyboardKB-2200
{ pkgs, ... }:
let
keymap = pkgs.writeText "keymap.xkb" ''
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(euro)+inet(evdev)+compose(menu)"
// mark 131 Hangul_Hanja
key <HJCV> { [ XF86Cut ] };
// paste 132 NoSymbol/Yen
key <AE13> { [ XF86Paste ] };
// home 180 XF86HomePage
// mail 163 XF86Mail
// search 255 XF86Search
// calculator 148 XF86Calculator
// explorer 152 XF86Explorer
// reload 181 XF86Reload
// favorites 164 XF86Favorites
// calendar 102 Muhenkan
key <MUHE> { [ XF86Calendar ] };
// pictures / powerpoint 100 Henkan_Mode
key <HENK> { [ XF86Pictures ] };
// excel 101 Hiragana_Katakana
key <HKTG> { [ XF86Excel ] };
// music 179 XF86Tools
key <I179> { [ XF86AudioMedia ] };
// audio prev 173 XF86AudioPrev
// audio next 171 XF86AudioNext
// audio play pause 172 XF86AudioPlay
// sleep 150 XF86Sleep
// poweroff 124 XF86PowerOff
};
xkb_geometry { include "pc(pc104)" };
};
'';
in {
i18n.consoleUseXkbConfig = true;
environment.systemPackages = with pkgs; [ xorg.xkbcomp ];
environment.etc."X11/keymap.xkb".source = keymap;
services.xserver = {
layout = "us";
xkbVariant = "euro";
xkbOptions = "compose:menu";
displayManager.sessionCommands = ''
${pkgs.xorg.xkbcomp}/bin/xkbcomp ${keymap} $DISPLAY
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment