aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-10-12 08:51:06 +0100
committerMatthew Lemon <y@yulqen.org>2023-10-12 08:51:19 +0100
commit0d3b4a22341fc6c81537c8c279de8cc5daa033cf (patch)
treeadf8db464c9a432fbf677e94d7c8acd1f30570c9
parentaf5c2e34c60e8c44fd77f755729e772ce102340a (diff)
Adds new aerc to task script
-rwxr-xr-xaerc2task.pl17
1 files changed, 17 insertions, 0 deletions
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 (<STDIN>) {
+ 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`
+ }
+}
+