-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport
executable file
·42 lines (39 loc) · 1.19 KB
/
report
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/make -f
EXCLUDE = .local .cache build vcs .cargo
SPACE = $(subst x, ,x)
EXCLUDE_RE = ^$(HOME)/\($(subst $(SPACE),\|,$(subst .,\.,$(EXCLUDE)))\)
ifeq ($(shell test -t 1 && echo term),term)
header = echo '\033[32m$1\033[m'
else
header = echo '$1'
endif
all: software notmuch git
help:
@echo Usage: report '[help|git|mail|notmuch|all]'
software:
@cecho green Updates:
@echo There are `pacman -Quq | wc -l` updates available.
git:
@cecho green Dirty git repositories:
@-find $(HOME) \
-regex '$(EXCLUDE_RE)' -prune -o \
\( \
-type d \
-name .git \
-execdir git is-dirty \; \
-exec dirname {} \; \
\) 2>/dev/null
mail:
@cecho green New mail:
@~/src/mailtools/check.py -e lists/zsh -e draft ~/mail || \
echo No new mail.
notmuch: QUERY = tag:unread AND query:inbox
notmuch:
@cecho green New mail:
@if [ `notmuch count $(QUERY)` -eq 0 ]; then \
echo No new mail.; \
else \
notmuch search $(QUERY); \
fi
.PHONY: software git mail all test notmuch
# vim: ft=make