summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYigit Sever2021-04-04 16:19:44 +0300
committerYigit Sever2021-04-04 16:19:44 +0300
commit58dc65e5242307736ef5530398c400d7bd6d5f01 (patch)
tree6d889c38e2256af4ad942d21f27c78cbe9f11d34
parent1d459f5326993cf08b7b236563e2b911824cccd1 (diff)
downloaddotfiles-58dc65e5242307736ef5530398c400d7bd6d5f01.tar.gz
dotfiles-58dc65e5242307736ef5530398c400d7bd6d5f01.tar.bz2
dotfiles-58dc65e5242307736ef5530398c400d7bd6d5f01.zip
Add context to polybar focus
-rwxr-xr-x.config/polybar/focus8
1 files changed, 7 insertions, 1 deletions
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];
35$task =~ s/^\s+|\s+$//g; # left and right trim 35$task =~ s/^\s+|\s+$//g; # left and right trim
36$task =~ s/\s+/ /g; # reduce multiple whitespace into one 36$task =~ s/\s+/ /g; # reduce multiple whitespace into one
37 37
38my $context = `task context | grep yes | cut -d' ' -f1`;
39
38if ($task =~ m/^(.*)?\s(\d+\w+)$/g) { 40if ($task =~ m/^(.*)?\s(\d+\w+)$/g) {
39 print "$1 | $2"; 41 if ($context) {
42 print "$1 | $2 @ $context";
43 } else {
44 print "$1 | $2";
45 }
40} 46}
41# print $task; 47# print $task;