Bash + xrandr, 44 characters
read -aa<<<`xrandr`
echo ${a[7]}x${a[9]::-1}
xrandr belongs to the X server, on Ubuntu is provided by x11-xserver-utils package.
Sample run:
bash-4.3$ read -aa<<<`xrandr`;echo ${a[7]}x${a[9]::-1}
1920x1080
I don't judge the quality of code by who wrote it. I judge by whether it does what it should. No, I haven't tried it, because I know how globbing works. But if seeing is believing: what does xrandr|echo * output on your machine?
The reason I said who is running it is so you can ask someone who actually knows this stuff and could explain why it is doing what it does AND fix it if it is wrong
Well, all I can says is that command|grep * expands the * in any shell and that is almost certainly not what the author intended. Glob expansion is suppressed by quoting.