From: Michael Stapelberg Date: Sat, 19 Jun 2010 09:48:47 +0000 (+0200) Subject: i3-wsbar: replace %w with the width of the output (Thanks dothebart) X-Git-Tag: 4.0~14^2~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=be49ed99f4140d047606737457735114ffcfb4ff;p=i3%2Fi3 i3-wsbar: replace %w with the width of the output (Thanks dothebart) This fixes ticket #231 --- diff --git a/i3-wsbar b/i3-wsbar index 5536e92c..4148c95c 100755 --- a/i3-wsbar +++ b/i3-wsbar @@ -136,9 +136,12 @@ sub got_outputs { } my $x = $new{$name}->{rect}->{x}; + my $w = $new{$name}->{rect}->{width}; my $launch = $command; $launch =~ s/([^%])%x/$1$x/g; + $launch =~ s/([^%])%w/$1$w/g; $launch =~ s/%%x/%x/g; + $launch =~ s/%%w/%w/g; $new{$name}->{cmd_input} = ''; my @cmd = ('/bin/sh', '-c', $launch); @@ -245,10 +248,11 @@ i3-wsbar -c [options] =item B<--command> This command (at the moment only dzen2 is supported) will be started for each -output. C<%x> will be replaced with the X coordinate of the output. +output. C<%x> will be replaced with the X coordinate of the output, C<%w> will +be replaced with the width of the output. Example: - --command "dzen2 -dock -x %x" + --command "dzen2 -dock -x %x -w %w" =item B<--input-on>