mirror of
https://github.com/soywod/himalaya.git
synced 2024-11-21 18:40:19 +00:00
rename idle notify cmd
This commit is contained in:
parent
5ba493c054
commit
781c4a2722
3 changed files with 9 additions and 9 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -396,9 +396,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.81"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
|
||||
checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
|
|
10
README.md
10
README.md
|
@ -53,17 +53,17 @@ downloads-dir = "/abs/path/to/downloads"
|
|||
|
||||
[gmail]
|
||||
default = true
|
||||
email = "my.email@gmail.com"
|
||||
email = "your.email@gmail.com"
|
||||
|
||||
imap-host = "imap.gmail.com"
|
||||
imap-port = 993
|
||||
imap-login = "test@gmail.com"
|
||||
imap-login = "your.email@gmail.com"
|
||||
imap-passwd-cmd = "pass show gmail"
|
||||
|
||||
smtp-host = "smtp.gmail.com"
|
||||
smtp-port = 487
|
||||
smtp-login = "test@gmail.com"
|
||||
smtp-passwd-cmd = "security find-internet-password -gs posteo -w"
|
||||
smtp-login = "your.email@gmail.com"
|
||||
smtp-passwd-cmd = "security find-internet-password -gs gmail -w"
|
||||
```
|
||||
|
||||
*See the [wiki section](https://github.com/soywod/himalaya/wiki/Configuration)
|
||||
|
@ -171,7 +171,7 @@ himalaya idle
|
|||
```
|
||||
|
||||
Starts a session in idle mode (blocking). When a new message arrives, it runs
|
||||
the command `notification-cmd` defined in the [config
|
||||
the command `notify-cmd` defined in the [config
|
||||
file](https://github.com/soywod/himalaya/wiki/Configuration).
|
||||
|
||||
Here a use case with [`systemd`](https://en.wikipedia.org/wiki/Systemd):
|
||||
|
|
|
@ -131,7 +131,7 @@ impl Account {
|
|||
pub struct Config {
|
||||
pub name: String,
|
||||
pub downloads_dir: Option<PathBuf>,
|
||||
pub notification_cmd: Option<String>,
|
||||
pub notify_cmd: Option<String>,
|
||||
|
||||
#[serde(flatten)]
|
||||
pub accounts: HashMap<String, Account>,
|
||||
|
@ -214,7 +214,7 @@ impl Config {
|
|||
pub fn run_notify_cmd(&self, subject: &str, sender: &str) -> Result<()> {
|
||||
let default_cmd = format!(r#"notify-send "📫 {}" "{}""#, sender, subject);
|
||||
let cmd = self
|
||||
.notification_cmd
|
||||
.notify_cmd
|
||||
.as_ref()
|
||||
.map(|s| format!(r#"{} "{}" "{}""#, s, subject, sender))
|
||||
.unwrap_or(default_cmd);
|
||||
|
|
Loading…
Reference in a new issue