From 198a85080fa76d9fe235d3cc88213ff7d2a5ef78 Mon Sep 17 00:00:00 2001
From: xzhih <842708096@qq.com>
Date: Sun, 5 Aug 2018 20:00:58 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=88=86=E8=BE=A8=E7=8E=87?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=B9=E5=BC=8F=EF=BC=8C=E6=9B=B4=E6=8E=A5?=
=?UTF-8?q?=E8=BF=91=E5=8E=9F=E7=94=9F=E9=80=89=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hidpi-zh.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++------
hidpi.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++------
2 files changed, 124 insertions(+), 14 deletions(-)
diff --git a/hidpi-zh.sh b/hidpi-zh.sh
index 2ad8565..255152e 100755
--- a/hidpi-zh.sh
+++ b/hidpi-zh.sh
@@ -140,12 +140,19 @@ EOF
read -p "选择你想要的配置: " res
case $res in
- 1 ) create_res 1680x945 1600x900 1440x810;;
-2 ) create_res 2048x1152 1920x1080 1840x1035 1760x990;;
+ 1 ) create_res_1 1920x1080 1680x945 1440x810 1280x720 1024x576
+;;
+2 ) create_res_1 2048x1152 1920x1080 1680x945 1440x810 1280x720
+ create_res_2 1024x576
+ create_res_3 960x540
+ create_res_4 2048x1152
+;;
3 ) custom_res;;
esac
-create_res 1280x720 1024x576 960x540 640x360
+create_res_2 1280x720 960x540 640x360
+create_res_3 840x472 720x405 640x360 576x324 512x288 420x234 400x225 320x180
+create_res_4 1920x1080 1680x945 1440x810 1280x720 1024x576 960x540 640x360
cat >> "$dpiFile" <<-\FFF
@@ -186,13 +193,61 @@ function create_res()
hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
#
cat << OOO >> $dpiFile
-
- ${hidpi:0:11}A
+ ${hidpi:0:11}AAAAB
${hidpi:0:11}AAAABACAAAA==
- ${hidpi:0:11}AAAAJAKAAAA==
-
OOO
+done
+}
+function create_res_1()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}A
+OOO
+done
+}
+
+function create_res_2()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}AAAABACAAAA==
+OOO
+done
+}
+
+function create_res_3()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}AAAAB
+OOO
+done
+}
+
+function create_res_4()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}AAAAJAKAAAA==
+OOO
done
}
diff --git a/hidpi.sh b/hidpi.sh
index 0a2a388..70c98cd 100755
--- a/hidpi.sh
+++ b/hidpi.sh
@@ -138,12 +138,19 @@ EOF
read -p "Enter your choice: " res
case $res in
- 1 ) create_res 1680x945 1600x900 1440x810;;
-2 ) create_res 2048x1152 1920x1080 1840x1035 1760x990;;
+ 1 ) create_res_1 1920x1080 1680x945 1440x810 1280x720 1024x576
+;;
+2 ) create_res_1 2048x1152 1920x1080 1680x945 1440x810 1280x720
+ create_res_2 1024x576
+ create_res_3 960x540
+ create_res_4 2048x1152
+;;
3 ) custom_res;;
esac
-create_res 1280x720 1024x576 960x540 640x360
+create_res_2 1280x720 960x540 640x360
+create_res_3 840x472 720x405 640x360 576x324 512x288 420x234 400x225 320x180
+create_res_4 1920x1080 1680x945 1440x810 1280x720 1024x576 960x540 640x360
cat >> "$dpiFile" <<-\FFF
@@ -184,13 +191,61 @@ function create_res()
hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
#
cat << OOO >> $dpiFile
-
- ${hidpi:0:11}A
+ ${hidpi:0:11}AAAAB
${hidpi:0:11}AAAABACAAAA==
- ${hidpi:0:11}AAAAJAKAAAA==
-
OOO
+done
+}
+function create_res_1()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}A
+OOO
+done
+}
+
+function create_res_2()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}AAAABACAAAA==
+OOO
+done
+}
+
+function create_res_3()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}AAAAB
+OOO
+done
+}
+
+function create_res_4()
+{
+ for res in $@; do
+ width=$(echo $res | cut -d x -f 1)
+ height=$(echo $res | cut -d x -f 2)
+ hidpi=$(printf '%08x %08x' $(($width*2)) $(($height*2)) | xxd -r -p | base64)
+#
+cat << OOO >> $dpiFile
+ ${hidpi:0:11}AAAAJAKAAAA==
+OOO
done
}