Normalize filename for .desktop-files
Not a real problem, but for convenience. When creating new .desktop-files with the "Install -> Web App" or "Install -> TUI" the filename of the .desktop file would use the name of the App, i.e. the same name as what would be displayed in the launcher.
I added an app with the name that contained a space, and it still works, but it is annoying if you want to reference the files for some reason as you have to "escape" the space or use citation marks to contain the name:
- cat "My App.desktop"
- cat My\ App.desktop"
It is neater to have lower-case filenames and replace the space with a underscore. I.e. instead of having the .desktop-filename "My App.desktop" it would be "my_app.desktop".
This PR just adds normalization of the APP_NAME, NORMALIZED_NAME, and uses the normalized name for the creating of the .desktop-file.
As the filename doesn't really matter, I don't see any issues with this change. From the user, the change is completely transparent. It just makes it better and/or easier if you want to manually mess around with the .desktop-files.
I vote for using - instead of _ for the filenames.
Snake case is more common and recommended in for example bash scripts. From my experience, it is also more common in Linux generally.
To me it makes more sense to keep the underscore.
Snake case is more common and recommended in for example bash scripts. From my experience, it is also more common in Linux generally.
To me it makes more sense to keep the underscore.
But those are not bash scripts, they are desktop files.
they all use - instead of _.
Hmm ok, the ones in my folders were primarily underscore. I can change it, doesn't really matter for me.
Taking some time off now though (without access to a computer). I will be able to change it by Monday next week!
@abenz1267 @adevade Fixed according to the feedback.
Updated and fixed conflicts. Not tested yet though.
@lucasrcezimbra It shouldn't be required. This only affects the file naming of .desktop-files, and the actual name doesn't matter for any system processes, as far as I am aware. I did however realize that the uninstall script for both TUI and Webapp needs to be updated as well, as they currently rely on APP_NAME to find the desktop-file to remove.
Not sure if this change is prioritized given it grew in scope.
Appreciate the suggestion, but I don't think it's worth the extra code to do this. It's perfectly fine imo to have spaces in file names, and it's exceptionally rare that anyone needs to mess with these files directly anyway.