Add a custom option in Nautilus right click menu [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
When a user right-click on a folder in Nautilus, a menu appears. I want to add more options in that menu. I am using Gnome 3.
Is there any other way to customize that menu with command line? Actually I am making a Linux software and I want that these these options should be added when user installs the software.

This answer may be late, but it might be still useful.
No any third party package(s) needed
Write your own script and put it to: ~/.local/share/nautilus/scripts/
An example might be more clear:
If you want to add a Context Menu like Open By VSCode, you can create a file named OpenByVScode.sh with the content:
#!/bin/bash
code -n ${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS}
then, make it executable;
chmod 744 OpenByVScode.sh
Finally, cope/move this file to ~/.local/share/nautilus/scripts/
The Context Menu is ready to use, which will be displayed under script submenu.
Codes explanation:
First line: #!/bin/bash, to specify which language interpreter needed
Second line: code -n ${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS}
code is the VSCode default command, option -n means force to open in new window, on the contrary, it also has other option like -r, reuse the current windows, if the software is not open, this option will be the same like -n. For more, please check by code --help.
The variable NAUTILUS_SCRIPT_SELECTED_FILE_PATHS is defined by nautilus, like its name meaning, the path for the selected file or folder. It also has other three type of variables:
1. NAUTILUS_SCRIPT_SELECTED_URIS : newline-delimited URIs for selected files
2. NAUTILUS_SCRIPT_CURRENT_URI : current location
3. NAUTILUS_SCRIPT_WINDOW_GEOMETRY : position and size of current window
For more info, please refer HERE

You might want to use a Nautilus script, which doesn't require any additional installation like for Nautilus Actions.
In order to do that :
copy your script in the folder ~/.local/share/nautilus/scripts/
make sure it's executable.
It will then appear under the Scripts entry, from the right click context menu like below:

Nautilus Actions
We may define our own right-click context menu items with nautilus-actions
.
Run the Nautilus-Actions Configuration Tool either from the Dash, or from a terminal with
nautilus-actions-config-tool
In the Action tab give your action a sensible label, e.g. "Open in Terminator" and choose to display this in the selection or the context menu.
Next open the Command tab to enter the commands to run
Give in the full path to your command (/usr/bin/command_to_run) and program options.
After logging out and in again the right click context menu below will be displayed:

Related

How to create desktop shortcut passing custom arguments? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I have KDE 5.20.5 and would like to create a desktop shortcut for launching Chromium passing custom command line arguments to it.
Initially, I've right-clicked on a Launcher Chromium menu entry -> Add to Desktop... and the shortcut got created. However, it's just a symlink to /usr/share/applications/chromium.desktop and I can't modify it.
Then, I've tried to copy that /usr/share/applications/chromium.desktop onto my desktop manually so I could modify the copy and not touch the original. However even before editing it, it 's unable to launch Chromium. It displays the following message box when double-clicked:
Unknown error code 100 You are not authorized to execute this file.
Please send a full bug report at https://bugs.kde.org.
I've sweated googling an answer to such the basic question: what is correct \ recommended way of creating a modifiable desktop shortcut based on a Launcher menu entry in KDE Plasma?
You need to make the copied chromium.desktop file executable. With Dolphin file manager: right-click on your .desktop file → Properties → Permissions tab → check Is executable checkbox.
Alternatively, from the folder with your .desktop file, you can run:
chmod 755 chromium.desktop
Now it should be able to launch Chromium.
To add a custom argument(-s) to the launcher - back in the Properties of your .desktop file go to the Application tab and add your argument(-s) to the Command field after the path to the executable, for example:
/usr/bin/chromium --profile-directory="Default"
While we are at the Application tab, you may want to change the Name field to something like "Chromium w/args" to help distinguish launchers later on.
As an option, you can edit the .desktop file by opening it with a text editor of your preference. To edit the launch command, navigate to the [Desktop Entry] group header, under which locate the line starting with Exec= and add custom arguments to it.
To edit the name of the launcher, under the same header locate lines starting with Name= (Name[xx_XX]=, e.g. Name[en_US]= for localized names) and alter them as you wish.
More information on Desktop Entries can be found in its specification or on ArchWiki
To add your new launcher to the application menus (for the current user) - move .desktop file to the
~/.local/share/applications/
Now your launcher will be available in Application Launcher and Krunner.
If you want the new launcher to co-exist with the original (instead of overriding it), you should rename the .desktop file to something like chromium_args.desktop.
Run this command at root directory :
ln -s $PWD ~/Desktop/

UFT doesn't click a WebCheckBox of a pop-up [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I'm using UFT 15 to automatize some Web GUI Tests using VB Script. I have to click on a WebCheckBox of a pop up but it doesn't work because when I used Record to click on the WebCheckBox, UFT pasted that line:
Browser("A").Window("B").WinObject("Internet Explorer_Server").Click
I understood that WinObject("Internet Explorer_Server") is a generic object.
Could someone help me?
It looks like your browser isn't correctly recognized by UFT, the object hierarchy should be something like: Browser("A").Page("B").WebElement("C").Click (where WebElement could be quite a few things like Link, WebButton etc.).
Check if UFT's agent is enabled in your browser (in this case IE).
During the first launch of IE you should have seen a toolbar like this:
If you didn't click Enable then, you should go to the "Gear icon" -> Manage Add-ons menu and enable the UFT addon:

Text selection not works on Ubuntu terminal with SHIFT+ARROW (Left or right) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Recently I installed Ubuntu and I've some troubles with typing text on terminal, the problems not occurs on the text editors. I can't select the text to right or left using shift+arrow. When I try it, like shift+left, D letter is typed on the line, and C is typed using shortcut with arrow right. Resuming, I've two issues:
Select text with shift+arrow not working;
Select all text with shift+home or shift+end
I installed KDE on Ubuntu. Please, anyone can help me?
The standard Terminal does not use the same shortcuts (or even the same cursor behavior) as you might expect in a browser or text editor window. The shift key by itself does not select text that way. shift+home will scroll to the top, shift+end to the bottom, and using it with pg up/pg down will scroll up/down one screen. The arrow keys are mapped to A/B/C/D.
As you can see on this list, most of the commands are for moving around and managing processes. I usually just select text with the mouse, then copy with ctrl+shift+c and paste with ctrl+shift+v. As discussed on Ask Ubuntu, there appears to be no easy way to select arbitrary text without the mouse.
Alternative terminal programs may offer more options.
Update While this is not a standard shortcut, you can go into Terminal's Edit > Preferences > Shortcuts, find the Edit section, click the Select All row in the Shortcut Key column, then enter a new shortcut like ctrl+shift+a. This new shortcut will then let you then copy all of the terminal text.

How can I assign a name for a screen? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm using the Screen multiplexer tool on the command shell and open a lot of screens. I then forget which process ID associates with which task.
I would like to set a name for a screen, but I can't find an option in the man page.
Currently, listing the screens looks like this:
There are screens on:
5422.pts-1.aws1 (Detached)
5448.pts-1.aws1 (Detached)
5027.pts-1.aws1 (Detached)
3 Sockets in /var/run/screen/S-sb.
And I would like to see something like this:
There are screens on:
5422.logCleanWorker (Detached)
5448.overNightLongTask(Detached)
5027.databaseOverNightLongTask (Detached)
3 Sockets in /var/run/screen/S-sb.
How can I do this?
To start a new session
screen -S your_session_name
To rename an existing session
Ctrl+a, : sessionname YOUR_SESSION_NAME Enter
You must be inside the session
To create a new screen with the name foo, use
screen -S foo
Then to reattach it, run
screen -r foo # or use -x, as in
screen -x foo # for "Multi display mode" (see the man page)
As already stated, screen -S SESSIONTITLE works for starting a session with a title (SESSIONTITLE), but if you start a session and later decide to change its title. This can be accomplished by using the default key bindings:
Ctrl+a, A
Which prompts:
Set windows title to:SESSIONTITLE
Change SESSIONTITLE by backspacing and typing in the desired title. To confirm the name change and list all titles.
Ctrl+a, "
The easiest way is to use Screen with a name:
screen -S 'name' 'application'
Ctrl + a, d = exit and leave the application open
Return to Screen:
screen -r 'name'
For example, using Lynx with Screen.
Create a screen:
screen -S lynx lynx
Ctrl+a, d = exit
Later, you can return with:
screen -r lynx
I am a beginner to Screen, but I find it immensely useful while restoring lost connections.
Your question has already been answered, but this information might serve as an add on - I use PuTTY with PuTTY connection manager and name my screens - "tab1", "tab2", etc. - as for me the overall picture of the 8-10 tabs is more important than each individual tab name. I use the 8th tab for connecting to db, the 7th for viewing logs, etc. So when I want to reattach my screens I have written a simple wrapper which says:
#!/bin/bash
screen -d -r tab$1
where first argument is the tab number.

Add icon to existing EXE file from the command line [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Is there a command line tool that can add an icon to an existing executable file? It should be able to set the icon as the file's "main" icon that is shown in Explorer.
I don't have Visual Studio and cannot recompile the exe with custom resources containing the icon.
UPDATE: The best tool I have found since posting this question is by far the RCEDIT.exe utility that is included with WinRun4J.
Sorry, I haven't personally tried this one just yet, but because I am wanting this while bundling up an atom-shell app, I found it very interesting when https://github.com/atom/rcedit showed up in my first search for the RCEDIT utility mentioned in other answers.
One of its commands is:
$ rcedit "path-to-exe-or-dll" --set-icon "path-to-ico"
…so assuming this works, it is likely the solution I will use — my Windows build machine is already set up to fetch source using git and compile via gyp.
UPDATE: there's a pre-built executable available via https://github.com/atom/rcedit/releases/ and it works well for me on Win7 (from Git Bash/Msys shell although I'd be surprised if that makes a difference).
Resource Hacker is a free tool that allows you to modify resources in executables, and it can be scripted from the command line.
In my case, trying to add an icon using RCEdit.exe with either /A or /I switches resulted in a trimmed executable. I have a NSIS (NullSoft Installer System) - created setup that was originally 13 MiB, but after running RCEdit to add an icon to it, all of what remains of it is only a few kilobytes (close to the size of the icon), but yes the executable shows the icon.
Adding the icon using Resource Hacker worked for me. It doesn't even need an option to set the icon as default, being the only icon group resource. I used 103 as the name of the resource and 1033 as the language.
Have you tried ResourceTuner Console?

Resources