mirror of
https://github.com/labi-le/wl-paste-uploader.git
synced 2026-08-22 11:04:04 +03:00
wl-paste share to a file host (0x0.st, catbox.moe, x0.at, envs.sh) and copy result url to clipboard
- Go 80.5%
- Nix 16.6%
- Makefile 2.9%
|
|
||
|---|---|---|
| .github | ||
| testdata | ||
| .gitignore | ||
| .golangci.yml | ||
| .goreleaser.yaml | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| main_test.go | ||
| Makefile | ||
| provider.go | ||
| provider_test.go | ||
| README.md | ||
wl-paste-uploader
wl-paste share to a file host (0x0.st, catbox.moe, x0.at, envs.sh) and copy result url to clipboard
Installation
-
Nix flake
as profile
nix profile install github:labi-le/wl-paste-uploaderimport the module
{ # inputs wl-uploader.url = "github:labi-le/wl-paste-uploader"; # outputs overlay-wl-uploader = final: prev: { wl-uploader = wl-uploader.packages.${system}.default; }; modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-wl-uploader ]; }) ]; # add package environment.systemPackages = with pkgs; [ wl-uploader ]; }nixos module
{ # inputs wl-uploader.url = "github:labi-le/wl-paste-uploader"; # outputs modules = [ wl-uploader.nixosModules.default { programs.wl-paste-uploader = { enable = true; ocr = true; # optional: pull in tesseract for `--ocr` provider = "catbox"; # optional: default upload provider (UPLOADER_PROVIDER) }; } ]; }
usage:
wl-uploader
example for sway
bindsym --to-code Mod4+p exec wl-uploader
with proxy
socks_proxy=socks5://127.0.0.1:1088 wl-uploader
you can also use env HTTPS_PROXY, HTTP_PROXY, SOCKS_PROXY, ALL_PROXY
Providers
Choose where to upload with --provider (or the UPLOADER_PROVIDER env var;
the flag takes precedence). Default: 0x0.
0x0— 0x0.st, size-based retentionx0— x0.at, 3–100 daysenvs— envs.sh, size-based retentioncatbox— catbox.moe, permanent (anonymous files removed after 2 years without access)
wl-uploader --provider catbox
example for sway
bindsym --to-code Mod4+p exec wl-uploader --provider catbox
OCR
With --ocr the text is recognized from the clipboard image and copied to the
clipboard instead of being uploaded:
wl-uploader --ocr
Requires tesseract in PATH.
Pick the recognition language(s) with OCR_LANG (defaults to tesseract's own
default, usually eng):
OCR_LANG=eng+rus wl-uploader --ocr
example for sway
bindsym --to-code Mod4+o exec wl-uploader --ocr