From 540266fbfda82cd5cca9d26da51655d4014ed408 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 16 Jan 2024 20:23:57 +0000 Subject: i3status-wrapper: attempt to handle case of empty monocle mode --- scripts/desktop/i3status-wrapper | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/desktop/i3status-wrapper b/scripts/desktop/i3status-wrapper index 416b99f7..a644f781 100755 --- a/scripts/desktop/i3status-wrapper +++ b/scripts/desktop/i3status-wrapper @@ -420,6 +420,12 @@ sub normalise_ws_cols { my @cmds; my $avail_l = scalar $ws->{off_left}->@*; my $avail_r = scalar $ws->{off_right}->@*; + + if ($ws->{monocle} && !@$cols) { + undef $ws->{monocle}; + $i = $old_i = !!$avail_l; + } + if (!$ws->{monocle} && $ws->{ncols} > @$cols && ($avail_l || $avail_r)) { # Pull columns in if there are too few columns but some available. # Want the focused column, after pulls, to be the $old_i'th. -- cgit v1.2.3