The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
2

How can I open an application when I open a certain workspace for the first time?

asked Apr 21 '14

Binary0010 gravatar image

For instance when I open workspace 4 for the first time I would like firefox to open automatically in that workspace. How can I achieve this?

1 answer

Sort by » oldest newest most voted
5

answered Apr 21 '14

TonyC gravatar image

Check out this script from the i3ipc-python project

usage: app-on-ws-init.py [-h] [--workspace NAME] [--command CMD]

Open an application on a given workspace when it is initialized

optional arguments:
  -h, --help        show this help message and exit
  --workspace NAME  The name of the workspace
  --command CMD     The command to run on the newly initted workspace

Add an exec_always line to your config with this script and --workspace=4 --command=firefox

Comments

I am getting the following error:

Binary0010 gravatar imageBinary0010 (Apr 21 '14)edit

[binary0010@Hephaestus .i3]$ ./apps-on-ws-init.py --workspace=4 --command=spotify Traceback (most recent call last): File "./apps-on-ws-init.py", line 23, in <module> i3.main() AttributeError: 'Connection' object has no attribute 'main'

Binary0010 gravatar imageBinary0010 (Apr 21 '14)edit

Right now, you should have the python overrides installed from the i3ipc-python project page. That is meant to fix some quirks in the library but probably won't be necessary in the future. https://github.com/acrisci/i3ipc-python/releases/tag/v0.1.1

TonyC gravatar imageTonyC (Apr 21 '14)edit

I fixed that one so it doesn't require the overrides so you should be good.

TonyC gravatar imageTonyC (Apr 21 '14)edit

This works great...Thanks!

Binary0010 gravatar imageBinary0010 (Apr 21 '14)edit

Question Tools

1 follower

Stats

Asked: Apr 21 '14

Seen: 246 times

Last updated: Apr 21 '14