From fa007b60ef1b5a8f3c7a6157f1bd2913dff32515 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Thu, 22 Sep 2022 14:32:39 -0400 Subject: [PATCH] Fix file path of cropped image --- sway/wallpaper.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sway/wallpaper.pl b/sway/wallpaper.pl index 5aabc79..a342327 100755 --- a/sway/wallpaper.pl +++ b/sway/wallpaper.pl @@ -226,7 +226,7 @@ sub crop my $oh = shift; my $cropped = $image; - $cropped =~ s#^.*/([^/]*)\.([^\.]+)$#$1-cropped.$2#; + $cropped =~ s#^.*/([^/]*)\.([^\.]+)$#$self->{'path'}$1-cropped.$2#; #$image = "/tmp/Pharma-out.png.jpg"; use Image::Magick; @@ -355,9 +355,9 @@ sub run } $self->set_background($target,$cropped); if ($self->{crop}) { - $self->do_log('LOG_DEBUG', "Deleting $cropped"); # Give swaybg a second, otherwise the file will be missing before it ends - sleep(2); + sleep(1); + $self->do_log('LOG_DEBUG', "Deleting $cropped"); unlink($cropped) || $self->do_log("LOG_WARNING", "Failed to delete $cropped after setting: $!"); } } else {