标签: linux function shell screen-resolution dash-shell
系统:Linux Mint 18/19 Cinnamon 64位。
外壳:dash(POSIX)。
dash
我需要在POSIX shell脚本中动态考虑屏幕分辨率。
我更喜欢重复使用的功能。
答案 0 :(得分:1)
get_screen_resolution() { xdpyinfo | awk '/dimensions:/ { print $2 }' }
resolution=$(get_screen_resolution)