[Gtk-sharp-list] System.Windows.Forms.SystemInformation equivalent

Adam Tauno Williams awilliam at whitemice.org
Tue Sep 7 13:44:44 EDT 2010

On Tue, 2010-09-07 at 11:35 -0400, Christopher David Howie wrote:
> On 09/07/2010 09:54 AM, Natalia Portillo wrote:
> > BootMode could reflect runlevel.
> Useless, since different distros use different runlevels to mean
> different things
> > ComputerName
> Stored in /etc/hostname

Disagree, that information is useless;  it doesn't tell you the CN of
the local machine, it may list many names.

Environment.MachineName; seems to work perfectly well in Mono [or M

> > DebugOS if kernel is compiled debug
> I'm not sure why you would need to know this and I'm not honestly even
> aware if there is a userland flag to indicate this.  Maybe you could
> parse it from the "uname -a" output?

I have no idea how to acquire that information [or event what an
application could possibly do with it].

> > MonitorCount depends on X11 not toolkit
> Gdk.Display.Default.NScreens

MMM, this may not be as obvious as it seems.

csharp> LoadPackage("gtk-sharp-2.0");
csharp> using Gdk;
csharp> Gdk.Display.Default.NScreens;

 - I have two physical displays.

> > MouseButtons, MousePresent, MouseWheelPresent depending on xinput if 
> > I'm not wrong
> You can probably inspect Gdk.Display.Default.CorePointer to determine
> these values.

csharp> var x = Gdk.Display.Default.CorePointer;
csharp> x.NumKeys;


> > Network is just a bool, is there any network at all?

On LINUX (GNOME) systems network availability is a D-bus service.  I
have no idea what Mac uses.  And Windows has its own thing.  

> This depends on what you mean by "is there any network".  You will have
> to clarify this point.  Do you mean "user can reach the Internet," or
> "user has access to something except localhost," or "the kernel supports
> networking," or...
> > PowerStatus on ACPI
> You'll have to be more specific about what kind of information you want.
> > PrimaryMonitorSize on X11

csharp> Gdk.Display.Default.DefaultScreen.GetMonitorGeometry(0);

> Gdk.Display.Default.DefaultScreen.Width/Height

csharp> Gdk.Display.Default.DefaultScreen.Width;
csharp> Gdk.Display.Default.DefaultScreen.Height;

> > ScreenOrientation on X11
> I assume you mean rotation and not simply portrait/landscape (which you
> could infer from the resolution of the default screen).  I'm not aware
> of any GDK mechanism you could use to obtain this.  You would have to
> query the XRandR subsystem directly.
> > TerminalServerSession this may have no meaning on Unix but 
> > UserInteractive does (remote X11 session, x11vnc server or user thru 
> > Apple Remote Desktop?)

There is no real way of knowing this;  local vs. remote user on UNIX is
a rather unknown distinction.

> mething very different from
> what the rest of the world calls a domain).
> > UserName
> System.Environment.UserName


More information about the Gtk-sharp-list mailing list