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 Jan 11 '14

anonymous user

Anonymous

updated Jan 11 '14

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?

1 answer

Sort by » oldest newest most voted
0

answered Jan 11 '14

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

Comments

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

Gulver gravatar imageGulver (Jan 11 '14)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 (Jan 13 '14)edit

Question Tools

1 follower

Stats

Asked: Jan 11 '14

Seen: 378 times

Last updated: Jan 11 '14