Skip to content

Instantly share code, notes, and snippets.

View bparks's full-sized avatar

Brian Parks bparks

View GitHub Profile
@bparks
bparks / screenshot.c
Last active December 1, 2019 20:14 — forked from bozdag/taking screenshot in linux with C
This C program takes the whole screenshot of the root window for a given display and saves it in PNG file format.
// Use the following command line to build:
// gcc -o screenshot screenshot.c -lX11 $(pkg-config cairo --cflags --libs)
/*
Grabs a screenshot of the root window.
Usage : ./scr_tool <display> <output file>
Example : ./scr_tool :0 /path/to/output.png
Author: S Bozdag <selcuk.bozdag@gmail.com>
*/