srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
Aside from being overkill, it hasn't been necessary to invoke srand() since 5.004. Any system new enough to be running Gnome2 probably doesn't have a Perl that old. :)
| [reply] [Watch: Dir/Any] [d/l] |
Nice job dystrophy. I whipped up an almost identical program just the other day, after stumbling upon GConf in another context.
In the hope that it may help another user in a similar situation, under RedHat 8.0, my background wasn't controlled by the value of the /desktop/gnome/background keys; I had to stop nautilus from drawing its own background. I added the --no-desktop flag to the nautilus command line in ~/.gnome/session, but this can also be done with gconftool-2:
gconftool-2 --type=bool --set /apps/nautilus/preferences/show_desktop false
The only side effect is that you can't have any 'desktop' icons. | [reply] [Watch: Dir/Any] [d/l] [select] |
It is possible to tell Nautilus not to draw its own
wallpaper without stopping it from drawing desktop
icons. My Mandrake 9.1 system was configured this
way OOTB, but I specifically recall changing the
setting in Nautilus under an earlier version of
Mandrake. (No, that's not where 9.1 got the setting;
I installed it on a blank partition.) Unfortunately,
I don't know how to do this from Perl :-(
Anyway, ++ to dystrophy; formerly I was just doing
`ln -s $f ~/images/current-wallpaper` and the new
wallpaper would take effect magically whenever X was
restarted, but that meant having the same wallpaper
for weeks, and I was just wondering the other day
how to tell Gnome to reload the wallpaper, so this
is a big improvement :-)
Oh, one thing to add. You just troll a directory tree
and look for images, but if you want better control
over which images to use as wallpaper and which not,
do what I do: create a single directory and fill it
with symlinks to just the images you want used. Then
@f=<~/images/wallpaper-symlinks/*>; and
there's no need for filtering.
{my$c;$ x=sub{++$c}}map{$ \.=$_->()}map{my$a=$_->[1];
sub{$a++ }}sort{_($a->[0 ])<=>_( $b->[0])}map{my@x=(&
$x( ),$ _) ;\ @x} split //, "rPcr t lhuJnhea eretk.as
o";print;sub _{ord(shift)*($=-++$^H)%(42-ord("\r"))};
| [reply] [Watch: Dir/Any] [d/l] [select] |
This is pretty nice. Though I have some minor niggles with the style -- use of global filehandles versus lexical, and single-arg system() -- it's all pretty much how I'd do something along these lines.
Also, I like the use of gconftool-2. I didn't know about this little program, and it seems very useful (even if GConf reminds me way too much of the Windows Registry). Thanks for the example. :)
| [reply] [Watch: Dir/Any] |