Application's start menu entry not picking up command line arguments

I’m trying to add a command line argument to a start menu entry in KDE plasma. The correct command line argument has been evaluated in terminal. By editing the entry seems to be not executed correspondingly.

This is the command (for the “cheese webcam application"):

cheese -d /dev/video0

This is a screenshot of the respective menu entry:

The command basically pre-selects the desired input device. It works in the terminal. It has no effect when launching via startmenu.

What am I doing wrong here?

Hi @dano,

I’m guessing, Note: guessing, not knowing, that it’s due to launcher menu entries needing to be rebuilt. Try loggin out and back in, and seeing if that works.

Can the input source not be chosen from the applications own settings menu?
I only have one webcam, so there is nothing to choose from there, it is pre-selected and cannot be changed.
If you have more capture devices, I’d assume you could change the source in that menu.
Can’t test that, I only have one.

Or can you change it and it keeps defaulting to the wrong one?

@Mirdarthos , unfortunately neither log-out/-in or restart fixed this.

@Nachlese, yes it can be selected, but it defaults to the wrong device with wrong resolution. (In fact it’s some builtin second cam of a single Logitech Brio device controlling brightness). It appears that the selection in cheese is not persistent. That’s why I tried the workaround via the menu entry.

OK, last think I can think of is rebuilding the .desktop database:

As your normal user, execute:

update-desktop-database ~/.local/share/applications/

Thanks, but no luck either.

Then I sadly am out of ideas. Sorry.

:sob:

Haha, that’s my tears… Thanks, though!

1 Like

Instead of putting the command line arguments in the separate Command line arguments section, does including them as a single line in the Program/Anwendung section as cheese -d /dev/video0 make any difference?

Also, you might want to try changing the Name to something different, such as Cheese at video0. Maybe having a custom application menu entry with the same name as the system default menu entry for that application causes an issue? Before you do this, ensure that you have removed any existing custom cheese.desktop menu entries from ~/.local/share/applications/, as renaming via the Menu Editor will not rename the actual matching .desktop file, it will only change the name within the file.

1 Like

Given the command works in the CLI, another way to get it to work might be to create two bash scripts.

Cheese-video0

#!/bin/bash
cheese -d /dev/video0

and cheese-video1

#!/bin/bash
cheese -d /dev/video1

Create a menu entry for each one, and call cheese using those, depending on which camera you want.

2 Likes

No difference.

Yes, @scotty65 suggestion works:

  • creating an additional entry with different name in ~/.local/share/applications/
  • changing the name inside the .desktop

Both steps seem to be necessary.

Interestingly, moving around the .desktop file changes the icon:

image

(Note the exclamation mark!). Additionally, I observed that removing the file from the .local at first removed the original menu entry, moving it back and forth again, put it back into the menu. Confusing.

For my problem, I am happy, since it is solved. Thank you for the kind support!

The overall functionality of customized menu items still seems to be a little bit strange at first sight. I guess this requires some additional KDE Plasma help self-lecture.

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.