I’m using this command to get the screen resolution:
system_profiler SPDisplaysDataType | grep Resolution
This returns your screen resolution of the form:
Resolution: 1366 x 768
The problem that I’m being faced with, is finding a way to get the values: 1366 and 768 separately by possibly using a regex in Ruby. The reason why I need to get these two values is so that I can use them here:
image = Image.new(x, y)
where x and y would be 1366 and 768 respectively. My question is how can I those two values by themselves?
1 Answer