Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Maim – A simple screenshot utility for Linux (github.com/naelstrof)
124 points by naelstrof on Oct 16, 2014 | hide | past | favorite | 83 comments

Looks nice, other good screencapture applications for Linux would be fx Shutter, http://shutter-project.org/, also really nice.

I remember being a big fan of Shutter, though some time ago, I switched to ScreenCloud ( https://screencloud.net/ ), for its ease in automatic instantly sharing.

I remember I tried Screencloud years ago and didn't like it. Unfortunately I don't remember why, but knowing myself it probably was a privacy issue. Shutter does everything right IMO and I'm still using it.

Shutter works well with my common workflows. It lets me grab a screen area, adjusting the captured area on the fly BEFORE capturing, then saves the capture to a file, lets me launch its editor with a single click to do basic stuff like drawing lines, circles, and labels, then lets me copy the finished image to the clipboard.

Can't recommend Shutter enough; it's great!

It can take a website (gnome-web-photo), full screen or only partial shots; can edit them and has a few handy plugins (censor, pixelise, text etc), can upload to all sorts of image hosting sites including your own FTP and can use the Gnome gvfs, too.

I use shutter heavily, and have been doing for years - recommended.

Shutter is fantastic, has a bunch of dependencies but it's actually good.

It looks like a nice tool if you need scripting capabilities. For everyday use I prefer KDE's ksnapshot; mapped on PrintScreen in KDE.

It has all the features of maim (minus easy scripting) and more. Also it lets you select a window or a section of a window using your mouse. Of course things like capturing the decorations or the mouse pointer are there too.

I have found KSnapshot to be the best snap shot utility I have used on any system.

Plasma Desktop users could also use Pastebin plasmoid in mix with KSnapshot. Just drag the image from KSnapshot to Pastebin plasmoid and a few seconds later, your image is uploaded to an image hosting service and its url is copied to your clipboard, ready to be pasted anywhere you want.


    cat /dev/screen  > /home/sixs/screenshot

Wouldn't that dump the screen in raw format though?

If so, you can do something similar if you have a framebuffer interface on linux by doing "cat /dev/fb0 > /wherever" although admittedly it'll dump all the buffers if you're multi-buffering.

As a plan9 image formatted file. The poster below introduces topng but there is slso togif and others.

But that just muddies the waters, You could email the file to another plan9 user, plan9 tools can work with it, display it etc

I guess you would do something like: cat /dev/screen | pngenc > foo.png

Actually it would be:

  topng < /dev/screen > foo.png

Wow. That's kinda awesome. I don't even see /dev/audio on Ubuntu now. I wonder if Plan9 is actually usable right now or is it only suited to talking about how operating systems could be?

What is your definition of "usable"? It's certainly stable.

I wonder how that worked for multi-user or multi-screen setups?

The filesystem in plan9 allows per-process namespaces.

The nearest linux equivalent is probably "xwd".

What if the screen updates at the same time? Does plan9 give any atomic guarantees?

Great readme explaining why to use this over scrot (the tool I use atm) and others. An improved render rectangle was the first item I checked for (saw this mentioned in slop). Section with examples of of other commands to combine is great as well.

I think good readmes are a bit undervalued on GitHub.

Hey thanks! I appreciate it, I put quite a bit of work making sure their purpose was clear so people wouldn't just label it as another drop in an ocean of screenshot utilities.

Bah, in my day you used "xwd" because that’s what you had, and you liked it!

Seriously though, I am pretty content with xwd, and would probably use it again; it’s not really worth the effort to learn whatever is in vogue this month every time for a screenshot, unless it offers some actual compelling advantage.

Thank you. I do quite a lot of test automation and in many cases I want take screenshot of either the application we are testing or the whole desktop when ever test fails.

On Windows I use https://code.google.com/p/screenshot-cmd/, OSX https://github.com/smokris/GetWindowID + screencapture and on Linux I used to use imagemagic. My Windows and OSX solutions were much nicer because I could just drop those executables in git and don't have to worry about installing stuff beforeand. Now I can replace imagemagic with maim.

Off topic but for those of you doing this manually on vista and above there are two tools built into windows which are helpful. Both are launched from the start menu and are available on all machines:

1. Snipping tool. Allows you to screenshot and annotate then email, save, copy the screenshot. This lives in my taskbar.

2. Problem steps recorder. Screen recorder that produces an Html document with embedded images and annotated key presses and clicks.

Both very helpful!

I've been using escrotum [1], which is a drop-in replacement for scrot. I wrote a script that uploads screenshots to MediaCrush, too [2].

[1] https://github.com/Roger/escrotum

[2] https://github.com/SirCmpwn/dotfiles/blob/master/scripts/scr...

escrotum? Was there a competition for worst open source project name that I did not hear about?

escrotum has a few bugs[1][2] that maim doesn't have.

[1] https://github.com/Roger/escrotum/issues/11

[2] https://github.com/Roger/escrotum/issues/7

Note the issue reporter for [2] :)

Also, issue [1] is a PEBKAC problem. Bash handles expansion for you.


  $ import ss.png

From TFA

> import doesn't play nicely with compositors; making effects like transparent windows not render properly in the screenshot. maim, like scrot, uses imlib2 which isn't inflicted with this problem.

> maim can actually take screenshots with your cursor included in them! It does this using the XFixes extension. I don't think there's any other screenshooters that do this.

> For those of you with multiple monitors, maim is aware of which pixels are visible or not and will make off-screen pixels that are in screenshots black and transparent. Import and scrot both mindlessly include off-screen pixel data in their screenshots which is very often just garbage.

I haven't had any problems with import and compositing. My setup is very basic though: xcompmgr -c

Well I'll be damned. ImageMagick is like ffmpeg, every time you think of something that needs doing, it's already been done, but you never think to look for it.

check this page out


imagemagick is hardcore underrated. I love it.

This is also what I use on a daily basis. One case where it falls through is where you are trying to capture a screenshot for something that has a certain UI state, like a mouseover. For those cases you can have PrintScreen set to capture your desktop and save it to a file. In OpenBox you would set up a key binding for Print that executes: import -window root filename.png

That's what I use most of the time. scrot is nice too.

This looks pretty slick. But "no other screenshooter can capture the mouse pointer" is flat out wrong. gnome-capture comes with Ubuntu/Debian and has options not only to include/exclude the pointer, but also select a window (with or without border), region, delay, etc.

Yeah you're right. My bad, I've changed the readme to reflect that. I did mean commandline screenshot utilities, but I was completely unaware that GUI screenshooters have the ability regardless (because I don't use any of them).

For a good screenshot utility with a gui, there's xfce4-screenshooter from the xfce desktop suite. It's the bees knees, has the possibility to capture the system cursor (a feature the maim readme was complaining about) and a fine region capturing.

Yeah, the xfce4-screenshooter tool is fantastic. The only thing that would make it more useful would be if the panel plugin had an option to show a drop-down when clicked, allowing you to select screen, region or window. I always forget my keybindings for screenshots (is it alt? alt-shift?).

It might already have that option but I'm running Debian Stable (Wheezy) on the desktop so am quite far behind the current XFCE release.

Edit: My solution to my suggestion (panel plugin with dropdown) has just been to add a launcher to the panel, starting xfce4-screenshooter. I'll just choose what I want to capture from the window - it's pretty minimal anyway. What a useful application.

You can also map various keyboard shortcut to xfce4-screenshooter -r and stuff. See xfce4-screenshooter --help for details on all the options.

Scrot doesn't suck either, but this is okay too.

> maim has no --exec or naming features. This is because maim follows the unix philosophy of "do one thing and do it well". These features are things that should be handled by the shell.

That seems to run counter to

> Allows you to take a screenshot of your desktop and save it in any format.

which would suggest maim only take 32b (RGBA) PNG (which incidentally is what OSX's integrated screenshotting does — using the keyboard/UI anyway, the CLI tool can generate multiple formats)

Well, it's using imlib2, so support for multiple formats comes "for free". There's no point in artificially restricting functionality if the code complexity is there anyway.

I actually downloaded https://gyazo.com/ for Windows recently... And i've never seen a better tool for screenshot (and gif) sharing... It's much more user friendly/simple then this one :)

My setup for this kind of thing is scrot+filepicker.io script+xclip. Works fine for few years now.

https://aur.archlinux.org/packages/scrot-patched has nice options to just screenshot the focused window. I like exec, I use it to then upload my screenshot to s3.

I've always used gnome-screenshot as you could use a parameter to get it to add dropped shadows in the same way that Mac OSX does with cmd-shift-4 (spacebar).

But I am in the dark ages with GNOME2 still - did gnome-screenshot make it to GNOME3 or was it culled?

I use it all the time on Linux 17 Cinnamon. It ocasionally has an issue when capturing an area: the rectangle overlay showing the selection gets captured too, altering the colors. I get around this by just taking a new shot.

This is really hard to fix, x11 is just terrible at cleaning up windows after they close. slop has lots of precautions to keep it from appearing in screenshots though. maim shouldn't suffer from it.

It has yet to be culled. Presumably after gedit is removed.

In order for imgurbash.sh to put the URL on my clipboard, using xclip, I had to modify a line:

`xclip -sel clip` instead of `xclip`


Shared it here: http://tuxdiary.com/2014/10/17/maim-slop/ Can anyone please share the compiled binaries on 32-bit Ubuntu 14.04?

This could not have some at a better time, I was just looking at the arch wiki this morning for a new screenshot utility, thank you so much for building this.

Thought I'd let you guys know we are in #maim on Freenode in case you need some help or have questions. Thanks!

I love it! This is one step closer to having puu.sh on Linux. One program I sorely envy Windows and QSX users for.

Pretty nice, but I only see disadvantages in comparison to scrot. Don't see a reason to switch now.

Did you read the readme?

Yes, sure. I don't think of program being unable to do something as an improvement, whatever philosophy might it be and I haven't experienced any glitches with scrot. More than that, I do experience it with maim (slop, to be more precise).

I'm not sure what could/should I report, but slop is terribly slow. That is, I'm moving cursor and the rectangle moves after it with delay of several seconds, literally. scrot -s responds instantly.

One more minor issue is that by default slop selects currently hovered window showing the border, but if I just press Enter rectangle returned would be still 0,0,0,0 which is kinda non-intuitive.

Yay, a drop-in replacement for scrot -s that doesn't leave selection borders in the screenshot every time.

Could you please share why you wrote the cmd line interface in C instead of using C++ ? Just for convenience ?

EDIT: Fix text.

  File autogenerated by gengetopt
That's probably why.

Oops i missed that. Thanks :)

What are the preferred tools for things like recording screencasts?

ffmpeg and slop work together nicely to record your desktop (record-my-desktop is great too), but I don't know of anything that streams the recordings.

Check this out for some more information on slop and ffmpeg: https://github.com/naelstrof/slop#practical-applications

What sucks about PrintScreen (or Alt+PrintScreen)?

> What sucks about PrintScreen (or Alt+PrintScreen)?

In which desktop environment? Gnome? KDE? This is not an universal shortcut in X11 or Linux in general. Instead, your environment has PrintScreen configured to launch some screenshot application which comes with the environment. Maim is an alternative to that tool.

Similarly, you can configure Xhotkeys or your desktop to launch main or scrot or GraphicsMagick's import under any desktop environment or window manager.

By default in Gnome.

Yes, that would be gnome-screenshot then. This application as well as the default keybinding are specific to Gnome. gnome-screenshot is alright for the task, but OP's maim tool has some more features and it does not depend on Gnome.

Lots of people who run Linux do not use fully featured desktop environments with bells and whistles but prefer a lean and mean windowing environment instead.

They don't suck, because they do well what they are designed to do. However their use cases are pretty limited in my experience. I usually don't want to capture the whole desktop or a whole window. Most of my screen captures are to report bugs in web applications I manage or to get images for analysis documents. In both cases I need only relatively small areas of the screen. I use shutter to select the area I want to capture and I save it as png. Using Print Screen or Alt Print Screen would mean to use Gimp to crop the images to their relevant areas. Too slow.

Ksnapshot, the KDE screenshot utility has that option, and more.

Gnome screenshot (available on for example Ubuntu) lets you take a screenshot of a portion of the screen that you choose yourself (so, like taking a full screenshot and then cropping). In unity, you can press Dash, start typing screenshot and then you can choose 'choose portion' or something from the menu.

(I think the command line argument is `gnome-screenshot -a`.)

I agree that just pressing printscreen and then cropping in Gimp is a pain! Really, the less I have to use Gimp for simple editing, the happier I am.

I just tried gnome-screenshot, which I didn't know about. It fails with an error after capturing an image because it seems it needs the gnome shell and I don't have it (nor unity) but from the man page it seems it's more or less functionally equivalent to shutter. There are two nice things with shutter: 1) the icon that sits in the notification area (or whatever it is called in a given DE) 2) the list of all the previous screenshots taken. They come in handy for those days when I have to capture dozen of images.

How do you install it?

make && sudo make install would do the trick (For both slop and maim), but you should try to see if you can get your package manager to install it somehow.

For example Arch Linux has slop and maim in the AUR. I'll add an install section to the README.md

cmd+shift+3 or 4?

Guess you missed the "For Linux" part in the title.

don't forget command shift 4 and then after hitting that combo hit spacebar.

Scrot, slop, maim - I really hate the names that people pick for open source projects.

Yea it's much better than man,finger,touch. Wait a second..

SeLect OPeration MAke IMage

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact