Fix resolution 2K 4K 8K 10K brend background

master v2.38
Dmitry Razumov 2 years ago
parent b0d3098b9f
commit a7b4eda97c
Signed by: asmeron
GPG Key ID: 50BC1DB583B79706

@ -2,15 +2,25 @@
##
## ./script ${RESOLUTION} ${VERSION_CODENAME} ${STATE_MODE}
## RESOLUTION:
## 1024x768 #(4:3)
## 2048x1536 #(4:3)
## 1440x1080 #(4:3)
## 2560x2048 #(5:4)
## 1920x1080 #(16:9)
## 3840x2160 #(16:9)
## 3440x1440 #(21:9)
## 1440x900 #(16:10)
## 2560x1600 #(16:10)
## 1024x768 #1.33 (4:3)
## 2048x1536 #1.33 (4:3)
## 1440x1080 #1.33 (4:3)
## 2560x2048 #1.25 (5:4)
## 1920x1080 #1.77 (16:9)
## 3840x2160 #1.77 (16:9)
## 3440x1440 #2.38 (21:9)
## 1440x900 #1.60 (16:10)
## 2560x1600 #1.60 (16:10)
## 2560x1440 #1.77 (19:10) 2K QHD 1440p
## 3840x2160 #1.77 (16:9) 4K UHD 2160p
## 3840x1600 #2.40 (12:5) 4K UHD 1600p
## 4096x2160 #1.89 (256:135) 4K UHD 2160p
## 4096x1416 #2.89 (1024:429) 4K UHD 1416p
## 3996x2160 #1.85 (999:540) 4K UHD 2160p
## 5120x2160 #2.37 (:) 5K UHD 2160p
## 7680x4320 #1.77(16:9 17:9 21:9) 8K UHD 4320p
## 10240x4320 #2.37 (21:9) 10K 4320p
## VERSION_CODENAME:
## ublinux_db
## ublinux_de
@ -266,7 +276,6 @@ insert_background_icon(){
# echo "${RESOLUTION}"
mkdir -p ${wallpapers_tmp}
# [[ -L ${wallpapers_dst} ]] || mkdir -p ${wallpapers_dst}
if [[ ! -e ${wallpapers_dst} ]]; then
mkdir -p $(readlink ${wallpapers_dst}) || mkdir -p ${wallpapers_dst}
@ -278,6 +287,7 @@ insert_background_icon(){
[[ -z $1 ]] || RESOLUTION=$1
[[ -z "${RESOLUTION}" ]] && get_max_resolution
[[ -z "${RESOLUTION}" ]] && echo "ERROR: resolution not detect" && exit 1
# Определение редакции ОС
[[ -z $2 ]] && edition_os=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d"=" -f2 2>/dev/null) || edition_os=$2
@ -297,11 +307,21 @@ insert_background_icon(){
fname_ratio="16:10"
elif [ $(bc -l <<< "${ratio}==2.38") -eq 1 ]; then
fname_ratio="21:9"
elif [ $(bc -l <<< "${ratio}==2.37") -eq 1 ]; then
fname_ratio="21:9"
elif [ $(bc -l <<< "${ratio}==2.40") -eq 1 ]; then
fname_ratio="12:5"
elif [ $(bc -l <<< "${ratio}==1.89") -eq 1 ]; then
fname_ratio="256:135"
elif [ $(bc -l <<< "${ratio}==2.89") -eq 1 ]; then
fname_ratio="1024:429"
elif [ $(bc -l <<< "${ratio}==1.85") -eq 1 ]; then
fname_ratio="999:540"
else
exit 0
fname_ratio="unknown"
fi
#echo "==> ${width}x${hight} :: ${ratio} :: $fname_ratio" && exit 1
#echo "==> ${width}x${hight} :: ${ratio} :: ${fname_ratio}" && exit 1
# Установка значений переменных для графических ресурсов, исходя из типа редакции ОС
geometry_logo_wp=+69-52
@ -401,6 +421,11 @@ insert_background_icon(){
convert -resize x${hight} ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
done
;;
*) # Изменить размер пропорционально
for filename in ${wp_de_filename} ${wp_dm_filename}; do
convert -resize x${hight} ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
done
;;
esac
build_background_dm
[[ -z ${BUILD_MANUAL} ]] && mv ${wallpapers_tmp}/${wp_de_filename} ${wallpapers_dst}/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg || mv ${wallpapers_tmp}/${wp_de_filename} ${wallpapers_tmp}/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg

Loading…
Cancel
Save