Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active August 29, 2015 14:05
Show Gist options
  • Save dardo82/9f8bbf0e94c699ab12a0 to your computer and use it in GitHub Desktop.
Save dardo82/9f8bbf0e94c699ab12a0 to your computer and use it in GitHub Desktop.
Italian speaking clock
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnableGlobbing</key>
<true/>
<key>Label</key>
<string>it.dardo82.TellTheTime</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Application Support/Tell The Time/ttt.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Minute</key>
<integer>15</integer>
</dict>
<dict>
<key>Minute</key>
<integer>30</integer>
</dict>
<dict>
<key>Minute</key>
<integer>45</integer>
</dict>
</array>
</dict>
</plist>
#! /bin/bash
H=$(date +%H)
M=$(date +%M)
case ${M#0} in
0) M="in punto";;
15) M="e un quarto";;
30) M="e mezzo";;
45) M="meno un quarto"; H=$[H+1];;
*) M="e ${M#0}";;
esac
case ${H#0} in
1|13) H="é l'una";;
0|24) H="é mezzanotte";;
12) H="é mezzogiorno";;
*) H="sono le $[H%12]";;
esac
say "[[volm 0.5]] $H $M"
@dardo82
Copy link
Author

dardo82 commented Aug 24, 2014

To download and install execute these commands:
mkdir "/Library/Application Support/Tell The Time/"
cd "
/Library/Application Support/Tell The Time/"
curl -s -o ttt.tgz https://gist.github.com/dardo82/9f8bbf0e94c699ab12a0/download
tar --strip-components 1 -zxvf ttt.tgz; rm ttt.tgz
mv it.dardo82.TellTheTime.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/it.dardo82.TellTheTime.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment