Screensavers in Ubuntu 9.x

I used to do some incredible tweaking for my screensaver in Ubuntu, especially because gnome-screensaver wouldn’t allow for editing the particular screensaver options like xscreensaver would (see: https://wiki.ubuntu.com/ScreenSaver). These days, I don’t want to tweak… I just want the thing to shut off when I am watching fullscreen flash video, so that I don’t have to wiggle the mouse every ten minutes. :-)

So I made a simple toggle script and created a launcher for the script on the desktop. Gonna watch video? Double-click the icon. Done watching video, double-click the icon.

#!/bin/bash
PID=`pidof gnome-screensaver`
 
if [ "$PID" != "" ]; then
	#gnome-screensaver is running shut it down
	killall -9 gnome-screensaver
else
	#gnome-screensaver is not running, start it up
	gnome-screensaver
fi

Post via script

I just whipped up some PHP and threw it in the root of a brand new WordPress 2.9.2 install:

<?php
include_once('wp-config.php');
include_once('wp-load.php');
include_once('wp-includes/wp-db.php');
 
$my_post = array();
$my_post['post_title'] = 'My post';
$my_post['post_content'] = 'This is my post.';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
 
wp_insert_post( $my_post );
?>

Voila. The post appeared when navigating to the .php file.

See: http://codex.wordpress.org/Function_Reference/wp_insert_post.

For more creativity, get into the database: http://codex.wordpress.org/Function_Reference/wpdb_Class