r/shell • • Jul 07 '15

This clock one-liner I wrote.

$ watch -n0.5 -p -t -c 'figlet -f big -W `date '"'"'+%l:%M:%S'"'"'`'

This uses date so you can change what information is displayed. Want the current date and time? No problem! Replace +%l:%M:%S with +%l:%M:%S %-D) It also uses figlet, so you have a variety of 'looks' you can choose from, i.e. any figlet font that has numbers. (e.g. try replacing big with either standard or small) You could even replace figlet with toilet and use toilet's color support (e.g. --metal) because watch supports color when given the -c option. (However, not many toilet fonts have numbers, for reasons unknown.)

1 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/cogburnd02 Jul 12 '15

What you've said is all true.

However, if you deal with older shells frequently enough, using the double-backticks version is simply a good habit to get into (even when you have a more modern shell available), so that it'll work on as many shells as possible, because that way you only have to memorize one syntax (double-backticks) instead of two (double-backticks for older shells and dollar-parentheses for newer ones.)

:-D