From 3038ad6c2665477032bf048d510876ed24c4ebec Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 2 Aug 2011 23:25:29 +0200 Subject: [PATCH 1/3] i3-wsbar: make workspace names clickable (Thanks marforio) --- i3-wsbar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3-wsbar b/i3-wsbar index 26d8caf7..4e272316 100755 --- a/i3-wsbar +++ b/i3-wsbar @@ -179,7 +179,7 @@ sub update_output { ($bg, $fg) = qw(4c7899 ffffff) if $ws->{visible}; ($bg, $fg) = qw(900000 ffffff) if $ws->{urgent}; - my $cmd = q|i3-msg "| . $ws->{num} . q|"|; + my $cmd = q|i3-msg "workspace | . $ws->{name} . q|"|; my $name = $ws->{name}; # Begin the clickable area From 9d3c99ee386b5689e0a2f47b41d5048f276ad58a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 2 Aug 2011 23:31:03 +0200 Subject: [PATCH 2/3] i3-wsbar: correctly handle EOF on stdin --- i3-wsbar | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/i3-wsbar b/i3-wsbar index 4e272316..2d546a73 100755 --- a/i3-wsbar +++ b/i3-wsbar @@ -223,7 +223,12 @@ $stdin = AnyEvent->io( fh => \*STDIN, poll => 'r', cb => sub { - chomp (my $line = ); + my $line = ; + if (!defined($line)) { + undef $stdin; + return; + } + chomp($line); $last_line = $line; update_output(); }); From 6ad00b1dffb437db0631c5db600adb4386b4c4f7 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 3 Aug 2011 03:54:00 +0200 Subject: [PATCH 3/3] i3-wsbar: display a separator between workspaces for every output when --show-all is used (Thanks marforio) Fixes #417 --- i3-wsbar | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/i3-wsbar b/i3-wsbar index 2d546a73..a485c150 100755 --- a/i3-wsbar +++ b/i3-wsbar @@ -167,14 +167,23 @@ sub output_change { sub update_output { my $dzen_bg = "#111111"; my $out; + my $previous_output; for my $name (keys %{$outputs}) { my $width = $outputs->{$name}->{rect}->{width}; + $previous_output = undef; $out = qq|^pa(;2)|; for my $ws (@{$workspaces}) { next if $ws->{output} ne $name and !$show_all; + # Display a separator if we are on a different output now + if (defined($previous_output) and + ($ws->{output} ne $previous_output)) { + $out .= qq|^fg(#900000)^ib(1)\|^ib(0)^p(+4)|; + } + $previous_output = $ws->{output}; + my ($bg, $fg) = qw(333333 888888); ($bg, $fg) = qw(4c7899 ffffff) if $ws->{visible}; ($bg, $fg) = qw(900000 ffffff) if $ws->{urgent};