Commandline IMAP Mail check & Screen

I wanted a commandline IMAP mailbox checker so I wrote one: imapchkr

Normal output for this is as below:

➜  ~  [jamespo: 0/190] [gmail: 0/80] 

But I decided I wanted to embed it in my GNU screen hardstatus so expanded it to offer a short output option (imapchkr -s). See bottom left corner for output.

➜  ~  dstat  
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--  
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw   
  1   0  98   0   0   0|  45k   65k|   0     0 |   1B    2B| 114   112   
  0   0 100   0   0   0|   0     0 | 106B 1003B|   0     0 |  45    55   
  1   0  97   3   0   0|   0    44k| 172B 1122B|   0     0 |  65    65   
  1   0  99   0   0   0|   0     0 |2234B 5945B|   0     0 | 168   183   
  1   1  99   0   0   0|   0    56k| 109B 1145B|   0     0 |  91   104   
  3   1  95   0   0   0|   0   208k| 122B 1187B|   0     0 | 206   219 ^C  
➜  ~    
j:0 g:0 Sat Feb 28 2:30pm Get a hair cut 0$ ssu  1$ ~    2$* ~  3$ ~  4!$ 192.168.0.254  5-$ ~

Configure your ~/.screenrc like this:

backtick 1 60 60 /home/james/bin/screen_agenda
backtick 2 90 90 /home/james/bin/imapchkr -s
hardstatus on
hardstatus alwayslastline
hardstatus string '%{wk}%2`%{yk}%1` %{= kG}%-Lw%{= kW}%50>  %n%f* %t%{= kG}%+Lw%<'

screen -t root
screen -t mail
screen -t root

I'm also using gcalci for Google Calendar appointments.

Leave a Reply

Your email address will not be published. Required fields are marked *