commit - 2099802b3cabc45f0b25079a9ab4919921da07a6
commit + 818ba3428c675cd065d3d6756c3c0ccb6b43bdf1
blob - 998fa4b9a0b2c8d702a31d6b8cce93a2fb5f85a2
blob + 9e0ccaa6cf6c83fbeccb1f36611428e4a80e8ed1
--- stimer.pl
+++ stimer.pl
use strict;
my $timerpath = "$ENV{HOME}/.local/state/statbartimer";
+my $time = $ARGV[0] // 1;
if (! -p $timerpath)
{
die "Could not find statbartimer file or not FIFO";
}
-$ARGV[0] =~ /^(?:\d{2}:(\d{2})|(\d+))$/ or die "Bad timer format";
+$time =~ /^(?:\d{2}:(\d{2})|(\d+))$/ or die "Bad timer format";
if ($1 > 59 or $2 > 5999)
{
die "Bad timer format";
{
open my $fh, '>', $timerpath or die $!;
- print $fh $ARGV[0];
+ print $fh $time;
}