add username and mail options, using templating where possible

This commit is contained in:
lelgenio 2020-10-17 03:32:16 -03:00
parent 7f6018544a
commit 5f293b4f53
5 changed files with 29 additions and 21 deletions

View File

@ -6,6 +6,8 @@
# |_|
variables:
username: lelgenio
mail: disroot.org
cursor_size: 24
launcher: wofi
terminal: kitty
@ -164,6 +166,8 @@ dotfiles: # {{{
mutt:
src: neomutt/
dst: ~/.config/neomutt/
actions:
- cpmbsync
crontab:
src: crontab
dst: ~/.local/share/crontab
@ -207,7 +211,9 @@ actions: #{{{
crontab -r
crontab ~/.local/share/crontab
vdirsyncer: |
yes | vdirsyncer discover
yes | vdirsyncer discover & disown
cpmbsync: |
ln -fs ~/.config/neomutt/mbsyncrc ~/.mbsyncrc
sponsorblock: >
test -d ~/.config/mpv/scripts/sponsorblock_shared ||
git clone

View File

@ -44,9 +44,9 @@ fileext = ".vcf"
[storage contacts_remote]
type = "carddav"
url = "https://cloud.disroot.org/remote.php/dav/addressbooks/users/lelgenio/contacts/"
username = "lelgenio@disroot.org"
password.fetch = [ "command", "sh", "-c", "pass Disroot | head -n1" ]
url = "https://cloud.{{@@ mail @@}}/remote.php/dav/addressbooks/users/{{@@ username @@}}/contacts/"
username = "{{@@ username @@}}@{{@@ mail @@}}"
password.fetch = [ "command", "_get-pass", "{{@@ mail @@}}" ]
# CALDAV
[pair calendar]
@ -64,6 +64,6 @@ fileext = ".ics"
[storage calendar_remote]
type = "caldav"
url = "https://cloud.disroot.org/remote.php/dav/calendars/lelgenio/personal/"
username = "lelgenio@disroot.org"
password.fetch = [ "command", "sh", "-c", "pass Disroot | head -n1" ]
url = "https://cloud.{{@@ mail @@}}/remote.php/dav/calendars/{{@@ username @@}}/personal/"
username = "{{@@ username @@}}@{{@@ mail @@}}"
password.fetch = [ "command", "_get-pass", "{{@@ mail @@}}" ]

View File

@ -1,21 +1,21 @@
IMAPStore disroot-remote
Host disroot.org
IMAPStore mail-remote
Host {{@@ mail @@}}
Port 993
User lelgenio@disroot.org
PassCmd "pass Disroot | head -n1"
User {{@@ username @@}}@{{@@ mail @@}}
PassCmd "_get-pass {{@@ mail @@}}"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore disroot-local
MaildirStore mail-local
Subfolders Verbatim
Path ~/.local/share/mail/
Inbox ~/.local/share/mail/INBOX
Flatten .
Channel disroot-remote
Channel mail-remote
Expunge Both
Master :disroot-remote:
Slave :disroot-local:
Master :mail-remote:
Slave :mail-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *

View File

@ -7,15 +7,14 @@
# |_| |_|\___|\___/|_| |_| |_|\__,_|\__|\__|
set my_user='lelgenio'
set my_host='disroot.org'
set my_pass=`pass show Disroot | head -n1`
set my_user='{{@@ username @@}}'
set my_host='{{@@ mail @@}}'
set my_pass=`pass show "{{@@ mail @@}}" | head -n1`
# Main settings{{{
set realname = "Leonardo da Rosa Eugenio"
set from = "lelgenio@disroot.org"
#alias me Leonardo da Rosa Eugenio <lelgenio@disroot.org>
set realname = "{{@@ username @@}}"
set from = "{{@@ username @@}}@{{@@ mail @@}}"
# Set MailDir
set mbox_type = Maildir

3
dotfiles/scripts/_get-pass Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
pass "$@" | head -n1