M-Reimer / leagueoflegends-linux

24 stars 4 forks source link

League desktop shortcut isn't created, if the user said no to the menu shortcut #8

Closed GSchuemann closed 4 years ago

GSchuemann commented 4 years ago

Looking at the code, the .desktop file is only created when the user says y to creating a menu shortcut. If he said no and then yes to the desktop shortcut nothing happens, since no .desktop file was created that could be copied. An easy way of fixing this would be to use a function when creating the desktop file. Something like this: `create_leaguedesktop () { if [ -f leagueoflegends.desktop ]; then echo "" echo "Creating League of Legends desktop shortcut." echo "" else echo "" echo "Creating League of Legends application menu shortcut." echo ""

echo "[Desktop Entry]" > leagueoflegends.desktop
echo "Encoding=UTF-8" >> leagueoflegends.desktop
echo "Name=League of Legends" >> leagueoflegends.desktop
echo "GenericName=League of Legends" >> leagueoflegends.desktop
echo "Exec=$HOME/bin/leagueoflegends \"\$@\"" >> leagueoflegends.desktop
echo "Icon=leagueoflegends" >> leagueoflegends.desktop
echo "StartupNotify=true" >> leagueoflegends.desktop
echo "Terminal=false" >> leagueoflegends.desktop
echo "Type=Application" >> leagueoflegends.desktop
echo "Categories=Application;Game" >> leagueoflegends.desktop

fi`. And then calling the function in both places should work.

EDIT: Looks like Github messes the formating up, sorry

M-Reimer commented 4 years ago

You are right. But as the file is created in the "source directory" first, I think it would be OK to always create it (doesn't take too much time to do this).

M-Reimer commented 4 years ago

Fixed in https://github.com/M-Reimer/leagueoflegends-linux/commit/5a4392614d6ee5b5495ce261e8bf4a93c1b610cb Probably we don't need the information output in front of the creating block but I think the whole output should be reconsidered at some time anyway. The whole script could be a bit more "silent".