[SOLVED] Keyboard shortcut for 'Open in Terminal' option in Nautilus
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2018
    Location
    us
    Posts
    6
    Linux (Fedora) Firefox 61.0

    Keyboard shortcut for 'Open in Terminal' option in Nautilus

    Hi,

    I have gnome-terminal-nautilus installed in Fedora 28. This gives me a right-click menu entry 'Open in Terminal' when I am in a directory. Is there a way to assign a keyboard shortcut to get this functionality?

    Meaning: Say, I'm in Documents. Pressing that keybinding would open gnome-terminal with the path set as ~/Documents, and when I'm in ~/Downloads, it would open the terminal with the path set to ~/Downloads. (Basically, I want to emulate the functionality in KDE where pressing F4 opens Konsole in whatever directory the user is in.)

    I've tried the --working-directory option with gnome-terminal.
    Code:
    gnome-terminal --working-directory=<some-path-that-should-change-dynamically-as-I-move-from-folder-to-folder>
    But have not been able to get it to work.

    Thanks for any inputs and suggestions.



    --------------------
    Edit #1:(For some reason, my replies to any threads are not showing, and I'm unable to mark threads as solved.) Below is my reply to Dutchy's post:

    Thanks so much for pointing me to the resource, Dutchy. Worked perfectly on my setup.

    For anyone stumbling onto this thread, here are the steps that worked on Fedora 28:
    1. Create a script (say, Terminal) in the folder ~/.local/share/nautilus/scripts

    2. The contents of that file created in step #1 will be
    Code:
    #! /bin/sh
    gnome-terminal
    3. Make the script executable.

    4. In the folder ~/.config/nautilus, edit the file named 'scripts-accels'. (There was no such file on my setup, so I created one.) The contents of the file will be of the format:

    'Desired keyboard short cut' 'Name of the script created in step #1.
    Example: <Control>F12 Terminal

    In my case, the contents of the file script-accels are
    Code:
    F4 Terminal
    5. Save the script, quit and restart nautilus
    Code:
    nautilus -q && nautilus
    Now upon browsing to any directory and pressing the keyboard shortcut should open gnome-terminal in that directory.

    (I don't see the full path in my terminal. Environment variables can be set to get more details, as mentioned in this link, but I haven't played with them. If someone is able to tweak what I've posted to show the full path in the terminal, that would be great.)

    Once again, thanks to Dutchy.

    Source


    ---------------------------------------------
    Edit #2:
    A simpler approach if you don't want to use scripts: My original need for such a solution was due the difficulty in getting the the right-click menu on nautilus to work on folders with many files / subfolders and not enough empty space to right click on (I use the 'list view'). In that case the following worked: Browse to a folder, press CTRL+F10 (or, if your keyboard has it, use the 'menu' key, usually next to the right CTRL key on the keyboard). That should open the right-click menu. Select 'Open Terminal here'. The solution outlined in Edit #1 seemed to remove the CTRL+F10 shortcut for right-click menu.
    Last edited by fedebsuse; 14th August 2018 at 01:53 PM. Reason: Trying to mark as solved

  2. #2
    Join Date
    Aug 2011
    Location
    ~
    Posts
    1,939
    Linux (Fedora) Firefox 61.0

    Re: Keyboard shortcut for 'Open in Terminal' option in Nautilus

    These instructions (or something similar) should work.

  3. #3
    Join Date
    Jan 2018
    Location
    us
    Posts
    6
    Linux (Fedora) Firefox 61.0

    Re: Keyboard shortcut for 'Open in Terminal' option in Nautilus

    Thanks so much for pointing me to the resource, Dutchy. Worked perfectly on my setup.

    For anyone stumbling upon this thread, here are the steps that worked on Fedora 28:

    1. Create a script (say, Terminal) in the folder ~/.local/share/nautilus/scripts

    2. The contents of that file 'Terminal' will be
    Code:
    #! /bin/sh
    gnome-terminal

    3. Make the script executable.

    4. In the folder ~/.config/nautilus, edit the file named 'scripts-accels'. (There was no such file on my setup, so I created one.) The contents of the file will be of the format:

    'Desired keyboard short cut' 'Name of the script created in step #1' (sans quotes)
    Example:
    Code:
    <Control>F12 Terminal
    In my case, the contents of the file script-accels are
    Code:
    F4 Terminal
    5. Save the script, quit and restart nautilus
    Code:
    nautilus -q && nautilus
    .

    Now upon browsing to any directory and pressing the keybinding should open gnome-terminal in that directory.

    (I don't see the full path in my terminal. Environment variables can be set to get more details, as mentioned in this link, but I haven't played with them. If someone is able to tweak what I've posted to show the full path in the terminal, that would be great.)

    Source: https://askubuntu.com/questions/6800...us-3-16/680053

Similar Threads

  1. Replies: 0
    Last Post: 1st September 2017, 09:26 AM
  2. Open a new terminal using keyboard shortcut.
    By Simen in forum Using Fedora
    Replies: 2
    Last Post: 11th March 2009, 07:55 PM
  3. Replies: 10
    Last Post: 28th May 2008, 01:33 AM
  4. keyboard shortcut for renaming files in nautilus?
    By slade17 in forum Using Fedora
    Replies: 2
    Last Post: 26th February 2007, 12:06 AM
  5. Terminal Keyboard Shortcut
    By smithxi in forum Using Fedora
    Replies: 3
    Last Post: 10th November 2006, 07:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •