#gnome #screenshot #linux #mac #kde

screenshot-rs

Simple library that allows for simple method of asking for screenshots from various Linux/BSD desktops

6 releases

✓ Uses Rust 2018 edition

0.1.5 Jun 13, 2019
0.1.4 Jun 10, 2019
0.1.2 Dec 7, 2018
0.1.1 Oct 3, 2018

#33 in Multimedia

Download history 8/week @ 2019-02-28 4/week @ 2019-03-07 6/week @ 2019-03-14 33/week @ 2019-03-21 4/week @ 2019-03-28 6/week @ 2019-04-04 6/week @ 2019-04-11 13/week @ 2019-04-18 15/week @ 2019-04-25 18/week @ 2019-05-02 21/week @ 2019-05-09 23/week @ 2019-05-16 22/week @ 2019-05-23 28/week @ 2019-05-30 45/week @ 2019-06-06

84 downloads per month
Used in 1 crate

MIT license

16KB
258 lines

screenshot-rs

Simple library that allows for simple method of asking for screenshots from various Linux/BSD desktops

Features

  • Works with some Wayland desktops
    • Plasma
    • GNOME
    • Sway
  • Works with all X11 desktops (with scrot installed as fallback)

Screenshot tools required (at least one)

  • spectacle (works with KDE Plasma, possibly LXQT)
  • gnome-screenshot (works with GNOME, Unity, Budgie, Cinnamon, etc)
  • scrot (works with anything with an X server, except WSL or Bash for Ubuntu for Windows)

Freezing screen for area screenshots

Uses feh if available to take a screenshot of the full screen, open it, and select an area of that screenshot to freeze the screen

How it works

Checks '$XDG_SESSION_TYPE' for either Wayland or X11, and checks for available screenshotting applications.

Methods

screenshot_area(file: String, freeze: Bool)

  • file will be the path and filename you want for your screenshot, in png format
  • Takes an area screenshot, meaning you can select an area of your screen to take a screenshot of
  • If 'freeze' is true, then it will use feh to freeze the screen in place to take an area screenshot

screenshot_window(file: String)

  • file will be the path and filename you want for your screenshot, in png format
  • Takes an window screenshot, meaning the currently used window will be screenshotted

screenshot_full(file: String)

  • file will be the path and filename you want for your screenshot, in png format
  • Takes a screenshot of an entire screen(s)

Changelog

[0.1.5] - 2019-06-13

  • Experimental Sway support

[0.1.4] - 2019-06-09

  • Experimental macOS Support

[0.1.3] - 2019-06-09

  • A typo

[0.1.2] - 2018-12-07

  • feh is no longer a requirement for "area" screenshots, was used to "freeze" the screen

[0.1.1] - 2018-10-03

  • Made enum ScreenshotKind public

[0.1.0] - 2018-10-01

No runtime deps