Unverified Commit 4bfc71dd authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Boris Yumankulov

use exe-thumbnailer instead convert

parent 7384b310
...@@ -1646,18 +1646,13 @@ pw_create_gui_png () { ...@@ -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"
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 [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
if command -v sestatus &>/dev/null && sestatus | grep "Current mode: *enforcing" ; then if check_flatpak ; then
SESTATUS="1" exe-thumbnailer --force-resize -s "${PW_RESIZE_TO}" "$(readlink -f "${portwine_exe}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
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"
else else
env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \ env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \
LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \ LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \
"${PW_WINELIB}/runtime/files/bin/python3.9" \ "${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" "$(readlink -f "${portwine_exe}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi fi
fi fi
...@@ -4668,18 +4663,13 @@ create_shortcut_from_link () { ...@@ -4668,18 +4663,13 @@ create_shortcut_from_link () {
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 [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
if command -v sestatus &>/dev/null && sestatus | grep "Current mode: *enforcing" ; then if check_flatpak ; then
SESTATUS="1" exe-thumbnailer --force-resize -s 128 "$(readlink -f "${exe_path}")" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
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"
else else
env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \ env PYTHONPATH="${PW_PLUGINS_PATH}/portable/lib/python3.9/site-packages/" \
LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \ LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64" \
"${PW_WINELIB}/runtime/files/bin/python3.9" \ "${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
fi fi
......
...@@ -639,13 +639,26 @@ else ...@@ -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\"%" 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 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}')" if check_flatpak ; then
PW_NAME_D_ICON_48="${PW_NAME_D_ICON//".png"/"_48.png"}" 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}" ]] \ if [[ ! -f "${PW_NAME_D_ICON_48}" ]] \
&& [[ -f "${PW_NAME_D_ICON}" ]] \ && [[ -f "${PW_NAME_D_ICON}" ]] ; then
&& command -v "convert" &>/dev/null if check_flatpak ; then
then exe-thumbnailer --force-resize -s "48" "${PW_NAME_D_ICON}" "${PW_NAME_D_ICON_48}"
convert "${PW_NAME_D_ICON}" -resize 48x48 "${PW_NAME_D_ICON_48}" &>/dev/null 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 fi
PW_DESKTOP_HELPER="${PW_DESKTOP_FILES// /@_@}" 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}"\"%" 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