summaryrefslogtreecommitdiff
path: root/scripts/desktop/i3status-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/desktop/i3status-wrapper')
-rwxr-xr-xscripts/desktop/i3status-wrapper21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/desktop/i3status-wrapper b/scripts/desktop/i3status-wrapper
index 22f01015..fb8d4e34 100755
--- a/scripts/desktop/i3status-wrapper
+++ b/scripts/desktop/i3status-wrapper
@@ -392,6 +392,27 @@ unless (fork // warn "couldn't fork command pipe reader") {
}
}
+ # Basic purpose of this wrapper command is to prevent accidentally
+ # moving to one of the holding workspaces using Sway's own commands.
+ elsif ($cmd =~ /^(move_)?workspace (prev|next)$/) {
+ my ($move, $dir) = (!!$1, $2);
+ $move && ensure_disable_monocle($ws);
+ my @keys = sorted_paper_ws();
+ my $k = first { $keys[$_] == $info{focused_ws} } 0..$#keys;
+ if ($dir eq "next" && $k < $#keys || $dir eq "prev" && $k > 0) {
+ my @cmds = "workspace $dir";
+ $info{focused_ws} = $keys[$dir eq "next" ? $k+1 : $k-1];
+ if ($move) {
+ push @cmds, show_con($ws->{focused_col});
+ push @cmds, "move right"
+ if $info{col_rows}
+ { $info{paper_ws}{$info{focused_ws}}{focused_col} };
+ push @cmds, "focus child" if $col_rows;
+ }
+ $wmipc->cmd(@cmds);
+ }
+ }
+
tied(%info)->unlock;
}
}