projects
/
clearscm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed jira to handle branch names that are just numbers
[clearscm.git]
/
bin
/
setbg
diff --git
a/bin/setbg
b/bin/setbg
index
85479a5
..
8de93c6
100755
(executable)
--- a/
bin/setbg
+++ b/
bin/setbg
@@
-63,16
+63,17
@@
contents of the bgdirs incase it has changed and display a new image". This is
useful for script to be able to alert setbg that something has changed. For
example, a script named rmbg might look at ~/.setbg to get the name of the
current background image file and remove it then signal setbg with SIGUSR1 to
useful for script to be able to alert setbg that something has changed. For
example, a script named rmbg might look at ~/.setbg to get the name of the
current background image file and remove it then signal setbg with SIGUSR1 to
-have it re-evaluate the state of bgdirs.
+have it re-evaluate the state of bgdirs.
Finally setbg will perform the this re-evaluation at midnight everyday. This is
Finally setbg will perform the this re-evaluation at midnight everyday. This is
-useful because we point setbg to look at -bgdirs from Dropbox where Camera
+useful because we point setbg to look at -bgdirs from Dropbox where Camera
Uploads is included and new pictures can arrive everyday.
=cut
use strict;
use warnings;
Uploads is included and new pictures can arrive everyday.
=cut
use strict;
use warnings;
+use experimental qw(signatures);
use FindBin;
use Getopt::Long;
use FindBin;
use Getopt::Long;
@@
-104,7
+105,7
@@
my %opts = (
my %totals;
my %totals;
-sub displayStats
() {
+sub displayStats() {
my $statsFile = Logger->new(
name => ".$FindBin::Script.stats",
path => $ENV{HOME},
my $statsFile = Logger->new(
name => ".$FindBin::Script.stats",
path => $ENV{HOME},
@@
-124,7
+125,7
@@
sub displayStats () {
return;
} # displayStats
return;
} # displayStats
-sub fillPictures
(
) {
+sub fillPictures
($signame = undef
) {
my @images;
$totals{bgdirs} = 0;
my @images;
$totals{bgdirs} = 0;
@@
-150,28
+151,29
@@
sub fillPictures () {
return @images;
} # fillPictures
return @images;
} # fillPictures
-sub writeHistory($) {
- my ($msg) = @_;
-
+sub writeHistory($msg) {
open my $hist, '>>', "$ENV{HOME}/.$FindBin::Script.hist"
or error "Unable to open $ENV{HOME}/.$FindBin::Script.hist for append - $!", 1;
$msg = localtime() . $msg;
open my $hist, '>>', "$ENV{HOME}/.$FindBin::Script.hist"
or error "Unable to open $ENV{HOME}/.$FindBin::Script.hist for append - $!", 1;
$msg = localtime() . $msg;
-
display $msg, $hist
;
+
print $hist "$msg\n"
;
close $hist;
} # writeHistory
close $hist;
} # writeHistory
-sub updateSetBG($$) {
- my ($bgimage, $lockimage) = @_;
+sub writeSetBG($filename, $image) {
+ open my $file, '>', $filename
+ or error "Unable to open $filename for writing - $!", 1;
- open my $setbg, '>', "$ENV{HOME}/.$FindBin::Script"
- or error "Unable to open $ENV{HOME}/.$FindBin::Script for writing - $!", 1;
+ print $file "$image\n";
- display $bgimage, $setbg;
+ close $file;
+} # writeSetBG
- close $setbg;
+sub updateSetBG($bgimage, $lockimage) {
+ writeSetBG "$ENV{HOME}/.$FindBin::Script", $bgimage;
+ writeSetBG "$ENV{HOME}/.$FindBin::Script.lock", $lockimage;
my $msg = ":$bgimage";
$msg .= " lock:$lockimage" if $opts{lockscreen};
my $msg = ":$bgimage";
$msg .= " lock:$lockimage" if $opts{lockscreen};
@@
-181,7
+183,7
@@
sub updateSetBG($$) {
return;
} # updateSetBG
return;
} # updateSetBG
-sub SwitchWallPaper {
+sub SwitchWallPaper
($saigname)
{
# We don't need to do anything here, just handle the interrupt and
# let the while loop continue.
debug 'SwitchWallPaper: Interrupt received';
# We don't need to do anything here, just handle the interrupt and
# let the while loop continue.
debug 'SwitchWallPaper: Interrupt received';
@@
-231,7
+233,7
@@
my ($setbgOpts, $setLockOpts);
if ($opts{mate}) {
$setbgOpts = 'set org.mate.background picture-filename ';
if ($opts{mate}) {
$setbgOpts = 'set org.mate.background picture-filename ';
- $setLockOpts = 'set org.mate.
background
picture-filename ';
+ $setLockOpts = 'set org.mate.
screensaver
picture-filename ';
} else {
$setbgOpts = "set org.gnome.desktop.background picture-uri \"file://";
$setLockOpts = "set org.gnome.desktop.screensaver picture-uri \"file://";
} else {
$setbgOpts = "set org.gnome.desktop.background picture-uri \"file://";
$setLockOpts = "set org.gnome.desktop.screensaver picture-uri \"file://";