5

I have a script that "generates" a sequentially named image (e.g. img_001.jpg) and saves it in a fixed directory, e.g. ~/Documents/Images.

After the file has been created, I'd like to display the folder with the file selected, i.e. similar to how Chrome and Firefox will open the directory of a downloaded file with it already selected.

Apparently my Linux Mint edition uses Caja. I tried,

caja $filename

But Caja decides to actually open the file using the default application. The caja help isn't very useful and I've looked everywhere but can't find any similar questions. Hopefully I'm just using the wrong search terms and Caja does actually support something as basic as this?

makhdumi
  • 153
  • 1
  • 5

2 Answers2

6

This command work fine for me:

dbus-send --session --type=method_call    --dest="org.freedesktop.FileManager1"     "/org/freedesktop/FileManager1"     "org.freedesktop.FileManager1.ShowItems" array:string:"file:///etc/hosts"     string:""
nik
  • 76
  • 1
  • 2
1

I'm not sure about selecting the file, but you're telling caja to open file $filename, when what you really want to do is to open the directory that contains $filename.

So instead do this:

$ caja ~/Documents/Images

However as I stated, this will not select a particular file. That capability does not appear to be present in Caja.

slm
  • 363,520
  • 117
  • 767
  • 871