How do I find out the screen resolution of my Linux desktop from a C# program running in Mono? I am using Ubuntu.
Using the xrandr
command I can view the resolution, but is there a programmatic way to get the same information?
How do I find out the screen resolution of my Linux desktop from a C# program running in Mono? I am using Ubuntu.
Using the xrandr
command I can view the resolution, but is there a programmatic way to get the same information?
Exactly the same way you would in .NET C#. That's the whole idea of Mono - for the underlying OS to be transparent.
Google "screen resolution C#". Your first search result should work just fine.
You can use following command:
xdpyinfo | grep 'dimensions:'