Commit bb97c240 authored by Boria138's avatar Boria138

Minor improvements

Replaced which with command -v since which is already deprecated Replaced lsb_release -d with cat /etc/os-release since this method is more universal Fixed a couple of typos in the PortProton installation script
parent 55dedfe5
......@@ -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
......
......@@ -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}" ]]
......
......@@ -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"
......@@ -685,7 +685,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//" "}"\"%"
......@@ -776,7 +776,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
......
......@@ -35,7 +35,7 @@ export PROGS_INST=""
export vexit=0
########################################################################
for PROGS in "wget" "curl" "tar" "awk" "zenity" "cabextract" "pidof" ; do
if [ ! -x "$(which "${PROGS}" 2>/dev/null)" ] ; then
if [ ! -x "$(command -v "${PROGS}" 2>/dev/null)" ] ; then
PROGS_INST="${PROGS_INST} ${PROGS}" && vexit=1
fi
done
......@@ -62,9 +62,9 @@ elif [ -z "${PW_SET_LANG}" ] ; then
if [ $? -eq 1 ] ; then echo "Installation language not set!" && exit 1 ; fi
case $PW_SET_LANG in
"$RUS_LANG")
INFO_TEXT="Вы запустили установщик PortWINE ${portname} версии ${port_ver}. \n\nЭто некоммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права стороннего программного обеспечения принадлежат их владельцам! \nПродолжая установку, Вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;;
INFO_TEXT="Вы запустили установщик ${portname} версии ${port_ver}. \n\nЭто некоммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права стороннего программного обеспечения принадлежат их владельцам! \nПродолжая установку, Вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;;
"$ENG_LANG")
INFO_TEXT="You’ve started PortWINE ${portname} installer v.${port_ver}. \n\nIt is a non-commercial product and is developed only for the idea and with the help of your donations. \nAll third-party software rights belong to their respective owners! \nIf you continue installation, you agree to these terms." > /dev/null 2>&1 ;;
INFO_TEXT="You’ve started ${portname} installer v.${port_ver}. \n\nIt is a non-commercial product and is developed only for the idea and with the help of your donations. \nAll third-party software rights belong to their respective owners! \nIf you continue installation, you agree to these terms." > /dev/null 2>&1 ;;
esac
zenity --info --title "INFO" --text "$INFO_TEXT" --no-wrap 2> /dev/null
if [ $? -eq 1 ] ; then echo "INFO message not displayed!" && exit 1 ; fi
......@@ -76,7 +76,7 @@ if [ "${PW_SILENT_INSTALL}" = "1" ] ; then
else
case $PW_SET_LANG in
"$RUS_LANG")
inst1=$(zenity --title "Установка ${portname}" --text "Выберите путь для установки (обновления) PortWINE \nили оставьте его по умолчанию." --list --radiolist --width=350 --height=220 \
inst1=$(zenity --title "Установка ${portname}" --text "Выберите путь для установки (обновления) ${portname} \nили оставьте его по умолчанию." --list --radiolist --width=350 --height=220 \
--column="" --column "Путь:" \
TRUE "${deflink}" \
FALSE "Другой путь..." ) 2> /dev/null
......@@ -89,7 +89,7 @@ else
D_PATH="${D_PATH}/${portname}" ;;
esac ;;
"$ENG_LANG")
inst1=$(zenity --title "Install ${portname}" --text "Choose path to install (update) PortWINE \nor leave it as default." --list --radiolist --width=350 --height=220 \
inst1=$(zenity --title "Install ${portname}" --text "Choose path to install (update) ${portname} \nor leave it as default." --list --radiolist --width=350 --height=220 \
--column="" --column "Path:" \
TRUE "${deflink}" \
FALSE "Other path..." ) 2> /dev/null
......@@ -108,7 +108,7 @@ fi
case $PW_SET_LANG in
"$RUS_LANG")
progress_bar() {
zenity --progress --title="Установка..." --text="Настройка ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
zenity --progress --title="Установка..." --text="Установка ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
} ;;
"$ENG_LANG")
progress_bar() {
......
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