diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2024-01-16 20:23:57 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2024-01-16 20:26:50 +0000 |
commit | 540266fbfda82cd5cca9d26da51655d4014ed408 (patch) | |
tree | 2e89428441332e917f704c04c1b5babd72ed0deb | |
parent | 4b5ea8017d94aa75abcd7bde9941ed637c5b019b (diff) | |
download | dotfiles-540266fbfda82cd5cca9d26da51655d4014ed408.tar.gz |
i3status-wrapper: attempt to handle case of empty monocle mode
-rwxr-xr-x | scripts/desktop/i3status-wrapper | 6 |
1 files changed, 6 insertions, 0 deletions
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. |