[Desktop Entry] in .desktop files : Where to find valid konsole options for starting bash script

I have read somewhere that valid options in .desktop files are those given by the help for konsole.
The konsole help give :

konsole --help
Usage: konsole [options] [args]
Terminal emulator

Options:
-h, --help Displays help on commandline options.
–help-all Displays help including Qt specific options.
-v, --version Displays version information.
–author Show author information.
–license Show license information.
–desktopfile The base file name of the desktop entry for this
application.
–profile Name of profile to use for new Konsole instance

It seems that the option for using a specific profile does not work for me:

[Desktop Entry]
Comment[en_US]=RUN MAIN SCRIPT
Comment=RUN MAIN SCRIPT
Exec=/run/media/$(logname)/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2023_12_01/MY_PROJECTS/MY_INSTALL_STEP_1/2023_12_01_19h31/001_SCRIPTS/003_MAIN_SCRIPT/main_script_machine.sh
GenericName[en_US]=RUN MAIN SCRIPT
GenericName=RUN MAIN SCRIPT
Icon=kwin
MimeType=
Name[en_US]=RUN MAIN SCRIPT
Name=RUN MAIN SCRIPT
Path=
StartupNotify=true
Terminal=true
TerminalOptions= --profile “MY_PROFILE_1” --noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-RunOnDiscreteGpu=false
X-KDE-SubstituteUID=false
X-KDE-Username=

If I start a konsole from the launcher, my profile is in use.
If I start a script from my .desktop icon, it is the hardcoded default profile that is in use.

Any help is welcome.

Hello .
Any help is welcome

I am not on KDE, hence not using konsole, but since noone else replied…

I think I would try to edit your Exec line to

Exec=konsole --profile MY_PROFILE_1 -e /run/media/$(logname)/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2023_12_01/MY_PROJECTS/MY_INSTALL_STEP_1/2023_12_01_19h31/001_SCRIPTS/003_MAIN_SCRIPT/main_script_machine.sh

Then delete the TerminalOptions line and set Terminal=false

I can’t verify whether it’s working, but I think it’s worth giving it a shot.

User profiles are stored in ~/.local/share/konsole/:

karl@erlangen:~> ll ./.local/share/konsole
insgesamt 4
-rw-r-xr-x 1 karl users 152 25. Jul 12:52 Profil 1.profile
karl@erlangen:~> 

Try e.g.: konsole --profile /home/karl/.local/share/konsole/Profil\ 1.profile. To my experience this works for everybody.

Hmm, I just wanted to say both suggestions don’t work. But then a double check showed this:
kasi@pluto:~> konsole --hold --profile Profile_test /home/kasi/Schreibtisch/1.sh


(I am pretty sure this didn’t work without the “-e” option before, but probably it’s a PEBKAC.) Well, it does now.

However, when I try to do the same with the “-e” option I still get the same issue as @jcdole :


It seems to be a generic profile, it didn’t even get a name.

So, the culprit seems to be the execute option “-e”. The desktop file apparently uses this option.

I rephrase my problem :

1°) On the desktop, do mouse right click
2°) select create new → link to application
3°) On the popup window select → Application
4°) Click on button → Advanced options
5°) click checkbox → Run in terminal
6°) Fill the field → Terminal options

Then my question is :
What option to use so that the terminal open using the profile “My_Good_Profile.profile”

And where is any KDE document which explain what options are available at this level.

Thank you for helping.

I don’t have this profile. I tested with TerminalOptions=--profile /home/karl/.local/share/konsole/jcdole.profile.

Thank you very much.
I have a try

Thanks. That works

Thanks for the feedback!

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