Keyd : Move system controls to Sway.
This commit is contained in:
parent
338b65429f
commit
a190f35e8f
|
@ -2,4 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./Fprint.nix
|
./Fprint.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Keyd Print to Macro remap.
|
||||||
|
services.keyd.keyboards.default.settings.main.print = "layer(layer_macro)";
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,5 @@ in {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.keyd.path = [ script ];
|
|
||||||
environment.systemPackages = [ script ];
|
environment.systemPackages = [ script ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,5 @@ in {
|
||||||
} // args))
|
} // args))
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.keyd.path = [ script ];
|
|
||||||
environment.systemPackages = [ script ];
|
environment.systemPackages = [ script ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,5 @@ in {
|
||||||
} // args))
|
} // args))
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.keyd.path = [ script ];
|
|
||||||
environment.systemPackages = [ script ];
|
environment.systemPackages = [ script ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, ... }: {
|
{ pkgs, lib, key, ... }: {
|
||||||
environment.systemPackages = with pkgs; [ keyd ];
|
environment.systemPackages = with pkgs; [ keyd ];
|
||||||
|
|
||||||
services.keyd = {
|
services.keyd = {
|
||||||
|
@ -10,9 +10,8 @@
|
||||||
backspace = "delete"; # Delete key on backspace.
|
backspace = "delete"; # Delete key on backspace.
|
||||||
capslock = "overload(control, esc)"; # Ctrl/esc combo.
|
capslock = "overload(control, esc)"; # Ctrl/esc combo.
|
||||||
compose = "layer(layer_macro)"; # Input macros.
|
compose = "layer(layer_macro)"; # Input macros.
|
||||||
esc = "layer(layer_system)"; # System controls.
|
esc = "${key.sysctrl}"; # System controls.
|
||||||
leftcontrol = "overload(layer_alternative, leftcontrol)"; # Alternative layer for home, end etc.
|
leftcontrol = "overload(layer_alternative, leftcontrol)"; # Alternative layer for home, end etc.
|
||||||
print = "layer(layer_macro)"; # ThinkPad remap to compose.
|
|
||||||
rightalt = "capslock"; # Language toggle.
|
rightalt = "capslock"; # Language toggle.
|
||||||
rightcontrol = "layer(layer_control)"; # Media and other controls.
|
rightcontrol = "layer(layer_control)"; # Media and other controls.
|
||||||
rightshift = "backspace"; # Backspace.
|
rightshift = "backspace"; # Backspace.
|
||||||
|
@ -45,17 +44,6 @@
|
||||||
z = "stopcd";
|
z = "stopcd";
|
||||||
};
|
};
|
||||||
|
|
||||||
layer_system = {
|
|
||||||
f = "command(swayscript montoggle)";
|
|
||||||
c = "command(loginctl kill-user voronind)";
|
|
||||||
l = "command(powerlimit toggle)";
|
|
||||||
m = "command(swayscript montoggle)";
|
|
||||||
p = "command(powersave toggle)";
|
|
||||||
v = "command(swayscript vrrtoggle)";
|
|
||||||
x = "command(systemctl poweroff -i)";
|
|
||||||
z = "command(systemctl suspend -i)";
|
|
||||||
};
|
|
||||||
|
|
||||||
layer_macro = {};
|
layer_macro = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -65,8 +53,5 @@
|
||||||
users.groups.keyd = {};
|
users.groups.keyd = {};
|
||||||
systemd.services.keyd.serviceConfig.CapabilityBoundingSet = [ "CAP_SETGID" ];
|
systemd.services.keyd.serviceConfig.CapabilityBoundingSet = [ "CAP_SETGID" ];
|
||||||
|
|
||||||
# HACK: Workaround for powersave/powerlimit/swayscript scripts.
|
|
||||||
systemd.services.keyd.serviceConfig.ProtectKernelTunables = lib.mkForce false;
|
|
||||||
# systemd.services.keyd.serviceConfig.ProtectHome = lib.mkForce false;
|
|
||||||
# systemd.services.keyd.environment.KEYD_DEBUG = "1";
|
# systemd.services.keyd.environment.KEYD_DEBUG = "1";
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
./module/Session.nix
|
./module/Session.nix
|
||||||
./module/Keyd.nix
|
./module/Keyd.nix
|
||||||
./module/Waybar.nix
|
./module/Waybar.nix
|
||||||
|
./module/Control.nix
|
||||||
] args;
|
] args;
|
||||||
in {
|
in {
|
||||||
config = (util.trimTabs ''
|
config = (util.trimTabs ''
|
||||||
|
|
14
module/sway/module/Control.nix
Normal file
14
module/sway/module/Control.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ key, ... }: let
|
||||||
|
mod = key.sysctrl;
|
||||||
|
in {
|
||||||
|
text = ''
|
||||||
|
bindsym ${mod}+c exec 'swaymsg exit'
|
||||||
|
bindsym ${mod}+f exec 'swayscript montoggle'
|
||||||
|
bindsym ${mod}+l exec 'powerlimit toggle'
|
||||||
|
bindsym ${mod}+m exec 'swayscript montoggle'
|
||||||
|
bindsym ${mod}+p exec 'powersave toggle'
|
||||||
|
bindsym ${mod}+v exec 'swayscript vrrtoggle'
|
||||||
|
bindsym ${mod}+x exec 'systemctl poweroff -i'
|
||||||
|
bindsym ${mod}+z exec 'systemctl suspend -i'
|
||||||
|
'';
|
||||||
|
}
|
|
@ -136,4 +136,6 @@
|
||||||
fullscreen = "f";
|
fullscreen = "f";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sysctrl = "print";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue