diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-08-15 09:19:39 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-08-17 16:18:14 -0700 |
commit | 0277189d5fe4ac4a452a2568db4d5ec97c793286 (patch) | |
tree | dc100bdb2cf7d1dd8295e3ede11b625ba58238ab /perl5 | |
parent | 0ad52a42d64f91d71f43c47fad87746c1afa6fb4 (diff) | |
download | dotfiles-0277189d5fe4ac4a452a2568db4d5ec97c793286.tar.gz |
handle workspace_buttons out in i3status-wrapper, compact less often
Even if we were to uncomment the call to compact_workspaces in
i3status-wrapper, (the rest of) this change would still mean we would do fewer
get_workspaces queries overall.
Diffstat (limited to 'perl5')
-rw-r--r-- | perl5/Local/Desktop.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/perl5/Local/Desktop.pm b/perl5/Local/Desktop.pm index 616ee89e..347495fe 100644 --- a/perl5/Local/Desktop.pm +++ b/perl5/Local/Desktop.pm @@ -85,8 +85,7 @@ sub fresh_workspace { =head compact_workspaces(%opts) -Rename workspaces so as to remove gaps in the sequence of workspaces, and show -or hide workspace buttons depending on whether there is >1 workspace. +Rename workspaces so as to remove gaps in the sequence of workspaces. If C<$opts{leave_gap}>, ensure there is a gap of one workspace after the currently focused workspace and return the name of the gap workspace, or just @@ -98,8 +97,6 @@ sub compact_workspaces { my %opts = @_; my @workspaces = @{ decode_json `$wmipc -t get_workspaces` }; @workspaces < @all_workspaces or return; - my $buttons_cmd - = "bar bar-0 workspace_buttons " . (@workspaces > 1 ? "yes" : "no"); my ($current_workspace, $gap_workspace); if ($opts{leave_gap}) { $_->{focused} and $current_workspace = $_->{name}, last @@ -119,7 +116,7 @@ sub compact_workspaces { : unshift @cmds, $pair } - wmipc $buttons_cmd, map "rename workspace $_->[0] to $_->[1]", @cmds; + wmipc map "rename workspace $_->[0] to $_->[1]", @cmds; $opts{leave_gap} and $gap_workspace } |