From d8ae0c1c48a12f21c68b06d5b1a70941cafca5bb Mon Sep 17 00:00:00 2001 From: John Mertz Date: Sat, 17 Sep 2022 15:17:28 -0400 Subject: [PATCH] Track PID --- sway/gammastep.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sway/gammastep.pl b/sway/gammastep.pl index 69878af..7a84a37 100755 --- a/sway/gammastep.pl +++ b/sway/gammastep.pl @@ -13,6 +13,13 @@ my $lat_lon = fetch_lat_lon($location); my $pid = fork; unless ($pid) { + open(my $fh, ">", $ENV{HOME}."/.spool/gammastep.pid"); + print $fh $$; + close($fh); + open($fh, ">", $ENV{HOME}."/.spool/gammastep.status"); + print $fh 1; + close($fh); + open STDIN, '/dev/null'; open STDOUT, '>>/dev/null'; open STDERR, '>>/dev/null';