/sscreenshot

A simple screenshot program written in C + XCB api

Primary LanguageCMIT LicenseMIT

SimpleScreenShot - SSS

A simple, toolkit-less screenshot program written in C + XCB api

๐Ÿ“‹ Features

  • 2 button program(hold left click to draw box, release to take pic, right click to quit)
  • Creates PNG format output screenshots
  • Option to take screenshot of whole screen or drawn area
  • Minimal dependencies, no toolkits
  • Easily built from source, configurations made by editing source code

๐Ÿš€ Download & Installation

Clone repository to directory of choice and enter cloned repository

git clone https://github.com/leath-dub/SimpleScreenShot.git
cd SimpleScreenShot

Run make to see build options

$ make

โ•ญโ”€โ”€โ”€โ”ค SSS โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚
โ”‚ sss build options: โ”‚
โ”‚   โ”œโ”€โ”€โ”€> install    โ”‚
โ”‚   โ”œโ”€โ”€โ”€> here       โ”‚
โ”‚   โ”œโ”€โ”€โ”€> link       โ”‚
โ”‚   โ”œโ”€โ”€โ”€> unlink     โ”‚
โ”‚   โ””โ”€โ”€โ”€> uninstall  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

CFLAGS = -lxcb-image -lxcb -lxcb-shm -lpng16 -lz
CC     = gcc

To install normally run:

sudo make install

To uninstall normally run:

sudo make uninstall

โ“Other build options:

  • here ๐Ÿ ’ compiles to current directory
  • link ๐Ÿ ’ compiles to current directory and creates symbolic link in binary directory
  • unlink ๐Ÿ ’ removes symbolic link

๐Ÿƒโ€โ™‚๏ธ Usage

SS_DIR = $HOME or $SS_DIR var if set

Run with no arguments(creates SS_DIR/screenshot.png):

sss

Run with -n option to specify a name(put in SS_DIR):

sss -n test.png

Run with -f option alone(creates SS_DIR/fullscreen.png):

sss -f

Run with -f option and specified name(put in SS_DIR):

sss -f test.png

๐Ÿ—’๏ธ Notes

  • the last box drawn will be the screenshot written
  • the program does not append numbers, e.g. ss-1.png, ss-2.png, etc. if there is a conflict in nameing the old version is overwritten
sV85mVg.-.Imgur.mp4

โš™๏ธ Configuration

Configuration is very minimal currently. It is done through the config.h source file, the contents are as follows:

#define LINE_WIDTH 4 /* width of drawn box lines */
#define LINE_COLOR 0xEBDBB2 /* color of drawn box lines */
#define CURSOR "cross" /* refer to your cursor theme /usr/share/icons */

๐Ÿ—’๏ธ Notes

  • The actual captured area will be bound to the size drawn by the user, excluding the lines visable and what they obscure
  • You must recompile each time you make a change to configuration
  • If you wish to remove the source files after compilation, this is fine, just make sure that you are happy with your configuration as you cannot change it without recompiling
  • By default screenshots got to directory assigned to environment variable $HOME. If you want to specify a different directory you need to assign a value to the environment variable $SS_DIR. In your shells config file put:
export SS_DIR=/home/username/screenshots

Dependencies list

run:

make depend

output

โ•ญโ”ค dependencies โ”œโ•ฎ
โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚
โ”‚ libxcb         โ”‚
โ”‚ libxcb-image   โ”‚
โ”‚ libxcb-shm     โ”‚
โ”‚ libxcb-cursor  โ”‚
โ”‚ libpng         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Void linux

You only need to install xcb-util-cursor-devel package

Contributions

Feel free to make pull requests, I will get to them asap. I would appreciate contributing your experience installing on different machines, what packages you need, etc.