nix-config/hosts/common/optional/desktop/xremap.nix

68 lines
1.7 KiB
Nix
Raw Normal View History

2023-12-27 10:57:55 +01:00
{
pkgs,
inputs,
lib,
2023-12-27 10:57:55 +01:00
...
}: {
imports = [
inputs.xremap.nixosModules.default
];
hardware.uinput.enable = true;
users.groups.uinput.members = ["ghoscht"];
users.groups.input.members = ["ghoscht"];
systemd.user.services.set-xhost = {
description = "Run a one-shot command upon user login";
path = [pkgs.xorg.xhost];
wantedBy = ["default.target"];
script = "xhost +SI:localuser:root";
environment.DISPLAY = ":0"; # NOTE: This is hardcoded for this flake
};
2023-12-27 10:57:55 +01:00
services.xremap = {
withX11 = true;
watch = true;
debug = false;
userName = "ghoscht";
serviceMode = "user";
2023-12-27 10:57:55 +01:00
config = {
keymap = [
2024-02-04 20:53:38 +01:00
{
name = "Global";
remap = {
"CapsLock" = "Esc";
"Esc" = "CapsLock";
super-x = {
launch = ["${lib.getExe pkgs.wezterm}"];
};
# super-space = {
# launch = ["${lib.getExe pkgs.rofi}" "-i" "-show" "drun" "-show-icons"];
# };
# super-control-l = {
# launch = ["${lib.getExe pkgs.firefox}"];
# };
# super-control-shift-l = {
# launch = ["${lib.getExe pkgs.firefox}" "--private-window"];
# };
};
2024-02-04 20:53:38 +01:00
}
2023-12-27 10:57:55 +01:00
{
name = "Music";
2023-12-27 10:57:55 +01:00
remap = {
"KEY_PLAYPAUSE" = {
launch = ["${lib.getExe pkgs.playerctl}" "play-pause"];
};
"KEY_NEXTSONG" = {
launch = ["${lib.getExe pkgs.playerctl}" "next"];
};
"KEY_PREVIOUSSONG" = {
launch = ["${lib.getExe pkgs.playerctl}" "previous"];
2023-12-27 10:57:55 +01:00
};
};
}
];
};
};
}