From 76c4e95b608787cd95ac2b0ba9ab442110cbd7df Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 19 Jun 2010 11:48:47 +0200 Subject: [PATCH] i3-wsbar: replace %w with the width of the output (Thanks dothebart) This fixes ticket #231 --- i3-wsbar | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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> -- 2.39.5