Skip to content

nhrx1337/xshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XShot

📋 Overview

XShot is a small command-line screen capture tool written in C using Xlib and libpng. It lets the user interactively select a rectangular region on the X11 root window and saves that region as a PNG image. The program is intentionally minimal and focused on reliable, no-dependencies screen capture on traditional X11 desktops.

📥 Installation

  1. Clone the repository:
git clone https://github.com/nhrx1337/xshot.git
cd xshot/
  1. Install build dependencies:

Debian-based

sudo apt-get install libx11-dev libpng-dev

Arch-based

sudo pacman -S libx11 libpng
  1. Build:
make
  1. (Optional) Install system-wide:
sudo make install

▶️ Usage

Run interactively:

./xshot
  • Click and drag with the left mouse button to draw a selection rectangle.
  • Release the button to save the selected area as a PNG file.
  • Press any key to abort selection.

Saved files are created in the current working directory with timestamped names like DD-MM-YYYY_HH-MM-SS.png.

⚙️ Behavior & Notes

  • The program grabs the pointer and keyboard while selecting to ensure it receives all events during the selection operation.
  • The selection rectangle is drawn using XOR drawing so it toggles cleanly while dragging.
  • Captured images are written with libpng as 8-bit RGB PNGs.

🧩 Dependencies

  • Xlib (libX11)
  • libpng

❌ Uninstallation

If you installed system-wide:

sudo make uninstall

About

A lightweight command-line X11 screen capture application written in C using Xlib and libpng.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors