Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

change wallpaper

Name: F 2007-11-22 5:38

#!/usr/bin/perl -w
#randomly change my wallpaper.
#by F. do what you will with this.

use warnings;
use strict;

opendir(DIR, "/home/f/misc/wallpaper") || die "can't opendir ~/misc/wallpapers: $!";
my @files = grep { $_ ne '.' and $_ ne '..' } readdir(DIR);
closedir DIR;

# perldoc -q "random element"
my $chosenwp = $files[rand @files];

print "chosen wallpaper is: $chosenwp\n";
system("feh --bg-scale /home/f/misc/wallpaper/$chosenwp");

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List