|
|
|
@ -1,5 +1,5 @@
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## ./script ${RESOLUTION} ${VERSION_CODENAME} ${STATE_MODE}
|
|
|
|
## ./script ${RESOLUTION} ${VERSION_CODENAME} ${STATE_MODE}
|
|
|
|
## RESOLUTION:
|
|
|
|
## RESOLUTION:
|
|
|
|
## 1024x768 #(4:3)
|
|
|
|
## 1024x768 #(4:3)
|
|
|
|
@ -30,7 +30,7 @@
|
|
|
|
## "/" # Песочница с сохранением профиля пользователя ub.mode= ; ub.home=/ublinux-data/homes
|
|
|
|
## "/" # Песочница с сохранением профиля пользователя ub.mode= ; ub.home=/ublinux-data/homes
|
|
|
|
## "" # Полная песочница RAM ub.mode= (clean); ub.home=
|
|
|
|
## "" # Полная песочница RAM ub.mode= (clean); ub.home=
|
|
|
|
## "" # Полная песочница HDD ub.mode=clear; ub.home=
|
|
|
|
## "" # Полная песочница HDD ub.mode=clear; ub.home=
|
|
|
|
##
|
|
|
|
## При запуске в ручную, получим изображения в каталоге: /tmp/ublinux_bg
|
|
|
|
|
|
|
|
|
|
|
|
ENABLED=yes
|
|
|
|
ENABLED=yes
|
|
|
|
[ "$ENABLED" != "yes" ] && exit 0
|
|
|
|
[ "$ENABLED" != "yes" ] && exit 0
|
|
|
|
@ -42,12 +42,13 @@ debug_mode "$0" "$@"
|
|
|
|
|
|
|
|
|
|
|
|
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
|
|
|
|
SOURCE=${SYSCONF}/theme; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
SOURCE=${SYSCONF}/video; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
SOURCE=${SYSCONF}/video; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
|
|
|
|
|
|
|
|
[[ ${DISPLAYMANAGER} == "none" ]] && exit
|
|
|
|
[[ ${DISPLAYMANAGER} == "none" ]] && exit
|
|
|
|
|
|
|
|
|
|
|
|
ROOTDIR= #`pwd`
|
|
|
|
ROOTDIR= #`pwd`
|
|
|
|
[[ -n $1 ]] && [[ -n $2 ]] && build_manual=yes
|
|
|
|
[[ -n $1 ]] && [[ -n $2 ]] && BUILD_MANUAL=yes
|
|
|
|
source_img_dir=${ROOTDIR}/usr/share/ublinux/backgrounds/source #Каталог с исходниками изображений
|
|
|
|
source_img_dir=${ROOTDIR}/usr/share/ublinux/backgrounds/source #Каталог с исходниками изображений
|
|
|
|
wallpapers_tmp=${ROOTDIR}/tmp/ublinux_bg #Каталог скомпиллированных изображений
|
|
|
|
wallpapers_tmp=${ROOTDIR}/tmp/ublinux_bg #Каталог скомпиллированных изображений
|
|
|
|
wallpapers_dst=${ROOTDIR}/usr/share/backgrounds/ublinux #Каталог скомпиллированных изображений
|
|
|
|
wallpapers_dst=${ROOTDIR}/usr/share/backgrounds/ublinux #Каталог скомпиллированных изображений
|
|
|
|
@ -144,113 +145,113 @@ get_max_resolution() {
|
|
|
|
RESOLUTION=$(XAUTHORITY=${PATH_XAUTHORITY} xrandr -d $(ls /tmp/.X11-unix | tr 'X' ':' | head -n 1) 2>/dev/null | grep "*" | xargs | cut -d" " -f1)
|
|
|
|
RESOLUTION=$(XAUTHORITY=${PATH_XAUTHORITY} xrandr -d $(ls /tmp/.X11-unix | tr 'X' ':' | head -n 1) 2>/dev/null | grep "*" | xargs | cut -d" " -f1)
|
|
|
|
# $(xrandr -d :0 --current | sed -n 's/.* connected \([0-9]*\)x\([0-9]*\)+.*/\1x\2/p')
|
|
|
|
# $(xrandr -d :0 --current | sed -n 's/.* connected \([0-9]*\)x\([0-9]*\)+.*/\1x\2/p')
|
|
|
|
# Если не обнаружено ни одно разрешение, то статическое
|
|
|
|
# Если не обнаружено ни одно разрешение, то статическое
|
|
|
|
[[ -z ${RESOLUTION} ]] && RESOLUTION=${WALLPAPERSRES}
|
|
|
|
[[ -z ${RESOLUTION} ]] && RESOLUTION=${BACKGROUND_RES}
|
|
|
|
[[ -z ${RESOLUTION} ]] && RESOLUTION="1920x1080"
|
|
|
|
[[ -z ${RESOLUTION} ]] && RESOLUTION="1920x1080"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_logo_ublinux_all(){
|
|
|
|
build_logo_ublinux_all(){
|
|
|
|
# Склейка логотипа UBLinux со свечением
|
|
|
|
# Склейка логотипа UBLinux со свечением
|
|
|
|
[[ -n ${logo_light} ]] && convert $source_img_dir/$logo_light $source_img_dir/$logo_img -gravity center -background none +smush -710 $wallpapers_tmp/tmp_$logo_clue_img \
|
|
|
|
[[ -n ${logo_light} ]] && convert ${source_img_dir}/$logo_light ${source_img_dir}/$logo_img -gravity center -background none +smush -710 ${wallpapers_tmp}/tmp_$logo_clue_img \
|
|
|
|
|| cp $source_img_dir/$logo_img $wallpapers_tmp/tmp_$logo_clue_img
|
|
|
|
|| cp ${source_img_dir}/$logo_img ${wallpapers_tmp}/tmp_$logo_clue_img
|
|
|
|
# Конвеер вставки логотипа редакции ОС
|
|
|
|
# Конвеер вставки логотипа редакции ОС
|
|
|
|
[[ -n ${edition_img} ]] && composite -geometry $geometry_edition_wp -gravity east $source_img_dir/$edition_img $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/tmp_$logo_clue_img
|
|
|
|
[[ -n ${edition_img} ]] && composite -geometry $geometry_edition_wp -gravity east ${source_img_dir}/$edition_img ${wallpapers_tmp}/tmp_$logo_clue_img ${wallpapers_tmp}/tmp_$logo_clue_img
|
|
|
|
|
|
|
|
|
|
|
|
# Конвеер вставки логотипа суббренда
|
|
|
|
# Конвеер вставки логотипа суббренда
|
|
|
|
if [ ${geometry_adara_wp} ]; then
|
|
|
|
if [ ${geometry_adara_wp} ]; then
|
|
|
|
img_logo_width=$(identify $wallpapers_tmp/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f1)
|
|
|
|
img_logo_width=$(identify ${wallpapers_tmp}/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f1)
|
|
|
|
img_adara_width=$(identify $source_img_dir/$logo_adara | cut -d" " -f3 | cut -d"x" -f1)
|
|
|
|
img_adara_width=$(identify ${source_img_dir}/$logo_adara | cut -d" " -f3 | cut -d"x" -f1)
|
|
|
|
let img_logo_width=($img_logo_width+$img_adara_width)
|
|
|
|
let img_logo_width=($img_logo_width+$img_adara_width)
|
|
|
|
convert $wallpapers_tmp/tmp_$logo_clue_img -gravity west -background none -extent $img_logo_width'x' $wallpapers_tmp/tmp_$logo_clue_img
|
|
|
|
convert ${wallpapers_tmp}/tmp_$logo_clue_img -gravity west -background none -extent $img_logo_width'x' ${wallpapers_tmp}/tmp_$logo_clue_img
|
|
|
|
composite -geometry $geometry_adara_wp -gravity east $source_img_dir/$logo_adara $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/tmp_$logo_clue_img
|
|
|
|
composite -geometry $geometry_adara_wp -gravity east ${source_img_dir}/$logo_adara ${wallpapers_tmp}/tmp_$logo_clue_img ${wallpapers_tmp}/tmp_$logo_clue_img
|
|
|
|
elif [ ${geometry_sibsutis_wp} ]; then
|
|
|
|
elif [ ${geometry_sibsutis_wp} ]; then
|
|
|
|
img_logo_width=$(identify $wallpapers_tmp/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f1)
|
|
|
|
img_logo_width=$(identify ${wallpapers_tmp}/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f1)
|
|
|
|
convert $wallpapers_tmp/tmp_$logo_clue_img -gravity west -background none -extent $img_logo_width'x' $wallpapers_tmp/tmp_$logo_clue_img
|
|
|
|
convert ${wallpapers_tmp}/tmp_$logo_clue_img -gravity west -background none -extent $img_logo_width'x' ${wallpapers_tmp}/tmp_$logo_clue_img
|
|
|
|
composite -geometry $geometry_sibsutis_wp -gravity north $source_img_dir/$logo_sibsutis $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/tmp_$logo_clue_img
|
|
|
|
composite -geometry $geometry_sibsutis_wp -gravity north ${source_img_dir}/$logo_sibsutis ${wallpapers_tmp}/tmp_$logo_clue_img ${wallpapers_tmp}/tmp_$logo_clue_img
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_background_all(){
|
|
|
|
build_background_all(){
|
|
|
|
# Наложение градиентного затемнения DE
|
|
|
|
# Наложение градиентного затемнения DE
|
|
|
|
convert -composite $background $source_img_dir/$shadow_img $wallpapers_tmp/$wp_de_filename
|
|
|
|
convert -composite $background ${source_img_dir}/$shadow_img ${wallpapers_tmp}/${wp_de_filename}
|
|
|
|
# Наложение градиентного затемнения DM
|
|
|
|
# Наложение градиентного затемнения DM
|
|
|
|
cp $wallpapers_tmp/$wp_de_filename $wallpapers_tmp/$wp_dm_filename
|
|
|
|
cp ${wallpapers_tmp}/${wp_de_filename} ${wallpapers_tmp}/${wp_dm_filename}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_background_de(){
|
|
|
|
build_background_de(){
|
|
|
|
# Наложение сетки шестигранников DE
|
|
|
|
# Наложение сетки шестигранников DE
|
|
|
|
convert -composite $wallpapers_tmp/$wp_de_filename $source_img_dir/$hex_img $wallpapers_tmp/$wp_de_filename
|
|
|
|
convert -composite ${wallpapers_tmp}/${wp_de_filename} ${source_img_dir}/$hex_img ${wallpapers_tmp}/${wp_de_filename}
|
|
|
|
# Конвеер вставки объединенного логотипа на фон DE
|
|
|
|
# Конвеер вставки объединенного логотипа на фон DE
|
|
|
|
composite -geometry $geometry_logo_wp -gravity west $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/$wp_de_filename $wallpapers_tmp/$wp_de_filename
|
|
|
|
composite -geometry $geometry_logo_wp -gravity west ${wallpapers_tmp}/tmp_$logo_clue_img ${wallpapers_tmp}/${wp_de_filename} ${wallpapers_tmp}/${wp_de_filename}
|
|
|
|
# Затенения обоев рабочего стола
|
|
|
|
# Затенения обоев рабочего стола
|
|
|
|
convert $wallpapers_tmp/$wp_de_filename -level 0,$shadow_level% $wallpapers_tmp/$wp_de_filename
|
|
|
|
convert ${wallpapers_tmp}/${wp_de_filename} -level 0,$shadow_level% ${wallpapers_tmp}/${wp_de_filename}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_background_dm(){
|
|
|
|
build_background_dm(){
|
|
|
|
# Вычисление коэффициента скейлинга
|
|
|
|
# Вычисление коэффициента скейлинга
|
|
|
|
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
ratio_scale=$(echo "scale=2;$img_hight/$hight" | bc)
|
|
|
|
ratio_scale=$(echo "scale=2;$img_hight/${hight}" | bc)
|
|
|
|
# echo RS=$ratio_scale
|
|
|
|
# echo RS=${ratio_scale}
|
|
|
|
tmp_logo_clue_hight=$(identify $wallpapers_tmp/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
tmp_logo_clue_hight=$(identify ${wallpapers_tmp}/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
nsize_logo_clue_hight=$(echo "scale=0;$tmp_logo_clue_hight/$ratio_scale" | bc)
|
|
|
|
nsize_logo_clue_hight=$(echo "scale=0;$tmp_logo_clue_hight/${ratio_scale}" | bc)
|
|
|
|
# echo RSCF Logo=$nsize_logo_clue_hight
|
|
|
|
# echo RSCF Logo=$nsize_logo_clue_hight
|
|
|
|
convert $wallpapers_tmp/tmp_$logo_clue_img -resize x$nsize_logo_clue_hight $wallpapers_tmp/tmp_dm_$logo_clue_img
|
|
|
|
convert ${wallpapers_tmp}/tmp_$logo_clue_img -resize x$nsize_logo_clue_hight ${wallpapers_tmp}/tmp_dm_$logo_clue_img
|
|
|
|
convert $wallpapers_tmp/tmp_dm_$logo_clue_img -resize 35% $wallpapers_tmp/tmp_dm_$logo_clue_img
|
|
|
|
convert ${wallpapers_tmp}/tmp_dm_$logo_clue_img -resize 35% ${wallpapers_tmp}/tmp_dm_$logo_clue_img
|
|
|
|
x_shift=$(echo "scale=0;150/$ratio_scale" | bc)
|
|
|
|
x_shift=$(echo "scale=0;150/${ratio_scale}" | bc)
|
|
|
|
y_shift=$(echo "scale=0;170/$ratio_scale" | bc)
|
|
|
|
y_shift=$(echo "scale=0;170/${ratio_scale}" | bc)
|
|
|
|
# echo "LOGO $x_shift on $y_shift px"
|
|
|
|
# echo "LOGO $x_shift on $y_shift px"
|
|
|
|
# Конвеер вставки объединенного уменьшенного логотипа на фон DM
|
|
|
|
# Конвеер вставки объединенного уменьшенного логотипа на фон DM
|
|
|
|
composite -geometry +$x_shift+$y_shift $wallpapers_tmp/tmp_dm_$logo_clue_img $wallpapers_tmp/$wp_dm_filename $wallpapers_tmp/$wp_dm_filename
|
|
|
|
composite -geometry +$x_shift+$y_shift ${wallpapers_tmp}/tmp_dm_$logo_clue_img ${wallpapers_tmp}/${wp_dm_filename} ${wallpapers_tmp}/${wp_dm_filename}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
insert_background_dm_txtpass(){
|
|
|
|
insert_background_dm_txtpass(){
|
|
|
|
# Вычисление коэффициента скейлинга
|
|
|
|
# Вычисление коэффициента скейлинга
|
|
|
|
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
ratio_scale=$(echo "scale=2;$img_hight/$hight" | bc)
|
|
|
|
ratio_scale=$(echo "scale=2;$img_hight/${hight}" | bc)
|
|
|
|
tmp_passwd_text_hight=$(identify $source_img_dir/$passwd_block_img | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
tmp_passwd_text_hight=$(identify ${source_img_dir}/$passwd_block_img | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
nsize_passwd_text_hight=$(echo "scale=0;$tmp_passwd_text_hight/$ratio_scale" | bc)
|
|
|
|
nsize_passwd_text_hight=$(echo "scale=0;$tmp_passwd_text_hight/${ratio_scale}" | bc)
|
|
|
|
x_shift_text=$(echo "scale=0;0/$ratio_scale" | bc)
|
|
|
|
x_shift_text=$(echo "scale=0;0/${ratio_scale}" | bc)
|
|
|
|
y_shift_text=$(echo "scale=0;370/$ratio_scale" | bc)
|
|
|
|
y_shift_text=$(echo "scale=0;370/${ratio_scale}" | bc)
|
|
|
|
# echo "TXT $x_shift_text on $y_shift_text px"
|
|
|
|
# echo "TXT $x_shift_text on $y_shift_text px"
|
|
|
|
# echo RSCF first=$nsize_passwd_text_hight
|
|
|
|
# echo RSCF first=$nsize_passwd_text_hight
|
|
|
|
convert $source_img_dir/$passwd_block_img -resize x$nsize_passwd_text_hight -colorspace RGB $wallpapers_tmp/tmp_$passwd_block_img
|
|
|
|
convert ${source_img_dir}/$passwd_block_img -resize x$nsize_passwd_text_hight -colorspace RGB ${wallpapers_tmp}/tmp_$passwd_block_img
|
|
|
|
composite -geometry +$x_shift_text+$y_shift_text -gravity NorthEast $wallpapers_tmp/tmp_$passwd_block_img $default_dm_img $default_dm_img
|
|
|
|
composite -geometry +$x_shift_text+$y_shift_text -gravity NorthEast ${wallpapers_tmp}/tmp_$passwd_block_img $default_dm_img $default_dm_img
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# $1 Файл иконки для вставки
|
|
|
|
# $1 Файл иконки для вставки
|
|
|
|
insert_background_icon(){
|
|
|
|
insert_background_icon(){
|
|
|
|
# Вычисление коэффициента скейлинга
|
|
|
|
# Вычисление коэффициента скейлинга
|
|
|
|
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
ratio_scale=$(echo "scale=2;$img_hight/$hight" | bc)
|
|
|
|
ratio_scale=$(echo "scale=2;$img_hight/${hight}" | bc)
|
|
|
|
# DM
|
|
|
|
# DM
|
|
|
|
# bg icon
|
|
|
|
# bg icon
|
|
|
|
tmp_state_icon_bg_hight=$(identify $source_img_dir/$img_state_bg_dm | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
tmp_state_icon_bg_hight=$(identify ${source_img_dir}/$img_state_bg_dm | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
nsize_state_icon_bg_hight=$(echo "scale=0;$tmp_state_icon_bg_hight/$ratio_scale" | bc)
|
|
|
|
nsize_state_icon_bg_hight=$(echo "scale=0;$tmp_state_icon_bg_hight/${ratio_scale}" | bc)
|
|
|
|
x_shift_img_bg=$(echo "scale=0;-160/$ratio_scale" | bc)
|
|
|
|
x_shift_img_bg=$(echo "scale=0;-160/${ratio_scale}" | bc)
|
|
|
|
y_shift_img_bg=$(echo "scale=0;170/$ratio_scale" | bc)
|
|
|
|
y_shift_img_bg=$(echo "scale=0;170/${ratio_scale}" | bc)
|
|
|
|
convert $source_img_dir/$img_state_bg_dm -resize x$nsize_state_icon_bg_hight -colorspace RGB $wallpapers_tmp/tmp_$img_state_bg_dm
|
|
|
|
convert ${source_img_dir}/$img_state_bg_dm -resize x$nsize_state_icon_bg_hight -colorspace RGB ${wallpapers_tmp}/tmp_$img_state_bg_dm
|
|
|
|
composite -geometry +$x_shift_img_bg+$y_shift_img_bg -gravity NorthEast $wallpapers_tmp/tmp_$img_state_bg_dm $default_dm_img $default_dm_img
|
|
|
|
composite -geometry +$x_shift_img_bg+$y_shift_img_bg -gravity NorthEast ${wallpapers_tmp}/tmp_$img_state_bg_dm $default_dm_img $default_dm_img
|
|
|
|
# icon
|
|
|
|
# icon
|
|
|
|
tmp_state_icon_hight=$(identify $source_img_dir/$1 | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
tmp_state_icon_hight=$(identify ${source_img_dir}/$1 | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
nsize_state_icon_hight=$(echo "scale=0;$tmp_state_icon_hight/($ratio_scale*1.5)" | bc)
|
|
|
|
nsize_state_icon_hight=$(echo "scale=0;$tmp_state_icon_hight/(${ratio_scale}*1.5)" | bc)
|
|
|
|
x_shift_img=$(echo "scale=0;120/$ratio_scale" | bc)
|
|
|
|
x_shift_img=$(echo "scale=0;120/${ratio_scale}" | bc)
|
|
|
|
y_shift_img=$(echo "scale=0;168/$ratio_scale" | bc)
|
|
|
|
y_shift_img=$(echo "scale=0;168/${ratio_scale}" | bc)
|
|
|
|
convert $source_img_dir/$1 -resize x$nsize_state_icon_hight -colorspace sRGB $wallpapers_tmp/tmp_state.png
|
|
|
|
convert ${source_img_dir}/$1 -resize x$nsize_state_icon_hight -colorspace sRGB ${wallpapers_tmp}/tmp_state.png
|
|
|
|
composite -geometry +$x_shift_img+$y_shift_img -gravity NorthEast $wallpapers_tmp/tmp_state.png $default_dm_img $default_dm_img
|
|
|
|
composite -geometry +$x_shift_img+$y_shift_img -gravity NorthEast ${wallpapers_tmp}/tmp_state.png $default_dm_img $default_dm_img
|
|
|
|
# DE
|
|
|
|
# DE
|
|
|
|
# bg icon
|
|
|
|
# bg icon
|
|
|
|
tmp_state_icon_bg_hight=$(identify $source_img_dir/$img_state_bg_de | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
tmp_state_icon_bg_hight=$(identify ${source_img_dir}/$img_state_bg_de | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
nsize_state_icon_bg_hight=$(echo "scale=0;$tmp_state_icon_bg_hight/$ratio_scale" | bc)
|
|
|
|
nsize_state_icon_bg_hight=$(echo "scale=0;$tmp_state_icon_bg_hight/${ratio_scale}" | bc)
|
|
|
|
x_shift_img_bg=$(echo "scale=0;1785/$ratio_scale" | bc)
|
|
|
|
x_shift_img_bg=$(echo "scale=0;1785/${ratio_scale}" | bc)
|
|
|
|
y_shift_img_bg=$(echo "scale=0;0/$ratio_scale" | bc)
|
|
|
|
y_shift_img_bg=$(echo "scale=0;0/${ratio_scale}" | bc)
|
|
|
|
convert $source_img_dir/$img_state_bg_de -resize x$nsize_state_icon_bg_hight -colorspace RGB $wallpapers_tmp/tmp_$img_state_bg_de
|
|
|
|
convert ${source_img_dir}/$img_state_bg_de -resize x$nsize_state_icon_bg_hight -colorspace RGB ${wallpapers_tmp}/tmp_$img_state_bg_de
|
|
|
|
composite -geometry +$x_shift_img_bg+$y_shift_img_bg -gravity NorthWest $wallpapers_tmp/tmp_$img_state_bg_de $default_de_img $default_de_img
|
|
|
|
composite -geometry +$x_shift_img_bg+$y_shift_img_bg -gravity NorthWest ${wallpapers_tmp}/tmp_$img_state_bg_de $default_de_img $default_de_img
|
|
|
|
# icon
|
|
|
|
# icon
|
|
|
|
tmp_state_icon_hight=$(identify $source_img_dir/$1 | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
tmp_state_icon_hight=$(identify ${source_img_dir}/$1 | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
nsize_state_icon_hight=$(echo "scale=0;$tmp_state_icon_hight/($ratio_scale*1.5)" | bc)
|
|
|
|
nsize_state_icon_hight=$(echo "scale=0;$tmp_state_icon_hight/(${ratio_scale}*1.5)" | bc)
|
|
|
|
x_shift_img=$(echo "scale=0;1940/$ratio_scale" | bc)
|
|
|
|
x_shift_img=$(echo "scale=0;1940/${ratio_scale}" | bc)
|
|
|
|
y_shift_img=$(echo "scale=0;50/$ratio_scale" | bc)
|
|
|
|
y_shift_img=$(echo "scale=0;50/${ratio_scale}" | bc)
|
|
|
|
convert $source_img_dir/$1 -resize x$nsize_state_icon_hight -colorspace sRGB $wallpapers_tmp/tmp_state.png
|
|
|
|
convert ${source_img_dir}/$1 -resize x$nsize_state_icon_hight -colorspace sRGB ${wallpapers_tmp}/tmp_state.png
|
|
|
|
composite -geometry +$x_shift_img+$y_shift_img -gravity NorthWest $wallpapers_tmp/tmp_state.png $default_de_img $default_de_img
|
|
|
|
composite -geometry +$x_shift_img+$y_shift_img -gravity NorthWest ${wallpapers_tmp}/tmp_state.png $default_de_img $default_de_img
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Test get resolution || Проверить массив мониторов с разрешениями
|
|
|
|
# Test get resolution || Проверить массив мониторов с разрешениями
|
|
|
|
@ -282,94 +283,94 @@ insert_background_icon(){
|
|
|
|
|
|
|
|
|
|
|
|
# Вычисление соотношения сторон экрана
|
|
|
|
# Вычисление соотношения сторон экрана
|
|
|
|
ratio=$(bc <<< "scale=2;${width}/${hight}")
|
|
|
|
ratio=$(bc <<< "scale=2;${width}/${hight}")
|
|
|
|
if [ $(bc -l <<< "$ratio==1.33") -eq 1 ]; then
|
|
|
|
if [ $(bc -l <<< "${ratio}==1.33") -eq 1 ]; then
|
|
|
|
fname_ratio="4:3"
|
|
|
|
fname_ratio="4:3"
|
|
|
|
elif [ $(bc -l <<< "$ratio==1.25") -eq 1 ]; then
|
|
|
|
elif [ $(bc -l <<< "${ratio}==1.25") -eq 1 ]; then
|
|
|
|
fname_ratio="5:4"
|
|
|
|
fname_ratio="5:4"
|
|
|
|
elif [ $(bc -l <<< "$ratio==1.77") -eq 1 ]; then
|
|
|
|
elif [ $(bc -l <<< "${ratio}==1.77") -eq 1 ]; then
|
|
|
|
fname_ratio="16:9"
|
|
|
|
fname_ratio="16:9"
|
|
|
|
elif [ $(bc -l <<< "$ratio==1.6") -eq 1 ]; then
|
|
|
|
elif [ $(bc -l <<< "${ratio}==1.6") -eq 1 ]; then
|
|
|
|
fname_ratio="16:10"
|
|
|
|
fname_ratio="16:10"
|
|
|
|
elif [ $(bc -l <<< "$ratio==2.38") -eq 1 ]; then
|
|
|
|
elif [ $(bc -l <<< "${ratio}==2.38") -eq 1 ]; then
|
|
|
|
fname_ratio="21:9"
|
|
|
|
fname_ratio="21:9"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#echo "==> ${width}x${hight} :: $ratio :: $fname_ratio" && exit 1
|
|
|
|
#echo "==> ${width}x${hight} :: ${ratio} :: $fname_ratio" && exit 1
|
|
|
|
|
|
|
|
|
|
|
|
# Установка значений переменных для графических ресурсов, исходя из типа редакции ОС
|
|
|
|
# Установка значений переменных для графических ресурсов, исходя из типа редакции ОС
|
|
|
|
geometry_logo_wp=+69-52
|
|
|
|
geometry_logo_wp=+69-52
|
|
|
|
case "$edition_os" in
|
|
|
|
case "${edition_os}" in
|
|
|
|
ublinux_db)
|
|
|
|
ublinux_db)
|
|
|
|
background=$source_img_dir/$bg_desktop_basic
|
|
|
|
background=${source_img_dir}/$bg_desktop_basic
|
|
|
|
edition_img=$logo_desktop_basic
|
|
|
|
edition_img=${logo_desktop_basic}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_de)
|
|
|
|
ublinux_de)
|
|
|
|
background=$source_img_dir/$bg_desktop_enterprise
|
|
|
|
background=${source_img_dir}/$bg_desktop_enterprise
|
|
|
|
edition_img=$logo_desktop_enterprise
|
|
|
|
edition_img=${logo_desktop_enterprise}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_edu)
|
|
|
|
ublinux_edu)
|
|
|
|
background=$source_img_dir/$bg_education
|
|
|
|
background=${source_img_dir}/$bg_education
|
|
|
|
edition_img=$logo_education
|
|
|
|
edition_img=${logo_education}
|
|
|
|
geometry_edition_wp=+70+256
|
|
|
|
geometry_edition_wp=+70+256
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_srv)
|
|
|
|
ublinux_srv)
|
|
|
|
background=$source_img_dir/$bg_server
|
|
|
|
background=${source_img_dir}/${bg_server}
|
|
|
|
edition_img=$logo_server
|
|
|
|
edition_img=${logo_server}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_exp)
|
|
|
|
ublinux_exp)
|
|
|
|
background=$source_img_dir/$bg_exp
|
|
|
|
background=${source_img_dir}/$bg_exp
|
|
|
|
edition_img=$logo_expert
|
|
|
|
edition_img=${logo_expert}
|
|
|
|
geometry_edition_wp=+72+256
|
|
|
|
geometry_edition_wp=+72+256
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_de_adara)
|
|
|
|
ublinux_de_adara)
|
|
|
|
background=$source_img_dir/$bg_desktop_enterprise
|
|
|
|
background=${source_img_dir}/$bg_desktop_enterprise
|
|
|
|
edition_img=$logo_desktop_enterprise
|
|
|
|
edition_img=${logo_desktop_enterprise}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_adara_wp=+130+42
|
|
|
|
geometry_adara_wp=+130+42
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_srv_adara)
|
|
|
|
ublinux_srv_adara)
|
|
|
|
background=$source_img_dir/$bg_server
|
|
|
|
background=${source_img_dir}/${bg_server}
|
|
|
|
edition_img=$logo_server
|
|
|
|
edition_img=${logo_server}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_adara_wp=+130+42
|
|
|
|
geometry_adara_wp=+130+42
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_de_sibsutis)
|
|
|
|
ublinux_de_sibsutis)
|
|
|
|
background=$source_img_dir/$bg_desktop_enterprise
|
|
|
|
background=${source_img_dir}/$bg_desktop_enterprise
|
|
|
|
edition_img=$logo_desktop_enterprise
|
|
|
|
edition_img=${logo_desktop_enterprise}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_sibsutis_wp=+470+166
|
|
|
|
geometry_sibsutis_wp=+470+166
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_edu_sibsutis)
|
|
|
|
ublinux_edu_sibsutis)
|
|
|
|
background=$source_img_dir/$bg_education
|
|
|
|
background=${source_img_dir}/$bg_education
|
|
|
|
edition_img=$logo_education
|
|
|
|
edition_img=${logo_education}
|
|
|
|
geometry_edition_wp=+70+256
|
|
|
|
geometry_edition_wp=+70+256
|
|
|
|
geometry_sibsutis_wp=+470+166
|
|
|
|
geometry_sibsutis_wp=+470+166
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_srv_sibsutis)
|
|
|
|
ublinux_srv_sibsutis)
|
|
|
|
background=$source_img_dir/$bg_server
|
|
|
|
background=${source_img_dir}/${bg_server}
|
|
|
|
edition_img=$logo_server
|
|
|
|
edition_img=${logo_server}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_sibsutis_wp=+470+166
|
|
|
|
geometry_sibsutis_wp=+470+166
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_liveoffice)
|
|
|
|
ublinux_liveoffice)
|
|
|
|
background=$source_img_dir/$bg_desktop_enterprise
|
|
|
|
background=${source_img_dir}/$bg_desktop_enterprise
|
|
|
|
logo_img=$logo_liveoffice
|
|
|
|
logo_img=${logo_liveoffice}
|
|
|
|
geometry_logo_wp=+260-130
|
|
|
|
geometry_logo_wp=+260-130
|
|
|
|
unset logo_light
|
|
|
|
unset logo_light
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
ublinux_unknown | *)
|
|
|
|
ublinux_unknown | *)
|
|
|
|
background=$source_img_dir/$bg_desktop_basic
|
|
|
|
background=${source_img_dir}/$bg_desktop_basic
|
|
|
|
edition_img=$logo_desktop_basic
|
|
|
|
edition_img=${logo_desktop_basic}
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
geometry_edition_wp=+86+256
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
CHECK_BOOT_FILE=$(find $wallpapers_dst/ -name "${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg" | wc -l)
|
|
|
|
CHECK_BOOT_FILE=$(find ${wallpapers_dst}/ -name "${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg" | wc -l)
|
|
|
|
CHECK_BACKGROUND_FILE=$(find $wallpapers_dst/ -name "${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg" | wc -l)
|
|
|
|
CHECK_BACKGROUND_FILE=$(find ${wallpapers_dst}/ -name "${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg" | wc -l)
|
|
|
|
if [[ ${CHECK_BOOT_FILE} -eq 0 ]] || [[ ${CHECK_BACKGROUND_FILE} -eq 0 ]]; then
|
|
|
|
if [[ ${CHECK_BOOT_FILE} -eq 0 ]] || [[ ${CHECK_BACKGROUND_FILE} -eq 0 ]]; then
|
|
|
|
[[ ! -x /usr/bin/composite ]] && [[ ! -x /usr/bin/convert ]] && echo "Error: not fount /usr/bin/composite or /usr/bin/convert" && exit 0
|
|
|
|
[[ ! -x /usr/bin/composite ]] && [[ ! -x /usr/bin/convert ]] && echo "Error: not fount /usr/bin/composite or /usr/bin/convert" && exit 0
|
|
|
|
build_logo_ublinux_all
|
|
|
|
build_logo_ublinux_all
|
|
|
|
@ -378,52 +379,52 @@ insert_background_icon(){
|
|
|
|
# Изменение разрешения фонов DM DE
|
|
|
|
# Изменение разрешения фонов DM DE
|
|
|
|
case ${fname_ratio} in
|
|
|
|
case ${fname_ratio} in
|
|
|
|
"4:3" | "5:4" | "16:10" ) # Изменить размер по высоте (hight)
|
|
|
|
"4:3" | "5:4" | "16:10" ) # Изменить размер по высоте (hight)
|
|
|
|
for filename in $wp_de_filename $wp_dm_filename; do
|
|
|
|
for filename in ${wp_de_filename} ${wp_dm_filename}; do
|
|
|
|
convert -resize x$hight $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
|
|
|
|
convert -resize x${hight} ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
|
|
|
|
convert -crop $width\x+0+0 $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
|
|
|
|
convert -crop ${width}\x+0+0 ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
|
|
|
|
done
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
"21:9") # Изменить размер по ширине (width)
|
|
|
|
"21:9") # Изменить размер по ширине (width)
|
|
|
|
for filename in $wp_de_filename $wp_dm_filename; do
|
|
|
|
for filename in ${wp_de_filename} ${wp_dm_filename}; do
|
|
|
|
convert -resize $width $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
|
|
|
|
convert -resize ${width} ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
|
|
|
|
out_img_hight=$(identify $wallpapers_tmp/${filename} | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
out_img_hight=$(identify ${wallpapers_tmp}/${filename} | cut -d" " -f3 | cut -d"x" -f2)
|
|
|
|
let crop_top=($out_img_hight-$hight)/2
|
|
|
|
let crop_top=($out_img_hight-${hight})/2
|
|
|
|
convert -crop x$hight+0+$crop_top $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
|
|
|
|
convert -crop x${hight}+0+$crop_top ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
|
|
|
|
done
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
"16:9") # Изменить размер пропорционально
|
|
|
|
"16:9") # Изменить размер пропорционально
|
|
|
|
for filename in $wp_de_filename $wp_dm_filename; do
|
|
|
|
for filename in ${wp_de_filename} ${wp_dm_filename}; do
|
|
|
|
convert -resize x$hight $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
|
|
|
|
convert -resize x${hight} ${wallpapers_tmp}/${filename} ${wallpapers_tmp}/${filename}
|
|
|
|
done
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
build_background_dm
|
|
|
|
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
|
|
|
|
[[ -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
|
|
|
|
[[ ${build_manual} ]] && mogrify -format png -write $wallpapers_tmp/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.png $wallpapers_tmp/$wp_dm_filename
|
|
|
|
[[ ${BUILD_MANUAL} ]] && mogrify -format png -write ${wallpapers_tmp}/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.png ${wallpapers_tmp}/${wp_dm_filename}
|
|
|
|
[[ -z ${build_manual} ]] && mv $wallpapers_tmp/$wp_dm_filename $wallpapers_dst/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg || mv $wallpapers_tmp/$wp_dm_filename $wallpapers_tmp/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg
|
|
|
|
[[ -z ${BUILD_MANUAL} ]] && mv ${wallpapers_tmp}/${wp_dm_filename} ${wallpapers_dst}/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg || mv ${wallpapers_tmp}/${wp_dm_filename} ${wallpapers_tmp}/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
[[ -z ${build_manual} ]] && cp -pf $wallpapers_dst/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg $default_de_img
|
|
|
|
[[ -z ${BUILD_MANUAL} ]] && cp -pf ${wallpapers_dst}/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg $default_de_img
|
|
|
|
[[ -z ${build_manual} ]] && cp -pf $wallpapers_dst/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg $default_dm_img
|
|
|
|
[[ -z ${BUILD_MANUAL} ]] && cp -pf ${wallpapers_dst}/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg $default_dm_img
|
|
|
|
|
|
|
|
|
|
|
|
# Если пароли по умолчанию ublinux, то вывести подсказку пароля
|
|
|
|
# Если пароли по умолчанию ublinux, то вывести подсказку пароля
|
|
|
|
[[ -z ${build_manual} ]] && grep -q "^root:$DEFAULTROOTPASSWD:" /etc/shadow && grep -q "^$(getent passwd "${ADMUID}" | cut -d: -f1):$DEFAULTPASSWD:" /etc/shadow && insert_background_dm_txtpass
|
|
|
|
[[ -z ${BUILD_MANUAL} ]] && grep -q "^root:${DEFAULTROOTPASSWD}:" /etc/shadow && grep -q "^$(getent passwd "${ADMUID}" | cut -d: -f1):${DEFAULTPASSWD}:" /etc/shadow && insert_background_dm_txtpass
|
|
|
|
if [[ -z ${build_manual} ]] && [[ "$GRAFFITI" != "no" ]]; then
|
|
|
|
if [[ -z ${BUILD_MANUAL} ]] && [[ ${GRAFFITI} != @(disable|no) ]]; then
|
|
|
|
[[ -z $3 ]] && state_mode="$(cmdline_value ub.mode)" || state_mode=$3
|
|
|
|
[[ -z $3 ]] && state_mode="$(cmdline_value ub.mode)" || state_mode=$3
|
|
|
|
[[ -z $3 ]] && state_home="$(cmdline_value ub.home)" || state_home=$3
|
|
|
|
[[ -z $3 ]] && state_home="$(cmdline_value ub.home)" || state_home=$3
|
|
|
|
# Полное сохранение ub.mode=changes
|
|
|
|
# Полное сохранение ub.mode=changes
|
|
|
|
if [[ $state_mode =~ ^"changes"$ ]]; then
|
|
|
|
if [[ ${state_mode} =~ ^"changes"$ ]]; then
|
|
|
|
insert_background_icon $img_fullsave
|
|
|
|
insert_background_icon $img_fullsave
|
|
|
|
# Сохранение в модуль ub.mode=toxzm ub.mode=machines
|
|
|
|
# Сохранение в модуль ub.mode=toxzm ub.mode=machines
|
|
|
|
elif [[ $state_mode =~ ^("toxzm"|"machines")$ ]]; then
|
|
|
|
elif [[ ${state_mode} =~ ^("toxzm"|"machines")$ ]]; then
|
|
|
|
insert_background_icon $img_modulesave
|
|
|
|
insert_background_icon ${img_modulesave}
|
|
|
|
# Песочница с сохранением профиля пользователя ub.mode= ; ub.home=/ublinux-data/homes
|
|
|
|
# Песочница с сохранением профиля пользователя ub.mode= ; ub.home=/ublinux-data/homes
|
|
|
|
elif [[ $state_home =~ ^"/" ]]; then
|
|
|
|
elif [[ $state_home =~ ^"/" ]]; then
|
|
|
|
insert_background_icon $img_homesave
|
|
|
|
insert_background_icon ${img_homesave}
|
|
|
|
# Полная песочница RAM ub.mode= (clean); ub.home=
|
|
|
|
# Полная песочница RAM ub.mode= (clean); ub.home=
|
|
|
|
# Полная песочница HDD ub.mode=clear; ub.home=
|
|
|
|
# Полная песочница HDD ub.mode=clear; ub.home=
|
|
|
|
else
|
|
|
|
else
|
|
|
|
insert_background_icon $img_nosave
|
|
|
|
insert_background_icon ${img_nosave}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
[[ -n ${build_manual} ]] || rm -rdf $wallpapers_tmp
|
|
|
|
[[ -n ${BUILD_MANUAL} ]] || rm -rdf ${wallpapers_tmp}
|
|
|
|
|
|
|
|
|