notes/BASH get screen resolution width and height Linux-ykxnyUv1.sh
#!/bin/bash

#get screen resolution

res="$(xrandr|grep '*'|head -n 1|awk '{print $1}')"

#get width and height
width="$(xrandr|grep '*'|head -n 1|awk '{print $1}'|cut -d\x -f1)"
height="$(xrandr|grep '*'|head -n 1|awk '{print $1}'|cut -d\x -f2)"


#output
echo "Your screen Resolution is $res"


echo "The width is $width and the height is $height"

syntax highlighted by Code2HTML, v. 0.9.1