AnyEvent-I3X-Workspace-OnDemand

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

# DESCRIPTION

Workspace switcher for i3.

This module listens to tick events which are named `group:$name` where the
name corresponds to the workspace groups you have defined. When you send a tick
event the current workspaces get renamed to `$former_group:$workspace_name` and leaves new workspaces for the ones you have defined.

In your `.config/i3/config` you can set something like this to switch
groups:

    bindsym $mod+w mode "Activities"
    mode "Activities" {
      bindsym 0 exec i3-msg -t send_tick group:foo; mode default
      bindsym 9 exec i3-msg -t send_tick group:bar; mode default
      bindsym 8 exec i3-msg -t send_tick group:baz; mode default
      bindsym Return mode "default"
      bindsym Escape mode "default"
    }

For the user guide please refer to
[AnyEvent::I3X::Workspace::OnDemand::UserGuide](https://metacpan.org/pod/AnyEvent%3A%3AI3X%3A%3AWorkspace%3A%3AOnDemand%3A%3AUserGuide).

# SYNOPSIS

    use AnyEvent::I3X::Workspace::OnDemand;

    my $i3 = AnyEvent::I3X::Workspace::OnDemand->new(
        debug => 0,
        layout_path => "$ENV{HOME}/.config/i3",
        workspaces => {
            foo => {
                layout => 'foo.json',
            },
            bar => {
                layout => 'bar.json',
                groups => {
                    foo => undef,
                    # Override the layout for group bar
                    bar => { layout => 'foo.json' },
                }
            },
            baz => {
                layout => 'baz.json',
                groups => {
                    all => undef,
                }
            }
        },
        groups => [
            qw(foo bar baz)
        ],
        swallows => [
            {
                cmd => 'kitty',
                match => {
                    class => '^kitty$',
                }
            },
            {
                # Start firefox on group bar
                cmd => 'firefox',
                on => {
                    group => 'bar',
                }
                match => {
                    window_role => '^browser$',



( run in 1.701 second using v1.01-cache-2.11-cpan-99c4e6809bf )