LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Find current Thunar directory from CLI? (https://www.linuxquestions.org/questions/linux-general-1/find-current-thunar-directory-from-cli-876214/)

jsteel 04-20-2011 05:28 PM

Find current Thunar directory from CLI?
 
Hi,

Is it possible to find out the directory Thunar is currently displaying from the command line? I will only have one instance of Thunar open at one time.

Thanks

stress_junkie 04-20-2011 06:45 PM

You would think so. I just tried this with Nautilus on Ubuntu 10.04. Maybe you will see something useful in this experiment.

First I started nautilus.

Second I started a terminal window under the same user account.

Third I issued the pidof nautilus command. That returned a PID.

Fourth I issued a ls -lh /proc/<pid> where <pid> is the number that was returned from the pidof nautilus command.

That showed a link named cwd, which I took to mean "current working directory". That link pointed to my home directory.

Fifth I changed the directory showing in the Nautilus window and issued the ls -lh /proc/<pid> again.

The cwd link did not change value.

Sixth I issued the cat /proc/<pid>/environ command and looked for PWD. That also showed the home directory, not the directory showing in the Nautilus window.

I am very surprised by the result.

PTrenholme 04-20-2011 07:21 PM

I just tried the same thing (well, a little differently) using Thunar in a Xfce4 session under Fedora with the same result: CWD is just the home directory. I even tried starting Thunar from a terminal after changing the working directory, but the Thunar process is started (by default) with the --daemon option, so a new window (which opens in the cwd of the terminal) still has the CWD= value in the /proc/####/eniron file (and the /proc/####/cwd symbolic link) set to $HOME, not $CWD.

Strange, eh?

jsteel 04-21-2011 02:05 AM

Thanks for that suggestion. I too have it point to my home directory no matter where I browse to :(


All times are GMT -5. The time now is 01:32 PM.