Assign workspaces on i3 to multiple displays
up vote
8
down vote
favorite
I've switched on using i3 on my Linux laptop. I'm usually using only the laptop's internal monitor (display eDP1
), but when I'm at work I tend to connect a secondary monitor to my computer's HDMI port (display HDMI2
). So far, I've made this work fine by adding these commands to my i3 config file:
# use workspaces on different monitors
workspace "1: P1" output eDP1
workspace "2: P2" output eDP1
workspace "3: P3" output eDP1
workspace "4: P4" output eDP1
workspace "5: P5" output eDP1
workspace "6: S1" output HDMI2
workspace "7: S2" output HDMI2
workspace "8: S3" output HDMI2
workspace "9: S4" output HDMI2
workspace "10: S5" output HDMI2
# add HDMI monitor when connected
exec --no-startup-id xrandr --output HDMI2 --right-of eDP1
bindsym $mod+m exec --no-startup-id xrandr --output HDMI2 --auto --right-of eDP1
In other words, when I connect my HDMI display I just press Mod+M to get i3 to detect it, place it right of my primary display, and delegate 5 named workspaces (6-10) to it.
Here's the problem: At home, I have another monitor that I can connect with VGA (display DP2
). I can run the xrandr
command above to place this display to the right of my primary display as well, but I can't get the workspaces to be assigned to this display by default, unless I replace the rules I already have for my HDMI monitor. I would like both these workspaces to work the same no matter which monitor I use, so this is not an option.
TL;DR Is there a way to assign workspaces to two different displays, depending on which display is connected (assuming they never will be connected at the same time)?
i3 workspaces
add a comment |
up vote
8
down vote
favorite
I've switched on using i3 on my Linux laptop. I'm usually using only the laptop's internal monitor (display eDP1
), but when I'm at work I tend to connect a secondary monitor to my computer's HDMI port (display HDMI2
). So far, I've made this work fine by adding these commands to my i3 config file:
# use workspaces on different monitors
workspace "1: P1" output eDP1
workspace "2: P2" output eDP1
workspace "3: P3" output eDP1
workspace "4: P4" output eDP1
workspace "5: P5" output eDP1
workspace "6: S1" output HDMI2
workspace "7: S2" output HDMI2
workspace "8: S3" output HDMI2
workspace "9: S4" output HDMI2
workspace "10: S5" output HDMI2
# add HDMI monitor when connected
exec --no-startup-id xrandr --output HDMI2 --right-of eDP1
bindsym $mod+m exec --no-startup-id xrandr --output HDMI2 --auto --right-of eDP1
In other words, when I connect my HDMI display I just press Mod+M to get i3 to detect it, place it right of my primary display, and delegate 5 named workspaces (6-10) to it.
Here's the problem: At home, I have another monitor that I can connect with VGA (display DP2
). I can run the xrandr
command above to place this display to the right of my primary display as well, but I can't get the workspaces to be assigned to this display by default, unless I replace the rules I already have for my HDMI monitor. I would like both these workspaces to work the same no matter which monitor I use, so this is not an option.
TL;DR Is there a way to assign workspaces to two different displays, depending on which display is connected (assuming they never will be connected at the same time)?
i3 workspaces
add a comment |
up vote
8
down vote
favorite
up vote
8
down vote
favorite
I've switched on using i3 on my Linux laptop. I'm usually using only the laptop's internal monitor (display eDP1
), but when I'm at work I tend to connect a secondary monitor to my computer's HDMI port (display HDMI2
). So far, I've made this work fine by adding these commands to my i3 config file:
# use workspaces on different monitors
workspace "1: P1" output eDP1
workspace "2: P2" output eDP1
workspace "3: P3" output eDP1
workspace "4: P4" output eDP1
workspace "5: P5" output eDP1
workspace "6: S1" output HDMI2
workspace "7: S2" output HDMI2
workspace "8: S3" output HDMI2
workspace "9: S4" output HDMI2
workspace "10: S5" output HDMI2
# add HDMI monitor when connected
exec --no-startup-id xrandr --output HDMI2 --right-of eDP1
bindsym $mod+m exec --no-startup-id xrandr --output HDMI2 --auto --right-of eDP1
In other words, when I connect my HDMI display I just press Mod+M to get i3 to detect it, place it right of my primary display, and delegate 5 named workspaces (6-10) to it.
Here's the problem: At home, I have another monitor that I can connect with VGA (display DP2
). I can run the xrandr
command above to place this display to the right of my primary display as well, but I can't get the workspaces to be assigned to this display by default, unless I replace the rules I already have for my HDMI monitor. I would like both these workspaces to work the same no matter which monitor I use, so this is not an option.
TL;DR Is there a way to assign workspaces to two different displays, depending on which display is connected (assuming they never will be connected at the same time)?
i3 workspaces
I've switched on using i3 on my Linux laptop. I'm usually using only the laptop's internal monitor (display eDP1
), but when I'm at work I tend to connect a secondary monitor to my computer's HDMI port (display HDMI2
). So far, I've made this work fine by adding these commands to my i3 config file:
# use workspaces on different monitors
workspace "1: P1" output eDP1
workspace "2: P2" output eDP1
workspace "3: P3" output eDP1
workspace "4: P4" output eDP1
workspace "5: P5" output eDP1
workspace "6: S1" output HDMI2
workspace "7: S2" output HDMI2
workspace "8: S3" output HDMI2
workspace "9: S4" output HDMI2
workspace "10: S5" output HDMI2
# add HDMI monitor when connected
exec --no-startup-id xrandr --output HDMI2 --right-of eDP1
bindsym $mod+m exec --no-startup-id xrandr --output HDMI2 --auto --right-of eDP1
In other words, when I connect my HDMI display I just press Mod+M to get i3 to detect it, place it right of my primary display, and delegate 5 named workspaces (6-10) to it.
Here's the problem: At home, I have another monitor that I can connect with VGA (display DP2
). I can run the xrandr
command above to place this display to the right of my primary display as well, but I can't get the workspaces to be assigned to this display by default, unless I replace the rules I already have for my HDMI monitor. I would like both these workspaces to work the same no matter which monitor I use, so this is not an option.
TL;DR Is there a way to assign workspaces to two different displays, depending on which display is connected (assuming they never will be connected at the same time)?
i3 workspaces
i3 workspaces
asked Feb 12 '17 at 2:36
Frxstrem
91116
91116
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
9
down vote
You can't assign multiple outputs to single workspace, see: https://github.com/i3/i3/issues/555
So the only way is to change i3 config dynamically. You could assign to hotkey script that will be doing 2 things: changing monitor outputs with xrandr
and moving workspaces with i3-msg
:
xrandr --output DP2 --auto --right-of eDP1
i3-msg "workspace 6, move workspace to output DP2"
...
i3-msg "workspace 10, move workspace to output DP2"
With above script you will move 6-10 workspaces to DP2 and end up staying on workspace 10.
add a comment |
up vote
0
down vote
According to the user's guide syntax:
workspace 1 output eDP1
...
workspace 6 output HDMI2 VGA
should work.
Or you may define primary and secondary outputs on your machines if not set (xrandr --output <output> --primary
) and use this syntax:
workspace 1 output primary
...
workspace 6 output secondary
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
9
down vote
You can't assign multiple outputs to single workspace, see: https://github.com/i3/i3/issues/555
So the only way is to change i3 config dynamically. You could assign to hotkey script that will be doing 2 things: changing monitor outputs with xrandr
and moving workspaces with i3-msg
:
xrandr --output DP2 --auto --right-of eDP1
i3-msg "workspace 6, move workspace to output DP2"
...
i3-msg "workspace 10, move workspace to output DP2"
With above script you will move 6-10 workspaces to DP2 and end up staying on workspace 10.
add a comment |
up vote
9
down vote
You can't assign multiple outputs to single workspace, see: https://github.com/i3/i3/issues/555
So the only way is to change i3 config dynamically. You could assign to hotkey script that will be doing 2 things: changing monitor outputs with xrandr
and moving workspaces with i3-msg
:
xrandr --output DP2 --auto --right-of eDP1
i3-msg "workspace 6, move workspace to output DP2"
...
i3-msg "workspace 10, move workspace to output DP2"
With above script you will move 6-10 workspaces to DP2 and end up staying on workspace 10.
add a comment |
up vote
9
down vote
up vote
9
down vote
You can't assign multiple outputs to single workspace, see: https://github.com/i3/i3/issues/555
So the only way is to change i3 config dynamically. You could assign to hotkey script that will be doing 2 things: changing monitor outputs with xrandr
and moving workspaces with i3-msg
:
xrandr --output DP2 --auto --right-of eDP1
i3-msg "workspace 6, move workspace to output DP2"
...
i3-msg "workspace 10, move workspace to output DP2"
With above script you will move 6-10 workspaces to DP2 and end up staying on workspace 10.
You can't assign multiple outputs to single workspace, see: https://github.com/i3/i3/issues/555
So the only way is to change i3 config dynamically. You could assign to hotkey script that will be doing 2 things: changing monitor outputs with xrandr
and moving workspaces with i3-msg
:
xrandr --output DP2 --auto --right-of eDP1
i3-msg "workspace 6, move workspace to output DP2"
...
i3-msg "workspace 10, move workspace to output DP2"
With above script you will move 6-10 workspaces to DP2 and end up staying on workspace 10.
answered Feb 14 '17 at 19:19
anlar
8571618
8571618
add a comment |
add a comment |
up vote
0
down vote
According to the user's guide syntax:
workspace 1 output eDP1
...
workspace 6 output HDMI2 VGA
should work.
Or you may define primary and secondary outputs on your machines if not set (xrandr --output <output> --primary
) and use this syntax:
workspace 1 output primary
...
workspace 6 output secondary
add a comment |
up vote
0
down vote
According to the user's guide syntax:
workspace 1 output eDP1
...
workspace 6 output HDMI2 VGA
should work.
Or you may define primary and secondary outputs on your machines if not set (xrandr --output <output> --primary
) and use this syntax:
workspace 1 output primary
...
workspace 6 output secondary
add a comment |
up vote
0
down vote
up vote
0
down vote
According to the user's guide syntax:
workspace 1 output eDP1
...
workspace 6 output HDMI2 VGA
should work.
Or you may define primary and secondary outputs on your machines if not set (xrandr --output <output> --primary
) and use this syntax:
workspace 1 output primary
...
workspace 6 output secondary
According to the user's guide syntax:
workspace 1 output eDP1
...
workspace 6 output HDMI2 VGA
should work.
Or you may define primary and secondary outputs on your machines if not set (xrandr --output <output> --primary
) and use this syntax:
workspace 1 output primary
...
workspace 6 output secondary
answered Nov 23 at 22:31
caseneuve
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f344329%2fassign-workspaces-on-i3-to-multiple-displays%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown