summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2024-01-16 20:23:57 +0000
committerSean Whitton <spwhitton@spwhitton.name>2024-01-16 20:26:50 +0000
commit540266fbfda82cd5cca9d26da51655d4014ed408 (patch)
tree2e89428441332e917f704c04c1b5babd72ed0deb
parent4b5ea8017d94aa75abcd7bde9941ed637c5b019b (diff)
downloaddotfiles-540266fbfda82cd5cca9d26da51655d4014ed408.tar.gz
i3status-wrapper: attempt to handle case of empty monocle mode
-rwxr-xr-xscripts/desktop/i3status-wrapper6
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.