feat(notmuch): script for cron

This commit is contained in:
Pavel Korytov 2021-01-30 13:12:47 +03:00
parent 09fe035d6f
commit 55343c49a9
6 changed files with 35 additions and 4 deletions

View file

@ -950,6 +950,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package notmuch
:ensure nil)
(my-leader-def "am" 'notmuch)
(use-package lsp-mode
:straight t

View file

@ -51,7 +51,7 @@ primary_email=thexcloud@gmail.com
[new]
tags=new
ignore=
ignore=.osync_workdir
# Search configuration
#

1
.signature Normal file
View file

@ -0,0 +1 @@
С уважением, Корытов Павел

View file

@ -1,4 +1,3 @@
#!/bin/bash
eval "$(conda shell.bash hook)"
conda activate mail
(cd /home/pavel/Mail/thexcloud/ && gmi sync)
GMI="/home/pavel/Programs/miniconda3/envs/mail/bin/gmi"
(cd /home/pavel/Mail/thexcloud/ && $GMI sync)

21
bin/scripts/check-email Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
export DISPLAY=:0
CHECK_FILE="/home/pavel/Mail/.last_check"
QUERY="tag:unread"
ALL_QUERY="tag:unread"
if [ -f "$CHECK_FILE" ]; then
DATE=$(cat "$CHECK_FILE")
QUERY="$QUERY and date:@$DATE.."
fi
notmuch new
NEW_UNREAD=$(notmuch count "$QUERY")
ALL_UNREAD=$(notmuch count "$ALL_QUERY")
if [ $NEW_UNREAD -gt 0 ]; then
notify-send "New Mail" "$NEW_UNREAD new messages\n$ALL_UNREAD total"
# elif [ $ALL_UNREAD -gt 0 ]; then
# notify-send "New Mail" "$ALL_UNREAD unread messages"
fi
echo "$(date +%s)" > $CHECK_FILE

8
bin/scripts/toggle_layout Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
if setxkbmap -query | grep -q us,ru; then
setxkbmap -layout us
setxkbmap -option
else
setxkbmap -layout us,ru
setxkbmap -model pc105 -option 'grp:win_space_toggle' -option 'grp:alt_shift_toggle'
fi