How do I add the option to the right click highlighted text and paste to terminal?
I want to short cut the action of highlighting commands from documents and web browser, right click and select copy, open terminal, right click and select paste and then repeat the action for each command.
When I right click in my file manager I get these options- 1.NEW FOLDER 2.NEW DOCUMENT+ 3.RESTORE MISSING FILES... 4.OPEN IN TERMINAL 5.PASTE 6.PROPERTIES
When I right click in my web browser (blank space not selecting text or image) I get these options- 1.options to move back one page, refresh, bookmark 2.save page as... 3.save page to pocket 4.send page to device 5.view background img 6.select all 7.view page source 8.view page info 9.inspect element 10.screen shot
When I right click highlighted commands in my web browser I get these options- 1.copy 2.select all 3.search google for (highlight text) 4.view selected source 5.inspect element (6th) option...............HERE
So I want to add a 6th option above (paste to terminal) or (paste to CL). this option would after highlighting the command and right clicking and selecting the option,open a terminal and paste the command straight to terminal, leaving the term window open and the cursor at the end of command text so i can add text or press enter to execute the command. I would then have to use the mouse again to navigate back to the browser.
The things I have tried are- 1. I did multiple google searches, all i got were mostly options on how to copy/paste in term or right click and middle button options for opening term in current directory. 2.I tried and failed to follow a old guide for Nautilus-Actions-tools, and faild. 3.looked into system settings at mouse options. (there are 2).
my system info is.
Linux me-ProDesk-600-G2-DM 4.13.0-32-generic #35~16.04.1-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
I am using Firefox vs 58.0.1 (64bit) canonical-1.0
If in some way it helps in using a wireless keyboard with touchpad, logitech k400r
Sorry for a long post, I am trying to add as much detail as possible to get the best answer possible, also last time i tried to post a screen shot on this site it wouldn't let me, so i had to type out my examples, i will try to add screen shots again. I am new to linux so please talk to me like a dumb child.
p.s I just tried to upload screen shots but I am not allowed to yet so here is a google drive share link,
#update. I've been reading a help/how to guide on nautilus conf action tool. Understand and can follow most of it, I get stuck at the scripting and Parameters part. Below is a copy and paste :) of the first half of the guide. I am stuck on numbers 7 through 10...
1...In this example, we are going to create an action which displays some pretty informations about the current selection. Checking for prerequisites
This action will require Zenity.
Zenity is a program which will allow you to create a graphical user interface from a command-line. You should check that this program is installed on your system, by example by typing the following command in a terminal: zenity then press Return.
2...Creating the action To create a new action, choose File ▸ New action ( Ctrl+N ). A new action is inserted in the items list, and its properties are displayed in the tabs on the right pane. The label of the currently edited action (this one) is added to the application name in the title bar.
3...In the Items list, the new action is displayed in italic characters. Italics are used as a reminder that the item has not yet been saved. As another reminder that there is some pending modifications, an asterisk (« * ») comes to prefix the application name in the title bar.
4...Qualifying your new action It merely consists of choosing how your action will be displayed in the file manager context menu. Enter My first action in the Context label entry box. The Context label entry box contains the label of the action as you want it to be displayed in the file manager context menu. The label is a mandatory property of your action. If it happens to be empty, then your action will be considered as invalid by Nautilus-Actions: it will be displayed in red in Items list and will never be candidate to be displayed in the file manager context menus.
5...Enter This will execute an action with some parameters in the Tooltip entry box. The Tooltip entry box contains the text you want to be displayed as a short help to your action.
6...Select in the Icon drop-down list. The Icon selection defines the icon which will be associated with your action in file manager context menus and in the toolbar. You have two ways of choosing the icon associated to your action: Click on the Icon drop-down list to select an icon. Click on Browse to search for an image in the filesystem.
7...Specifying the command to be executed When you will select your action in the file manager context menu, this command will be executed, with arguments of your choice. Click on the Command tab to show the page which will permit you to enter the command.
8...Enter zenity in the Path entry box. The Path entry box defines the command which will be executed when you will select your action in the file manager context menu. You have two ways of defining the command to be executed:
9...Enter it in the Path entry box. Click on Browse to select the executable file on the filesystem. If the command you enter does not have an absolute path, then it will be searched for in the PATH variable at execution time.
10...Enter --info --text='%c selected item(s): %U' in the Parameters entry box. The Parameters contains the arguments which will be passed to your command when it will be executed. These arguments may embed parameters which will be expanded at runtime. If both Path and Parameters are empty, then this action will be considered as invalid: it will be displayed in red in Items list and will never be candidate to be displayed in the file manager context menus.
11...Saving To save all pending modifications, choose File ▸ Save ( Ctrl+S ). Nautilus automatically takes into account your new action, and displays it in its context menu.
Note that the 3rd tab in the program allows you to choose how the action is executed.
3rd tab= Execution -first option is called-Execution mode- it gives 4 options. 1.normal 2.in a terminal 3.embeded 4.display output
-second option is start up mode, 2 options 1.a check box to notify at start up 2.a text entry box labeled start window manager class
-third option isexecute as user with a text entry box.