diff --git a/.emacs.d/init.el b/.emacs.d/init.el index f4ba87e..5699495 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -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 diff --git a/.notmuch-config b/.notmuch-config index 3dd8a9f..1e93cff 100644 --- a/.notmuch-config +++ b/.notmuch-config @@ -51,7 +51,7 @@ primary_email=thexcloud@gmail.com [new] tags=new -ignore= +ignore=.osync_workdir # Search configuration # diff --git a/.signature b/.signature new file mode 100644 index 0000000..9214948 --- /dev/null +++ b/.signature @@ -0,0 +1 @@ +С уважением, Корытов Павел \ No newline at end of file diff --git a/Mail/.notmuch/hooks/pre-new b/Mail/.notmuch/hooks/pre-new index b76040f..e86e1c9 100755 --- a/Mail/.notmuch/hooks/pre-new +++ b/Mail/.notmuch/hooks/pre-new @@ -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) diff --git a/bin/scripts/check-email b/bin/scripts/check-email new file mode 100755 index 0000000..f41337d --- /dev/null +++ b/bin/scripts/check-email @@ -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 diff --git a/bin/scripts/toggle_layout b/bin/scripts/toggle_layout new file mode 100755 index 0000000..76f9c4b --- /dev/null +++ b/bin/scripts/toggle_layout @@ -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