Swap caps+escape and alt+super

only on chupacabra laptop keyboard
This commit is contained in:
Griffin Smith 2020-04-05 15:26:16 -04:00
parent 07d4cf66eb
commit a566e0208f
3 changed files with 28 additions and 3 deletions

View file

@ -1,7 +1,31 @@
{ ... }:
{
{ pkgs, ... }:
let
laptopKeyboardId = "25";
in {
system.machine = {
wirelessInterface = "wlp59s0";
i3FontSize = 9;
};
systemd.user.services.laptop-keyboard = {
Unit = {
Description = "Swap caps+escape and alt+super, but only on the built-in laptop keyboard";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = (
"${pkgs.xorg.setxkbmap}/bin/setxkbmap "
+ "-device ${laptopKeyboardId} "
+ "-option caps:swapescape "
+ "-option compose:ralt "
+ "-option altwin:swap_alt_win"
);
};
};
}