maim(1)

πŸ“¦
version 5.8.2 Β· 3 versions
, in alpine 3.24, arch rolling, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– maim β€” the manual page, but make it cute πŸ’–

okay bestie, sit down, hydrate, and let me tell you about maim (that's maim(1) if we're being formal, which we're not) 🫢


✨ NAME ✨

maim β€” capture screenshot of desktop and make image πŸ“Έ


✨ SYNOPSIS ✨

maim [OPTIONS] [FILEPATH]

✨ DESCRIPTION ✨

so maim literally stands for make image (yes, it's that girl πŸ’…) and what she does is take a screenshot of your desktop and encode it into a png, jpg, bmp or webp image. that's the whole vibe.

and here's the iconic part: by default she just dumps the encoded image data straight to standard output. no file, no fuss, just data. slay.


✨ OPTIONS ✨

  • -h, --help β€” prints the help and then dips out. bye πŸ‘‹
  • -v, --version β€” prints the version and exits. iconic, brief, perfect.
  • -x, --xdisplay=hostname:number.screen_number β€” sets the xdisplay to use. tell her which display, she'll go there. 🌈
  • -f, --format=STRING β€” sets the desired output format. by default maim will try to figure out the format all by herself from the output file 🧠✨. and if that fails? she defaults to a lossless png format. currently only supports png, jpg, bmp, and webp β€” those four, no more, no less, don't push her.
  • -i, --window=WINDOW β€” by default maim captures the root window. this parameter overrides that and sets the desired window to capture. allows for an integer, hex, or root for input. she's flexible like that πŸ’β€β™€οΈ
  • -g, --geometry=GEOMETRY β€” sets the region to capture, using local coordinates from the given window. so -g 10x30-5+0 would represent the rectangle wxh+x+y where w=10, h=30, x=-5, and y=0. x and y are the upper left location of this rectangle. math but make it fashion πŸ“
  • -w, --parent=WINDOW β€” by default maim assumes the --geometry values are in respect to the provided --window (or root if not provided). this parameter overrides that behavior by making the geometry be in respect to whatever window you provide to --parent. allows for an integer, hex, or root for input. it's giving "everything is relative" πŸ¦‹
  • -B, --capturebackground β€” by default, when capturing a window, maim will ignore anything beneath the specified window. this parameter overrides that and also captures elements underneath the window. peek behind the curtain energy.
  • -d, --delay=FLOAT β€” sets the time in seconds to wait before taking a screenshot. prints a simple message to show how many seconds are left before a screenshot is taken ⏳. see --quiet for muting this message.
  • -u, --hidecursor β€” by default maim super-imposes the cursor onto the image, and you can disable that behavior with this flag. bye bye cursor arrow πŸ‘‹πŸ–±οΈ
  • -m, --quality β€” an integer from 1 to 10 that determines the compression quality. for lossy formats (jpg and webp), lower settings will produce smaller files with lower quality, while higher settings will increase quality at the cost of higher file size. a quality of 10 is lossless for webp. for png, lower settings will compress faster and produce larger files, while higher settings will compress slower, but produce smaller files. no effect on bmp images. bmp said "not today" πŸ’€
  • -s, --select β€” enables an interactive selection mode where you may select the desired region or window before a screenshot is captured 🎯. uses the settings below to determine the visuals and settings of slop.

πŸŽ€ SLOP OPTIONS πŸŽ€

(yes these are literally slop's options, maim is borrowing, we love a crossover episode 🀝)

  • -b, --bordersize=FLOAT β€” sets the selection rectangle's thickness. thick or thin, her choice πŸ’…
  • -p, --padding=FLOAT β€” sets the padding size for the selection, and this can be negative. negative padding, she contains multitudes 😌
  • -t, --tolerance=FLOAT β€” how far in pixels the mouse can move after clicking, and still be detected as a normal click instead of a click-and-drag. setting this to 0 will disable window selections. alternatively setting it to 9999999 would force a window selection. go big or go home fr fr πŸ”₯
  • -c, --color=FLOAT,FLOAT,FLOAT,FLOAT β€” sets the selection rectangle's color. supports RGB or RGBA input. depending on the system's window manager/OpenGL support, the opacity may be ignored. rip transparency, sometimes.
  • -r, --shader=STRING β€” this sets the vertex shader, and fragment shader combo to use when drawing the final framebuffer to the screen. this obviously only works when OpenGL is enabled. the shaders are loaded from ~/.config/maim. see https://github.com/naelstrof/slop for more information on how to create your own shaders. custom shaders?? main character energy ✨
  • -n, --nodecorations=INT β€” sets the level of aggressiveness when trying to remove window decorations. 0 is off, 1 will try lightly to remove decorations, and 2 will recursively descend into the root tree until it gets the deepest available visible child under the mouse. defaults to 0. level 2 is unhinged in the best way 🌲
  • -l, --highlight β€” instead of outlining a selection, maim will highlight it instead. this is particularly useful if the color is set to an opacity lower than 1. glow up ✨
  • -D, --nodrag β€” allows you to click twice to indicate a selection, rather than click-dragging. two taps, no dragging, we love efficiency 🫢
  • -q, --quiet β€” disable any unnecessary cerr output. any warnings or info simply won't print. shhh 🀫
  • -k, --nokeyboard β€” disables the ability to cancel selections with the keyboard. no escape, literally. 😭
  • -o, --noopengl β€” disables graphics hardware acceleration. sometimes you just wanna go slow and steady 🐒

🌸 EXAMPLES 🌸

screenshot the active window and save it to the clipboard for quick pasting.

maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png

save a desktop screenshot with a unique ordered timestamp in the Pictures folder.

maim ~/Pictures/$(date +%s).png

save screenshot to the Pictures folder and add it to the clipboard at the same time.

maim | tee ~/Pictures/$(date +%s).png | xclip -selection clipboard -t image/png

prompt for a region to screenshot. add a fancy shadow to it, then save it to shadow.png.

maim -s | convert - \( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage shadow.png

in scripts, here in i3 window manager: enable light on the Thinkpad T430 laptop, wait 5 seconds, screenshot all displays, save file like ~/screenshots/2022-dec-21--12-56-08_maim.png, disable light, show i3 notification for 3 seconds.

bindsym $mod+Shift+x exec "    echo 1 > /sys/class/leds/platformmicmute/brightness;     sleep 5;     maim --hidecursor ~/screenshots/$(date +%Y-%b-%d--%H-%M-%S_maim | tr A-Z a-z).png;     echo 0 > /sys/class/leds/platformmicmute/brightness;     i3-nagbar --message 'Screenshot created' --type warning &     sleep 3; pkill i3-nagbar"

πŸ‘€ SEE ALSO πŸ‘€

slop(1) β€” go say hi to her sister, she's the selection queen πŸ’œ


πŸ› BUGS πŸ›

no known bugs. she's perfect, your honor βœ¨πŸ‘‘


🫢 AUTHOR 🫢

Dalton Nell (naelstrof@gmail.com) β€” thank you for the screenshots king πŸ‘‘


ok that's the whole page bestie, go take some screenshots and be iconic about it πŸ“ΈπŸ’–

and that's a wrap β€” this page lives on Linux, it's the version from 2021-02-03, and yes it's still maim(1) in spirit πŸŽ€ bye pookie πŸ’œ