0

The intended functionality should be similar to what's seen in many windows editors e.g. "open explorer here". For those unfamiliar with windows, I just want to open nautilus to the directory of the active document.

I've tried two solutions so far, both which end up opening nautilus to the correct directory but without the window activating (not coming to the front with input focus).

Solution attempt 1 - Use the pre-existing "set build commands" and run the following command instead of make

nautilus %d; xdotools windowactivate $(xdotools search --name %d)

Solution attempt 2 - Use the Lua scripting plugin

dir = geany.dirname(geany.filename())
os.execute("nautilus " .. dir .. "; xdotools windowactivate $(xdotools search --name " .. dir .. ")")

I'm not worried about multiple windows having the same name, and I've tested the xdotools script in bash and it works fine. I'm really unsure what I'm missing here. I also don't want to use the explorer side-bar as a work-around.

aaaaaa
  • 1,233
  • 13
  • 24

2 Answers2

1

Just another solution: Geany-Plugin treebrowser is able to do this.

frlan
  • 6,950
  • 3
  • 31
  • 72
  • I tried its function, changed 'explorer %d' to 'nautilus %d' and got the same behavior. I'm beginning to think it's a bigger issue than just geany, even though I haven't seen the problem elsewhere. Looking into the issue reported [here](https://bugs.launchpad.net/ubuntu/+source/deluge/+bug/1168858). I will post a solution if I find one. – aaaaaa Jan 07 '15 at 23:43
  • Having thunar configured it worked at least as I understood you ;D Thunar opened and became focus. – frlan Jan 08 '15 at 08:04
  • Yeah I looked into the issue as I mentioned above but wasn't having any luck. I'm not familiar with thunar but I will take a look and get back to you. I would love for that to work because this bug has been a real bother. I appreciate you getting back to me. – aaaaaa Jan 08 '15 at 08:19
  • My guess it's related to the Desktop Environment you are suing. Tested in on Xfce. – frlan Jan 08 '15 at 08:23
  • Unty for me just an fyi - good to narrow that stuff down for sure. – aaaaaa Jan 08 '15 at 08:27
  • Finally got around to resolving this. Thanks a ton for your help @frlan :) – aaaaaa Jan 13 '15 at 19:13
0

I did not resolve the bug using Nautilus. Thanks to frlan's help though using Thunar as an alternative works great. There are better guides exising on the internet, but all I did was install thunar[1]

sudo aptitude install thunar

then set it as my default via another package which I had to install in order to run exo-preferred-applications[2]

sudo aptitude install exo-utils
exo-preferred-applications

[1]
[2]

I'm not going to keep the links up to date - so if they are broken just do a quick google search. There are plenty of resources surrounding this topic.

Community
  • 1
  • 1
aaaaaa
  • 1,233
  • 13
  • 24