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

kdialog, --getopenfilename, current path don't work

Tags: None
(comma "," separated)
totoro
Registered Member
Posts
11
Karma
0
OS
Hi,

I'm looking to make a script how use kdialog with --getopenfilename.
Code: Select all
#!/bin/bash

EXEC=$(kdialog --getopenfilename .)

The problem is, the kdialog windows open in a different place if I run the script with a shell or with dolphin or konqueror.
In the shell it's work well. Every time kdialog open the local path (who his where the script is or where the command is run), ex: /home/user/script/tmp
But if I run it in the same place whit dolphin or konqueror, I always have:
/home/user/document
I read this page:
viewtopic.php?f=64&t=59511&p=77424&hilit=kdialog#p77424
But the script I want to make have to run under Gnome and KDE and I'm scared than the "#!/usr/bin/env bash" in the answer make some problem under gnome (and zenity)
Do you know a other way to solve my problem ?

Thank's

Totoro
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
That line at the top of the file ( also known as the shebang ) is essential for making it work.
http://en.wikipedia.org/wiki/Shebang_(Unix)

The reason why it always opens in $HOME/Documents for Dolphin/Konqueror is that they do not launch applications themselves. They ask KLauncher to do it for them instead, and KLauncher's working directory doesn't change. This is intended behaviour.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
totoro
Registered Member
Posts
11
Karma
0
OS
Thank's
I done like it was in the other forum.
But I'm surprised to don't see a other way (more simple) to do it.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]