Skip to content

Conversation

@sshcrack
Copy link
Contributor

@sshcrack sshcrack commented Oct 22, 2024

This pull requests adds the option for the user to select in which folder they want to create their shortcut.
grafik

(See issue #639 )

I've tested on windows but couldn't test it for linux / flatpak / AppImage / macos. But it should also work there

Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
@sshcrack sshcrack force-pushed the add-startmenu-shortcut branch from 1727f56 to 59efca7 Compare October 22, 2024 19:20
@Trial97
Copy link
Member

Trial97 commented Oct 24, 2024

Also for systems like Flatpak where we can't get the desktop or applications path I think this option/action should be just one(ask the user where he wants the shortcut to be created).

Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
@sshcrack
Copy link
Contributor Author

Alright, I've just pushed the suggested changes. It works on windows, but I haven't tested for linux and can't test for macOS.

Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
@Trial97 Trial97 added enhancement New feature or request changelog:changed A PR that appears under "Changed" in the changelog labels Oct 25, 2024
@Trial97 Trial97 added this to the 10.0 milestone Oct 29, 2024
@Mick235711
Copy link
Contributor

Mick235711 commented Nov 29, 2024

I don't think this currently works with macOS; AFAIK, in macOS, createShortcut() currently ignores the first parameter and just creates an app file in the user Applications folder. Therefore, with the current code, it creates an application shortcut in macOS regardless of which option you choose.
I think we should either

  • Still only show one button for macOS (i.e., don't add the menu) and retain current behavior or
  • Properly implement desktop shortcut support for macOS.

Personally, I think this should be simple enough to implement correctly; maybe just making createShortcut() 's applicationDirectory variable respect the first argument is all that's needed for this to work. Though it's debatable if we also need a PrismLauncher Instances folder for desktop shortcuts like we have for Launchpad (application) shortcuts...

If you can't test for macOS, I can offer some assistance as I have a macOS system (aarch64) on hand.

Copy link
Member

@TheKodeToad TheKodeToad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good and worked on my Windows install!

However the macos implementation should be updated to support the desktop too... also maybe make the windows implementation put it in a start menu folder named LAUNCHER_NAME Instances too :P. I don't think you can do the same on Linux and have it work for all desktop environments though

Also it crashed for me the first time on windows but I'm not sure if you introduced this bug since I could not reproduce it again

@TheKodeToad
Copy link
Member

TheKodeToad commented Dec 1, 2024

Also mockups of ideas I had (obviously out of scope for this PR, just putting these ideas out there) (sorry they are a bit rushed and messy)

I think it'd be better as a dialog, then there's room for more options

image
image

Would be super cool if it's viable (i'll probably open a dedicated issue)
image

I don't think it's that easy to delete things out of the application menu/start menu/launchpad, so maybe there should also be a button to delete all shortcuts for an instance or something like this which might be overkill now I think about it

image

We should probably at the very least clear all shortcuts for an instance when it is deleted

@sshcrack
Copy link
Contributor Author

sshcrack commented Dec 1, 2024

Alright thanks for the feedback! Unfortunately I'm busy right now but will try to implement the changes in the next two weeks

@TheKodeToad
Copy link
Member

I was just posting the other ideas for the sake of it, no need to implement them in this pr

@sshcrack
Copy link
Contributor Author

sshcrack commented Dec 1, 2024

Didn't express myself correctly 😅 meant the suggestions / fixes for mac.
Also are there any specific instructions on what exactly to change, I've got no idea of the whole mac thing (like application /desktop folders). I could look it up, but it will take some time then

@Mick235711
Copy link
Contributor

Mick235711 commented Dec 1, 2024

I'm pretty sure macOS is very similar to Linux in these regards:

  • For application shortcut, create a .app directory in ~/Applications/${LauncherName} Launcher/ (this is already implemented)
  • For a desktop shortcut, create the same .app directory in ~/Desktop
  • For shortcuts in other places, create the same .app directory in the directory chosen by the user

So, basically, the only difference between the three is the target directory, which actually follows the same convention as Linux afaik.

@TheKodeToad
Copy link
Member

That should work, yes

Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
@sshcrack sshcrack force-pushed the add-startmenu-shortcut branch from 145ac6c to c4ba7fc Compare December 7, 2024 19:25
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
@Mick235711
Copy link
Contributor

To add a non-Steam game, the shortcuts.vdf file must be modified. I can't find a way to refresh the steam library to reflect changes though, I've tried steam://AddNonSteamGame or steam://flushconfig but it doesn't seem to work

It seems that shortcuts.vdf should be modified while the Steam client is not opened? This way there should be no refresh issues...

@sshcrack
Copy link
Contributor Author

sshcrack commented Dec 7, 2024

I guess so, but that would get annoying for the user. What I observed is that the shortcuts file gets refreshed when adding the shortcut

@TheKodeToad
Copy link
Member

TheKodeToad commented Dec 8, 2024

Oops, I forgot.
Opened #3176 so this pr isn't cluttered with discussion

@Mick235711
Copy link
Contributor

Mick235711 commented Jan 10, 2025

Random idea: since Quick Play was implemented for worlds since 9.0, maybe we should allow creating shortcuts to worlds too...
(Not in the scope for this PR though)

@sshcrack
Copy link
Contributor Author

sshcrack commented May 5, 2025

Hey, any updates on this one?

Copy link
Contributor

@Mick235711 Mick235711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I think the code is pretty ready.
Gentle ping @TheKodeToad for review

@TheKodeToad TheKodeToad requested a review from Trial97 May 6, 2025 21:47
Copy link
Member

@Trial97 Trial97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bring this PR up to date with the latest develop.

@sshcrack
Copy link
Contributor Author

sshcrack commented May 7, 2025

Working on a fix for those failed checks

@Mick235711
Copy link
Contributor

Working on a fix for those failed checks

I don't think you can do anything here; the failures are in the lines that this PR does not touch.

@Trial97
Copy link
Member

Trial97 commented May 7, 2025

The failing checks are unrelated to your PR

@sshcrack
Copy link
Contributor Author

sshcrack commented May 7, 2025

Okay, was confused already because it merged cleanly

@Trial97
Copy link
Member

Trial97 commented May 7, 2025

No I do not know but encountered the same error on a different PR: most probably the MinGW did update or something unrelated to your work

@Trial97 Trial97 merged commit 2c838f8 into PrismLauncher:develop May 10, 2025
14 of 16 checks passed
@DioEgizio DioEgizio mentioned this pull request Nov 9, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:changed A PR that appears under "Changed" in the changelog enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make a distinct button for making an application menu shortcut apart from desktop shortcut

5 participants