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 2014-04-21 14:16:08 +0000

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
5

answered 2014-04-21 18:29:47 +0000

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

edit flag offensive delete link more

Comments

I am getting the following error:

Binary0010 gravatar imageBinary0010 ( 2014-04-21 19:13:43 +0000 )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 ( 2014-04-21 19:13:54 +0000 )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 ( 2014-04-21 20:32:15 +0000 )edit

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

TonyC gravatar imageTonyC ( 2014-04-21 20:40:42 +0000 )edit

This works great...Thanks!

Binary0010 gravatar imageBinary0010 ( 2014-04-21 20:59:08 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2014-04-21 14:16:08 +0000

Seen: 246 times

Last updated: Apr 21 '14