From 190081b246319df17f689131c159f105a1206ddd Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:32:19 +0100 Subject: [PATCH] Switch xremap to user mode system mode didn't work for executing applications --- hosts/common/optional/desktop/xremap.nix | 35 +++++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/hosts/common/optional/desktop/xremap.nix b/hosts/common/optional/desktop/xremap.nix index b1e1b12..7b547ac 100644 --- a/hosts/common/optional/desktop/xremap.nix +++ b/hosts/common/optional/desktop/xremap.nix @@ -17,26 +17,47 @@ path = [pkgs.xorg.xhost]; wantedBy = ["default.target"]; script = "xhost +SI:localuser:root"; - environment.DISPLAY = "DP-4"; # NOTE: This is hardcoded for this flake + environment.DISPLAY = ":0"; # NOTE: This is hardcoded for this flake }; services.xremap = { withX11 = true; watch = true; - # debug = true; + debug = false; userName = "ghoscht"; - serviceMode = "system"; + serviceMode = "user"; config = { keymap = [ { name = "Global"; - remap = {"CapsLock" = "Esc";}; # globally remap CapsLock to Esc + 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 = "main remaps"; + name = "Music"; remap = { - super-e = { - launch = ["${lib.getExe pkgs.pavucontrol}"]; + "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"]; }; }; }