How can I manually generate a fake ACPI lid event from a script in linux?
I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?
linux script acpi events
add a comment |
I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?
linux script acpi events
Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up.
– Unfundednut
Jul 4 '10 at 23:57
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them.
– Ryan Thompson
Jul 5 '10 at 1:04
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html)
– Sam
Aug 8 '10 at 15:55
add a comment |
I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?
linux script acpi events
I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?
linux script acpi events
linux script acpi events
asked Jul 4 '10 at 22:30
Ryan ThompsonRyan Thompson
6,87383760
6,87383760
Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up.
– Unfundednut
Jul 4 '10 at 23:57
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them.
– Ryan Thompson
Jul 5 '10 at 1:04
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html)
– Sam
Aug 8 '10 at 15:55
add a comment |
Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up.
– Unfundednut
Jul 4 '10 at 23:57
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them.
– Ryan Thompson
Jul 5 '10 at 1:04
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html)
– Sam
Aug 8 '10 at 15:55
Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up.
– Unfundednut
Jul 4 '10 at 23:57
Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up.
– Unfundednut
Jul 4 '10 at 23:57
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them.
– Ryan Thompson
Jul 5 '10 at 1:04
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them.
– Ryan Thompson
Jul 5 '10 at 1:04
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html)
– Sam
Aug 8 '10 at 15:55
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html)
– Sam
Aug 8 '10 at 15:55
add a comment |
1 Answer
1
active
oldest
votes
ACPI-FakeKeys might do the trick.
There does not appear to be a lid button defined in/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event usingacpi-fakekey
– Ryan Thompson
Aug 11 '10 at 17:17
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f160016%2fhow-can-i-manually-generate-a-fake-acpi-lid-event-from-a-script-in-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
ACPI-FakeKeys might do the trick.
There does not appear to be a lid button defined in/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event usingacpi-fakekey
– Ryan Thompson
Aug 11 '10 at 17:17
add a comment |
ACPI-FakeKeys might do the trick.
There does not appear to be a lid button defined in/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event usingacpi-fakekey
– Ryan Thompson
Aug 11 '10 at 17:17
add a comment |
ACPI-FakeKeys might do the trick.
ACPI-FakeKeys might do the trick.
answered Aug 11 '10 at 15:58
JarvinJarvin
5,88544062
5,88544062
There does not appear to be a lid button defined in/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event usingacpi-fakekey
– Ryan Thompson
Aug 11 '10 at 17:17
add a comment |
There does not appear to be a lid button defined in/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event usingacpi-fakekey
– Ryan Thompson
Aug 11 '10 at 17:17
There does not appear to be a lid button defined in
/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event using acpi-fakekey– Ryan Thompson
Aug 11 '10 at 17:17
There does not appear to be a lid button defined in
/usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event using acpi-fakekey– Ryan Thompson
Aug 11 '10 at 17:17
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f160016%2fhow-can-i-manually-generate-a-fake-acpi-lid-event-from-a-script-in-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up.
– Unfundednut
Jul 4 '10 at 23:57
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them.
– Ryan Thompson
Jul 5 '10 at 1:04
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html)
– Sam
Aug 8 '10 at 15:55