-
-
Save sbko/73ac220b6ba13da31929a48518a8de2b to your computer and use it in GitHub Desktop.
BitBar plugin to display today's Org-mode agenda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# <bitbar.title>Agenda</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Matthew Kennard</bitbar.author> | |
# <bitbar.author.github>mgkennard</bitbar.author.github> | |
# <bitbar.desc>Shows the Org-mode agenda</bitbar.desc> | |
# <bitbar.dependencies>bash</bitbar.dependencies> | |
echo "Today" | |
echo "---" | |
echo "|dropdown=false" | |
echo "---" | |
echo "Refresh|refresh=true" | |
echo "---" | |
line_index=0 | |
had_timed_entries=false | |
/usr/local/bin/emacs -batch -l ~/.emacs.d/init.el -eval '(org-batch-agenda "a" org-agenda-span (quote day))' 2>/dev/null | while read line ; do | |
if [[ $line_index -gt 1 ]] && [[ ! $line = *"---" ]] && [[ ! $line = *"- - -"* ]] ; then | |
if [[ $line = *"..."* ]] ; then | |
had_timed_entries=true | |
elif [[ $had_timed_entries = true ]] ; then | |
echo "---" | |
had_timed_entries=false | |
fi | |
if [[ $line = *"TODO "* ]] ; then | |
font="Menlo-Bold" | |
else | |
font="Menlo-Regular" | |
fi | |
if [[ $line = *"DONE "* ]] || [[ $line = *"CANCELLED "* ]] ; then | |
color="gray" | |
elif [[ $line = *"x: "* ]] ; then | |
color="red" | |
else | |
color="black" | |
fi | |
echo "$line | font=$font size=14 color=$color trim-false" | |
fi | |
line_index=$((line_index+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment