Posted Jan 16, 2013 7:11 UTC (Wed) by ekj (guest, #1524)
[Link]
Is there also "IgnoreIfOnWallPowerOtherwiseSuspend" ?
The Grumpy Editor's Fedora 18 experience
Posted Jan 16, 2013 13:34 UTC (Wed) by cortana (subscriber, #24596)
[Link]
Perhaps the kernel needs to grow a virtual machine to run a program which can more precisely control the conditions under which the system is suspended.
The Grumpy Editor's Fedora 18 experience
Posted Jan 16, 2013 13:40 UTC (Wed) by ekj (guest, #1524)
[Link]
If you need real flexibility it's better to run a userspace-program when something related to power-status changes, and let that program decide what to do.
But having different rules for what to do when you're plugged in, relative to when you're on battery-power is something that's fairly standard, and something there's a good reason for.
The Grumpy Editor's Fedora 18 experience
Posted Jan 29, 2013 15:16 UTC (Tue) by oblio (guest, #33465)
[Link]
Windows has already grown this "virtual machine", since it has different power setting depending on the power source: battery or plugged in.
I doesn't seem to absurd to not make the laptop suspend when the lid is closed while plugged in, since it could use an external display and keyboard. But when it's not plugged in you don't want it chugging along in your backpack, getting fried due to the lack of ventilation.
The Grumpy Editor's Fedora 18 experience
Posted Jan 16, 2013 15:24 UTC (Wed) by lkundrak (subscriber, #43452)
[Link]
Seconded. I find this use case very useful.
When the machine is plugged in, I mostly close the lid to turn off the screen so that it does not disturb me from sleep, but can still be alive finishing a build.
When it's not plugged, I'm probably travelling and I close the lid so that I can carry the laptop in my bag.
This even sounds like a sane default to me and I'll miss the setting terribly if it goes away from my desktop.
The Grumpy Editor's Fedora 18 experience
Posted Jan 16, 2013 18:45 UTC (Wed) by mathstuf (subscriber, #69389)
[Link]
In systemd 196, I added the option of 'lock' to the lid switch, though it appears as though F18 has 195 and probably won't get that upgrade (though a backport should be minimal work/maintenence; I'd certainly love to see it in RHEL7 at least). This causes all sessions to receive a 'lock' signal. If there's a signal for when the lid closes as well, the listener in the DEs could check if they're on AC and suspend if so. I'm writing a minimal Python daemon which does what I want (with flexibility); haven't worked on it for a while though.
The Grumpy Editor's Fedora 18 experience
Posted Jan 17, 2013 8:52 UTC (Thu) by michich (subscriber, #17902)
[Link]
Posted Jan 18, 2013 22:37 UTC (Fri) by mathstuf (subscriber, #69389)
[Link]
Ah, I had missed it in Koji because it has a trailing '.1' instead of fc18. Sounds good :) .
The Grumpy Editor's Fedora 18 experience
Posted Jan 18, 2013 9:06 UTC (Fri) by Kamilion (subscriber, #42576)
[Link]
Forgive me for sidebusting here, both as a normally ubuntu user and the occasional windows 7 gamer. I've been playing with FC18-lxde in a client project for the last few days, but have been actively lurking the systemd and wayland MLs since they were wee footnotes on LWN, and frowning my little heart out at *ubuntu for keeping upstart over systemd. But hey, least it isn't the tangle of LFS sysv scripts or openrc!
My Asus netbook currently has the exact settings you speak of, under windows 7. If the machine is on AC, display off. If the machine is on battery, suspend. I find myself instinctively pulling the cord out before closing the screen when I'm about to take it somewhere. Just consider it another plus one to the idea, since I think it's Asus's fancy 'superhybridengine' power profiles that seem to invoke this behavior.
Can't complain, since they threw a free windows license in my face, might as well stick steam on it.
On the upside, FC18 ships with systemd 19*, so it'd be pretty sane to send a patch to the ML and expect to be able to build and utilize the resulting fix. (haha, systemd-44 patches? YGTBSM.)
The Grumpy Editor's Fedora 18 experience
Posted Jan 29, 2013 8:15 UTC (Tue) by Duncan (guest, #6647)
[Link]
Anybody that's serious about having their laptop run differently on wall power than it does on battery should have a look at laptop-mode-tools.
Originally designed to deal with the kernel's laptop-mode, it now ships a plethora of scripts designed to control all sorts of things. The defaults are sane and reasonable in most cases, but those who feel the need can tweak settings to their heart's content (as naturally I have, being a gentooer =:^)
rpmfind doesn't appear to list any fedora packages, but it does list mandriva/opensuse/sourceforge/mageia/dagfabian-rhel noarch packages, upto 1.61, which is only a version behind the 1.62 that's showing up here on gentoo (and that adds systemd support according to the changelog, so anyone running that will probably want to grab 1.62 from the home page, there's Fedora-specific instructions), and it lists homepages/sites for it as well, so that would appear to be a reasonable place for rpm-based-distro folks at least to start looking for more, if they're interested.
But you really have to take a look in the tarball to see all the modules it comes with, and thus the configuration options. =:^)
While I don't see a direct lid-switch module in the 1.60 tarball that's what I have on my (slightly dated) netbook install, there's hooks for adding commandlines to execute at plug/unplug, and it'd be simple enough to add the commands above, there.
Duncan
The Grumpy Editor's Fedora 18 experience
Posted Jan 16, 2013 22:54 UTC (Wed) by mezcalero (subscriber, #45103)
[Link]
We only implement the most basic policy in systemd's logind: We give the user/admin a way to disable logind's built-in lid switch handling entirely, and we give DEs/apps a way to turn it off temporarily. DEs may then build on that and implement a smarter policy, that takes other conditions into account.
GNOME for example turns off lid switch handling if an external monitor is plugged in. If you want a different policy, file a bug against GNOME or hack it up yourself.