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
This commit is contained in:
Boria138
2023-07-21 09:39:19 +06:00
parent 55dedfe548
commit bb97c240eb
4 changed files with 19 additions and 19 deletions

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"
@ -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