I make an album with pictures from several friends' cameras. Let's imagine that the EXIF exposure date and time are correct in all files. Filenames, however, are not aligned (e.g. my camera starts at IMG0001 but my friend's phone camera starts at pic1234.jpg, and my own phone starts at pic5678.jpg).

Is there a way with Shotwell to export the files from everyone over to a plain directory, with the filenames rewritten so that the pictures are sorted in chronological order? Then, when I slideshow these files in another computer, with another image viewer (or with Shotwell itself in file browsing mode), they will show in the right chronological order.

Example.
If I have these six files...

My camera: IMG_0001.JPG - EXIF exposure date 2012/12/25 12:05:00

My camera: IMG_0002.JPG - EXIF exposure date 2012/12/25 12:11:00

My own phone: pic5678.jpg - EXIF exposure date 2012/12/25 12:09:00

My own phone: pic5679.jpg - EXIF exposure date 2012/12/25 12:15:00

Friend's phone: pic1234.jpg - EXIF exposure date 2012/12/25 12:08:00

Friend's phone: pic1235.jpg - EXIF exposure date 2012/12/25 12:18:00

...then I would like to export them with filenames like these:

20121225_120500-IMG_0001.JPG

20121225_120800-pic1234.jpg

20121225_120900-pic5678.jpg

20121225_121100-IMG_0002.JPG

20121225_121500-pic5679.jpg

20121225_121800-pic1235.jpg

so that they show in the right order when browsing with any image browser.

The following script does the trick, but is not integrated in Shotwell, which is the point of the question, and will (gracefully) fail if the pictures are not exported with Exif data:

Notice that you can add characters between the values in the curly brackets (like the underscore between {imageday} and {imagehour}), to make the output easier to read.

The last {num3+1} bit is optional but helps if you happen to have two photos shot at the same second, and makes the whole lot easier to read.

If you do this and find that one or more of the device clocks are off, you can use Shotwell to modify the time/date, and then re-do the pyrenamer step to have everything in perfect order. This is especially helpful for something like a wedding where people are coming to the event from different time zones, and photos out of order look totally wrong.