From 3b4a2168bcfa83de0f8c69484e31a077bc62cc12 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Mon, 13 Feb 2023 09:08:11 +0000 Subject: [PATCH] xmodmap on hotplug --- desktop.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/desktop.nix b/desktop.nix index f8774a7..c790b46 100644 --- a/desktop.nix +++ b/desktop.nix @@ -17,6 +17,25 @@ in { windowManager.xmonad.enable = true; }; + systemd.user.services.xmodmap = { + description = "xmodmap hotplug"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + unitConfig = { + StartLimitIntervalSec = 0; + }; + serviceConfig = { + PassEnvironment = "DISPLAY"; + Restart = "always"; + RestartSec = 0; + }; + script = '' + ${pkgs.inotify-tools}/bin/inotifywait -e create /dev/input + sleep 1s + ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'add mod3 = Muhenkan' + ''; + }; + #services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.xautolock = {