add systemd and launchd unit files, suppress unused warnings

This commit is contained in:
2026-03-20 03:00:50 +09:00
parent 1a134f448b
commit 38cff6ef55
4 changed files with 34 additions and 0 deletions

12
docs/bw-agent.service Normal file
View File

@@ -0,0 +1,12 @@
[Unit]
Description=Bitwarden Desktop Agent
After=graphical-session.target
[Service]
Type=simple
ExecStart=%h/.local/bin/bw-agent --email %I
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.bitwarden.agent</string>
<key>ProgramArguments</key>
<array>
<string>/Users/USER/.local/bin/bw-agent</string>
<string>--email</string>
<string>USER@EXAMPLE.COM</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/bw-agent.log</string>
</dict>
</plist>

View File

@@ -113,6 +113,7 @@ pub fn get_prompter(name: Option<&str>) -> Prompter {
}
}
#[allow(dead_code)]
pub fn available() -> Vec<&'static str> {
let mut found = vec!["cli"];
if cfg!(target_os = "macos") {

View File

@@ -2,6 +2,7 @@ pub mod pin;
pub trait KeyStore {
fn name(&self) -> &str;
#[allow(dead_code)]
fn is_available(&self) -> bool;
fn has_key(&self, uid: &str) -> bool;
fn store(&self, uid: &str, data: &[u8], auth: &str) -> Result<(), String>;