Keyd : Move system controls to Sway.

This commit is contained in:
Dmitry Voronin 2024-05-09 00:20:56 +03:00
parent 338b65429f
commit a190f35e8f
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
8 changed files with 22 additions and 20 deletions

View file

@ -2,4 +2,7 @@
imports = [
./Fprint.nix
];
# Keyd Print to Macro remap.
services.keyd.keyboards.default.settings.main.print = "layer(layer_macro)";
}

View file

@ -54,6 +54,5 @@ in {
];
};
systemd.services.keyd.path = [ script ];
environment.systemPackages = [ script ];
}

View file

@ -20,6 +20,5 @@ in {
} // args))
];
systemd.services.keyd.path = [ script ];
environment.systemPackages = [ script ];
}

View file

@ -17,6 +17,5 @@ in {
} // args))
];
systemd.services.keyd.path = [ script ];
environment.systemPackages = [ script ];
}

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, key, ... }: {
environment.systemPackages = with pkgs; [ keyd ];
services.keyd = {
@ -10,9 +10,8 @@
backspace = "delete"; # Delete key on backspace.
capslock = "overload(control, esc)"; # Ctrl/esc combo.
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.
print = "layer(layer_macro)"; # ThinkPad remap to compose.
rightalt = "capslock"; # Language toggle.
rightcontrol = "layer(layer_control)"; # Media and other controls.
rightshift = "backspace"; # Backspace.
@ -45,17 +44,6 @@
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 = {};
};
};
@ -65,8 +53,5 @@
users.groups.keyd = {};
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";
}

View file

@ -20,6 +20,7 @@
./module/Session.nix
./module/Keyd.nix
./module/Waybar.nix
./module/Control.nix
] args;
in {
config = (util.trimTabs ''

View 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'
'';
}

View file

@ -136,4 +136,6 @@
fullscreen = "f";
};
};
sysctrl = "print";
}