Add anything to Yosemite's Notification Center – all it takes is the right command.
If there's a piece of information you wish you could check regularly, you need to know about Today Scripts (download). This simple Mac app gives you the ability to add practically anything to the new Notification Center in Yosemite.
If you're like most Mac users, you're still exploring all the new features in OS X Yosemite. My personal favourite is the new, expanded Notification Center – which comes complete with Today Widgets, just like on iOS. It's pretty clear Apple intends for this to replace the long-obsolete Dashboard, and it's possible to find all the widgets you need to do that right now.
But what if you can't find a way to add a vital piece of information? Enter Today Scripts. This simple app lets you add widgets using any Terminal command. If you've used a program like Geektool or Übersicht to add beautiful widgets to your desktop, you know how powerful this can be.
Whether you want to monitor your system, or just want to see certain information quickly, we've got you covered. Here are a few commands you can try out after installing Today Scripts.
One Month Calendar, With Current Date Highlighted
Sometimes you need to know what the date will be next Tuesday, or what day of the week November 22 falls on. Longtime Mac users know that the "cal" command shows the current month in the Terminal. You can simply use that, or you can use the following script for the current date to be highlighted in red:
cal | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"
Either way, you'll have a quick way to glance at the current month's dates.
via Command Line Fu
See The Time In Various Time Zones
Yosemite comes with a world clock widget, but for some insane reason it offers clock faces instead of a straight-forward list of times. If you find this as stupid as I do, use the following command instead:
echo "Denver `export TZ='US/Mountain';date +'%-l:%M %p';unset TZ`"
echo "London `export TZ='Europe/London';date +'%-l:%M %p';unset TZ`"
echo "Paris `export TZ='Europe/Paris';date +'%-l:%M %p';unset TZ`"
echo "Mumbai `export TZ='Asia/Kolkata';date +'%-l:%M %p';unset TZ`"
echo "Sydney `export TZ='Australia/Sydney';date +'%-l:%M %p';unset TZ`"
Want to see different time zones than above? Editing the command is relatively simple. Check Wikipedia's list of tz database time zones so you know what to put after "TZ=".
Inspired by this Übersicht widget.
See What's On Your Clipboard
Want a quick way to see what's on your clipboard? No problem. Just use this:
pbpaste
See BrainyQuote's Quote Of The Day
Not everything needs to be perfectly practical. If you want something to think about in those down moments during your day, check this out:
curl --silent www.brainyquote.com/quotes_of_the_day.html | egrep '(span class=\"bqQuoteLink\")|(div class=\"bq-aut\")' | sed -n '1p; 2p; ' | sed -e 's/<[^>]*>//g'
This pulls the Quote Of The Day from BrainyQuote into your Notification Center.
Via a comment at macosxtips.co.uk
See A System Overview With iStats
Want a quick overview of your CPU, fan and battery status? If you have iStats installed, it's easy: just add "istats" as a command. Done!
Note that installing iStats requires a bit of command line skill.
See Your Battery's Status, Quickly
This one's simpl3 enough: you'll see what percentage of power is left in your battery, and how much longer it will last. Or, if you're charging, how long until it's fully charged.
pmset -g batt | { read; read n status; echo "$status"; }
via the Today Scripts wiki
List The Top Apps By RAM usage
Wondering what's using up all your RAM? This command gives you quick overview.
ps xmo rss=,pmem=,comm= | while read rss pmem comm; ((n++<5)); do
size="$[rss/1024]";
short=$[4-${#size}];
size="(${size}M)";
i=0;
while ((i++ < short)); do size=" $size"; done;
pmem="${pmem%%.*}"
if (($pmem >= 20)); then color=$'\e[31m';
elif (($pmem >= 10)); then color=$'\e[33m';
else color=$'\e[32m ';
fi;
echo "$color$pmem% $size $(basename "$comm")"$'\e[0m'"";
done
via the Today Scripts Wiki
Top Apps by CPU Usage
Like the above, but for CPU usage.
ps xro %cpu=,comm= | while read cpu comm; ((i++<5)); do echo $cpu% $(basename "$comm"); done
via the Today Scripts Wiki
Display Your External IP
Want to know what your IP is? Here's a quick way to find out.
curl ifconfig.me
(I was using a VPN when I took the screenshot. I'm not a complete idiot, nor do I reside anywhere close to Switzerland.)
What Else Could We Add?
There are a few ideas left, such as using iCalBuddy to get a more precisely-defined agenda. Can you think of anything else? Share any great commands you find below, and together we'll make the Notification Center the most informative panel on your Mac.
So you've seen a few commands that I've found, but now I want to know:
What will you add to your Notification Center?