Skip to content

SSS (Super ScreenShot) is a WIP: CLI/Lib to take amazing screenshot of code or screen

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

SergioRibera/sss

Repository files navigation

Super ScreenShot

Super ScreenShot is a set of libraries and tools for building screenshots in a standardized, high-performance image format made in rust.

🧩 Libraries

It provides different options depending on your needs.

  • sss_lib: The base library for screenshot generation, providing the core functionality for the other tools.
  • sss_code: A terminal tool specifically designed to take screenshots of your code, making it easy to share and showcase your snippets.
  • sss: A versatile terminal tool that allows you to capture screenshots of your entire screen or specific regions.

🚀 Installation

Important

At the moment the tool is not available in any store. Please redirect to releases section in order to download.

 Nix

sss packages are built and cached automatically. To avoid unnecessary recompilations, you may use the binary cache.

nix.settings = {
  builders-use-substitutes = true;
  extra-substituters = [ "https://sss.cachix.org" ];
  extra-trusted-public-keys = [ "sss.cachix.org-1:YI2JMG95LEu62PC7VMz75N7bypEdUz9Z/Il1hkGH4AA=" ];
};

Warning

While using the sss flake, overriding the nixpkgs input for sss will cause cache hits, i.e., you will have to build from source every time. To use the cache, do not override the Nixpkgs input.

On nix you can use the provided flake:

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    sss = {
      url = "github:SergioRibera/sss";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs }: {
    nixosConfigurations."<your_hostname>" = nixpkgs.lib.nixosSystem {
      # ...
      modules = [
        # Add sss to modules to make it available
        inputs.sss.nixosModules.default

        {
          programs.sss {
            enable = true; # Enable principal cli to take screenshots
            code = true; # Enable sss_code to capture code
          }
        }
      ];
      # ...
    };
  };
}

 Nix Home-Manager

[!NOTES] You can find more details about the available options at here

home-manager.users."yourusername" = ({
  imports = [
    inputs.sss.nixosModules.home-manager
  ];

  programs.sss = {
    enable = true;
    code = {
      enable = true;
      line-numbers = true;
    };

    general = {
      shadow = true;
      shadow-image = true;
      author = "@SergioRibera";
      colors = {
        background = "#FFFFFF";
        author = "#000000";
      };
    };
  };
};

⚙️ Configuration

Note

To know how to configure it from a file, you can review the default.toml file.

All cli arguments can be set from a single file in the path ~/.config/sss/config.toml, right here you can place the configuration for sss_code and sss.

💻 Usage

You can find examples and options in the following links.

💡 Acknowledgments

  • syntect: Rust library for syntax highlighting using Sublime Text syntax definitions.
    • I use this library for code highlighting and parsing.
  • djanho: Convert VSCode themes to (Neo)Vim colorschemes
    • Use this project to understand how to import (Neo)vim themes.

🏁 Other Goals

  • silicon: Create beautiful image of your source code.
    • I used it as a basis for my code screenshot project.