From 0d3b4a22341fc6c81537c8c279de8cc5daa033cf Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 12 Oct 2023 08:51:06 +0100 Subject: Adds new aerc to task script --- aerc2task.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 aerc2task.pl diff --git a/aerc2task.pl b/aerc2task.pl new file mode 100755 index 0000000..4c907ef --- /dev/null +++ b/aerc2task.pl @@ -0,0 +1,17 @@ +#!/bin/env perl + +# this script is used to pipe an email from aerc using pipe -m ./aerc2task.pl to taskwarrior + +foreach my $line () { + chomp; + if ($line =~ /^Subject/) { + print "Received: $line\n"; + my @task_split = split(/Subject: /, $line); + $task = @task_split[1]; + $task =~ s/TASK//g; + $task =~ s/WATCH//g; + print "So task is: $task\n"; + `task add $task` + } +} + -- cgit v1.2.3