Overview
I've done some more research and found a workaround. I really hope Gnome restores this functionality (that it
removed in Nautilus 3.30). If CentOS 10 Gnome doesn't fix this I may need to find a different desktop environment. My workaround solutions work, but they're aren't as easy and convenient to use as the old native Gnome functionality.
The single best problem and solution description I found is by Vivek Gani
here. Unfortunately, the two parts of his workaround don't work for me, since
WeblocOpener doesn't have an RPM for me to install (yes, it's a Java program I could probably get working eventually, but I'm lazy) and the
QuickCut
Firefox extension isn't currently working due to a Firefox bug.
Therefore I had to come up with my own solution. This loss of functionality is really two separate problems:
- I can no longer create .desktop website link files by dragging the Firefox address into a Nautilus (Files) window
- I can no longer open .desktop website link files by double clicking them
Solution 1
To solve problem 1 (create .desktop link files) I used the bookmarklet that HappyPony posted
here. I've copied his bookmarklet here to keep this solution all in a single post:
Code: Select all
javascript:(function() { function copyToClipboard(text) { if (window.clipboardData && window.clipboardData.setData) { /*IE specific code path to prevent textarea being shown while dialog is visible.*/ return clipboardData.setData("Text", text); } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { var textarea = document.createElement("textarea"); textarea.textContent = text; textarea.style.position = "fixed"; /* Prevent scrolling to bottom of page in MS Edge.*/ document.body.appendChild(textarea); textarea.select(); try { return document.execCommand("copy"); /* Security exception may be thrown by some browsers.*/ } catch (ex) { console.warn("Copy to clipboard failed.", ex); return false; }finally { document.body.removeChild(textarea); } }} var DEntryLine = '[Desktop Entry]\n'; var EncodingLine = 'Encoding=UTF-8\n'; var NameLine = 'Name='; var TypeLine = 'Type=Link\n'; var URLLine = 'URL='; var IconLine = 'Icon=gnome-panel-launcher\n'; var CommentLine = 'Comment=\n'; var KeywordsLine = 'Keywords='; var dewDesktopItem = DEntryLine + EncodingLine + NameLine + document.title + "\n" + URLLine + window.location.href + "\n" + IconLine + CommentLine + KeywordsLine; copyToClipboard(dewDesktopItem); })();
To use this bookmarklet:
- Go to a page you want to create a desktop link to
- Click the bookmarklet favorite you created in Firefox (this bookmarklet didn't work for me in Chrome)
- Create a new text file in Files (Nautilus)
- Open the new text file and paste in the text that the bookmarklet generated
- Close and save the text file
- Rename the text file giving it a ".desktop" extension
Solution 2
To solve problem 2 (open .desktop website link files) I created my own desktop file launcher by creating a file here
Code: Select all
~/.local/share/applications/webLinkFileLauncher.desktop
with this text:
Code: Select all
[Desktop Entry]
Type=Application
Exec=sh -c "xdg-open $(sed -n 's/URL=//p' %f)"
Name=Web link file launcher (.desktop or .URL)
Terminal=false
# Works without the MimeType line, not sure if there's any reason to have this line:
MimeType=application/x-desktop;application/x-mswinurl
You'll notice in the comment in webLinkFileLauncher.desktop that I don't really know what I'm doing, so if someone has a better desktop entry please share it and I'd be happy to copy your work.
All this "app" does is use sed to pull the URL from the file and pass that to xdg-open which launches the URL in your default browser.
Next you need to associate .desktop files with the new "Web link file launcher (.desktop or .URL)" app we just created by following these steps in Nautilus (Files):
- Right click on a .desktop or .URL file
- Go to "Open With Other Application > View All Applications"
- Scroll down to and select "Web link file launcher (.desktop or .URL)"
- Click the "Select" button
Now you can open .desktop or .URL web link files simply by double clicking them (or select the file and press ENTER or "Right click > Open With Web link file launcher (.desktop or .URL)"). Note, in addition to Gnome's native .desktop files this solution also works for Windows' .URL files. That's one small bonus of having to recreate this functionality myself. Thanks to Evan Langlois whose post
here gave me the idea of creating this launcher.