Fix annoying email popup by checking for the presence of a Yubikey

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-05-28 12:40:31 +02:00
parent 9bd3b12c4a
commit 0c84a84414
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -39,7 +39,7 @@ Email is a complicated beast, I decided to use *mu4e* and *mbsync*.
(setq auth-source-debug t)
(with-eval-after-load 'mu4e
(setq mu4e-get-mail-command "mbsync -a"
(setq mu4e-get-mail-command "usbs=$(for dev in /sys/bus/usb/devices/* ; do [ -f ${dev}/idVendor ] && [ -f ${dev}/idProduct ] && ( env cat ${dev}/idVendor | tr -d [:space:] ; printf : ; env cat ${dev}/idProduct ); done) ; yubi=0 ; for usb in $usbs ; do [ $usb = \"1050:0407\" ] && yubi=1 ; done ; [ $yubi = 1 ] && mbsync -a || exit 1"
mu4e-update-interval 300
message-kill-buffer-on-exit t)