Roy Schestowitz |
The PurposeThe page outlines a simple way of making public 'reflection' of your display (screen/s or monitor/s). This puspose of this network of scripts is to make such a reflection possible without user intervention, i.e. everything should happen in the background. Perferably, this should also run without affecting other processes currently running. To see an example of the output, have a look at the bottom of the introduction page. As well as a current snapshot of the display being public, a series of daily screenshots can be retained and made public. Moreover, timestamps get assigned to images and processes currently running can be shared with the public (not highly recommended though). Basic Instructions
#!/bin/sh
export DISPLAY=localhost:0.0 # set display (to make cron job work) import -window root ~/public_html/screen-temp.jpeg # capture display mogrify -resize 25% ~/public_html/screen-temp.jpeg # save to temporary file so as to avoid full-sized # image from being public for a second cp ~/public_html/screen.jpeg ~/public_html/screen-previous.jpeg # save the previous screenshot mv ~/public_html/screen-temp.jpeg ~/public_html/screen.jpeg # below are bits that write information to a simple text file echo "Refresh cycle is currently set to 10 minutes" > ~/public_html/caption.txt echo "" >> ~/public_html/caption.txt echo "Image last captured on: " >> ~/public_html/caption.txt date >> ~/public_html/caption.txt echo "" >> ~/public_html/caption.txt TERM=linux export TERM top -b -n 1 >> ~/public_html/caption.txt # The line above exposes plenty. Replace the above line with # echo "List of processes omitted" >> ~/public_html/caption.txt # to block it altogether echo "" >> ~/public_html/caption.txt echo "______________________________________________" >> ~/public_html/caption.txt echo "Script by Roy Schestowitz, August 2005" >> ~/public_html/caption.txt Note: Some of the commands listed above require Image Magick, which is included in most (if not all) *NIX distributions from the very start.
ArchivesThe retain archives of daily screenshots, the ideas remain similar, but general changes are made (often mere simplifications of the above). CodeSet up a new script file with the filename #!/bin/sh
export DISPLAY=localhost:0.0 # set display (to make cron job work) import -window root ~/public_html/archive/screen-temp.jpeg # capture display mogrify -resize 18% ~/public_html/archive/screen-temp.jpeg # save to temporary file so as to avoid full-sized # image from being public for a second mv ~/public_html/archive/screen-temp.jpeg ~/public_html/archive/screen-`date +%Y-%m-%d-%H`.jpeg Cron JobThe capture cycle will now be different. Since all screen grabs get saved, their number needs to be reasonable, or else you would run out of space quickly. Below is a cron job that will invoke the script once a day. 0 10 * * * nice /home/[user]/Scripts/grab_screen_archive.sh
This will register a screenshot every morning at 10. Ensure that Linking to Archive DirectoryAs before, you may wish to add code to link to the actual archive from a public page: <a href="Your machine address (namespace or IP address):8001/archive">Daily Archive</a>
Epilogue and Other ToolsThis page described a method for keeping track of desktop usage history. It is essentially a log of the user's wallpapers, applications and general look-and-feel, which later in life will have a nostlagic value. If you wish to keep track of music that you listen to you, have a look at the music log files page as well. |
This page was last modified on August 22nd, 2005 | Maintained by Roy Schestowitz |