mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
xsession: add xplugd service to accompany setxkbmap (#2450)
This fixes #1638; xplugd will restart setxkbmap if a new keyboard is plugged in to ensure it is also configured correctly.
This commit is contained in:
parent
1b03a8ab7a
commit
3b9c625b64
1 changed files with 23 additions and 0 deletions
|
@ -126,6 +126,29 @@ in {
|
|||
in "${pkgs.xorg.setxkbmap}/bin/setxkbmap ${toString args}";
|
||||
};
|
||||
};
|
||||
|
||||
xplugd = {
|
||||
Unit = {
|
||||
Description = "Rerun setxkbmap.service when I/O is changed";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
|
||||
Service = {
|
||||
Type = "forking";
|
||||
ExecStart = let
|
||||
script = pkgs.writeShellScript "xplugrc" ''
|
||||
case "$1,$3" in
|
||||
keyboard,connected)
|
||||
systemctl --user restart setxkbmap.service
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
in "${pkgs.xplugd}/bin/xplugd ${script}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
targets = {
|
||||
|
|
Loading…
Reference in a new issue