App-papersway

 view release on metacpan or  search on metacpan

bin/papersway  view on Meta::CPAN

    # We can't always populate this value when a workspace is initialised
    # because we might not know the output's width yet.  This happens when
    # initialising a new workspace on a newly enabled output.
    sub ncols {
	my $ws = shift;
	$ws->{ncols} //= $output_init_cols{$ws->{output}}
    }
}

sub init_ws {
    my $id = shift;
    bless +($paper_ws{$id} = { id => $id,
			       cols => [], off_left => [], off_right => [],
			       last_dir => 1, @_ }
	) => "App::papersway::paper_ws"
}

sub ws_name {
    my ($before, $after) = split /:/, $_[0];
    $after // $before
}
sub ws_num { (split /:/, $_[0])[0] }

sub focused_col_idx {
    first { $_[0]->{cols}->[$_] == $_[0]->{focused_col} } 0..$#{$_[0]->{cols}}
}

sub widep { defined $col_wide{(shift)} }

__END__

=pod

=encoding UTF-8

=head1 NAME

papersway - PaperWM-like scrollable tiling window management for Sway/i3wm

=head1 VERSION

version 3.000

=head1 SYNOPSIS

B<papersway> [B<--i3status>] [B<--cols=>I<N>|B<--cols-min-width=>I<N>] [B<--with-ws-cmd>] [B<--debug>]

=head1 DESCRIPTION

This is an implementation of PaperWM-like scrollable tiling window management
for Sway/i3wm.  If you like Sway/i3wm's commitments to stability, avoiding
scope creep etc. but dislike the window management model, papersway is an
alternative.

=head1 OPTIONS

=over 4

=item B<--i3status>

Start a background instance of B<i3status>, filter and print its output.

=item B<--cols=>I<N>

Set the number of columns on a new workspace.  The default, and minimum, is 2.
Incompatible with I<--cols-min-width>.

=item B<--cols-min-width=>I<N>

Set the number of columns on a new workspace to be the maximum that will fit
while maintaining a column width of at least I<N> pixels (with Sway,
implicitly scaled by the output's scale factor).  Incompatible with I<--cols>.

=item B<--with-ws-cmd>

Don't hide the workspace buttons, and when I<--i3status>, don't include
information about workspaces in the status output.

=item B<--debug>

Enable some debug printing and don't hide Sway's workspace buttons.

=back

=head1 USAGE

Here we discuss how to integrate papersway into your existing Sway/i3wm
configuration file, usually found at F<~/.config/sway/config> or
F<~/.config/i3/config>, as appropriate.

=head2 Activation

The recommended way to activate papersway is by using it as your bar command.
For Sway,

=over 4

    bar {
        status_command papersway --i3status

        # [ .. further bar options .. ]
    }

=back

and for i3,

=over 4

    bar {
        status_command papersway --i3status --with-ws-cmd
        workspace_command papersway-ws-cmd

        # [ .. further bar options .. ]
    }

=back

This ensures that you can see a visual representation of your paper
workspaces, which will be useful while getting the hang of papersway.



( run in 1.881 second using v1.01-cache-2.11-cpan-f56aa216473 )