nix-config/hosts/common/optional/desktop/xremap.nix
GHOSCHT 190081b246
Switch xremap to user mode
system mode didn't work for executing applications
2024-02-16 12:32:19 +01:00

67 lines
1.7 KiB
Nix

{
pkgs,
inputs,
lib,
...
}: {
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
};
services.xremap = {
withX11 = true;
watch = true;
debug = false;
userName = "ghoscht";
serviceMode = "user";
config = {
keymap = [
{
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"];
# };
};
}
{
name = "Music";
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"];
};
};
}
];
};
};
}