I am trying to read the screen resolution from within a Qt application, but without using the GUI module.
So I have tried using:
xrandr |grep \* |awk '{print $1}'
command through QProcess, but it shows a warning and does not give any output:
unknown escape sequence:'\\*'
Rewriting it with \\\*
does not help, as it leads to the following error:
/usr/bin/xrandr: unrecognized option '|grep'\nTry '/usr/bin/xrandr --help' for more information.\n
How can I solve that?