- Rust 100%
Co-authored-by: snek <the@snek.dev> See-also: https://discord.com/channels/367759499613962240/583055343177695232/1478490025346728086 |
||
|---|---|---|
| example | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| readme.md | ||
folder to minio
tiny rust binary that uploads a folder containing my screenshots to minio, and then stores the urls in the clipboard
i just quickly threw this together one evening, because my previous solution (a zsh script using the minio cli) was just so infuriatingly slow i couldn't bear it any longer
uses clap, arboard, and the minio rust sdk
from preliminary testing: it works! really well!
in the future, maybe i'll make it aggregate links uploaded in one "session" (i.e. close together) into newline-separated lists on the clipboard rather than separate entries
running as a service
there are some example service definitions:
linux (systemd)
the example definition runs ftm in daemon mode (-w), which will make it watch
the filesystem for changes; while systemd also provides this functionality, due
the way linux handles the clipboard, ftm needs to be running the time anyway
to enable:
cp example/ftm.service ~/.config/systemd/user/- fill in the necessary credentials
systemctl --user start ftm- enable it, e.g. for niri:
systemctl --user add-wants niri.service ftm.service
for macos
the example launchd unit uses launchd's inbuilt QueueDirectories functionality
to start ftm when necessary, rather than watching the filesystem like on linux
to enable:
cp example/*.ftm.plist ~/Library/LaunchAgents/- fill in the necessary credentials
launchctl load ~/Library/LaunchAgents/*.ftm.plist