I have a regular expression that I\'m using to try to detect screen resolution as follows
xrandr | grep -P \'(.*\\d+x\\d+)* | awk {\'print$3\'}
w