
Show HN: Maim – A simple screenshot utility for Linux - naelstrof
https://github.com/naelstrof/maim
======
tkrill
Looks nice, other good screencapture applications for Linux would be fx
Shutter, [http://shutter-project.org/](http://shutter-project.org/), also
really nice.

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

~~~
jafaku
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.

------
andmarios
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.

~~~
Zardoz84
[https://www.kde.org/applications/graphics/ksnapshot/](https://www.kde.org/applications/graphics/ksnapshot/)

------
SixSigma
Plan9's

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

~~~
simias
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.

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

~~~
cremno
Actually it would be:

    
    
      topng < /dev/screen > foo.png

------
peterlvilim
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.

~~~
naelstrof
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.

------
teddyh
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.

------
hpaavola
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/](https://code.google.com/p/screenshot-cmd/), OSX
[https://github.com/smokris/GetWindowID](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.

~~~
monstermonster
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!

------
Sir_Cmpwn
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](https://github.com/Roger/escrotum)

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

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

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

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

~~~
Sir_Cmpwn
Note the issue reporter for [2] :)

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

------
krmtl
imagemagick:

    
    
      $ import ss.png

~~~
masklinn
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.

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

------
couchand
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.

~~~
naelstrof
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).

------
noswi
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.

~~~
davb
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.

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

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

------
masklinn
> 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)

~~~
icebraining
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.

------
NicoJuicy
I actually downloaded [https://gyazo.com/](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 :)

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

------
hendry
[https://aur.archlinux.org/packages/scrot-
patched](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.

------
72deluxe
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?

~~~
Zecc
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.

~~~
naelstrof
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.

------
grimgrin
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`

[https://github.com/naelstrof/maim/issues/8](https://github.com/naelstrof/maim/issues/8)

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

------
meandave
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.

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

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

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

~~~
naelstrof
Did you read the readme?

~~~
krick
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.

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

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

EDIT: Fix text.

~~~
theGimp

      File autogenerated by gengetopt
    

That's probably why.

~~~
lmedinas
Oops i missed that. Thanks :)

------
Zikes
What are the preferred tools for things like recording screencasts?

~~~
naelstrof
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](https://github.com/naelstrof/slop#practical-applications)

------
nodata
What sucks about PrintScreen (or Alt+PrintScreen)?

~~~
pmontra
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.

~~~
Dewie
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.

~~~
pmontra
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.

------
willemmerson
How do you install it?

~~~
naelstrof
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

------
stefan_kendall3
cmd+shift+3 or 4?

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

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

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

