alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
240 stars 12 forks source link

How to enable MODE MAX for all displays? #117

Closed Cloudef closed 11 months ago

Cloudef commented 11 months ago

Can you put wildcard into NAME_DESC?

Cloudef commented 11 months ago

Not ideal, but currently doing this workaround:

systemd.user.services.way-displays = let
  adapters = filter (v: v != "") (splitString "\n" (builtins.readFile (pkgs.runCommandLocal "list-adapters" {
    __noChroot = true;
  } ''
    find /sys/devices -name "edid" -printf "%h\n" | while read -r path; do
      base="''${path##*/}"
      printf '%s\n' "''${base/card?-}"
    done > $out
    '')));
  config = pkgs.writeText "config.yaml" (''
    AUTO_SCALE: false
    '' + concatMapStringsSep "\n" (adp: ''
    MODE:
      - NAME_DESC: ${adp}
        MAX: true
    '') adapters);
in mkIf (cfg.monitors == []) {
  Unit.Description = "Wayland automatic display manager";
  Service.ExecStart = "${pkgs.way-displays}/bin/way-displays --config ${config}";
  Service.Restart = "on-failure";
  Install.WantedBy = [ "hyprland-session.target" ];
};
alex-courtis commented 11 months ago

Yes, you can use a regex: way-displays Configuration

Please let me know if that works for you.

Cloudef commented 11 months ago

Oh, I missed that completely. I'll test it out right away.

Cloudef commented 11 months ago

Seems to work, thank you