Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really love Arch, but for me the reason it's segregated to a VM is:

- power management: Linux does not hold a candle to OSX (which is able to shutdown entire components like soundcard, webcam dynamically when not in use)

- Lion's external display+lid+sleep behavior: external screen+AC power makes lid-close sleep inoperant, so I can just plug both lid closed and my laptop wakes up to be a desktop (bluetooth input devices help a lot). Conversely unplugging either makes it go to sleep, back in laptop mode.



The Linux kernel is capable of commanding individual devices to power off. Run powertop and it will show you what's using power and offer to turn it off. My experience with Thinkpads (from two or three years ago) is that running Windows gives you about 10 hours of battery life while doing essentially nothing, while running Linux gives you 8 hours. Both are so high that it doesn't really matter. My X220 has never run out of battery, and I fly a lot and don't really plug my laptop in at home, so 8 hours is apparently enough.

For your second point, just explicitly command your computer to do what you want. If you want it to go to sleep, type "acpitool -s". If you don't want it to go to sleep, don't type that.

If you like OS X, use it, but if you hate OS X and are only using it because of the two issues you list above, that's crazy :)


> The Linux kernel is capable of commanding individual devices to power off. Run powertop and it will show you what's using power and offer to turn it off

Oh I perfectly know that, the problem is that it's manual. With OSX I play a song, soundcard comes alive from its powered off state and plays sound, song stops, soundcard powers down after a little idle timeout. The same goes for the webcam, ethernet board and various other components. With Linux I have to either write some suboptimal wrappers to programs to kick devices in or out, or do it manually, or sacrifice battery life.

Comparing battery life, Linux is two~three full hours behind OSX out of seven~eight (after thorough analysis involving powertop1/2). That's a 30% drop and brings me to almost a day to a little more than half a day of work per cycle. Well, it was so a year ago, because now my battery has crossed the 600 cycle count bar so it holds an hour less. And don't start telling me "oh that was a year ago, Linux has improved on that front since then", since OSX improved in that area too (I've looked at hard data battery metrics).

> For your second point, just explicitly command your computer to do what you want. If you want it to go to sleep, type "acpitool -s". If you don't want it to go to sleep, don't type that.

You're missing the point, I perfectly know that too.

Find me a single PC that can do this:

1) asleep with lid closed, you plug in an external screen and if you're on AC power the computer wakes up and makes the external screen primary, else it does not even wake up and stays asleep.

2) awake with lid closed, AC and screen plugged in, you plug out external screen or AC power and the computer goes to sleep

3) awake with lid closed, AC and screen plugged in, you open the lid and it becomes primary while external screen becomes secondary.

4) awake with lid open, AC doesn't matter but you plug in an external screen and this one becomes secondary, retains its specific configuration including relative position, wallpapers, resolution and color calibration settings from previous times per external screen device.

I've written my own extendable acpid handler in Python to achieve various schemes, react to complex events, and take complex actions. I know exactly how to do 2, 3 and 4, and I know exactly how much hackery and time is needed to achieve this, and it's not really reliable in the end. As for 1 it might as well be downright impossible.

> My X220 has never run out of battery, and I fly a lot and don't really plug my laptop in at home, so 8 hours is apparently enough.

As I said my battery is getting past middle-aged and the more minutes, the happier. Also you can consider not only "instant" battery life (i.e time it takes to go from full to empty) but long-term battery life (time it takes before the battery is a complete brick): the longer the cycles, the less wear it takes, so the longer it lasts before going to the trash.

> If you like OS X

I do :-)

If only Lion's "full-screen" would really be a chrome-less tiling window manager I'd be completely happy. Things, like Window Magnet, fullscreen Terminal.app and tmux help a lot though.


> Find me a single PC that can do this

Every computer can do this, its not a function of hardware. You'll have to write your own scripts to do it but thats just part of the Arch Linux ethos.

To wake and reconfigure displays on in your example (1), you can poll for ACPI events for on:

    /proc/acpi/ibm/video:video_switch


> Every computer can do this, its not a function of hardware.

I'm dying to know how a computer in ACPI S3† can execute my ACPI scripts. The only way for it to work is for some hardware to trigger an event that will kick it out of S3, and PCs old and new that do so on external display plug are (if any) apparently rare enough that I never encountered them, so currently I consider them devoid of this feature.

Even if it were so, this would require, as you say, and again as I did already for cases 2) 3) and 4), writing scripts, and such scripts are non-trivial. Calling xrandr (which of course needs DISPLAY and some X magic cookies) from an ACPI handler (which runs as root while the X session runs as you) requires interesting piles of trickery. Then timing issues come in, as drivers take time adjusting themselves and you have no way of knowing when they're ready (in the meantime e.g xrandr redurns/does crap). Also, interestingly enough, all sorts of fun stuff happens on VTs when the primary display vanishes to be thrown into an external one.

I long for the day when KMS supports multiple monitors and I can have VTs left and right, and I can run my favorite phrakture-like no-X setup on bare metal (and my web browser in a lightweight Wayland), but that day is far away so that setup stays in a VM.

† i.e CPU off == no power at all, only RAM and components registered for waking like USB controllers have reduced power.

edit: formatting




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: