mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-17 00:03:46 +00:00
stash: blocking persistent entries by window class
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a6964061bd97b4ffc4e84d835072331a966c6
This commit is contained in:
parent
e5204c4a3a
commit
36c183742d
7 changed files with 483 additions and 19 deletions
26
src/main.rs
26
src/main.rs
|
|
@ -10,6 +10,7 @@ use inquire::Confirm;
|
|||
|
||||
mod commands;
|
||||
mod db;
|
||||
#[cfg(feature = "use-toplevel")] mod wayland;
|
||||
|
||||
use crate::commands::{
|
||||
decode::DecodeCommand,
|
||||
|
|
@ -47,6 +48,11 @@ struct Cli {
|
|||
#[arg(long)]
|
||||
db_path: Option<PathBuf>,
|
||||
|
||||
/// Application names to exclude from clipboard history
|
||||
#[cfg(feature = "use-toplevel")]
|
||||
#[arg(long, value_delimiter = ',', env = "STASH_EXCLUDED_APPS")]
|
||||
excluded_apps: Vec<String>,
|
||||
|
||||
/// Ask for confirmation before destructive operations
|
||||
#[arg(long)]
|
||||
ask: bool,
|
||||
|
|
@ -160,7 +166,16 @@ fn main() {
|
|||
Some(Command::Store) => {
|
||||
let state = env::var("STASH_CLIPBOARD_STATE").ok();
|
||||
report_error(
|
||||
db.store(io::stdin(), cli.max_dedupe_search, cli.max_items, state),
|
||||
db.store(
|
||||
io::stdin(),
|
||||
cli.max_dedupe_search,
|
||||
cli.max_items,
|
||||
state,
|
||||
#[cfg(feature = "use-toplevel")]
|
||||
&cli.excluded_apps,
|
||||
#[cfg(not(feature = "use-toplevel"))]
|
||||
&[],
|
||||
),
|
||||
"Failed to store entry",
|
||||
);
|
||||
},
|
||||
|
|
@ -313,7 +328,14 @@ fn main() {
|
|||
}
|
||||
},
|
||||
Some(Command::Watch) => {
|
||||
db.watch(cli.max_dedupe_search, cli.max_items);
|
||||
db.watch(
|
||||
cli.max_dedupe_search,
|
||||
cli.max_items,
|
||||
#[cfg(feature = "use-toplevel")]
|
||||
&cli.excluded_apps,
|
||||
#[cfg(not(feature = "use-toplevel"))]
|
||||
&[],
|
||||
);
|
||||
},
|
||||
None => {
|
||||
if let Err(e) = Cli::command().print_help() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue