Step 1: Getting the Files.....
First you need all the files. I have put a link to my copy of the files below. Download the airplay.jar file.
Airplay.jar file download
Once you have downloaded the file, place it in your home directory. Easy enough? Next Step!
Step 2: Getting a Java Runtime...
First, you need to open the Ubuntu Software Center. Go to the top right corner, to the search bar, and search 'Java'. You should see the third or fourth one down is the OpenJDK Java Runtime 7. Make sure it is version 7 not 6. Install that and you'll be sitting pretty for the next step!
Step 3: Executing in Terminal....
You now need to leave your computer and go to your AppleTV. Go to Settings->General->Network and notice the IP Address. Use the DHCP one if it shows more than one. Write this down, unless you have good memory. Back to the computer.
In terminal you need to change the directory that your commands are executing in by typing - cd /home/USER - but substitute USER for your actual user name. Example in image. Now you need to type the following command -
java -jar airplay.jar -h 172.18.129.223 -d
Just remember to substitute the ip address with the address of YOUR AppleTV. You should now see your desktop on your AppleTV! If not run the command as root by typing - sudo - before the command. This is a pseudo-mirroring technique meaning that it just relays images of you desktop over time to the AppleTV so it could be a little choppy and slow but its the best we have for now. Enjoy! If you have any questions feel free to ask them in the comments!