Ask for root permissions
on clicking open in text editor, the application should ask for root permission for opening desktop files stored in /usr/share/applications.
This is not possible ATM. Most applications don't handle running as root and they just reject to even run. I'm not sure about the solution to this tbh.
Scratch does not reject running as root. It works properly. Currently, I open in Text editor the app I want to change as root, to get its path. Then I open terminal -> sudo scratch-text-editor file and edit it.
The best way to solve this would be to handle root changes by your awesome application. Put a on/off switch next to the new entry button, call it "Root mode". When the user clicks it - ask for password for sudo actions. Then if the users edits something in /usr/share/applications or elsewhere where root is required, automatically edit those files as root. No need to run the entire app as root, just do the changes as root. If this gets implemented, I'll gladly donate for a coffee, or two, because I use your app a lot.
I would also much appreciate this feature and think the approach suggested by @zvirdaniel is the way to go. This is also how the elementary team handles root access in the system settings (e.g. Language & Region settings). Perhaps you could check their source code to see how they do it?
@jtrees I know how the code works in system settings for permissions work because some of the plugs that require them were written by me. The problem here is that applications aren't guaranteed to handle root properly and ideally they shouldn't be ran as root.
What @zvirdaniel suggested seems possible though. Create a temp file in the tmp directory, open that in the editor, wait for the editor process to close, check if there are any changes in the file and if there are, ask the user if he wants to save these changes only for the current user or for all.
Sounds wonderful, would love to have it.
By the way, I landed here because I was looking for a way to delete items that are owned by root. Perhaps you could consider this use case in the design of your solution.
You can just make a local file that overrides the root ones, you should never be running as root.
I've attempted to implement this, but seems like there are some blockers, which I cannot get around, I'm postponing this for another release.