diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2024-01-15 14:49:58 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2024-01-16 17:17:31 +0000 |
commit | 43c43062b601a9f8a0aad7b4ea13b257e06d43e1 (patch) | |
tree | 2a2467800fb9fd8fa96c827b5f2e06ee59e23dc4 | |
parent | 53adca6f7937d0950a0c3ba1465382a770b7c407 (diff) | |
download | dotfiles-43c43062b601a9f8a0aad7b4ea13b257e06d43e1.tar.gz |
compact_workspaces: ignore i3status-wrapper hidden workspaces
-rw-r--r-- | perl5/Local/Desktop.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl5/Local/Desktop.pm b/perl5/Local/Desktop.pm index a9051b02..f769d827 100644 --- a/perl5/Local/Desktop.pm +++ b/perl5/Local/Desktop.pm @@ -29,7 +29,7 @@ use File::LibMagic; use File::Spec::Functions "rel2abs"; use Exporter "import"; use File::Copy; -use List::Util "first"; +use List::Util "first", "any"; use Local::Desktop::WMIPC; our @EXPORT = qw( @@ -94,7 +94,10 @@ return undef if there is no space for a gap. sub compact_workspaces { my %opts = @_; my $wmipc = Local::Desktop::WMIPC->new; - my @workspaces = $wmipc->get_workspaces->@*; + my @workspaces; + foreach my $ws ($wmipc->get_workspaces->@*) { + any { $_ eq $ws->{name} } @all_workspaces and push @workspaces, $ws + } @workspaces < @all_workspaces or return; my ($current_workspace, $gap_workspace); if ($opts{leave_gap}) { |