diff --git a/scripts/README.md b/scripts/README.md index 12dd747..e4c92a4 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -3,6 +3,7 @@ This directory contains nix derivations for shell scripts I want to use across devices. -| Filename | Scripts | Description | -| ---------- | -------- | --------------------------- | -| `clip.nix` | `c`, `p` | Copy and paste abstractions | +| Filename | Scripts | Description | +| ---------- | -------- | ------------------------------------------ | +| `clip.nix` | `c`, `p` | Copy and paste abstractions | +| `sc.nix` | `sc` | Area screenshot tool with clip integration | diff --git a/scripts/sc.nix b/scripts/sc.nix new file mode 100644 index 0000000..99a00b9 --- /dev/null +++ b/scripts/sc.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: with pkgs; { + + # Take a screenshot of a selected area and put it in the clipboard. + sc = (writeShellApplication { + name = "sc"; + runtimeInputs = [ xclip scrot ]; + text = '' + scrot -z -s - | tee /tmp/sc.png | xclip -i -sel clip -t image/png + ''; + }); + +}