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

How to bind a key to start an app in a specific workspace

asked 2014-01-11 09:37:08 +0000

anonymous user

Anonymous

updated 2014-01-11 09:38:01 +0000

We autostart applications in the workspaces we want like this:

exec --no-startup-id i3-msg 'workspace xxx; exec /usr/bin/x'

We'd start an application via a key-bind:

bindsym a+b exec /usr/bin/x

What I want is to specify the workspace which the new window will appear in the last key-binding scheme.

I tried

bindsym a+b exec --no-startup-id i3-msg 'workspace xxx; exec /usr/bin/x'

bindsym a+b exec i3-msg --no-startup-id 'workspace xxx; exec /usr/bin/x'

bindsym a+b exec i3-msg 'workspace xxx; exec /usr/bin/x'

Sarcastically enough,

i3-msg --no-startup-id 'workspace xxx; exec /usr/bin/x'

This executed in a bash without hassle. Any tricks I am missing?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2014-01-11 09:48:05 +0000

Michael gravatar image

You don’t need to use i3-msg in a key binding. Just use this:

bindsym a+b workspace 3; exec urxvt
edit flag offensive delete link more

Comments

Any chance to run the exec without automatically switching to the specified workspace?

Gulver gravatar imageGulver ( 2014-01-11 12:42:05 +0000 )edit

`bindsym a+b workspace xxx; exec /usr/bin/x; workspace back_and_forth` works for startup notification aware apps for example gnome tools (do **not** use `--no-startup-id`). These will be opened on 'xxx' even though i3 switches to back_and_forth without waiting for the window to be created.

Adaephon gravatar imageAdaephon ( 2014-01-13 12:18:44 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2014-01-11 09:37:08 +0000

Seen: 378 times

Last updated: Jan 11 '14