Offload wallpaper script to systemd
This commit is contained in:
parent
fffbb5d5e0
commit
0cfe8d4079
|
@ -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`;
|
||||
|
|
Loading…
Reference in New Issue