dotfiles

My opinionated dotfiles
git clone git://git.erethon.com/dotfiles
Log | Files | Refs

commit b5329979360d3f434c0de397037b2e125086c35e
parent 1b21ac3feaefe135cb701ea138fdc34ace5f0b35
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Mon,  6 Apr 2020 03:17:36 +0300

bin: Add mail.sh, adapt .xsession to use it

Diffstat:
.xsession | 2+-
bin/mail.sh | 12++++++++++++
bin/mbsync.sh | 3+--
3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/.xsession b/.xsession @@ -2,7 +2,7 @@ setxkbmap us,gr -option grp:alt_shift_toggle setxkbmap -option ctrl:nocaps export LC_CTYPE="en_US.UTF-8" while true; do - xsetroot -name "$(date +"%F %R")" + xsetroot -name "$(mail.sh) $(date +"%F %R")" sleep 1m done & ssh-agent /usr/local/bin/dwm diff --git a/bin/mail.sh b/bin/mail.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +mailboxes="$HOME/mail/dgrig/dgrig/new $HOME/mail/matrix/INBOX/new" +num_mail=0 +for i in $mailboxes; do + in=$(find $i | wc -l) + num_mail=$(expr $num_mail + $in) +done +if [ $num_mail -gt 2 ] +then + echo -n "New mail!" +fi diff --git a/bin/mbsync.sh b/bin/mbsync.sh @@ -1,5 +1,4 @@ -#!/bin/sh - +#!/usr/bin/env sh while : do killall mbsync