-1

I'm okay with ubuntu's classic terminal, (I'm using 18.04) but I want something more useful if I can.

I installed guake, it works fine, except I can not open guake terminal in a specific directory. When I right click, I want to see 'Open Guake Here' or something, not just 'open terminal here'.

I also have installed a terminal called terminology, it is useful too, but still I can't open it in a specific directory.

Is there a ubuntu terminal that gives us this oppurtunity? Or can I add this option for my other little terminals?

1

Run the following commands to add an entry called “Open Guake” to the “Scripts” submenu in Nautilus’ dropdown menu:

echo \
'#!/bin/bash
cd "${NAUTILUS_SCRIPT_CURRENT_URI##file://}" &&
guake' \
>~/.local/share/nautilus/scripts/"Open Guake"

to save the script,

chmod +x ~/.local/share/nautilus/scripts/"Open Guake"

to make it executable and

nautilus ~/.local/share/nautilus/scripts/

to visit the scripts directory for the script to appear in the dropdown menu. When you click the new “Open Guake” entry now, Guake opens up with the current directory as your PWD.

Further reading

  • Thanks for your reply! But I get an error after I run nautilus ~/.local/share/nautilus/scripts/, then I get: /home/teoman/.local/share/nautilus/scripts/Open Guake: line 2: cd: file:///home/teoman/.local/share/nautilus/scripts: No such file or directory – Teoman Yüksel Jun 5 '18 at 14:06
  • @TeomanYüksel I updated the answer, try again by simply running all three commands please. – dessert Jun 5 '18 at 14:18
  • Haha thanks for the occupation, but I get Nautilus-Share-Message: 19:53:59.566: Called "net usershare info" but it failed: Failed to execute child process “net” (No such file or directory) at the end. – Teoman Yüksel Jun 5 '18 at 16:55
  • @TeomanYüksel net usershare info is something else entirely. What did you do to get that error? Trying to share something from Nautilus? – Fabby Jun 5 '18 at 18:13
  • @Fabby Just followed the dessert's instructions. – Teoman Yüksel Jun 5 '18 at 18:58
0

Running Ubuntu 18.04.1 LTS. Full credit to this solution. I'm posting here to fully elaborate on the process which worked for me:

  1. Navigate to the location where scripts are stored for nautilus:

    cp ~/.local/share/nautilus/scripts/
    
  2. Then create a new file for the script in your text editor of choice (you might like to call it "Open in Guake")

    sudo nano "Open in Guake"
    
  3. Add the following code to the file:

    #!/bin/bash
    
    base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
    if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
     dir="$base"
    else
         while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
         dir="$base/$1"
    fi
    
    guake -n "$dir" -r "`echo ${dir%/} | rev | cut -d'/' -f1 | rev`" -t
    
  4. Save the file, and change the permissions to make it executable

    sudo chmod +x "Open in Guake"
    

Fingers crossed, you should now be able to click on a file or folder, and a scripts menu should now appear, with a sub-option to open the directory of that file/folder in Guake. I didn't need to reboot or restart Nautilus to get it going.

NOTE: You can't click in white space for this to work (I wasn't able to find a solution to this). The scripts menu is hard-coded to work only when right-clicking on files/folders.

Also, if Guake is not open, it probably won't pop up either. However, if you hit F12 or your defined mapping to open Guake, it should open to the tab with the folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.