# DDC/CI monitor input control: list displays, get/set input by bus or name.
{ pkgs }:
let
  script = builtins.readFile ./monitor-input.sh;
  unwrapped = pkgs.writeShellScriptBin "monitor-input" script;
in
pkgs.runCommand "monitor-input" { nativeBuildInputs = [ pkgs.makeWrapper ]; } ''
  mkdir -p $out/bin
  cp ${unwrapped}/bin/monitor-input $out/bin/monitor-input
  chmod +x $out/bin/monitor-input
  wrapProgram $out/bin/monitor-input --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.ddcutil ]}
''
