Randomized Backdrops

#!/usr/bin/perl -w

# This little program sets my background image
# randomly in blackbox (and now openbox).
# It's called when I startx.

$backdrop_directory = "/home/willyyam/crap/backdrop/";
# Set this to your backdrop files directory.

opendir(BD, "$backdrop_directory") or die;
# Normally we'd report errors, but since we will be
# running this via script and discarding the STDOUT
# that it generates, that would be a waste of time.

@backdrops = readdir(BD);
# Grab the contents of the backdrop directory.

@spordkcab = reverse(@backdrops);
pop(@spordkcab);
pop(@spordkcab);
# The first two entries readdir() finds are
# . and  ..  We don't want to hand these
# entries to bsetbg, so I reverse the array
# and do away with them.  There is a smooth,
# tidy way to do this.  I don't care :-)

$pic_o_the_moment = $spordkcab[ rand @spordkcab];
$pic_o_the_moment = $backdrop_directory . $pic_o_the_moment;
`/home/willyyam/bin/bsetbg $pic_o_the_moment &`;

# This the program call to bbsetbg, written by
# tmk@lordzork.com, is what does all the work --
# I just call it.

exit;

# William O'Higgins yam@nerd.cx

xinitrc

numlockx
wmusic -r -t -u -a -l&
xterm -fg white -bg black -vb  -geometry 80x55 &
bbbg.pl &
exec openbox

vimrc

" Set settings
set autoindent
set title
set ruler
set nocompatible
set showcmd
set ts=4
set tw=72
set backspace=indent,eol,start
set incsearch
syntax on

" Remember where I last edited a file
set viminfo='10,"100,:20,%,n~/.viminfo
au BufReadPost * if line("'"") > 0|if line("'"") < = line("$")|exe("norm '"")|else|exe "norm $"|endif|endif

if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
set t_Co=16
set t_Sf=^[[3%dm
set t_Sb=^[[4%dm
endif
" Settings set

" Map mappings
:inoremap ( ()i
:inoremap [ []i
:inoremap " ""i
:inoremap { {}i
:inoremap < <>i

map W :!aspell -c -x %
map F gqap

" http://vim.sourceforge.net/tips/tip.php?tip_id=465
" make an element out of anything you type with a CR in the middle
imap ,,, bdwapakA

" Fix common typos
iab teh the
iab hte the
iab adn and
iab taht that
iab htat that
iab fo of
iab ot to
" Mapping mapped

if has("autocmd")
" Enabled file type detection
" Use the default filetype settings. If you also want to load indent files
" to automatically do language-dependent indenting add 'indent' as well.
filetype plugin on
endif " has ("autocmd")