aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rbw/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/rbw/commands.rs')
-rw-r--r--src/bin/rbw/commands.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs
index 03f07b3..10f981d 100644
--- a/src/bin/rbw/commands.rs
+++ b/src/bin/rbw/commands.rs
@@ -1,5 +1,4 @@
use anyhow::Context as _;
-use copypasta::{ClipboardContext, ClipboardProvider};
use serde::Serialize;
use std::io;
use std::io::prelude::Write;
@@ -741,13 +740,8 @@ pub fn config_unset(key: &str) -> anyhow::Result<()> {
}
fn clipboard_store(val: &str) -> anyhow::Result<()> {
- let mut ctx = ClipboardContext::new().map_err(|e| {
- anyhow::anyhow!("couldn't create clipboard context: {e}")
- })?;
-
- ctx.set_contents(val.to_owned()).map_err(|e| {
- anyhow::anyhow!("couldn't store value to clipboard: {e}")
- })?;
+ ensure_agent()?;
+ crate::actions::clipboard_store(val)?;
Ok(())
}