32 lines
696 B
Nix
32 lines
696 B
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
services.udev = {
|
|
extraRules = ''
|
|
ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", TAG+="systemd", ENV{SYSTEMD_WANTS}="monitor-hotplug.service"
|
|
'';
|
|
};
|
|
|
|
systemd.services.monitor-hotplug = {
|
|
description = "Monitor hotplug";
|
|
|
|
environment = {
|
|
DISPLAY = ":0";
|
|
XAUTHORITY = "/home/nnm/.Xauthority";
|
|
};
|
|
|
|
path = [ pkgs.xorg.xrandr pkgs.bash pkgs.i3 ];
|
|
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
};
|
|
|
|
script = ''
|
|
#"/home/nnm/development/monitor-update-outputs/target/scala-2.11/monitor-update-outputs-out"
|
|
/run/current-system/sw/bin/echo test112233
|
|
'';
|
|
|
|
wantedBy = [ "default.target" ];
|
|
};
|
|
}
|