Skip to content

Ability to pass custom exec arguments and env variables #59

Open

Description

@madratzz

Is your feature request related to a problem? Please describe.
I'm always frustrated when using wayland and HDPI.

Describe the solution you'd like
able to pass in custom env variables and scale factors with the project will help a lot while using hyprland and/or niri, this will at least give me some scaling options specific to unity

Activity

  1. Ravbug commented on Nov 8, 2025

    @Ravbug
    Owner

    Are you asking for the ability to pass environment variables from UnityHubNative to the Unity Editor? Or do you want to pass environment variables to UnityHubNative to control its scaling?

  2. madratzz commented on Nov 9, 2025

    @madratzz
    Author

    I am asking to pass in env variable/cmd arguments from UnityHubNative to the Unity Editor.

    I did modify the code to change the exec command in code and recompiled it. Worked exactly as expected on HDPi, GDK_SCALE,2 was passed in and the editor was usable on 4K, but I was not able to add in UI elements etc, otherwise I would have opened a PR.

  3. madratzz commented on Nov 9, 2025

    @madratzz
    Author

    Also tried a combination of GDK_SCALE and DPI env variables and that made the UI more in line, and serviceable.
    All in all if we can get the ability to pass in env variables and other arguments via UnityHubNative that will be a huge use-ability boost compared to the default UnityHub, which just a glorified Ad spot at this point, and does not pass the env variable to the editor used to open the hub.

  4. madratzz commented on Nov 9, 2025

    @madratzz
    Author

    Adding the code snippet, used gemini for the modifications :D

            #if defined __linux__
                std::string cmd = "GDK_SCALE=2 GDK_DPI_SCALE=0.5 XCURSOR_SIZE=24 \"";
            #else
                std::string cmd = "\"";
            #endif
    
                // Append the rest of the Unity Editor command
                cmd += editorPath.string() + "\" -projectpath \"" + p.path.string() + "\"";`
    
  5. added a commit that references this issue on Jun 5, 2026
    3ba2c2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions