I work in one place and have my family in another--a five-hour commute. This has posed special problems in my work habits, since I lose 10 hours the weeks I drive back home, have my work materials scattered between apartment, office, house, and car, and have conflicting demands on my attention. I'm surprised I am able to get anything done at all, but I think I have managed to develop some efficiencies out of the very difficulties that beset me. When I have to stay weekends at my job, I get a lot done. I plan the week efficiently so I don't have to bring a lot of work home when I am away from the office. I use the five-hour drive to come up with new ideas. I am less neurotic about having to have every book I need at any one time. If there's a book I need that's 300 miles away, I just work around the missing material until I have a chance to get it.
In short, a less than ideal situation does not prevent above average scholarly productivity.