4 Simple Ways to Take Screenshots with the Context Menu in Linux

Not getting the option to take screenshots in the menu options? Not to worry, we have four easy solutions for you to try out on your Linux machine.

Obviously, you’re attempting to assist someone or want to attach screenshots of your work to a project file, class assignment, or anything else, but before arriving here, you tried to take a screenshot of the right-click context menu or something from the menu bar that didn’t show up in the screenshot, right?

Then, let me take you to the resolution part, where you will learn four different ways to capture screenshots with the right-click context menu, both with and without the need for any additional tools.

Take Screenshots with the Right-Click Context Menus using GNOME Screenshot

One of the simplest ways to capture a screenshot is to use the inbuilt tools, which you can always invoke by prt sc on your keyboard, to take a screenshot of the whole window, but the problem with that is that it doesn’t have the option to take screenshots with a menu option.

For that, you might have been using the delay function to take a screenshot with the menu option to get around this, but after GNOME 40.0, you can’t do this anymore because GNOME took away this function by default from GNOME Screenshot.

I’m not sure why they took that away, but you can still access it via the command line.

Oh! At least they didn’t remove it from here. You can use it to take screenshots with delay and interactive functionality from the command line, but it’s not convenient to take out the terminal every time to capture screenshots, so we will add the custom shortcuts, which you can use anytime to take the picture.

Step 1: Create and test command to bring back delay option

One of the first steps is to open the terminal and type the following command, which will show you the option to set the delay for taking screenshots with the context menu.

$ gnome-screenshot --interactive

As previously stated, the preceding command will bring up the option to take screenshots with an interactive option, where you can select a delay option to take a snapshot with the context menu, as shown in the image:

GNOME Screenshot interactive interface
GNOME Screenshot: Interactive Interface

To take a screenshot with the right-click context menu, first set the timer in “Delay in Seconds” as per your convenience, then click on “Take Screenshot,” which will be similar to the below image:

Result with right-click menu context to save file
Result: Screenshot of terminal with right-click context menu

Great! I was able to take a snip of the screen with a context menu. Thanks a lot. I’m coming back later to follow the next steps… Wait, wait, don’t go right now; follow the last step to assign a custom shortcut to show the interactive way to take a screenshot.

Step 2: Create a Custom Shortcut

Now you need to make this setting permanent so that you can always use the function by pressing the key combination. To accomplish this, follow the steps below, which may differ slightly in some distributions, but the majority of them will be the same.

  • Search for “Keyboard” or “Keyboard Shortcuts” in system settings
  • Under the hood, change the tab to “Shortcuts
  • Click on the “Add custom shortcut”
  • You will get the pop-up as shown below, where you just need to name the shortcut, copy and paste the gnome-screenshot --interactive command, and click on “Add”
Create Custom Command Shortcut in Linux
Create a Custom Command Shortcut in Linux
  • After that, you need to assign custom keybindings to call this function, so to do this, click on “Screenshot Interactive Mode” and go to the keybinding section to assign keystrokes like shown below.
Set Custom Keybinding
Customize Keybindings

Once it is done, close the window to test the keybindings and get screenshots. By pressing the specified key combination, you will be able to call the custom command shortcut.

Step 3: Result

After setting up the custom keybindings, it is important to test them and make sure they are working properly

Now press the combination key that you have chosen to take the screenshot with in the menu; here I have used "Ctrl + Alt + I," so let me run it for you and show the output with the right-context menu.

Result with right-click menu context to save file
Screen is captured with the right-click menu context

Take Screenshots with the Right-Click Context Menus using Shutter

In the top section, you learned how to take a screenshot with the right-click context menu without downloading any utilities, but it may not be useful to a distro that does not have GNOME Screenshot, so to make this article useful for other distros, let me introduce you to some of the open-source tools.

Shutter is one of my favourite tools because it allows you to take screenshots based on workspace, applications, or even just “menu,” and like that, you will find many useful features like annotation, cropping, and rotation, which will make your job much easier.

But for that, you need to install Shutter, which you can easily do by following this article: Install Shutter on all Linux distributions.

How do I take a screenshot of the menu?

To take a screenshot with the right context menu on Shutter, start the programme and click on “File” -> “New” -> “Menu,” which will take seconds to capture the menu, so in the meantime, press the right click and wait for the shutter to take a snap of it, as shown below.

Screenshot of menu
Screenshot of the menu

If you don’t want to take the screenshot like that, then you can use another option from File->New->Desktop, where you can take the full screenshot with a menu, but don’t forget to set a delay from the main interface.

Take Screenshots with the Right-Click Context Menus using ksnip

Alternatively, you can use ksnip, a cross-platform screenshot and annotation tool, which is also one of the tools I use, but I won’t recommend you use it because it sometimes behaves weirdly while taking the screenshot.

However, it’s a great tool for taking screenshots, which you can install by following this article: Ksnip: Advance Screenshot and Annotation Tool

To take screenshots with right-click context menus, follow this simple step: Open the ksnip, click on the “New” drop menu, and choose the “Full Screen” option to take a screenshot with menu options like those shown below.

Click on New to take screenshot
Click on “New” to take a screenshot

After taking a screenshot, use the built-in editor to crop the image for the perfect look.

Take Screenshots with the Right-Click Context Menus using scrot

If you are the kind of person who likes to perform all of their tasks using the command line, then I hope you will like the scrot (SCReenshOT), which is a minimal but powerful tool that allows you to capture your screenshot and save it to your home directory.

It’s a simple tool, but you can tweak it to your liking with the help of the options it provides. To get it set up on your system, simply execute the appropriate command for your distribution:

# Ubuntu/Debian based user
$ sudo apt scrot
# Fedora based user
$ sudo dnf install scrot -y
# Arch based user
$ sudo pacman -S scrot
# openSUSE based user
$ sudo zypper install scrot

Once the installation is over, you can run this simple piece of code to take screenshots with the right-click context menu, but you will not find any flashy effects on a successful capture.

For example, let me use the scrot command, to take a screenshot of my entire screen with a 5 second delay by running the below command.

$ scrot -d 5 

So how do you know if a file has been captured or not? Just check the current directory using the ls or exa command, which is a more modern way to list files.

To learn more about scrot usage, you can refer to the man page.

Wrap up

The four methods I’ve demonstrated for taking a screenshot have served their purpose, and I’d like to move on to another topic in the next post, which you’re going to read very soon.

In the mean time you can check 2 Ways to Capture Website Screenshots from the Command-line on Linux.

Leave a Reply