-
Notifications
You must be signed in to change notification settings - Fork 15
/
clocking
executable file
·31 lines (28 loc) · 835 Bytes
/
clocking
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
#!/bin/sh
# Displays the title of current active (clocked) task in org-mode
# along with its pomodoro counter and overall spent time.
elisp=$(cat <<'END_HEREDOC'
(concat
;; (setq org-duration-format 'h:mm)
(if (org-clock-is-active) (org-clock-get-clock-string) "")
;; " "
;; (when (org-pomodoro-active-p)
;; (format
;; (propertize org-pomodoro-format 'face 'org-pomodoro-mode-line)
;; (org-pomodoro-format-seconds)))
)
END_HEREDOC
)
if [[ -z $(pidof emacs) ]]
then
echo ""
else
TIME=`emacsclient --eval "$elisp" \
| grep -s -o "\".*\"" | sed 's/\"//g' | sed 's/^ //g' | sed 's/ $//g' | sed 's/\[//g' | sed 's/\]//g'`
if [ -n "$TIME" ]; then
# echo "<font color='#ffc107'> $TIME </font>"
echo " $TIME"
else
exit 1
fi
fi