You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. # This is a custom file for a surface.
  2. { config, lib, pkgs, modulesPath, ... }:
  3. {
  4. # Set an usable key configuration: Ctrl at capslock, Win at Alt, Alt at Ctrl
  5. services.xserver.displayManager.sessionCommands =''
  6. ${pkgs.xorg.xmodmap}/bin/xmodmap "${pkgs.writeText "xkb-layout" ''
  7. !
  8. ! Swap Caps_Lock and Control_L
  9. !
  10. remove Lock = Caps_Lock
  11. remove Control = Control_L
  12. ! keysym Control_L = Caps_Lock
  13. keysym Control_L = Mode_switch
  14. keysym Caps_Lock = Control_L
  15. add Lock = Caps_Lock
  16. add Control = Control_L
  17. ! map arrows to more ergonomic position
  18. keycode 43 = h H Left
  19. keycode 44 = j J Down
  20. keycode 45 = k K Up
  21. keycode 46 = l L Right
  22. ''}"
  23. '';
  24. # add pulseaudio support to manage audio
  25. hardware.pulseaudio.enable = true;
  26. ## NOTES:
  27. # Susspend issue:
  28. # https://github.com/linux-surface/linux-surface/wiki/Known-Issues-and-FAQ#suspend-aka-sleep-vs-lid-closingopening-events
  29. # run:
  30. # > sudo modprobe -r surface_gpe
  31. # and:
  32. # > sudo bash -c 'echo -e "\n# Blacklisting lid vs. suspend issue module\nblacklist surface_gpe" >> /etc/modprobe.d/blacklist.conf'
  33. #
  34. # Now folding the keyboard to the screen will not suspend and brick the
  35. # session, but you will need to manually suspend the session if saving battery
  36. # is desired.
  37. }