mirror of
https://github.com/dragoonDorise/EmuDeck.git
synced 2024-06-02 19:47:51 -04:00
darwin AR
This commit is contained in:
parent
bfbf9d2d4a
commit
3ba95d6b19
|
@ -86,3 +86,26 @@ installEmuZip(){
|
|||
|
||||
}
|
||||
|
||||
gcd() {
|
||||
while [ $2 -ne 0 ]; do
|
||||
set -- $2 $(( $1 % $2 ))
|
||||
done
|
||||
echo $1
|
||||
}
|
||||
|
||||
|
||||
function getScreenAR(){
|
||||
dimensions=$(system_profiler SPDisplaysDataType | awk '/Resolution/{print $2, $4}')
|
||||
|
||||
width=$(echo $dimensions | cut -d ' ' -f 1)
|
||||
height=$(echo $dimensions | cut -d ' ' -f 2)
|
||||
|
||||
|
||||
g=$(gcd $width $height)
|
||||
|
||||
aspect_ratio_width=$((width / g))
|
||||
aspect_ratio_height=$((height / g))
|
||||
|
||||
return $aspect_ratio_width$aspect_ratio_height
|
||||
|
||||
}
|
Loading…
Reference in a new issue