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

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Subhuti
Level 1
Level 1
Posts: 9
Joined: Wed Feb 21, 2018 1:02 pm

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

Post by Subhuti » Wed Feb 21, 2018 1:52 pm

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 Subhuti on Sat Mar 03, 2018 10:22 pm, edited 2 times in total.

User avatar
Moem
Level 16
Level 16
Posts: 6527
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Adding right-click context-menu items?

Post by Moem » Wed Feb 21, 2018 1:56 pm

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!

User avatar
killer de bug
Level 14
Level 14
Posts: 5394
Joined: Tue Jul 08, 2008 1:49 pm
Location: Graz, Austria

Re: Adding right-click context-menu items?

Post by killer de bug » Wed Feb 21, 2018 2:00 pm

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).
Image
If it ain't broke, fix it until it is.

Pat D
Level 4
Level 4
Posts: 360
Joined: Thu Jul 14, 2016 2:31 pm

Re: Adding right-click context-menu items?

Post by Pat D » Wed Feb 21, 2018 2:25 pm

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
Level 1
Level 1
Posts: 9
Joined: Wed Feb 21, 2018 1:02 pm

Re: Adding right-click context-menu items?

Post by Subhuti » Fri Mar 02, 2018 12:50 pm

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 5
Level 5
Posts: 774
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: Adding right-click context-menu items?

Post by slipstick » Fri Mar 02, 2018 1:51 pm

Subhuti wrote:
Fri Mar 02, 2018 12:50 pm
I'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
Level 1
Level 1
Posts: 9
Joined: Wed Feb 21, 2018 1:02 pm

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

Post by Subhuti » Fri Mar 02, 2018 3:37 pm

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 5
Level 5
Posts: 774
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 » Fri Mar 02, 2018 6:56 pm

Subhuti wrote:
Fri Mar 02, 2018 3:37 pm
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?
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 pm
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?
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
Level 1
Level 1
Posts: 9
Joined: Wed Feb 21, 2018 1:02 pm

Re: Adding right-click context-menu items?

Post by Subhuti » Sat Mar 03, 2018 10:26 pm

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.

User avatar
killer de bug
Level 14
Level 14
Posts: 5394
Joined: Tue Jul 08, 2008 1:49 pm
Location: Graz, Austria

Re: Adding right-click context-menu items?

Post by killer de bug » Sun Mar 04, 2018 5:26 am

Subhuti wrote:
Sat Mar 03, 2018 10:26 pm
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.
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.
Image
If it ain't broke, fix it until it is.

Subhuti
Level 1
Level 1
Posts: 9
Joined: Wed Feb 21, 2018 1:02 pm

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

Post by Subhuti » Sun Mar 04, 2018 12:58 pm

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.

Post Reply

Return to “Newbie Questions”