| index.md - sites - public wiki contents of suckless.org | |
| git clone git://git.suckless.org/sites | |
| Log | |
| Files | |
| Refs | |
| --- | |
| index.md (1823B) | |
| --- | |
| 1 email notifications | |
| 2 =================== | |
| 3 | |
| 4 Description | |
| 5 ----------- | |
| 6 This init script is based on some ideas taken from the dwm ML. It adds e… | |
| 7 notification using `fetchmail`. It also adds the functionality of showin… | |
| 8 content of the file `$HOME/.message` when it exists. This can be used for | |
| 9 displaying info by other programs writing to this file. | |
| 10 | |
| 11 When a new email arrives a flashing text message is shown on the dwm's | |
| 12 status bar. | |
| 13 | |
| 14 Config .fetchmailrc | |
| 15 ------------------- | |
| 16 This config works with GMail over IMAP with the IDLE extension for low b… | |
| 17 | |
| 18 poll imap.gmail.com port 993 proto IMAP user "<your_user>@gmail.… | |
| 19 there with password "<your_pass>" keep ssl idle | |
| 20 | |
| 21 Init script | |
| 22 ----------- | |
| 23 The notification is flashing during 60 seconds, then it is removed. Lines | |
| 24 written to `.message` are displayed during a second in the status bar. If | |
| 25 `.message` is deleted, the normal status message (date and uptime) retur… | |
| 26 | |
| 27 A pipe must be used with `fetchmail` when using IDLE extension because t… | |
| 28 it waits for updates from the inbox not doing polling. If the `.message`… | |
| 29 exists with some content, it is preserved and no email notification is s… | |
| 30 | |
| 31 fetchmail --check 2>/dev/null | while read line; do | |
| 32 new=`echo $line | sed 's/(//' | awk '{print $1-$3}'` | |
| 33 if [ $new != 0 ] && [ ! -e ~/.message ]; then | |
| 34 echo "New mail($new)" > ~/.message | |
| 35 echo "!!! !!! !!!" >> ~/.message | |
| 36 sleep 60 | |
| 37 if grep '^New mail' ~/.message >/dev/null 2>/dev… | |
| 38 rm -f ~/.message | |
| 39 fi | |
| 40 fi | |
| 41 done & | |
| 42 while true; do | |
| 43 if [ -r ~/.message ]; then | |
| 44 while read line; do | |
| 45 xsetroot -name "$line" | |
| 46 sleep 1 | |
| 47 done < ~/.message | |
| 48 else | |
| 49 xsetroot -name "`date` `uptime | sed 's/.*,//'`" | |
| 50 sleep 1 | |
| 51 fi | |
| 52 done & | |
| 53 exec dwm | |
| 54 rm -f ~/.message | |
| 55 | |
| 56 Author | |
| 57 ------ | |
| 58 * Ricardo Catalinas Jiménez <[email protected]> |