How do I get screen resolution in Julia?

I couln’t get displaysize() to return my monitor resolution.

I know I can get it with the help of e.g. Gtk.jl, but I’d prefer avoiding using an external package. Is there a way in Julia Base to obtain the screen resolution ?

Julia (the core language and the standard libraries) does not know anything about graphical output, so you will have to rely on a package for that.

For a specific OS, you may be able to formulate a command line query though (eg from the output of xdpyinfo on X).

2 Likes

Thanks ! Got it done with Glfw.jl.

1 Like