AnyEvent-I3X-Workspace-OnDemand

 view release on metacpan or  search on metacpan

lib/AnyEvent/I3X/Workspace/OnDemand/UserGuide.pod  view on Meta::CPAN

      class: ^kitty$

Here you see that kitty is started on the class kitty.
But you can start a specific thunderbird profile on the group C<work> when your
layout has a class C<thunderbird-default>, but starts another instance when you
are on either a different workspace or group:

  - cmd: tb-work
    on:
      group: work
    match:
      class: ^thunderbird-default$

  - cmd: tb-private
    on:
      workspace: area51
    match:
      class: ^thunderbird-default$

The same can be done for browsers:

  - cmd: firefox-nightly
    on:
      group: personal
    match:
      window_role: ^browser$

  - cmd: --no-startup-id start-chrome work
    on:
      group: work
    match:
      window_role: ^browser$

This allows you to tweak all the startup applications you have defined in the
layout without having to start them when you open i3. Closing an empty
workspace and reopening it will result in an C<init> action by i3 and gives you
a fresh layout start.

=head2 i3 Integration

Use to ensure i3-wod is always running correctly, even after reloading i3:

  exec_always --no-startup-id "i3-wod &"

As shown earlier you can use regular C<bindsym>s to trigger group or context
changes. Modes are the preferred way:

  # Dynamic workspaces
  bindsym $mod+w mode "Dynamic workspaces"
  mode "Dynamic workspaces" {
    bindsym 0 exec i3-msg -t send_tick group:personal; mode default
    bindsym 9 exec i3-msg -t send_tick group:work; mode default
    bindsym Return mode "default"
    bindsym Escape mode "default"
  }

But you can also use L<rofi|https://davatorium.github.io/rofi/> for a more
visual style. Script for this are not included in the distribution as it
would add a dependency and maybe unneeded for users who use different tools.

Once a group (or context) is switched current workspaces get renamed to
$former_group:$workspace_name and leaves new workspaces for the ones you have
defined. If you switch back to the previous group the workspaces get renamed,
and the old ones get reinserted/applied.

=head2 Restarting i3

If you change the configuration of i3 and restart i3 i3-wod will also restart
itself. It will use two properties on the X11 root window to restore the
previous state:

  xprop -root -notype _I3_WOD_GROUP
  xprop -root -notype _I3_WOD_WORKSPACE

This allows us to pick up where we left of and you don't need to worry about
mismatching groups or workspaces.

=head3 i3status

Because we keep state you can use i3status to display the group in your status
bar. To do that you can use the C<i3-status> script of shipped with this
module:

   # ~/.config/i3/config
   status_command i3status | i3-status

   # ~/.config/i3status/config
   general { output_format = "i3bar" }

We than trigger an update on i3status to get the new group.

If you don't use i3 status, or aren't interested in the group you can set
C<i3status = 0> in your wod.conf. We won't inspect the process tables in that
case.

=head1 AUTHOR

Wesley Schwengle <waterkip@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2024 by Wesley Schwengle.

This is free software, licensed under:

  The (three-clause) BSD License

=cut



( run in 1.022 second using v1.01-cache-2.11-cpan-39bf76dae61 )