Merge pull request #50 from Boria138/minor-improvements

Minor improvements
This commit is contained in:
Mikhail Tergoev
2023-07-24 12:17:06 +03:00
committed by GitHub
4 changed files with 19 additions and 19 deletions

View File

@ -205,7 +205,7 @@ var_vk_istance_layers_config_update () {
unpack_tar_zst () {
set -o pipefail
unset PW_ZSTD_PORT
if [[ `which zstd` ]] &>/dev/null ; then
if [[ `command -v zstd` ]] &>/dev/null ; then
tar -I zstd -xhvf "$1" -C "$2" | sszen
[ "${PIPESTATUS[0]}" != 0 ] && print_error "File $1 unpacking error." && return 1 || return 0
else
@ -651,8 +651,8 @@ pw_download_libs () {
export pw_yad_v12_3="${PW_WINELIB}/portable/bin/yad_v12_3"
export pw_zstd="${PW_WINELIB}/portable/bin/zstd"
export pw_7z="${PW_WINELIB}/portable/lib/p7zip/7z"
if [ -x "`which xterm 2>/dev/null`" ]; then
export SYS_XTERM=`which xterm`
if [ -x "`command -v xterm 2>/dev/null`" ]; then
export SYS_XTERM=`command -v xterm`
export PW_XTERM="${SYS_XTERM} -geometry 159x37 -e"
else
export PW_XTERM="${PW_WINELIB}/runtime/files/bin/xterm -geometry 159x37 -e"
@ -949,7 +949,7 @@ pw_create_gui_png () {
try_remove_file "${PORT_WINE_PATH}/data/img/Setup.png"
try_remove_file "${PORT_WINE_PATH}/data/img/launcher.png"
try_remove_file "${PORT_WINE_PATH}/data/img/Launcher.png"
if [[ -x "`which wrestool 2>/dev/null`" ]] && [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
if [[ -x "`command -v wrestool 2>/dev/null`" ]] && [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
try_remove_dir "${PORT_WINE_TMP_PATH}/tmp_img"
create_new_dir "${PORT_WINE_TMP_PATH}/tmp_img"
wrestool -x --output="${PORT_WINE_TMP_PATH}/tmp_img/" -t14 "${portwine_exe}"
@ -964,7 +964,7 @@ pw_create_gui_png () {
cp -f "${PORT_WINE_TMP_PATH}/tmp_img/${PORTPROTON_NAME}.png" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
if [[ -z "`file "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" | grep "${PW_RESIZE_TO} x ${PW_RESIZE_TO}"`" ]] && \
[[ -x "`which "convert" 2>/dev/null`" ]] && [[ -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
[[ -x "`command -v "convert" 2>/dev/null`" ]] && [[ -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
convert "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" -resize ${PW_RESIZE_TO}x${PW_RESIZE_TO} "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
if [[ -z "${PW_ICON_FOR_YAD}" ]] ; then

View File

@ -19,7 +19,7 @@ if [[ $(id -u) = 0 ]] ; then
zenity --error --text "Do not run this script as root!"
exit 1
fi
if [[ "${s_install}" != "1" && ! -x "`which "zenity" 2>/dev/null`" ]] ; then
if [[ "${s_install}" != "1" && ! -x "`command -v "zenity" 2>/dev/null`" ]] ; then
echo "You will need to install: zenity, and restart the port."
xdg-open "https://linux-gaming.ru/portproton/" > /dev/null 2>&1 & exit 0
fi
@ -227,7 +227,7 @@ start_portwine () {
setxkbmap us,ru
fi
fi
if [[ -x "`which "gamemoderun" 2>/dev/null`" ]] && [[ "$PW_USE_GAMEMODE" = "1" ]] ; then
if [[ -x "`command -v "gamemoderun" 2>/dev/null`" ]] && [[ "$PW_USE_GAMEMODE" = "1" ]] ; then
export GAMEMODERUN=1
PW_GAMEMODERUN_SLR="gamemoderun"
# if [[ ! -z "${PW_LD_PRELOAD}" ]]

View File

@ -123,7 +123,7 @@ portwine_start_debug () {
echo "$PORT_WINE_PATH" >> "${PORT_WINE_PATH}/${portname}.log"
echo "----------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
echo "Operating system" >> "${PORT_WINE_PATH}/${portname}.log"
lsb_release -d | sed s/Description/ОС/g >> "${PORT_WINE_PATH}/${portname}.log"
cat /etc/os-release | grep -oP 'PRETTY_NAME="\K[^"]+' >> "${PORT_WINE_PATH}/${portname}.log"
echo "--------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
echo "Desktop environment:" >> "${PORT_WINE_PATH}/${portname}.log"
echo "Desktop session: ${DESKTOP_SESSION}" >> "${PORT_WINE_PATH}/${portname}.log"
@ -142,20 +142,20 @@ portwine_start_debug () {
echo "Graphic cards and drivers:" >> "${PORT_WINE_PATH}/${portname}.log"
echo 'lspci -k | grep -EA3 VGA|3D|Display:' >> "${PORT_WINE_PATH}/${portname}.log"
echo $(lspci -k | grep -EA3 'VGA|3D|Display') >> "${PORT_WINE_PATH}/${portname}.log"
[[ `which glxinfo` ]] && glxinfo -B >> "${PORT_WINE_PATH}/${portname}.log"
[[ `command -v glxinfo` ]] && glxinfo -B >> "${PORT_WINE_PATH}/${portname}.log"
echo " " >> "${PORT_WINE_PATH}/${portname}.log"
echo "inxi -G:" >> "${PORT_WINE_PATH}/${portname}.log"
"${PW_WINELIB}/portable/bin/inxi" -G >> "${PORT_WINE_PATH}/${portname}.log"
echo "----------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
echo "Vulkan info device name:" >> "${PORT_WINE_PATH}/${portname}.log"
[[ `which vulkaninfo` ]] && vulkaninfo | grep deviceName >> "${PORT_WINE_PATH}/${portname}.log"
[[ `command -v vulkaninfo` ]] && vulkaninfo | grep deviceName >> "${PORT_WINE_PATH}/${portname}.log"
"${PW_WINELIB}/portable/bin/vkcube" --c 50
if [ $? -eq 0 ]; then
echo "Vulkan cube test passed successfully" >> "${PORT_WINE_PATH}/${portname}.log"
else
echo "Vkcube test completed with error" >> "${PORT_WINE_PATH}/${portname}.log"
fi
if [ ! -x "$(which gamemoderun 2>/dev/null)" ]
if [ ! -x "$(command -v gamemoderun 2>/dev/null)" ]
then
echo "---------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
echo "!!!gamemod not found!!!" >> "${PORT_WINE_PATH}/${portname}.log"
@ -684,7 +684,7 @@ else
for PW_DESKTOP_FILES in ${PW_ALL_DF} ; do
PW_NAME_D_ICON="$(cat "${PORT_WINE_PATH}/${PW_DESKTOP_FILES}" | grep Icon | 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}" ]] && [[ -x "`which "convert" 2>/dev/null`" ]] ; then
if [[ ! -f "${PW_NAME_D_ICON_48}" ]] && [[ -f "${PW_NAME_D_ICON}" ]] && [[ -x "`command -v "convert" 2>/dev/null`" ]] ; then
convert "${PW_NAME_D_ICON}" -resize 48x48 "${PW_NAME_D_ICON_48}"
fi
PW_GENERATE_BUTTONS+="--field= ${PW_DESKTOP_FILES//".desktop"/""}!${PW_NAME_D_ICON_48}!:FBTN%@bash -c \"run_desktop_b_click "${PW_DESKTOP_FILES//" "}"\"%"
@ -775,7 +775,7 @@ else
# --field=" Bethesda.net Launcher"!"$PW_GUI_ICON_PATH/bethesda.png"!"":"FBTN" '@bash -c "button_click PW_BETHESDA"'
# --field=" ROBLOX"!"$PW_GUI_ICON_PATH/roblox.png"!"":"FBTN" '@bash -c "button_click PW_ROBLOX"'
if [[ `which wmctrl` ]] &>/dev/null ; then
if [[ `command -v wmctrl` ]] &>/dev/null ; then
sleep 2
while [[ $(pgrep -a yad_v12_3 | head -n 1 | awk '{print $1}' 2>/dev/null) ]] ; do
sleep 2