Environment
System: Linux Mint 18 / 19 Cinnamon 64-bit.
Question
I need to dynamically account for the screen resolution in a POSIX shell script.
I prefer a function for re-use.
Advertisement
Answer
Function
get_screen_resolution() { xdpyinfo | awk '/dimensions:/ { print $2 }' }
Usage
resolution=$(get_screen_resolution)