Browse Source

mail: wait for changes via inotifywait

Fabian Peter Hammerle 4 years ago
parent
commit
00461c94de
2 changed files with 3 additions and 4 deletions
  1. 1 1
      README.md
  2. 2 3
      config

+ 1 - 1
README.md

@@ -5,6 +5,6 @@ https://vivien.github.io/i3blocks/
 ## Installation
 
 ```sh
-sudo apt-get install i3blocks acpi curl moreutils feh
+sudo apt-get install i3blocks acpi curl moreutils feh coreutils inotify-tools
 git clone git@git.hammerle.me:fphammerle/config-i3blocks.git $HOME/.config/i3blocks
 ```

+ 2 - 3
config

@@ -17,9 +17,8 @@ interval=60
 
 [mail]
 label=✉️
-command=python3 -c "import glob, os, sys; num=len(glob.glob(os.path.expanduser('~/.mail/*/inbox/new/*'))); print(num); sys.exit(33 if num else 0)"
-interval=120
-signal=2
+command=inotifywait -qq --recursive --event move --event delete --exclude mbsyncstate ~/.mail || sleep 60; python3 -c "import glob, os, sys; num=len(glob.glob(os.path.expanduser('~/.mail/*/inbox/new/*'))); print(num); sys.exit(33 if num else 0)"
+interval=repeat
 
 [volume 5% pulse]
 label=♪