forked from CastroFidel/PortWINE
Added numbering for duplicates and determining their uniqueness
This commit is contained in:
parent
42dfd9c8d3
commit
c08f0142ab
@ -1009,7 +1009,7 @@ stop_portwine () {
|
|||||||
for dir in "${DESKTOP_DIRS[@]}" ; do
|
for dir in "${DESKTOP_DIRS[@]}" ; do
|
||||||
while IFS= read -r -d '' link_file; do
|
while IFS= read -r -d '' link_file; do
|
||||||
LINKS+=("$link_file")
|
LINKS+=("$link_file")
|
||||||
done < <(find "$dir" -type f -iname "*.lnk" ${SHORTCUT_SKIP_LIST_NEW} -print0 2>/dev/null | sort -u)
|
done < <(find "$dir" -type f -iname "*.lnk" -print0 2>/dev/null | sort -u)
|
||||||
done
|
done
|
||||||
|
|
||||||
for link_file in "${LINKS[@]}"; do
|
for link_file in "${LINKS[@]}"; do
|
||||||
@ -1048,7 +1048,7 @@ stop_portwine () {
|
|||||||
else
|
else
|
||||||
create_shortcut_from_link
|
create_shortcut_from_link
|
||||||
if [[ "${SHORTCUT_DUBLICATE}" == "true" ]] ; then
|
if [[ "${SHORTCUT_DUBLICATE}" == "true" ]] ; then
|
||||||
print_info "Created link for dublicate: $link_name - $prefix_name"
|
print_info "Created link for dublicate: $link_name - $prefix_name [$number_dublication]"
|
||||||
else
|
else
|
||||||
print_info "Created link for: $link_name"
|
print_info "Created link for: $link_name"
|
||||||
fi
|
fi
|
||||||
@ -1371,15 +1371,30 @@ create_shortcut_from_link () {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f "${link_file}"
|
||||||
if [[ -f "${PORT_WINE_PATH}/${PORTPROTON_NAME}.desktop" ]] ; then
|
if [[ -f "${PORT_WINE_PATH}/${PORTPROTON_NAME}.desktop" ]] ; then
|
||||||
create_new_dir "${PORT_WINE_PATH}/dublicate"
|
if ! grep -i "${exe_path}" "${PORT_WINE_PATH}/${PORTPROTON_NAME}.desktop" &>/dev/null ; then
|
||||||
PW_NAME_DESKTOP="${PORT_WINE_PATH}/dublicate/${PORTPROTON_NAME} - ${prefix_name}.desktop"
|
create_new_dir "${PORT_WINE_PATH}/dublicate"
|
||||||
export SHORTCUT_DUBLICATE="true"
|
SHORTCUT_DUBLICATE="true"
|
||||||
|
number_dublication="1"
|
||||||
|
if [[ -f "${PORT_WINE_PATH}/dublicate/${PORTPROTON_NAME} - ${prefix_name} [$number_dublication].desktop" ]] ; then
|
||||||
|
number_dublication="$(ls "${PORT_WINE_PATH}/dublicate"/ 2>/dev/null)"
|
||||||
|
number_dublication="${number_dublication//*[/}"
|
||||||
|
number_dublication="${number_dublication//]*/}"
|
||||||
|
if ! grep -i "${exe_path}" "${PORT_WINE_PATH}/dublicate/${PORTPROTON_NAME} - ${prefix_name} [$number_dublication].desktop" &>/dev/null ; then
|
||||||
|
number_dublication="$(($number_dublication+1))"
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
PW_NAME_DESKTOP="${PORT_WINE_PATH}/dublicate/${PORTPROTON_NAME} - ${prefix_name} [$number_dublication].desktop"
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PW_NAME_DESKTOP="${PORT_WINE_PATH}/${PORTPROTON_NAME}.desktop"
|
PW_NAME_DESKTOP="${PORT_WINE_PATH}/${PORTPROTON_NAME}.desktop"
|
||||||
export SHORTCUT_DUBLICATE=""
|
SHORTCUT_DUBLICATE=""
|
||||||
fi
|
fi
|
||||||
rm -f "${link_file}"
|
|
||||||
|
|
||||||
echo "[Desktop Entry]" > "${PW_NAME_DESKTOP}"
|
echo "[Desktop Entry]" > "${PW_NAME_DESKTOP}"
|
||||||
echo "Name=${PORTPROTON_NAME}" >> "${PW_NAME_DESKTOP}"
|
echo "Name=${PORTPROTON_NAME}" >> "${PW_NAME_DESKTOP}"
|
||||||
|
Loading…
Reference in New Issue
Block a user