d8b1ac1f37
list: properly error notification if clipboard copy fails
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696459d7fbc344545daeead6164cad5cde6f
2025-10-09 11:45:36 +03:00
4c0782f80e
list: add clipboard actions for delete and copy; notify
...
This adds an optional dependency on notify-rust, which we use to display
notifications when an entry is deleted or copied. If the user thinks a
TUI using desktop notifications is *not* desirable, it can be disabled
with the `notifications` feature flag.
We now support copying entries to the clipboard with `Enter` and
deleting entries with `Shift+D`. Both of those will show notifications.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69642d0c13a1359b3b51125cc4b691cd5679
2025-10-09 11:08:50 +03:00
a41d72fb6b
stash: refactor error handling and entry deduplication
...
This includes breaking changes to the database entries, where we have
started deduplicating based on hashes instead of full entries. Entry
collisions are possible, but highly unlikely.
Additionally we use `Box<str>` for error variants to reduce allocations.
This is *yet* to give me a non-marginal performance benefit but doesn't
hurt to be more correct.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964d0a33392da61372214ca3088551564ac
2025-09-19 14:08:15 +03:00
d05ad311a9
wayland: remove closed toplevels on event
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69644f5e067b3533a7f62c42d4a6d01be00b
2025-09-19 14:08:14 +03:00
36c183742d
stash: blocking persistent entries by window class
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964061bd97b4ffc4e84d835072331a966c6
2025-09-19 11:22:58 +03:00
c9a73b462d
commands: more consistent error propagation
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69647a0eb8de028e4251465fbb94f0a14cef
2025-08-20 18:38:05 +03:00
ae98cc0b86
stash: replace atty with is_terminal from std::io
...
It's deprecated, oops.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69646dc5a20ff1fde23ea9a846a7a3fdd16a
2025-08-20 18:38:04 +03:00
Rexiel Scarlet
ef0d05cbad
reset auto increment on stash wipe
2025-08-20 18:53:46 +04:00
b1a220400d
stash: add help text for cliphist compat flags
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964aa5c4ab66d13fe6e0d38400cdde5de1a
2025-08-20 11:06:53 +03:00
1ed518a3b6
stash: move import logic into stash::commmands
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964f8fb8c9b14049ba3a343bb453ca59004
2025-08-20 11:06:52 +03:00
f39937d3ca
stash: import all entries by default; log if db import fails
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964804698d2e83a37ec2688e9c126cf412b
2025-08-20 09:57:45 +03:00
6a5cd9b95d
treewide: format with rustfmt
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69642c2865f41a4b141ddf39a198a3fc2e09
2025-08-20 09:57:44 +03:00
47fd5e4964
db: support other image formats supported by imagesize
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69646b72b8bc223fe9729be3dbefbae2b353
2025-08-15 08:04:36 +03:00
7c26947437
commands/list: resolve clippy warnings
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964e1bb8c22b5026ce65889e3aec1b90a71
2025-08-15 08:04:35 +03:00
83d45c6414
list: if we're in a TTY, output data in a TUI
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696493f2e7ca911b6c1e2692b67f357a4b6b
2025-08-15 08:04:24 +03:00
0547376a9e
chore: apply clippy fixes; suppress "too many lines" lint
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696476135218b9979677c66c4be4d96aced8
2025-08-14 17:31:26 +03:00
f3089148e0
db: allow explicitly skipping sensitive entries
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964ed1deaac0215ae9c6f4c70cfdc50164d
2025-08-14 17:24:20 +03:00
86001652cd
stash: allow confirming destructive operations with --ask
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69644c23734a8b088e20473d381390d532b4
2025-08-14 17:24:01 +03:00
f6bf5586ad
import: nesting is ew yuck
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964becfe6f31b0411110b75d4cdfe2b9c63
2025-08-14 10:53:40 +03:00
64c923480e
decode: fallback to relaying current clipboard to stdout on failure
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696451def3e367afa9e8b0dd6ae626906e53
2025-08-13 18:46:02 +03:00
db6a962c75
stash: create database directory automatically if missing
...
Oops.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964866a1711971322c81ea194aa062466da
2025-08-13 17:07:06 +03:00
9d0ad95e07
db: treat valid UTF-8 entries as text/plain
...
Makes JSON output more... servicable.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964f642a02e990979f93f53a8b69764b469
2025-08-12 23:01:12 +03:00
9d40dde63a
commands/watch: make it trait-based; move out of main
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964c16396f2013e7f8a5c1a6c0c3bb2aeaa
2025-08-12 22:57:20 +03:00
d9b0908ada
db: allow listing database contents as JSON
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964a756588168f476d984d18f9e8d65bc4e
2025-08-12 22:57:19 +03:00
7d1aa21cdd
db: switch from image to imagesize
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964ab449f38999b5036d6e5554ccae7c049
2025-08-12 21:54:00 +03:00
5bcc23b6f9
stash: don't initialize watch daemon with None
...
Fixes the daemon always updating the latest entry.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696489a2e9a0928ff799a4210c160014c485
2025-08-12 21:53:59 +03:00
6c5408abd1
stash: make watch loop async
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69641a4f39f0368de1bcf5780afbe8e5c0b1
2025-08-12 21:53:47 +03:00
fcaf5fb14f
stash: print --help text if no subcommand is provided
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69646361b7ade52ee73a6aa11be859132a94
2025-08-12 19:21:13 +03:00
4f725425fc
db: switch to sqlite as the primary backend
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69648f81d0d094e11a3e0f0a19d3b8eccd5d
2025-08-12 19:07:38 +03:00
efcbe17d73
stash: add watch subcommand
...
Watches primary clipboard for changes and stores them in the database.
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964de9949bbe6d8b9301ca97ae785852b46
2025-08-12 19:07:26 +03:00
aa602edbee
treewide: fix remaining clippy warnings
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964a4f18b72e3fa774cec6b81baa8267cb6
2025-08-12 17:34:43 +03:00
7ebe514e3a
stash: deduplicate error reporting
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964f0f3f13190dde392fc859718716b56a8
2025-08-12 17:34:42 +03:00
6e21021306
treewide: improve logging; custom error types with thiserror
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696464e4123d15cfaedf4727776e55948369
2025-08-12 17:34:41 +03:00
c23c5af8c1
stash: allow controlling verbosity from the command line
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69641d5d727b1d95f8c9e2b851b3a194315a
2025-08-12 17:34:39 +03:00
d8d27fab22
stash: remove redundant log messages
...
Ported from print-based logging, now redundant
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964c1ba52c792bd3c2a3e15a97a3b03260e
2025-08-12 17:34:38 +03:00
0e4f4018ab
stash: use more granular STASH_CLIPBOARD_STATE
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964d59d2ce974ba482aee9b1c8f20cdb44e
2025-08-12 17:34:37 +03:00
0c8003d636
stash: remove redundant import flag
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964348f1ad4915890f0b4ccd59619cc3e1a
2025-08-12 17:34:36 +03:00
254c288111
treewide: improve logging; get rid of unwrap()s
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696442ff25c3f65bb2d5f68e0d78a569fd76
2025-08-12 15:03:41 +03:00
b0820a1940
modularize codebase
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69648ea836bfeb539450db14a666c623412e
2025-08-12 15:01:32 +03:00
e2c10f386f
first working prototype
...
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964dedc7f122b26b0e2e5040248b7866c93
2025-08-12 15:01:28 +03:00