-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create ~/.local/share/applications/ if it doesn't exist (Linux) #1848
Conversation
Is there a new location for the .desktop files? |
I moved the From the XDG spec:
I'm not immediately sure how we should |
well, in the autoupdater, we literally just do a |
Can we test that the directory creation was successful and throw an error if not? |
@Postremus I'll copy that code, then. |
string XDGDataHome = Environment.GetEnvironmentVariable("XDG_DATA_HOME"); | ||
if (XDGDataHome != null) | ||
{ | ||
ApplicationsPath = Path.Combine(XDGDataHome, "applications"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The applications
subdirectory is deprecated. The preferred path is specced here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks.
So, we need a strategy for determining which Should we write to the first one we find out of I think |
If neither location contains a mimeapps.list, we could possibly assume that the distribution is not supporting mime types, so why bother creating mimeapps.list? |
It doesn't mean mimeapps.list isn't supported. It just means that nothing's created any user-level mime-type associations yet. It's possible that a user's home directory could be completely empty, so we need to create these directories. |
Hmm. Reading that spec, it sounds like we probably don't really need to be messing with mimeapps.list at all. We can put our associations in our ckan-handler.desktop file (which we should probably fix to be just ckan.desktop). mimeapps.list is to add or remove associations in the .desktop files. Am I off base? |
Ok, I suppose that could be possible if people have a dedicated machine for running KSP. |
I think the distinction is that If I remove (or delete the line from) I've just realized that this makes "CKAN Launcher" show up in application launchers, unsurprisingly, and it should work fine. Its category is "Utility" (comes up under Accessories in XFCE4). The icon is defined as "ckan" but I don't have any of the icons installed (they go in |
Link to spec for .desktop files. See the "Registering Mime Types" page. |
I actually made my own CKAN.desktop launcher, just so I could take control of where I'm launching it from and which category it goes in. |
It's almost like Ubuntu is not properly following the Freedesktop standards. |
It says that |
Fair enough. |
|
@@ -159,13 +168,6 @@ private static void RegisterURLHandler_Linux() | |||
parser.WriteFile(MimeAppsListPath, data); | |||
|
|||
var handlerPath = Path.Combine(ApplicationsPath, HandlerFileName); | |||
var handlerDirectory = Path.GetDirectoryName(handlerPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the rationale behind removing this code?
Just want to confirm why there was some code removed, otherwise LGTM. |
Discovered this on Ubuntu Server 16.04, where I didn't have this directory.
Directory.CreateDirectory
creates directories recursively, so it should be fine.