Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Displays X Linux

2 Displays and 2 Workspaces With Linux and X? 460

Borov writes "I'm planning to buy a second monitor in near future and I was searching for ways to configure it under Linux. It seems there are two main ways: 1) to have one 'big' desktop, which means I have single workspace — changing virtual desktop switches both monitors or 2) to have separate X sessions for each display — which means I have separate workspaces, but I can't move applications between them. I need something in the middle — a separate workspace for each screen, so that I can have independent virtual desktops on each screen, but still have the ability to move applications between monitors (no need to strech one app across both of them). I've read that some tiling window managers can do this kind of thing, but I'd rather go with 'classical' window managers, like Openbox/Gnome/KDE or similar."
This discussion has been archived. No new comments can be posted.

2 Displays and 2 Workspaces With Linux and X?

Comments Filter:
  • tiling (Score:2, Informative)

    by by (1706743) ( 1706744 ) on Thursday January 28, 2010 @04:21PM (#30940148)
    I know you don't want a tiling manager, but for anyone wondering, I can speak from experience that dwm works wonderfully with two monitors. I run an external 1920x1200 display, and an internal 1024x600 from my netbook.
  • Awesome (Score:1, Informative)

    by Anonymous Coward on Thursday January 28, 2010 @04:22PM (#30940170)

    Not a 'classical" window manager but the only one that can do this afaik.
    http://awesome.naquadah.org/

  • 4 Screens (Score:5, Informative)

    by spribyl ( 175893 ) on Thursday January 28, 2010 @04:23PM (#30940202)

    I have 4 screen using 2 nvida 9500 cards and KDE.
    I have one X session. By not using Xinerama my maximize button is limited to the size of the two screens on one card. I can stretch the window to full size using all 4 screens.
    I also use multiple desktops to manage windows.

    Right now each screen gets its own window. When I need to look and wide things(log files) I maximize to two screens. For really big things I can stretch the window to all four screens.

  • by chibiace ( 898665 ) on Thursday January 28, 2010 @04:23PM (#30940208) Journal

    gnome with two screens is just fine. you can maximize on either side and even use the window list say one panel per screen to show what windows are open on each display.
    most distros dont even need configuring for dualscreen now.

  • Gnome + Twinview (Score:1, Informative)

    by nleaf ( 953206 ) on Thursday January 28, 2010 @04:24PM (#30940224)
    I'm using Twinview on a standard Ubuntu 9.10 install. While it's one big desktop stretching across two screens, you can set up metamodes in xorg.conf that allows windows to comfortably use a whole monitor (i.e. maximizing makes a window take up one monitor, not stretch across). If you're using an Nvidia card, the nvidia-setttings utility will even set this up for you. Both monitors are of course set to the same workspace, though. As far as I know, separate X servers are the only way to have each monitor on a different workspace.
  • Google (Score:5, Informative)

    by Albanach ( 527650 ) on Thursday January 28, 2010 @04:24PM (#30940242) Homepage

    30 seconds with Google points me to

    http://en.wikipedia.org/wiki/Xpra [wikipedia.org]
    xpra or X Persistent Remote Applications is a tool which allows you to run X programs usually on a remote host and then direct their display to your local machine without losing any state. It differs from standard X forwarding in that it allows disconnection and reconnection without disrupting the forwarded application

    http://en.wikipedia.org/wiki/Xmove [wikipedia.org]
    xmove is a computer program that allows the movement of X Window System applications between different displays and the persistence of X applications across X server restarts[3]. It solves a problem in the design of X, where an X client (an X application) is tied to the X server (X display) it was started on for its lifetime. Also, if the X server is shut down, the client application is forced to stop running.

    Have you investigated any of these before 'asking /.'?

    I'd fire up a second X session on your machine - you can run multiple instances of X with a single monitor after all, and try moving apps between your sessions. Get that to work and everything should be (mostly) trivial after you get your new monitor.

  • Re:4 Screens (Score:5, Informative)

    by cephalien ( 529516 ) <benjaminlungerNO@SPAMgmail.com> on Thursday January 28, 2010 @04:25PM (#30940246)

    Last I checked, KDE + NVIDIA is the way to go; GNOME doesn't really support multiple monitors in anything but a combined mode.

  • Enlightenment (Score:5, Informative)

    by illogict ( 889976 ) on Thursday January 28, 2010 @04:29PM (#30940338) Homepage
    Enlightenment DR17 (http://www.enlightenment.org) lets you do that: virtual desktops are managed on a per-screen basis, and still you can move windows between screens. Don't worry it is not "officially" released, it's really stable, I've not seen a crash or anything for months.
  • My setup (Score:3, Informative)

    by morgandelra ( 448341 ) on Thursday January 28, 2010 @04:30PM (#30940344)

    I use nvidia twinview on the monitors with Gnome. I also have 3 virtual desktops that I access via edge flipping on the vertical axis. I find this workas alot better than arranging the flipping on the sides with 2 large monitors.

  • Re:Enlightenment (Score:3, Informative)

    by silent_artichoke ( 973182 ) <mike AT mikeandebony DOT com> on Thursday January 28, 2010 @04:35PM (#30940448) Homepage
    I was pretty sure someone was going to mention this before me. I just started playing with e17 this Monday. I got a shock when I realized it worked this way. Looks great too!
  • by __aastpl2241 ( 1723140 ) on Thursday January 28, 2010 @04:36PM (#30940480)
    xmonad is one of those WM
  • Re:Enlightenment +1 (Score:4, Informative)

    by Anonymous Coward on Thursday January 28, 2010 @04:36PM (#30940484)

    it's really stable, I've not seen a crash or anything for months.

    More importantly: I've only ever seen the window manager crash, but it has never brought down X with it. When it crashes, it gives you a very helpful (and ugly) dialog which allows you to restart the window manager. In the 3 years of using e17, I have never had a single application crash or data loss. And the last e17 crash is from 2008, I think.

    Oh, and: mod parent up.

  • Re:Google (Score:5, Informative)

    by Chryana ( 708485 ) on Thursday January 28, 2010 @04:38PM (#30940542)

    I tried xpra to hold the mail/news/calendar (Kontact) application in KDE, and it crashed after about a day... So I wouldn't recommend it personally, or at least not yet. As for xmove, the xpra FAQ states it has been without maintenance since 1997.

  • Re:dual monitor (Score:1, Informative)

    by Peter Nikolic ( 1093513 ) on Thursday January 28, 2010 @04:40PM (#30940584) Journal

    not tested it yet but i believe xmonad may be of use to you as i say not tested it yet . but the mailing list seems to be very active .

  • by sleekware ( 1109351 ) on Thursday January 28, 2010 @04:42PM (#30940628)
    Ah! This might be it, I just Google'd it and it looks very promising: http://awesome.naquadah.org/ [naquadah.org]
  • Re:Google (Score:3, Informative)

    by Albanach ( 527650 ) on Thursday January 28, 2010 @04:44PM (#30940662) Homepage

    Which part of the summary do you believe I missed?

    He wants separate x sessions - both of these solutions are designed for such an instance. Most folk would use them on separate machines but I see no indication they won't work on a local box with multiple X sessions running.

    He would prefer a classical window manager. He can run whatever window manager he likes - these apps allow the move of an X application from one X server to another.

  • by jgtg32a ( 1173373 ) on Thursday January 28, 2010 @04:44PM (#30940674)

    Actually there is a powertoy that gives you virtual desktops, called desktops. There are some limitations, such as you can't move stuff between desktops, and some apps get pissy about launching; once you learn to live with the limitations its a great app to have.

  • by sleekware ( 1109351 ) on Thursday January 28, 2010 @04:45PM (#30940696)
    This one looks promising too! (Just did a Google search for it, http://xmonad.org/ [xmonad.org] Guess I'll have to try them both...
  • by pwnies ( 1034518 ) * <j@jjcm.org> on Thursday January 28, 2010 @04:46PM (#30940716) Homepage Journal
    "linux dual head [google.com]"
    The first three mention either xrandr or xinerama. Didn't check beyond that.
  • by idontgno ( 624372 ) on Thursday January 28, 2010 @04:47PM (#30940730) Journal

    Probably "xinerama and xrandr"

    When searching for an answer, it helps to know the answer.

  • by HeronBlademaster ( 1079477 ) <heron@xnapid.com> on Thursday January 28, 2010 @04:47PM (#30940734) Homepage

    xinerama + xrandr does not solve the question posed by the OP. Xinerama allows the two alternatives mentioned in the OP as the undesired options (i.e. either two monitors as one screen sharing a workspace, or a separate screen on each monitor which does not allow moving windows between screens).

    OP wants two monitors with their own separate workspaces, while still being able to drag windows between them.

    In other words, OP wants to be able to transfer running applications between separate X screens, which to my knowledge is not currently possible (or, if it's possible, the functionality is not exposed in Gnome or KDE).

    This isn't "+1 Insightful", it's "-1 Didn't bother reading the OP" (or "-1 Doesn't really know what xinerama+xrandr does").

  • by scot4875 ( 542869 ) on Thursday January 28, 2010 @04:48PM (#30940762) Homepage

    There are any number of utilities that will give you multiple virtual desktops on Windows, while retaining Windows' native multi-display features.

    In fact, one comes from Sysinternals, which is now part of Microsoft itself. It's called Desktops. It only does 4 virtual desktops though, so if that's not enough, you'll have to look elsewhere.

    --Jeremy

  • Re:Go away, TROLL! (Score:5, Informative)

    by Homburg ( 213427 ) on Thursday January 28, 2010 @04:51PM (#30940828) Homepage

    With the one large desktop when you maximize a window it fills both monitors

    No it doesn't. Most window managers have handled multihead the way you saw Windows 7 does for some years now (five or six, I think).

  • Re:Synergy (Score:3, Informative)

    by HeronBlademaster ( 1079477 ) <heron@xnapid.com> on Thursday January 28, 2010 @04:51PM (#30940830) Homepage

    You don't need synergy for that. Xinerama lets you do that natively. What the OP wants to do is be able to move windows between X screens.

  • by pz ( 113803 ) on Thursday January 28, 2010 @04:58PM (#30940992) Journal

    I have had a computer running Linux (Fedora of one flavor or another) with two displays for getting on to be most of a decade. Wouldn't work seriously any other way. I have 12 desktops (one for each Fn key on standard keyboards), which are linked so that both monitors switch at the same time.

    If you haven't TRIED this sort of setup yet (and it sounds very much like you have not), then I would encourage you to try it first. What problem are you trying to solve with being able to switch monitors individually? WIndows can be trivially moved between virtual desktops under Linux, and with single keystroke desktop switching (remember those Fn keys?) I find that I rarely, if ever, need to move applications from one desktop to another. To promote efficiency, I have adopted, over the years, a standard pattern of where given windows are. The details are good for me, but not necessarily anyone else, so I won't go through the particulars, but, just as one example, when I want to use a browser, I hit F6, and BOOM, there are two browser windows at full screen. When I need an editor, another single keystroke (F3, if you care), and BOOM, emacs on the left, and, usually, an xterm on the right. Fully maximized. Moving windows around and resizing them is a waste of time and screen area. Twelve desktops maps nicely to the Fn keys -- which, again, is why I have 12, and, again is why switching between applications is 1-keystroke-instantaneous -- and I cannot recall running out of room, ever.

    If the reason you want to switch workspaces individually is that you don't have enough flexibility in your workspaces (like you only have four per monitor), then you're solving the wrong problem. Increase the number of workspaces you have. Also, stop putting the task bar on the long dimension of the monitor -- that's the one where you have the least distance to play with. And if you're doing any document-based work, then it's a MUST to use portrait orientation.

    Or were you just going to dick around, switching the left workspace, then the right one, then the left, then the right?

    When people join my lab, they universally comment on how efficient my work setup is ... and usually leave using a very similar setup themselves.

  • by jedidiah ( 1196 ) on Thursday January 28, 2010 @04:59PM (#30940996) Homepage

    Virtual Workspace addons for Windows? They're all crap. That goes triple for the "powertoy" one.

  • by sammyF70 ( 1154563 ) on Thursday January 28, 2010 @05:01PM (#30941032) Homepage Journal

    yes. probably Awesome WM. There is such a picture on the Awesome homepage (http://awesome.naquadah.org/). It's often advertised as a tiling manager and Julien Danjou seems to have been so upset about that that the 3.4 release now defaults to floating layout on all tags (you can default any tag to tiling or floating, and in the case of multiple monitors, you can have a tilingbehaviour on one monitor, and a floating one on the other monitor, and move windows and applications back and forth).

    Awesome is indeed awesome, if you don't mind some manual editing of the lua configuration file.It should fit the OP's requirement nicely. Additionally, it's a blast on netbooks

  • Putty vs. Cygwin (Score:3, Informative)

    by flajann ( 658201 ) <fred.mitchell@g m x .de> on Thursday January 28, 2010 @05:03PM (#30941076) Homepage Journal
    I don't know about Putty, but you can install CygwinX, and run ssh in an x-session, and actually run X applications on your Windows desktop that way.
  • Re:Google (Score:5, Informative)

    by ArtInvent ( 1164183 ) on Thursday January 28, 2010 @05:06PM (#30941150)
    You know, I've messed with multiple monitors enough on Linux for a few years to know that just about anything is possible, but it's not always easy. At all. I think this is a very valid question to ask /. because he is certainly trying to do something that's not at all 'out of the box' with the simple multimonitor support in things like nvidia-settings or Xinerama or whatever. In fact, some of the responses I've read seem to indicate that exactly what he's after isn't actually possible. I recently *finally* figured out how to account for overscan on my HDTV. It involved a custom metamode line and other junk in xorg.conf, quite a lot of Google hunting, a very specialized Windows-only monitor analysis app, and mathematics to arrive at the value. A LOT of stuff that other OS's can do with a nice onscreen GUI are still not even close on Linux. Google does not give you answers. It gives you data and tons of it. And I have no idea what to say to people who take the time to read these questions and get offended that they were asked, and bother to answer them (incorrectly) along with an insulting rtfm or something. No one really forced you to read or respond to anything. You're wasting your own time.
  • Re: (Score:5, Informative)

    by anagama ( 611277 ) <obamaisaneocon@nothingchanged.org> on Thursday January 28, 2010 @05:10PM (#30941222) Homepage
    I use mac laptops and linux desktops. I'm not an Apple hater, maybe even a fanboy to some degree. But I don't think a mac will help him do what he wants. With a second monitor on a mac, you can either do screen spanning or screen mirroring. He is saying he doesn't want spanning, he wants both monitors to have their own "desktop", i.e., separate menu bars and such with the added kicker of being able to move apps between the separate desktops. You can think of spanning as a big desk and separate desktops as two desks in two rooms making it a hassle to shuffle one set of papers to another. What he wants is two desks in one room with the ability to move papers back and forth at will, but with each having distinct work areas.

    It would be cool if macs did that, but they don't. So getting a mac is totally useless for him.
  • by jon3k ( 691256 ) on Thursday January 28, 2010 @05:18PM (#30941402)
    I prefer DWM [suckless.org]. This is the ultimate in simplicity and usability.
  • by Anonymous Coward on Thursday January 28, 2010 @05:19PM (#30941410)

    Maybe I am stupid. But what's the difference between a big desktop over two monitors, and separate desktops, while still moving windows from one side to the other? I have two monitors, with one big desktop (Nvidia twinview) with KDE. Both sides have a separate task bar where I switch windows on each side locally. Maximizing a window happens within one monitor. But you can stretch the window over both monitors. I can, if I want, place different pictures as background on each monitor. What is not possible with my setup, you want to do? Do you want the window decorator to change while dragging windows? Have one monitor play a screensaver?

  • by Wannabe Code Monkey ( 638617 ) on Thursday January 28, 2010 @05:25PM (#30941516)
    gnome with two screens is just fine. you can maximize on either side and even use the window list say one panel per screen to show what windows are open on each display.

    I just want to second this. I have two monitors and one desktop stretched over both, but with gnome if you maximize a window it will snap to the edges of just the monitor it's on. You can stretch any window across both monitors, but you don't have to. I also duplicated the top and bottom panels from the 'main' monitor (my left) to the 'secondary' (my right). The task bars (gnome calls them 'Window Lists') on each monitor show just the windows on that monitor. You could have the gnome menu at the top left of each monitor, and the fast user switcher and date/time at the top right so it would really feel like two separate desktops.

  • by kabniel ( 609212 ) on Thursday January 28, 2010 @05:25PM (#30941520)
    I've been using xmonad for 6 months now and i dont think i can ever go back a regular non-tiling window manager again, dual monitors with independant workspaces is just too sweet.
    Win + w/e to switch focus between screens
    Win + tab to cycle through windows
    Win + 1-9 to switch between workspaces on active screen
    Win + Shift + 1-9 to send active window to workspace of choice

    It was a pretty steep learning curve at first since the config is written in haskell, but totally worth it.

    You can have floating windows if you really want to, but who wants to drag around windows all the time ;)
  • This is a first (Score:5, Informative)

    by 93 Escort Wagon ( 326346 ) on Thursday January 28, 2010 @05:35PM (#30941676)

    Smug answers from Windows users AND smug answers from Linux users - and neither group seems to actually understand the questions the poster is asking!

    He wants independent desktops, guys. All these silly "Jus use Windows 7, dummy" and "Use Xinerama, idiot" responders are not grasping that fundamental point - you're all thinking of one large desktop that spans multiple monitors. Basically you're confusing desktops with viewports.

    Unfortunately I don't know the answer either - but I do think I at least understand the question...

  • Re:Go away, TROLL! (Score:5, Informative)

    by mangu ( 126918 ) on Thursday January 28, 2010 @05:36PM (#30941704)

    With the one large desktop when you maximize a window it fills both monitors and things might size oddly if your monitors aren't the same size/resolution

    That's true and it does not depend on which operating system you're using.

    In Windows 7 multiple monitors were made extremely easy to setup

    It was extremely easy to setup in Linux long before Windows 7 came out.

    Windows multiple monitors also supports having separate monitors where you can maximize a window on a single display, but you can move windows between the monitors or even span multiple monitors. Is this setup possible to do under Linux?

    Of course. In Linux, or at least in KDE, there are several other easy ways to handle window resizing. If you mid-click in the maximize button the window is maximized vertically but it keeps the original horizontal size. Conversely, if you right-click in the maximize button the window is maximized horizontally and keeps the vertical size. Want to fine-tune the window size? Press the ALT key and the right mouse button simultaneously, the cursor will grab the *nearest* window border, no need to hit the *exact* pixels of the border.

    Finally how do you have putty run an x session? You can use it to do an ssh tunnel, but you'll need something else to handle connection to the xserver.

    If you say so. All I know is that it's trivial in Linux, but I always hear people complaining they must install Cygwin and puTTY and I don't know what else to run Xwindow in Windows.

  • Re:Wow (Score:3, Informative)

    by glop ( 181086 ) on Thursday January 28, 2010 @05:38PM (#30941736)

    What do you mean? How do you enable multiple desktops on Windows without 3rd party software?
    The OP is not talking about spreading the desktop over multiple screens which is what most distributions do.
    He want to combine multiple screens and multiple desktops in a way that is not common. I personally like the OP's suggestion but apparently we must be in the minority since only Enlightenment does it that way...

    That said, multiple screens have a long history of being harder on Linux due to driver issues. I believe people are usually quite successful using the NVIDIA drivers and tools. I got decent results with my EEE PC 701 and a TV. But I don't use it much so it does not really count.

  • Re:4 Screens (Score:3, Informative)

    by AlXtreme ( 223728 ) on Thursday January 28, 2010 @05:41PM (#30941772) Homepage Journal

    Xfce4 + Nvidia also works pretty well, Xfce4 handles multiple desktops with multiple monitors just fine.

  • by Anonymous Coward on Thursday January 28, 2010 @05:54PM (#30942018)

    I spent months trying to do the same thing with a normal window manager but I never found a way that worked well. xmove sounded promising but I couldn't get it to run. Now I use xmonad and it behaves exactly the way I want. You can set it up with window decorations and run it in Gnome [haskell.org] and whatever else you want to do. It's really not as big of a leap as you think it is. If you're scared of the "tiling" aspect, you can set every workspace to floating and it will never do any tiling.

  • Re:4 Screens (Score:3, Informative)

    by Narishma ( 822073 ) on Thursday January 28, 2010 @06:57PM (#30943054)

    KDE has it's own compositing manager, it doesn't use Compiz.

  • by theTerribleRobbo ( 661592 ) on Thursday January 28, 2010 @07:00PM (#30943074) Homepage

    The powertoy one is pretty terrible, falls over, loses windows, etc.
    I thoroughly recommend using VirtuaWin [sourceforge.net] instead.

    (I'm currently stuck with Windows at work, and it does most things GNOME virtual desktops can do.)

  • by Chris Pimlott ( 16212 ) on Thursday January 28, 2010 @07:54PM (#30943678)

    The latter option mentioned in the summary - each monitor being a distinct X session - is sometimes called Zaphod mode.

    I have opted for it myself, but the downside of not being able to drag windows is sometimes a real pain. You can mitigate this to some degree for text programs using screen or dtach. I am interested in trying out xpra, which promises to be like 'screen for x-windows', but I haven't had time yet.

    Another issue is that some programs, like Firefox, don't like to run multiple instances. So if you fire it up on one session while it's running on the other, it will try to connect to the existing instance but fail because its on a different session. I work around this with a small script that detects what screen firefox is running on and prepends the appropriate DISPLAY variable.

  • Re:Google (Score:3, Informative)

    by Qzukk ( 229616 ) on Thursday January 28, 2010 @08:13PM (#30943864) Journal

    But they are not really useful for working with multiple monitors.

    They are when you want one monitor to have 9 virtual desktops, and a second monitor to be running 9 completely different virtual desktops, and about the only way you're going to get anything to do that is going to be running a separate X server on each monitor.

    Merge this with Synergy+'s recommendation below, and you can do all that with one keyboard and mouse.

  • Re:Google (Score:3, Informative)

    by slick_rick ( 193080 ) * <rwrslashdot@nOspam.rowell.info> on Thursday January 28, 2010 @11:55PM (#30945460) Homepage Journal

    Mr. Albanach Surly should also mention that both the programs he linked are basically dead, unmaintained relics. One of the wikipedia pages he linked even mentioned this. He did actually read what he linked, right?

    The OP has asked a very interesting question though. If you could take something like xmove or Xpra and make an awesome [naquadah.org] window manager aware/compatible, it would be very interesting software indeed.

  • Re:This is a first (Score:3, Informative)

    by smallfries ( 601545 ) on Friday January 29, 2010 @07:20AM (#30947694) Homepage

    No - he doesn't understand what he wants because he has freely intermixed the terms desktop and workspace in the question. This has quite rightly confused the crap out of both sides of the never-ending windows-vs-linux death-match on slashdot.

    It sounds like he wants independent workspace flipping on both screens, while dragging windows between. This is not hard to do, but by mentioning desktops he has confused everyone. The majority of the posts above are telling him that you cannot transfer windows between independent X screens (true, but irrelevant).

    What he actually wants is a standard spanning X display (probably Xinerama) with a custom workspace flipper that groups the windows according to which logical display they are on. It's been a few years since I tried this and my memory is vauge; I would guess that the workspace flipper in Blackbox does this. If not, there are plenty of suggestions in other threads that sound plausible.

    Your point was nearly correct: he wants independent workspaces, not desktops, or viewports, nor monitors. Personally I would tell him to get over the whole workspace thing and just use Expose on OS-X hooked up to keyboard shortcuts, but that is not the answer that he is looking for.

"May your future be limited only by your dreams." -- Christa McAuliffe

Working...