Skip to content

Instantly share code, notes, and snippets.

@ytoshima
Created February 10, 2013 01:46
Show Gist options
  • Save ytoshima/4747954 to your computer and use it in GitHub Desktop.
Save ytoshima/4747954 to your computer and use it in GitHub Desktop.
A simple script to show screen resolution
#!/bin/sh
exec ~/local/scala-2.10.0/bin/scala "$0" "$@"
!#
val ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment
val mode = ge.getDefaultScreenDevice.getDisplayMode
println("%dx%d".format(mode.getWidth, mode.getHeight))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment