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

Disconnecting external monitor

asked 2012-08-26 19:39:37 +0000

lzap gravatar image

updated 2012-08-26 19:40:00 +0000

Hello,

I use multi-monitor setup with eight workspaces, four on each:

workspace 1 output HDMI1
workspace 2 output HDMI1
workspace 3 output HDMI1
workspace 4 output HDMI1
workspace 5 output LVDS1
workspace 6 output LVDS1
workspace 7 output LVDS1
workspace 8 output LVDS1

When I start my laptop WITHOUT any external monitor, i3 assumes HDMI1 -> LVDS1 so everything work fine (I have all workspaces on my laptop screen). The issue is when I disconnect my laptop from dock - all running applications from 1-4 workpaces are unavaiable to me. I can only "feel" they are still there (but I dont see them). Processes are still running.

While this is not bad behavior (good for meetings when you need quickly do something and than return to your desk), I would like to tell i3 to move all of them to LVDS1 when I plan for example to finish my work only on laptop.

Is there any way to do this? Some kind of script that would move all workspaces to LVDS1. I would call this onescreen.sh. And also a second script (twoscreens.sh) that would put my original setting back.

So far I am pretty impressed with i3, the final test will be to test Elluminate desktop sharing software (I have to use it). It's a Java app with some weird features, so far so good (recorded meetings work), need to test sharing next week.

edit retag flag offensive close merge delete

Comments

Hmmm this could do it: i3-msg workspace N output XYZ. Will need to try with an external monitor connected. Currently (without it) this works (i3-msg workspace 1 output VGA1), workspace disappears but after I switch to it it goes back to LVDS1. Strange, it did not work like this when I undocked it.

lzap gravatar imagelzap ( 2012-08-26 19:57:10 +0000 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2012-08-27 09:56:12 +0000

Michael gravatar image

Merely disconnecting the laptop from dock is (most likely) not sufficient to trigger a RandR event, so i3 does not know about the change in your monitor configuration.

Instead, when undocking, you should run xrandr --output HDMI1 --off and i3 will automatically do what you want. You could add this to the/a script which is run when an undock event is detected (this is outside the scope of i3 and I don’t know exactly where that happens, maybe somebody else can help).

edit flag offensive delete link more

Comments

Thanks. But when I undock by X201, I can see the output is no longer active when I execute xrandr command. I mean HDMI1 is not listed in the output, but i3 still does not move them to the LVDS1. Strange.

lzap gravatar imagelzap ( 2012-08-27 10:48:31 +0000 )edit

Many thanks for all your help, I wrote a big blogpost about i3. Totally in love: http://lukas.zapletalovi.com/2012/08/new-in-fedora-17-i3-42-tiling-wm.html :-)

lzap gravatar imagelzap ( 2012-08-31 13:13:05 +0000 )edit

lzap, I also have an x201 tablet with the dock and run into the same issue. I can disconenct from doc (even if I push the disconnect button first) and I'll have to kill and relaunch i3 to get my desktop to show up on the laptop screen. (I'm using two 24" screens and no laptop screen normally)

c0ldg0ld gravatar imagec0ldg0ld ( 2015-11-07 20:39:05 +0000 )edit

Were you able to get this resolved or figure out how to make the dock disconnect button trigger a script?

c0ldg0ld gravatar imagec0ldg0ld ( 2015-11-07 20:39:37 +0000 )edit

Question Tools

Stats

Asked: 2012-08-26 19:39:37 +0000

Seen: 1,954 times

Last updated: Aug 27 '12