0

I use Guake with tmux as my preferred terminal on Ubuntu 14.04LTS. I would like to be able to run a script from nautilus that does the following actions:

Ctrl + L, Ctrl + C, F12, cd Ctrl + Shift + V

meaning: Open the path I am currently in on nautilus in Guake/tmux.

I followed the instructions that are mentioned in this question and created the following script (called test.sh):

#!/bin/bash
xdotool key Ctrl+L
xdotool key F12
xdotool type cd
xdotool key space
xdotool key Ctrl+Shift+V

and put it in ~/.local/share/nautilus/scripts as indicated here

It works fine when it is put in a directory and run from there.

However, when I run the script from the nautilus menu. it always enters the string

/home/bruni/.local/share/nautilus/scripts/test.sh

irrespective of where I am in Nautilus

PS: The proposed solution does not necessarily have to build on the above path of using xdotool. I am perfectly happy with any solution that would let me open the current nautilus path in guake/tmux (the running shell not a new one).

Bruni
  • 10,542

1 Answers1

0

The mistake I did in the above script is rather stupid. I did not consider that the commands are case sensitive. Here is the working script.

#!/bin/bash
xdotool key ctrl+l
xdotool key ctrl+c
xdotool key F12
xdotool type cd
xdotool key space
xdotool key ctrl+shift+v

I have added a shortcut under system settings --> keyboard --> custom shortcuts.

Now, if somebody could tell me how to have a shortcut to the script that is only activated from nautilus, that would be great.

A more reliable solution for the particular problem can be found here:

How to open directory in Guake from Nautilus

Bruni
  • 10,542