-1

In Ubuntu 18.04, Plasma desktop, i open dolphin, right-click -> Create new -> Link to location (URL). This creates a weblink using a .desktop file. The contents of my file after creation are

[Desktop Entry]
Icon=text-html
Type=Link
URL[$e]=https://www.theguardian.com/film/2016/mar/27/50-best-documentaries-alex-gibney-joshua-oppenheimer-james-marsh

When I click on the file, I expect a browser to open and load the proper website. Instead, I get

Error
Failed to add a plugin to the panel
No running instance of xfce4-panel was found

This used to work before the OS upgrade. What's going on here?

user32849
  • 107
  • 1
  • 2
    You write "In Ubuntu 18.04, Plasma desktop" and then later on you have `Failed to add a plugin to the panel` and `No running instance of xfce4-panel was found`. Now why would "Ubuntu 18.04, Plasma desktop" come up with such a response? On a pure Kubuntu 18.04, things work just as you describe using Dolphin, no errors or mention of plugins or `xfce4-panel`: just the creation of a file that when double-clicked opens the default browser to the desired link. To my mind, you have a somewhat mixed-up system. You do mention "OS upgrade". Maybe that has something to do with the confusion? – DK Bose Oct 31 '18 at 13:19
  • Nothing "mixed up" here, you can have multiple desktop environments installed on a Linux system, you know? The upgrade refers to an upgrade from 16.04 to 18.04. All pretty standard... But yes, something's mixed up here, but I didn't tinker with anything other than installing packages through apt. – user32849 Oct 31 '18 at 14:02
  • 2
    Well, you're seeing the effects of whatever you've installed. On a pure system, things work as you describe. – DK Bose Oct 31 '18 at 14:05
  • 2
    Let's see. Do you know whether you have any application with `xfce4` in its name? What does `apt list --installed | grep -i xfce4` show you? – DK Bose Oct 31 '18 at 14:11
  • Yes, 47 of them, because the XFCE desktop is installed. It just shouldn't interfere with Plasma. I guess my question is how I can force Plasma to do its default thing. – user32849 Oct 31 '18 at 14:22
  • 2
    But you're seeing evidence of that. Anyway, all the best. – DK Bose Oct 31 '18 at 14:27
  • Yes, and the question is how to fix that, not to acknowledge the problem, which is already done by posing the question, no? – user32849 Oct 31 '18 at 14:39
  • 1
    It would certainly be helpful to add the information that @DKBose's comments brought to light to your question. Assuming there's a way to resolve the conflict, it's surely more likely that someone here will find it for you if we know the cause. Comments are mainly for working to clarify and improve posts, so they are often deleted once that process has been successful – Zanna Oct 31 '18 at 15:52
  • 1
    We don't even know what desktop environment is being run. – DK Bose Oct 31 '18 at 16:12
  • Plasma, as mentioned right at the beginning of the question. Or are you referring to something else? – user32849 Nov 01 '18 at 06:34

2 Answers2

0

Try creating a desktop file like so:

[Desktop Entry]
Version=1.0
Type=Application
Name=(Name of the site)
Comment=(A description of it)
TryExec=(Path or command for your browser) (URL)
Exec=(Path or command for your browser) %F
Icon=text-html
Actions=(Any context menu actions you want, each ending with “;”, no whitespace)

Append to the file for each action:

(Empty space)
[Desktop Action (action name)]
Exec=(Command or path)
Name=(Context menu name)
Icon=(The icon for it)

That’s it! It might take longer, but is a workaround for it.

JMoore2007
  • 11
  • 1
0

The fix.

By default, Dolphin shows these options after double-clicking on a desktop file:

Dolphin: What do you wish to do with this executable file? Do not ask again Open Execute Cance

Most likely you have at some point checked the "Do not ask again" box and then chose "Open" instead of "Execute", possibly for ease of editing executable shell scripts.

You can undo this behavior with this command:

kwriteconfig5 --file kiorc --group 'Executable scripts' --key 'behaviourOnLaunch' 'alwaysAsk'

or graphically by following these steps:

  1. Open Dolphin.

  2. Go to "Settings" → "Configure Dolphin..."

  3. Select the "General" section.

  4. Click the "Confirmations" tab.

  5. Enable the "Executing scripts or desktop files" setting under the "Ask for confirmation in all KDE applications when:" section.

  6. Press "OK" or "Apply".

Dolphin General Preferences

Now when you open the desktop file, select "Execute" instead of "Open".

The explanation.

As to why this happens: look at this file:

/usr/share/applications/panel-desktop-handler.desktop

from the xfce4-panel package:

[Desktop Entry]
Type=Application
Name=Create Launcher on the panel
# ...
Comment=Add a new launcher to the panel based on the information of this desktop file
# ...
Exec=xfce4-panel --add=launcher %u
Icon=application-x-executable
Terminal=false
NoDisplay=true
StartupNotify=false
MimeType=application/x-desktop;

Notice in particular the MimeType=application/x-desktop line. As mentioned in the comments, you have the XFCE desktop installed alongside KDE Plasma, so evidently panel-desktop-handler.desktop is the default handler for the application/x-desktop mimetype.

You can see this from the command line via e.g.

ktraderclient5 --mimetype 'application/x-desktop'

or you can also view it within dolphin under "File Type Options" → "Application Preference Order".

Related questions.

Nathaniel M. Beaver
  • 1,478
  • 12
  • 32