cargo: switch out dead clipboard
crate with arboard
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
318c81200a
commit
a78870d47a
1387
Cargo.lock
generated
1387
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -10,7 +10,6 @@ repository = "https://git.c8h4.io/c8h4/bwtui"
|
||||||
description = "terminal-based vault browser for bitwarden"
|
description = "terminal-based vault browser for bitwarden"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clipboard = "0.5.0"
|
|
||||||
cursive_buffered_backend = "0.6.0"
|
cursive_buffered_backend = "0.6.0"
|
||||||
cursive_table_view = "0.14.0"
|
cursive_table_view = "0.14.0"
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
|
@ -18,6 +17,11 @@ fuzzy-matcher = "0.3.7"
|
||||||
serde_json = "1.0.83"
|
serde_json = "1.0.83"
|
||||||
unicase = "2.6.0"
|
unicase = "2.6.0"
|
||||||
|
|
||||||
|
[dependencies.arboard]
|
||||||
|
version = "3.4"
|
||||||
|
default-features = false
|
||||||
|
features = ["wayland-data-control"]
|
||||||
|
|
||||||
[dependencies.bitwarden]
|
[dependencies.bitwarden]
|
||||||
path = "bitwarden"
|
path = "bitwarden"
|
||||||
|
|
||||||
|
|
12
src/vault.rs
12
src/vault.rs
|
@ -5,8 +5,6 @@ use std::fs::{self, File};
|
||||||
use std::io::{BufReader, BufWriter};
|
use std::io::{BufReader, BufWriter};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use clipboard::ClipboardContext;
|
|
||||||
use clipboard::ClipboardProvider;
|
|
||||||
use cursive::event::{Event, Key};
|
use cursive::event::{Event, Key};
|
||||||
use cursive::traits::*;
|
use cursive::traits::*;
|
||||||
use cursive::views::{Dialog, DummyView, EditView, LinearLayout, OnEventView, TextView};
|
use cursive::views::{Dialog, DummyView, EditView, LinearLayout, OnEventView, TextView};
|
||||||
|
@ -128,9 +126,8 @@ pub fn create(siv: &mut Cursive) {
|
||||||
siv.call_on_name("password_table", |view: &mut VaultTableView| {
|
siv.call_on_name("password_table", |view: &mut VaultTableView| {
|
||||||
if let Some(row) = view.item() {
|
if let Some(row) = view.item() {
|
||||||
if let Some(entry) = view.borrow_item(row) {
|
if let Some(entry) = view.borrow_item(row) {
|
||||||
let mut clipboard: ClipboardContext = ClipboardProvider::new().unwrap();
|
let mut clipboard = arboard::Clipboard::new().unwrap();
|
||||||
|
clipboard.set_text(entry.username.to_string()).unwrap();
|
||||||
clipboard.set_contents(entry.username.to_string()).unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -140,9 +137,8 @@ pub fn create(siv: &mut Cursive) {
|
||||||
siv.call_on_name("password_table", |view: &mut VaultTableView| {
|
siv.call_on_name("password_table", |view: &mut VaultTableView| {
|
||||||
if let Some(row) = view.item() {
|
if let Some(row) = view.item() {
|
||||||
if let Some(entry) = view.borrow_item(row) {
|
if let Some(entry) = view.borrow_item(row) {
|
||||||
let mut clipboard: ClipboardContext = ClipboardProvider::new().unwrap();
|
let mut clipboard = arboard::Clipboard::new().unwrap();
|
||||||
|
clipboard.set_text(&entry.password).unwrap();
|
||||||
clipboard.set_contents(entry.password.clone()).unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue