[SOLVED] Adding right-click context-menu items?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Subhuti

[SOLVED] Adding right-click context-menu items?

Post by Subhuti »

Hello!


I have just installed Linux Mint CInnamon on a USB, and am trying to explorer and decide if I can switch to this from Windows at some point.

I have a general question about Linux GUIs:

I am okay about learning about using the command line interface for some things, as I already like to automate many things with batch-files in Windows. But for random, non-automated processes, I like to have graphical programs to do operations quickly.

For example, if I want the sha-256 hashes of all files in a folder and its subfolders, I guess it's fine to run a script to run sha256hash or whatever the linux utility for doing that is called.

But if I am working on something, shifting from folder to folder, and come to a point where I suddenly need to get a sha-256 hash for a file, in Windows, I can just right click on the file, and choose "CRC SHA" from the context-menu, which is an option added when one installs the compression archiving utility 7zip.

This is quite time saving instead of having to open the prompt, cd to that folder, and type out a long commandline, just to achieve the same result.

You can say it's a sign of laziness, or whatever, but I have come to work in that way. That small tasks like these are easy to call up and get done through right-click context menu options, so I can concentrate my effort on bigger tasks.

Is that possible to add functionality like that to the Linux GUIs like Mint, or am I limited to having to do everything on the CLI?

And do graphical programs exist for small things, such as SHA-hashing, or are they all command-line programs? I guess that wouldn't be a problem, if it can be integrated into the right-clicking menus, and if it is easy to copy the output using the mouse....

Thank you.


Isak Lytting
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Moem
Level 22
Level 22
Posts: 16224
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Adding right-click context-menu items?

Post by Moem »

Subhuti wrote: Wed Feb 21, 2018 1:52 pm do graphical programs exist for small things, such as SHA-hashing
Certainly. Check the Software Manager and you'll find GtkHash.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
killer de bug

Re: Adding right-click context-menu items?

Post by killer de bug »

You can add actions in Nemo, and then you will see them in the contextual menu.
There is already such an action for checking the SHA sum of an iso file. You can customize it a little to get it running for all files.

Code: Select all

[Nemo Action]
Active=true
Name=Check SHA256
Name[de]=Prüfe SHA256-Hash
Name[fr]=Vérifier le SHA256
Comment=Check the SHA256 signature of the file
Comment[de]=Prüfe den SHA256-Hash der Datei
Comment[fr]=Vérifier la signature SHA256 de ce fichier
Exec=mint-sha256sum '%F'
Icon-Name=gtk-execute
Selection=S
Mimetypes=application/x-iso9660-image;
This is the content of mint-sha256sum.nemo_action located in /usr/share/nemo/actions/

You should browse this folder to learn more about actions.
If you want to create your own actions, store them in: ~/.local/share/nemo/actions (this is a folder in your home folder).
Pat D

Re: Adding right-click context-menu items?

Post by Pat D »

I found this in my "How To" bookmarks - I guess I forgot about it.
I haven't done it myself, but maybe it's what your looking for:

https://www.pcsteps.com/4434-add-right- ... nt-ubuntu/
Subhuti

Re: Adding right-click context-menu items?

Post by Subhuti »

Thank you so much! That's great. I tried that stuff with the CRC, and it worked just great! That's a relief.

I'd like to ask whether there is also a way of enabling right-click dragging a file to a destination?

One of my favourite time-saving things which was introduced to Windows at some point (I think it might have been Windows XP), was the ability to right-click drag a file to another folder. If you drag a selected file or group of files with the right-button down, when you release the button, a small window appears asking you if you want to copy or move the files there. If you have installed the compression-software 7Zip, there is also an option allowing you to extract an archive to the destination (if it is an archive), or to add the files to an archive at the destination (if the file is not an archive).

For mundane tasks like this, it's really nice to save some steps which can become a bit tedious in the long run. Instead of selecting a file, right-clicking, selecting copy, clicking on another window, selecting the folder-window, right-clicking, selecting paste, then the operations become reduced to right-clicking while dragging, releasing button, and selecting copy. Subjectively, it seems like a lot less work, and it is certainly much faster in many cases.

I really missed that when I tried Mint Cinnamon. Is this "missing" feature something do with Cinnamon or with the Nemo file-manager. Can it be altered by selecting a different file-manager, or does one have to select a different UI, like Mate, xcfe or KDE?

Or is this a behaviour by the system which can be altered by changing the contents of some files, like it was in the case of my question about adding menu items to context menus?


Thank you.
User avatar
slipstick
Level 6
Level 6
Posts: 1071
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: Adding right-click context-menu items?

Post by slipstick »

Subhuti wrote: Fri Mar 02, 2018 12:50 pmI'd like to ask whether there is also a way of enabling right-click dragging a file to a destination?
Use F3 to put Nemo into dual-pane mode - with the source folder in one pane and the destination folder in the other, use the middle mouse button (or press left and right buttons together) to drag the file. After releasing the mouse button, select move, copy, or link.
In theory, theory and practice are the same. In practice, they ain't.
Subhuti

Re: [SOLVED] Adding right-click context-menu items?

Post by Subhuti »

Great, thank you so much! I will try it!

The middle button is a bit awkward, because on my mouse, it's not a button but a wheel! And on my laptop, there IS no middle button! But right and left at the same time, you say? Is there anywhere one can change these "hotkey"-combinations to map them onto other keys/combinations?

Also, is there a way of adding menu items to this action as well, so I can, for instance, tell an archiving program to decompress files to the destination folder? And if so, is there a way to differentiate between file-extensions, so that one menu-option is presented to one type of file, and another to another type? So that one could offer to decompress files in the case of *.zip files, or to compress in the case of all other extensions?
User avatar
slipstick
Level 6
Level 6
Posts: 1071
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: [SOLVED] Adding right-click context-menu items?

Post by slipstick »

Subhuti wrote: Fri Mar 02, 2018 3:37 pmThe middle button is a bit awkward, because on my mouse, it's not a button but a wheel! And on my laptop, there IS no middle button! But right and left at the same time, you say? Is there anywhere one can change these "hotkey"-combinations to map them onto other keys/combinations?
My middle button is also a wheel. Instead of pressing straight down on the wheel, I find it easier to bend my finger so that my fingertip is on the rear of the wheel, then press down and slightly forward. I don't know if that key or key combination can be changed.
Subhuti wrote: Fri Mar 02, 2018 3:37 pmAlso, is there a way of adding menu items to this action as well, so I can, for instance, tell an archiving program to decompress files to the destination folder? And if so, is there a way to differentiate between file-extensions, so that one menu-option is presented to one type of file, and another to another type? So that one could offer to decompress files in the case of *.zip files, or to compress in the case of all other extensions?
I don't know how to add items to a context menu. I suggest you start a new thread to ask this question. Because you have marked this thread as [SOLVED], no one will be reading it anymore.
In theory, theory and practice are the same. In practice, they ain't.
Subhuti

Re: Adding right-click context-menu items?

Post by Subhuti »

I tried the left+right drag, and it works like you said! But I prefer the alt+left button, I think. In the case of the latter, you can press either first, and it still works. But with the former, you have to do ALL three things at the same time, or it will fail! Either opening the right-button context menu or opening the file. The alt-button method is more gentle in that way.
I don't know how to add items to a context menu. I suggest you start a new thread to ask this question. Because you have marked this thread as [SOLVED], no one will be reading it anymore.
Okay, I will. Now I have removed the [SOLVED] prefix. It was just a way of acknowledging that the original question had been answered so well.
killer de bug

Re: Adding right-click context-menu items?

Post by killer de bug »

Subhuti wrote: Sat Mar 03, 2018 10:26 pmOkay, I will. Now I have removed the [SOLVED] prefix. It was just a way of acknowledging that the original question had been answered so well.
You original question has been answered, and therefore the thread is marked as solved.
If you have a new specific question, please open a new thread. But I have to warn you, I have never heard of any means to modify the middle click button contextual menu.
Subhuti

Re: [SOLVED] Adding right-click context-menu items?

Post by Subhuti »

But I have to warn you, I have never heard of any means to modify the middle click button contextual menu.
When you say you have never heard of it. do you mean in Nemo, or in the case of any file manager?

It's odd if it turns out one cannot do it. It seems like such an obvious feature to add. Even Windows has it! It saves so many steps, so much typing. And since one cannot achieve the same saving of steps by any other method, it would seem to be quite neglectful to exclude. Unless one likes tedious, repetitive tasks.
Locked

Return to “Beginner Questions”