From 0cfe8d4079f8ccac3adb75252b837d7cc1c84b31 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Fri, 19 Apr 2024 18:05:12 -0600 Subject: [PATCH] Offload wallpaper script to systemd --- sway/displays.pl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sway/displays.pl b/sway/displays.pl index 0317338..1896a14 100755 --- a/sway/displays.pl +++ b/sway/displays.pl @@ -393,7 +393,7 @@ my $t = Proc::ProcessTable->new(); foreach my $p ( @{ $t->table } ) { my $cmndline = $p->{'cmndline'}; $cmndline =~ s/\s*$//g; - if ($cmndline =~ /^(waybar|wallpaper\.pl).*/) { + if ($cmndline =~ /^waybar.*/) { # Never kill this process if ($p->{'pid'} == $$) { next; @@ -546,13 +546,5 @@ unless ($pid) { `WAYLAND_DISPLAY=$waydisplay nohup $waybar_bin -b waybar0 --config=$waybar_config >> $ENV{'HOME'}/.waybar.log`; } -# Start wallpapers script as fork -if ($w) { - $pid = fork; - unless ($pid) { - open STDIN, '/dev/null'; - open STDOUT, '>>/dev/null'; - open STDERR, '>>/dev/null'; - `/usr/bin/perl $ENV{'HOME'}/scripts/sway/wallpaper.pl -d $w`; - } -} +# Restart wallpaper daemon +`systemctl --user restart wallpapers.service`;