Commit e327599a authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'Boria138-drop-convert' into devel

parents 017dd5d7 23497261
......@@ -1646,18 +1646,13 @@ pw_create_gui_png () {
try_remove_file "${PORT_WINE_PATH}/data/img/launcher.png"
try_remove_file "${PORT_WINE_PATH}/data/img/Launcher.png"
if [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
if command -v sestatus &>/dev/null && sestatus | grep "Current mode: *enforcing" ; then
SESTATUS="1"
else
SESTATUS="0"
fi
if command -v exe-thumbnailer &>/dev/null && [[ "${SESTATUS}" == "0" ]] ; then
exe-thumbnailer -s "${PW_RESIZE_TO}" "$(readlink -f "${portwine_exe}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
if check_flatpak ; then
exe-thumbnailer --force-resize -s "${PW_RESIZE_TO}" "$(readlink -f "${portwine_exe}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
else
env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \
LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \
"${PW_WINELIB}/runtime/files/bin/python3.9" \
"${PW_PLUGINS_PATH}/portable/bin/exe-thumbnailer" -s "${PW_RESIZE_TO}" \
"${PW_PLUGINS_PATH}/portable/bin/exe-thumbnailer" --force-resize -s "${PW_RESIZE_TO}" \
"$(readlink -f "${portwine_exe}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
fi
......@@ -4667,18 +4662,13 @@ create_shortcut_from_link () {
try_remove_file "${PORT_WINE_PATH}/data/img/Launcher.png"
if [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
if command -v sestatus &>/dev/null && sestatus | grep "Current mode: *enforcing" ; then
SESTATUS="1"
else
SESTATUS="0"
fi
if command -v exe-thumbnailer &>/dev/null && [[ "${SESTATUS}" == "0" ]] ; then
exe-thumbnailer -s 128 "$(readlink -f "${exe_path}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
if check_flatpak ; then
exe-thumbnailer --force-resize -s 128 "$(readlink -f "${exe_path}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
else
env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \
LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \
"${PW_WINELIB}/runtime/files/bin/python3.9" \
"${PW_PLUGINS_PATH}/portable/bin/exe-thumbnailer" -s 128 "$(readlink -f "${exe_path}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
"${PW_PLUGINS_PATH}/portable/bin/exe-thumbnailer" --force-resize -s 128 "$(readlink -f "${exe_path}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
fi
......
......@@ -639,13 +639,26 @@ else
PW_GENERATE_BUTTONS="--field= $(gettext "Create shortcut...")!${PW_GUI_ICON_PATH}/find_48.svg!:FBTN%@bash -c \"button_click pw_find_exe\"%"
for PW_DESKTOP_FILES in ${PW_ALL_DF} ; do
PW_NAME_D_ICON="$(grep Icon "${PORT_WINE_PATH}/${PW_DESKTOP_FILES}" | awk -F= '{print $2}')"
PW_NAME_D_ICON_48="${PW_NAME_D_ICON//".png"/"_48.png"}"
if [[ ! -f "${PW_NAME_D_ICON_48}" ]] \
&& [[ -f "${PW_NAME_D_ICON}" ]] \
&& command -v "convert" &>/dev/null
then
convert "${PW_NAME_D_ICON}" -resize 48x48 "${PW_NAME_D_ICON_48}" &>/dev/null
if check_flatpak ; then
PW_NAME_D_ICON="$(grep Exec "${PORT_WINE_PATH}/${PW_DESKTOP_FILES}" | awk -F'=' '{print $2}' |
sed -e 's|flatpak run ru.linux_gaming.PortProton||' -e 's|"||g' -e 's|^[ \t]*||')"
else
PW_NAME_D_ICON="$(grep Exec "${PORT_WINE_PATH}/${PW_DESKTOP_FILES}" | awk -F"=env " '{print $2}' |
sed -e "s|${PORT_SCRIPTS_PATH}/start.sh||" -e 's|"||g' -e 's|^[ \t]*||')"
fi
PW_ICON_PATH="$(grep Icon "${PORT_WINE_PATH}/${PW_DESKTOP_FILES}" | awk -F= '{print $2}')"
PW_NAME_D_ICON_48="${PW_ICON_PATH%.png}_48.png"
if [[ ! -f "${PW_NAME_D_ICON_48}" ]] \
&& [[ -f "${PW_NAME_D_ICON}" ]] ; then
if check_flatpak ; then
exe-thumbnailer --force-resize -s "48" "${PW_NAME_D_ICON}" "${PW_NAME_D_ICON_48}"
else
env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \
LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \
"${PW_WINELIB}/runtime/files/bin/python3.9" \
"${PW_PLUGINS_PATH}/portable/bin/exe-thumbnailer" \
--force-resize -s "48" "${PW_NAME_D_ICON}" "${PW_NAME_D_ICON_48}"
fi
fi
PW_DESKTOP_HELPER="${PW_DESKTOP_FILES// /@_@}"
PW_GENERATE_BUTTONS+="--field= ${PW_DESKTOP_FILES//".desktop"/""}!${PW_NAME_D_ICON_48}!:FBTN%@bash -c \"run_desktop_b_click "${PW_DESKTOP_HELPER}"\"%"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment