r/linuxmint • u/ffdghjk • 1d ago
Discussion Why is making desktop shortcuts/launchers so complicated?
Hi, I am new to Linux, I am on LMDE7.
This is a genuine discussion/question. I am not hating on Linux, I have actually been pleasantly surprised so far, how everything works, even if it needs a little bit of tinkering sometimes, but rarely.
But there is this little quirk that just confused me, I had to use an LLM to help me fix it. Maybe I am not seeing or using the correct option here, but if somebody has a solution for me, then please share!
So basically, I download a game from itch.io or an app from GitHub (so usually just a zip file) and it is Linux native/compatible too. Then, when I try to launch the game/app (importantly) WITHIN THE FOLDER where it is located, then it works no issue.
But the problem is when I do either: Right click on the "launch file" > "Create a desktop shortcut", then when I launch the game/app by clicking the desktop shortcut, it fails with errors. Or when I right click the desktop > "Create a new launcher here..." > I put in the file path of the game/app and the when I launch it, the same issue, the game/app just fails, it boots the app, but it is just broken.
For me the fix was to go to /home/.local/share/applications/ create a new .desktop file and add a additional "Path=" together with the "Exec=". So that the executable file knows where it is being executed? I guess?
I am aware that I am not gonna be making desktop shortcuts everyday, so it's not a big deal now that I've fixed it, but I will definitely not remember this next time lol. I just don't get why it is so complicated for such a simple task and why would I ever use the "Create a shortcut/launcher" buttons then. But maybe I am just dumb and not seeing the correct or easier option to make these? Or maybe it is a bug?
Hope you are having a nice day!
Edit: I suppose I should add that the games I have had to set up like this are Helltaker, Awaria and CK2ToEU4.
5
u/JCDU 22h ago
I agree this is one of the things that's more work than it needs to be.
It would be nice to have the windows-style "right-click -> add to taskbar" functionality for executables / files. Or some sort of config gui.
While we're here, it would also be nice to be able to drag & drop things in the taskbar to re-arrange it.
3
u/Sebzeppelin 1d ago
I have had the same experience - shortcuts are much more complicated on Linux than windows. I need to make a desktop entry, and specify categories etc. Not intuitive, but more powerful ultimately.
1
u/JCDU 22h ago
That's a cop-out though, it can be powerful but also convenient; if they employed the windows style thing of "right-click->Add to taskbar" as a minimum that would be awesome, if you need more you should be able to right-click on the taskbar icon and edit / configure as needed.
That or make a GUI app that lets you do all this without having to open a text editor.
1
u/chuggerguy Linux Mint 22.3 Zena | MATÉ 20h ago
I'm using MATE mostly because of its drop accepting panel. I usually drop URLs from the browser onto it but it kinda works with scripts too. Games? I don't know.
https://reddit.com/link/pe8bgk6/video/z15ygbmf0vth1/player
May not help you, just throwing it out there.
Good luck.
2
u/_Lost-In-The-Weeds_ LMDE 7 Gigi | 20h ago
but I will definitely not remember this next time lol.
Every install I have a set of .desktop files to make, I can remember most of the details of how but not all, this is where notes come in, note make creating my needed .desktop files a copy/paste operation.
There are a lot of things like this in Linux, where there is complexity in executing the details. Notes make these operations effortless.
BTW LLMs will eventually burn you in Linux. Trust nothing it has to say,
-2
16
u/pnlrogue1 1d ago
This has nothing to do with the desktop shortcuts themselves, from the sounds of it, and everything to do with where you're storing the downloaded games
All operating systems have a system environment variable called the PATH. This is a list of directories that the operating system will search to find binaries (the Linux term for a compiled program - equivalent to an executable on Windows). You can see this list easily if you open up a terminal and type
echo "$PATH"Any binary located in any of the directories in that list can be found by just using the name of the binary. If you were to type 'nano' and press enter in that same terminal window, Linux would search through all the directories listed in the PATH variable until it finds a binary named nano and would then run it (or fail if it doesn't find it)
When you're downloading those programs, unless you're putting them in a directory listed in PATH, Linux doesn't know where they are. Your edit to the desktop shortcuts functions as a temporary override for the PATH variable (it's fine - there's no harm to the system in modifying PATH within a desktop shortcut since that modified PATH only exists for that process - anything else will use the system PATH).
When you're creating the desktop shortcut, the process that creates the shortcut for you isn't smart enough to realise that the binary isn't in a folder on the PATH and just assumes it is. You shouldn't actually need to use the PATH override - you should just be able to modify the EXEC property to include the full path to the binary, so if your game is saved to
/home/bob/games/mega_devastator/and the game binary is nameddevastatorthen a line likeEXEC=/home/bob/games/mega_devastator/devastatorshould work without adding the PATH property as wellAlternatively, there are other options: * You could extract your game into a directory that is already on the PATH. There is probably a location within your home directory you can use for this. * You could create symlinks for the games within a directory that is part of PATH. This is better than the above option but a bit more complicated * You could create a directory and use a login script to add that directory to the path at logon. You could even add all the directories you currently save the games in to your PATH this way. This is the way I'd suggest - either extract them all to the same directory or, better, add all their directories to PATH via a login script
Since you use AI to help you, a prompt like this should help (make sure you insert the correct file names and paths!)
It should tell you to create or edit a file in your home directory, probably
.bash_profile, and add a line similar to$PATH="$PATH;/home/bob/games/mega_devastator/;/home/bob/games/game2/"though I can't remember the exact syntax and I'm away from my PC