Screenshot of terminal, text #TDC5055 FigLet Fun in a figlet 'font'

I’ve been thinking about the DS106 experience recently due to my marginal involvement in the combobulating experience. This was very much focused on The Daily Create, a bit of fun I dip into occasionally. One of the things that I thought about was the fact I often got more fun out of the DS106 assignment bank than the daily tasks. Today Alan’s post reminded me why. It made me dig into this post, notes for which were sitting the my drafts app, spiff it up a bit and post it.

The other day I saw the #tdc5055 #ds106 ASCII Art on The Daily Create

Use the ASCII Art Paint site to create something interesting with the thematic symbols.

It immediately reminded me of figlet. Took me a couple of minutes to remember the name.

Figlet makes big ASCII text on the command line. You just type in “figlet “#DS106” and you get something like this in the terminal:

You can try figlet out online if you don’t want to use the terminal and install it: Asciified

asciified is a small webapp that gives you the ability to create figlets using the figlet package

I had a dim memory that figlet had the concept of “fonts” so checked the help. The fonts were stored in a folder. As there didn’t seem to be an easy way to preview them, I thought I’d just write a script. This would loop through all the fonts I’d copied to a text file, and allow me to pick the best version.

while IFS= read -r font; do
    figlet -f "$font" -c -S "Daily Create"
	sleep 0.5
done < figfonts.txt

Watching them scroll past then made me think a screen recording might be interesting. I cleaned up the list of fonts1 a little and recorded my window, posted it to YouTube and replied to @creating. Job done2.

The next day I wondered if I could do a better job of this: automate the screen capture by grabbing screenshots and then taking them and stringing them together to make a “video” with ffmpeg. And indeed I could.

#!/usr/bin/env bash

WINID=$(osascript -e 'tell application "Terminal" to id of front window')

screencapture -l $WINID  -o  0000.png  >/dev/null 2>&1

while IFS= read -r font; do
	pngfile=$(printf "%04d.png") 
    figlet -f "$font" -c -S "Daily Create"
 	screencapture -l $WINID  -o  $pngfile  >/dev/null 2>&1
	sips --resampleWidth 1200 $pngfile  >/dev/null 2>&1
done < figfonts.txt

ffmpeg -framerate 5 -i %04d.png -c:v libx264  -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -r 24 -pix_fmt yuv420p figfontfun.mp4

screencapture can capture just a window if you give it a Window ID. A search showed me how to get that. sips resizes the images. I sent the output off screen with >/dev/null 2>&1. Taking a screenshot of the window without shadow, the -o bit, made for neater images.

The loop give me a bunch of png files which are concatenated into a video. I’ve done that a few times. Unfortunately I don’t use ffmpeg enough to get that right the first time. Video codec and many ffmpeg paramaters seem very complicated. Again a few searches put me right3. And I had a short script that would work.

Here is the result:

I am still not sure why writing up this post, trying to put a rather silly idea in order, is satisfying. But it was.

  1. I just copied out the list of items in the figlet font folder to a text file, removed folder and then file names that didn’t work. I am sure a smarter script could do that without the manual clean up. ↩︎
  2. When I say job done I mean footering about for an hour or two with figlet, and QuickTime Player to record the screen. ↩︎
  3. FFMPEG solutions are very searchable. NTS: the bit about rounding sizes to even numbers has bitten me before. Hopefully this footnote will help me remember that the next time. ↩︎

‘Points & grunt’ or ‘eloquently instruct’

A couple of weeks ago Oliver Quinlan was a guest on Radio EDUtalk. The thing that stuck in my mind the most from the episode was this idea. Oliver has now written a bit more about it on his blog.

The command prompt allows you to use the power of language to interact with a computer. In comparison, clicking around in a  desktop environment is akin to pointing and grunting. Getting people to do things by pointing and grunting is OK at first, but as children we naturally put in the effort to learn how to move beyond this to get things done quicker, more precisely and more elegantly.

‘Points & grunt’ or ‘eloquently instruct’ – Language & computers – Oliver Quinlan

I’ve often struggled to explain, even to myself, why I enjoy using the terminal application. This is the best elevator pitch I’ve heard.

I am no command line expert, but I end up using it for small things or interesting experiments most days. I guess my first exposure was on the introduction of Mac OS X in 2001. Af first it was something to use occasionally for system settings that could not be done in other ways. Slowly over the last 15 (eek!) years I’ve used it a bit more and slowly learned. It is not something you need to be an expert to get use from. For example Batch Processing MP3 files is probably not eloquent but it saved me a huge amount of time.

For most of the time I’ve been using the terminal I though of it as a somewhat old fashioned process. It is now fairly obvious that it will be in use for some time yet. This week the news that Microsoft is bringing the Bash shell to Windows 10 brought that home.

It is worth mentioning that there is an amazing amount of information on using the command line on the web. I can’t remember when a search has failed to help me learn.

Elsewhere Oliver recommended Conquer the Command Line as a good resource to getting started. From the MagPi Magazine available as a free PDF.

 

Featured image: my own, grabbed with LICEcap.