diff options
author | Yigit Sever | 2021-04-04 16:19:44 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-04 16:19:44 +0300 |
commit | 58dc65e5242307736ef5530398c400d7bd6d5f01 (patch) | |
tree | 6d889c38e2256af4ad942d21f27c78cbe9f11d34 /.config/polybar | |
parent | 1d459f5326993cf08b7b236563e2b911824cccd1 (diff) | |
download | dotfiles-58dc65e5242307736ef5530398c400d7bd6d5f01.tar.gz dotfiles-58dc65e5242307736ef5530398c400d7bd6d5f01.tar.bz2 dotfiles-58dc65e5242307736ef5530398c400d7bd6d5f01.zip |
Add context to polybar focus
Diffstat (limited to '.config/polybar')
-rwxr-xr-x | .config/polybar/focus | 8 |
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 | ||
38 | my $context = `task context | grep yes | cut -d' ' -f1`; | ||
39 | |||
38 | if ($task =~ m/^(.*)?\s(\d+\w+)$/g) { | 40 | if ($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; |