Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples/avoid-ws.py #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xenomachina
Copy link
Contributor

This script listens listens to i3 new/move events, and tells i3 to move
windows from workspace 1 to workspace 10 unless they have a mark that
starts with "_dontmove".

Thanks to /u/airblader for suggesting the use of marks for this.

This script listens listens to i3 new/move events, and tells i3 to move
windows from workspace 1 to workspace 10 unless they have a mark that
starts with "_dontmove".

Thanks to /u/airblader for suggesting the use of marks for this.
ws = w.workspace()
if ws and ws.name == '1'and not any(
mark.startswith('_dontmove') for mark in w.marks):
i3.command('[con_id=%d] move window to workspace 10' % w.id)
Copy link
Member

@acrisci acrisci Apr 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try w.command('move... for this purpose.

@acrisci
Copy link
Member

acrisci commented Apr 27, 2016

Two things in general should be addressed here.

  1. Make the script configurable with command line arugments with an ArgumentsParser and add a help string and descriptions for the parameters and such.

  2. Make a description that explains to people what this is for. It's kind of hard to understand the use case of this so you should explain why it is useful.

- This script does *not* move windows on startup, so you probably want to run
it early on. I run it from my .i3/config before starting any apps:

exec --no-startup-id ~/src/i3ipc-python/examples/avoid-ws.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend people use exec_always so the script will rerun on restarts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants