How to pass extra cmdline parameter to a Gnome Apps

I always add frequently used Apps to Gnome’s Favarite bar.

In General, how can I modify the App with extra cmdline parameters?

Even better, can I have two icons in Favarite, one with default and one with those extras with some kind of identifications?


You can create custom launchers by adding .desktop files to the folder ~/.local/share/applications. (Since .local starts with a ., it is hidden from the ls command unless you use ls -a. You can also get to it in the Files application by hitting Ctrl-L to jump to the title bar and typing ~/.local/ and hitting enter.)

The specification for .desktop files is on, including a sample. (But many of the fields aren’t strictly required.)

[Desktop Entry]
Exec=gnome-terminal --geometry=80x25 -- /home/mattdm/.local/bin/connect-to-server
Name=Connect to Server
Comment=Connect to Server

which I use to connect to a server which needs to go through some hoops rather than just a simple ssh connection (the command /home/mattdm/.local/bin/connect-to-server jumps those hoops and is executed when the gnome-terminal shell starts — just like you are looking for, it’s an app with extra command-line parameters added.) I also changed the icon so I can easily tell this apart from the normal terminal icon.

You’ll find that this is where Steam and other programs also drop their own desktop entries; for example, I have:

[Desktop Entry]
Comment=Play this game on Steam
Exec=steam steam://rungameid/281990

as well.

Once you have a .desktop file in place, you will be able to find it in the applications list in the overview. From there, drag it to the dock (or right-click and Add to Favorites).


Thank you very much!

I looked at ~/.local/share/applications, there is one .desktop file created by Telegram which I can handily copy and modify. And it works!

It is something I wanted to do for years! is really the place to get help on using Fedora!


5 posts were split to a new topic: How can I locate the “.desktop” of an existing Gnome App, so that I can copy and modify it?

I’ve tweaked the topic slightly.

“Adding new command line parameters” is different to “passing extra parameters”. To add new command line options, one has to edit the sources of the software so that it can parse the new options. What we’re discussing here is simply how to pass more of the already existing options to a tool by default.

1 Like


1 Like

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