From 58dc65e5242307736ef5530398c400d7bd6d5f01 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sun, 4 Apr 2021 16:19:44 +0300 Subject: Add context to polybar focus --- .config/polybar/focus | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '.config/polybar/focus') diff --git a/.config/polybar/focus b/.config/polybar/focus index 849a440..42edffb 100755 --- a/.config/polybar/focus +++ b/.config/polybar/focus @@ -35,7 +35,13 @@ my $task = $lines[2]; $task =~ s/^\s+|\s+$//g; # left and right trim $task =~ s/\s+/ /g; # reduce multiple whitespace into one +my $context = `task context | grep yes | cut -d' ' -f1`; + if ($task =~ m/^(.*)?\s(\d+\w+)$/g) { - print "$1 | $2"; + if ($context) { + print "$1 | $2 @ $context"; + } else { + print "$1 | $2"; + } } # print $task; -- cgit v1.2.3-70-g09d2