aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-09-14 17:04:48 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-09-14 17:04:48 +0100
commit58f7c12176c52813004b0b3da3bcd4965d6bee67 (patch)
tree621060d6a02d3636a82298511bf212ceef4ac0c1
parent1cd266e34ecb354a6c39c50946f667359233181f (diff)
dont reference school on weekends
-rw-r--r--dayplan.pl26
1 files changed, 19 insertions, 7 deletions
diff --git a/dayplan.pl b/dayplan.pl
index dc8bcd9..c43f5f7 100644
--- a/dayplan.pl
+++ b/dayplan.pl
@@ -29,21 +29,33 @@ else {
$weekday = $weekdays[$dt->day_of_week - 1];
}
+sub schoollines {
+ my $day = shift;
+ print "In schoolines\n";
+ if ($day =~ /Saturday|Sunday/) {
+ return "";
+ } else
+ {
+ return "
+08:15 - 08:20 - Harvey to school
+08:45 - 09:00 - Sophie to school
+09:15 - 09:30 - Email";
+ }
+}
+
my $reminders = qx(ssh bobbins remind ~/.reminders $y-$m-$d);
$reminders =~ s/\s{2,}/\n/gs;
$reminders =~ s/^Reminders.+\:\n//;
-my $template = "
-Goal for $weekday: [replace this with your goal]
+my $s = schoollines($weekday);
+
+my $template = "Goal for $weekday: [replace this with your goal]
---
Reminders:
-
+---------
$reminders
-
-08:15 - 08:20 - Harvey to school
-08:45 - 09:00 - Sophie to school
-09:15 - 09:30 - Email
+$s
09:30 - 10:00 -
10:00 - 11:00 -
11:00 - 12:00 -