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
commitab38d1f10baa4ae763fbfeab026bb975380052b9 (patch)
tree04e8cde6122e932233fb8ca7dbfd077e45b162c0
parent4173b7c41711b00b68f6d21264a972a2a2250314 (diff)
downloadpapersway-ab38d1f10baa4ae763fbfeab026bb975380052b9.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 416b99f..a644f78 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.