Single-window-Wanderlust
[dotfiles.git] / .xinitrc
1 #!/bin/bash
2 # Copyright (c) 2014 Gabriel Perez-Cerezo.
3 while true
4 do
5 TIME="<span foreground=\"#F0F\" > $(date "+%-d/%-m/%y %H:%M")</span>"
6 MESSAGES="$(find /home/gpcf/Maildir/inbox/new -type f | wc -l)"
7 QUEUE="$(ls /home/gpcf/Maildir/queue/cur | wc -l)"
8 if [ $QUEUE -gt 0 ]
9 then
10 COLOR="#FA0"
11 else
12 COLOR="#F0F"
13 fi
14 TIME="<span foreground=\"#0FA\"><i>$QUEUE</i></span> <span font_desc=\"Icons 10\" foreground=\"$COLOR\"></span> | $TIME"
15 if [ $MESSAGES -gt 0 ]
16 then
17 COLOR="#0AF"
18 else
19 COLOR="#0F0"
20 fi
21 TIME="<span foreground=\"#F0A\"><i>$MESSAGES</i></span> <span font_desc=\"Icons 10\" foreground=\"$COLOR\"></span> | $TIME"
22 if ssh-add -l > /dev/null
23 then
24 COLOR="#0FA"
25 else
26 COLOR="#F00"
27 fi
28 TIME="<span foreground=\"$COLOR\" font_desc=\"Icons 10\" ></span> | $TIME"
29 if acpi -a | grep off-line > /dev/null
30 then
31 BAT="$(acpi -b | cut -d " " -f 4-5 | tr -d ',')"
32 AVAILABLE="$(echo $BAT | cut -d '%' -f 1)"
33 if [ $AVAILABLE -gt 90 ]
34 then
35 COLOR="#0F0"
36 elif [ $AVAILABLE -gt 20 ]
37 then
38 COLOR="yellow"
39 else
40 COLOR="red\" weight=\"bold"
41 fi
42 BAT="<span foreground=\"$COLOR\" >$BAT</span>"
43 TIME="$BAT | $TIME"
44 fi
45 TIME="<span foreground=\"#FF0\" font_desc=\"Icons 10\" ></span> | $TIME"
46
47 xsetroot -name "$TIME"
48 sleep 5
49 done &
50
51
52
53 feh --bg-fill ~/Pictures/granada/DSCN0459.JPG
54 emacs &
55
56 exec msva-perl dwm