This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Launching Applications from Dolphin and CWD

Tags: None
(comma "," separated)
Twey
Registered Member
Posts
3
Karma
0
By default, Dolphin resets the working directory to $HOME before launching an executable. However, most applications expect their working directory to be the directory in which the application is stored; particularly, bundled applications often come with data files in the same directory. This means that the only way to launch these applications is to press Shift-F4 and launch them from the shell. How can I tell Dolphin to not reset the working directory and instead launch the executable with the working directory set to the directory I was in in Dolphin when I launched it?

(specific use case: my mother downloaded a game, and she is constantly surprised when clicking the game's executable launches a blank screen without any sprites or text [which the game expects to find in the working directory])
Kryten2X4B
Registered Member
Posts
911
Karma
4
OS
Start the menu editor (right-click on the menu and you'll see something like "Start kmenuedit" or "Edit applications..."

Find the game, to use your use-case, and select it. On the right-hand side you will see two tabs, one "General" and one "Advanced". Under advanced, you'll find a "Work path". Select the full path to the game directory and save.

That does not set the working directory to wherever the application is stored on a global basis so you need to do it on a per-application basis. It should work for those programs that require it, probably very few. In my experience, at least 95 % of the time you need to do something like is for programs not found in the repositories of the distro in question.

Edited to add: Upon re-reading it it seems she is launching the game from within Dolphin rather than the menu, in which case the above solution won't work. You need to add the game to the menu then, or create a proper .desktop file instead of clicking just on the executable.


OpenSUSE 11.4, 64-bit with KDE 4.6.4
Proud to be a member of KDE forums since 2008-Oct.
Twey
Registered Member
Posts
3
Karma
0
So I need to teach my mother to create a .desktop file every time she downloads a game? Many bundled apps seem to work this way — ones that aren't in the repo, aye.
Kryten2X4B
Registered Member
Posts
911
Karma
4
OS
No, but it might be a good idea to teach her the menu-editor. Name, command, and work path should be all that she needs to remember to fill in. Plus giving the app/game an icon maybe.

The menu editor does save a .desktop file so it can be copied into a more convenient location. Alternatively, use the folder view as her desktop and set the location to be /home/username/.kde/share/applications and the icon will appear on the desktop. The drawback is that the desktop may become cluttered with icons if the menueditor has been used extensively.


OpenSUSE 11.4, 64-bit with KDE 4.6.4
Proud to be a member of KDE forums since 2008-Oct.
Twey
Registered Member
Posts
3
Karma
0
This doesn't seem very friendly, or intuitive. Surely there's an option somewhere to just keep the working path intact?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]