One of my not-so-geek friends that practice couch-surfing in my living room was impressed with my ability to shut down my workstation after watching a movie. Here you have the recipe.
#!/bin/bash if [ $1 = "" ]; then echo "Usage: $0 PROCESS_NAME" exit fi while pidof $1; do sleep 1; done
Assuming the script is called foo.sh:
$ ./foo.sh mplayer && shutdown