use FindBin;
use Getopt::Long;
use Proc::ProcessTable;
+use CGI qw/:standard/;
use lib "$FindBin::Bin/../lib";
} # foreach
# Using gsettings
-my $setbg = "gsettings";
+my $setbg = "gsettings";
my $setbgOpts = "set org.gnome.desktop.background picture-uri \"file://";
my @images;
EnterDaemonMode unless defined $DB::OUT;
while () {
- my $image = $images[int (rand $#images)];
+ my $image = escapeHTML ($images[int (rand $#images)]);
open my $log, '>', "$ENV{HOME}/.$FindBin::Script"
or error "Unable to open $ENV{HOME}/.setbg for writing - $!", 1;
my $cmd = "$setbg $setbgOpts$image\" 2> /dev/null";
- `$cmd`;
+ my @output = `$cmd`;
+ if ($? != 0) {
+ display "ERROR Trying to set background - command used \"$cmd\"", $log;
+ display "Output:";
+ display join "\n", @output, $log;
+ } # if
+
close $log;
sleep $sleep;