What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use the command that matches your Linux display session: run scrot screenshot.png or ImageMagick’s import -window root screenshot.png on X11; run grim screenshot.png on a Wayland compositor that supports the screencopy protocol. For an interactive Wayland region, use grim -g "$(slurp)" screenshot.png. Bash is only launching the utility—the display server, compositor, and installed dependencies determine whether capture works.
Check whether the session is X11 or Wayland
Before choosing a command, identify the graphical protocol. In Bash, run:
echo "$XDG_SESSION_TYPE"
The usual result is x11 or wayland. If the variable is empty or reports something unexpected, inspect your desktop login session and test the utilities’ help output. A remote shell, a container, or a shell without access to the graphical session may also lack the display environment required for capture.
- X11: use X11-aware tools such as scrot or ImageMagick import.
- Wayland: use a compositor and tool path that exposes the required screencopy protocol; grim is the direct command-line option documented for that workflow.
- Desktop tools: GNOME Screenshot and KDE Spectacle have their own command-line interfaces, but exact flags depend on the installed version.
Wayland screenshots with grim
Grim’s manual documents PNG output by default, standard-output support, geometry selection, output selection, and cursor options. Its compositor requirement is important: grim currently needs screencopy support, so the command is not guaranteed on every Wayland desktop.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Capture the whole desktop to a PNG
grim screenshot.png
This writes a file named screenshot.png in the current directory. Use an absolute or expanded path when a script may run from an unknown working directory:
grim "$HOME/Pictures/desktop-$(date +%Y%m%d-%H%M%S).png"
Capture all outputs using grim’s default handling
grim
When no filename is supplied, grim follows its default output handling. Check the installed manual with grim --help or man grim if you need to confirm where your distribution sends that output.
Select a region interactively
Install slurp separately, then run:
grim -g "$(slurp)" screenshot.png
slurp draws the selection interface and returns rectangle coordinates; grim captures that rectangle. Both programs must be installed, and the compositor must support the required path. Pressing Escape in the selector normally cancels the command, so a script should handle a non-zero exit status:
set -e
geometry="$(slurp)" || exit 1
grim -g "$geometry" screenshot.png
Capture an image to standard output or the clipboard
Grim uses - for image data on standard output:
grim - > screenshot.png
For a Wayland clipboard, install the separate wl-copy utility and pipe the image:
grim - | wl-copy
Saving a file and copying an image are different workflows. A clipboard command may appear to do nothing if no Wayland clipboard provider is available or if the shell is not connected to the active desktop session.
Output, cursor, and geometry options
Run grim --help and read the local manual for the exact option spelling in your package. The documented option set includes choosing an output, including the pointer, and supplying a rectangle in layout coordinates. Keep the command and destination explicit in automation so a change in monitor arrangement does not silently capture the wrong area.
X11 screenshots with scrot
Scrot’s Debian manual describes it as a scriptable command-line capture utility that can save multiple image formats and capture a window or rectangle.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Capture the full X11 screen
scrot screenshot.png
Use a shell-generated filename for repeatable jobs:
mkdir -p "$HOME/Pictures"
scrot "$HOME/Pictures/x11-$(date +%Y%m%d-%H%M%S).png"
Window and region capture
Scrot supports selecting a specific window or rectangle; its flags vary by release. Start with scrot --help or man scrot and use the syntax installed on your system rather than copying a flag from an unrelated version. This avoids confusing an X11 window identifier with a Wayland surface, which cannot be assumed to be interchangeable.
ImageMagick import on X11
ImageMagick’s Import documentation shows capture of some or all of an X server screen. The commonly used root-window command is:
import -window root screenshot.png
On installations where ImageMagick uses the magick launcher, the equivalent form may be:
magick import -window root screenshot.png
Command names differ between ImageMagick versions and distributions. If one form is not recognized, run import -help or magick import -help. These commands target an X server; they are not a general native-Wayland solution.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →GNOME and KDE command-line tools
GNOME Screenshot
The gnome-screenshot manual documents full-screen, active-window, area, clipboard, delay, and output-file modes. Because option spelling and availability can change with the installed package, begin with:
gnome-screenshot --help
man gnome-screenshot
Use the displayed option for your required target (whole screen, active window, or selected area), then provide an output filename if the help text supports it.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
KDE Spectacle
KDE’s Spectacle documentation explains starting the application from the command line. Background mode, output-file, and capture-mode flags depend on the installed KDE Frameworks version, so check:
spectacle --help
Spectacle can be useful when your KDE session exposes capture behavior that a generic utility does not, but do not assume GNOME and KDE flags are interchangeable.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Make Bash scripts reliable
Fail clearly and create the destination directory
#!/usr/bin/env bash
set -Eeuo pipefail
out_dir="${1:-$HOME/Pictures/screenshots}"
mkdir -p -- "$out_dir"
case "${XDG_SESSION_TYPE:-}" in
wayland)
command -v grim >/dev/null || { echo "grim is required" >&2; exit 127; }
output="$out_dir/wayland-$(date +%Y%m%d-%H%M%S).png"
grim "$output"
;;
x11)
command -v scrot >/dev/null || { echo "scrot is required" >&2; exit 127; }
output="$out_dir/x11-$(date +%Y%m%d-%H%M%S).png"
scrot "$output"
;;
*)
echo "Unsupported or unknown XDG_SESSION_TYPE" >&2
exit 2
;;
esac
printf 'Saved %sn' "$output"
This script deliberately refuses to guess. If a Wayland compositor lacks screencopy support, installing scrot will not solve the protocol mismatch; if an X11 session lacks scrot, install it or substitute ImageMagick after checking its help.
Check the result and preserve exit status
if [[ ! -s "$output" ]]; then
echo "Capture produced no data" >&2
exit 1
fi
file "$output"
For pipelines, avoid hiding failures in a later command. set -o pipefail (included above through set -Eeuo pipefail) makes a failed grim invocation fail the pipeline rather than reporting only the clipboard command’s status.
Common failures and fixes
“Cannot open display” or an empty display variable
The shell may not be attached to the graphical login, especially over SSH, through sudo, or inside a service. Run the command in a terminal within the desktop session. On X11, verify that DISPLAY is set; on Wayland, verify that WAYLAND_DISPLAY and the session’s runtime directory are available. Do not copy those values from another user’s session without understanding the security implications.
Grim reports missing screencopy support
This is a compositor capability issue, not a filename problem. Check grim --help, your compositor documentation, and distribution packages. A desktop-specific tool such as GNOME Screenshot or Spectacle may use a different portal path. A community report illustrates that Wayland behavior can vary by configuration; it does not establish a limitation for every GNOME setup: GNOME Discourse discussion.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match“slurp: command not found” or selection fails
Install slurp separately from grim and test it by itself. If Escape cancels selection, do not pass an empty geometry to grim. A selector may also fail when the compositor does not expose the needed interfaces.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
The screenshot is black, partial, or from the wrong monitor
Confirm the session type, monitor layout, and whether you requested an output or a layout rectangle. X11 tools cannot be expected to understand native Wayland surfaces. For multi-monitor Wayland capture, consult grim’s local manual for output selection and coordinate behavior.
The command works interactively but not from cron or a service
Scheduled jobs usually lack the desktop environment, authentication, runtime directory, and display variables. Run the capture from a user-level desktop service with the required environment, or pass a deliberate environment only when you understand the session’s permissions. A system service should not blindly capture a user’s display.
ImageMagick’s import command is unknown
Try the launcher form documented by your package: import -help or magick import -help. Install ImageMagick’s import component if your distribution packages it separately.
Free tools Windows power users keep installed
One-click scans. No signup required.
Performance, privacy, and file-management considerations
Desktop capture is normally fast, but full multi-monitor images are larger than a single window or region. PNG preserves exact pixels and is convenient for documentation; choose another format only when the installed tool and your workflow support it. Timestamped names prevent accidental overwrites, while mkdir -p makes scripts repeatable.
Remember that screenshots can contain passwords, tokens, private messages, and customer data. Restrict output-directory permissions, avoid sending captures to world-readable locations, and remove temporary files when a script no longer needs them. Clipboard contents may remain available to other applications until replaced.
One frontend, with qualifications
A wrapper such as gscreenshot documents several X11 and Wayland backends. It can reduce command differences, but its functionality and dependencies still vary by configuration, so inspect its README and local help before relying on it in automation. The archived grim repository points development to SourceHut; its examples remain useful, while your distribution’s current manual is the better reference for installed flags.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If your goal is a screenshot of a website rather than the local desktop, ScreenshotNeo returns a PNG, JPEG, WebP, or PDF from one GET request. Its API accepts the page URL and can wait for content, load lazy images, select an element, set a viewport or device preset, apply custom CSS or JavaScript, block resources, and use cookies or headers. Before capture it accepts consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled.
Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
See the ScreenshotNeo API documentation for all options. A direct cURL capture is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
You get 1,000 screenshots per month free with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Create a free ScreenshotNeo account.
Quick decision checklist
- Is
$XDG_SESSION_TYPEx11orwayland? - For X11, is scrot or ImageMagick installed and able to open the display?
- For Wayland, does the compositor support screencopy, and are grim and (for regions) slurp installed?
- Do you need a file, standard output, or a clipboard image?
- Will the script run inside the active desktop session rather than cron or an unrelated service?
- Does the destination protect sensitive screenshot content?
Frequently Asked Questions
Can scrot capture a native Wayland desktop?
No. Scrot targets an X server. Use grim when the Wayland compositor supports screencopy, or use a desktop-specific portal tool.
Recommended Free Tools
Is slurp included with grim?
No. Slurp is a separate region-selection utility used by the demonstrated grim command.
How do I put a grim screenshot on the clipboard?
Run grim - | wl-copy; wl-copy must be installed and available in the active Wayland session.
Why does a command-line screenshot work in a terminal but fail in cron?
Cron generally lacks the desktop display variables, runtime directory, and permissions available to an interactive graphical session.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

