Ubuntu server - How do disable sleep when laptop screen is closed but allow screen to shut off ...

Why do we say 'Un seul M' and not 'Une seule M' even though M is a "consonne"

Does Germany produce more waste than the US?

What happened in Rome, when the western empire "fell"?

Is there such a thing as a proper verb, like a proper noun?

Getting Stale Gas Out of a Gas Tank w/out Dropping the Tank

The Ultimate Number Sequence Puzzle

Is there a reasonable and studied concept of reduction between regular languages?

Yu-Gi-Oh cards in Python 3

Towers in the ocean; How deep can they be built?

Can this note be analyzed as a non-chord tone?

What is the process for cleansing a very negative action

Defamation due to breach of confidentiality

Audio Conversion With ADS1243

It is correct to match light sources with the same color temperature?

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

vector calculus integration identity problem

What day is it again?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Is it okay to majorly distort historical facts while writing a fiction story?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

How to Implement Deterministic Encryption Safely in .NET

What difference does it make using sed with/without whitespaces?

Man transported from Alternate World into ours by a Neutrino Detector



Ubuntu server - How do disable sleep when laptop screen is closed but allow screen to shut off



The Next CEO of Stack OverflowHow to disable auto sleep in Ubuntu 18.04Ubuntu Server on laptop - power off display when close lid13.10 Laptop goes to sleep instead of shutting down when lid is closedHow can I prevent anything from happening when I shut the lid of my laptop?Laptop goes to sleep right after boot with lid closed and external monitor connectedDisable sleep on laptop lid close in tty1Laptop not going to sleep when closing the lidClicks on the screen while laptop lid is closedUbuntu 16.04 - Cannot reboot laptop if the lid is closed?How to disable auto sleep in Ubuntu 18.04xubuntu 18.04 system freeze screen off or lid closed












0















I have a dell laptop that i just installed Ubuntu server 18.04 LTS on, and that i'm using as a Plex / TVHeadend server. I'd like to stop the laptop from going to sleep when the lid/laptop screen is closed, but still allow the screen to shut off.



Currently I modified /etc/systemd/login.conf and set



HandleLidSwitch=ignore


The only problem is that now the screen never shuts off when the lid is closed. Since this will be left running 24/7, i'd like the screen to shut off so as not to generate extra heat and save on power



Any suggestions?










share|improve this question























  • A solution has been described here: askubuntu.com/questions/1062369/…

    – bixiou
    Sep 1 '18 at 14:23
















0















I have a dell laptop that i just installed Ubuntu server 18.04 LTS on, and that i'm using as a Plex / TVHeadend server. I'd like to stop the laptop from going to sleep when the lid/laptop screen is closed, but still allow the screen to shut off.



Currently I modified /etc/systemd/login.conf and set



HandleLidSwitch=ignore


The only problem is that now the screen never shuts off when the lid is closed. Since this will be left running 24/7, i'd like the screen to shut off so as not to generate extra heat and save on power



Any suggestions?










share|improve this question























  • A solution has been described here: askubuntu.com/questions/1062369/…

    – bixiou
    Sep 1 '18 at 14:23














0












0








0








I have a dell laptop that i just installed Ubuntu server 18.04 LTS on, and that i'm using as a Plex / TVHeadend server. I'd like to stop the laptop from going to sleep when the lid/laptop screen is closed, but still allow the screen to shut off.



Currently I modified /etc/systemd/login.conf and set



HandleLidSwitch=ignore


The only problem is that now the screen never shuts off when the lid is closed. Since this will be left running 24/7, i'd like the screen to shut off so as not to generate extra heat and save on power



Any suggestions?










share|improve this question














I have a dell laptop that i just installed Ubuntu server 18.04 LTS on, and that i'm using as a Plex / TVHeadend server. I'd like to stop the laptop from going to sleep when the lid/laptop screen is closed, but still allow the screen to shut off.



Currently I modified /etc/systemd/login.conf and set



HandleLidSwitch=ignore


The only problem is that now the screen never shuts off when the lid is closed. Since this will be left running 24/7, i'd like the screen to shut off so as not to generate extra heat and save on power



Any suggestions?







server 18.04 power-management laptop






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 20 '18 at 1:58









John-Rock BilodeauJohn-Rock Bilodeau

65




65













  • A solution has been described here: askubuntu.com/questions/1062369/…

    – bixiou
    Sep 1 '18 at 14:23



















  • A solution has been described here: askubuntu.com/questions/1062369/…

    – bixiou
    Sep 1 '18 at 14:23

















A solution has been described here: askubuntu.com/questions/1062369/…

– bixiou
Sep 1 '18 at 14:23





A solution has been described here: askubuntu.com/questions/1062369/…

– bixiou
Sep 1 '18 at 14:23










2 Answers
2






active

oldest

votes


















0














I have had the same issue and no luck trying to search online. Past Ubuntu versions had this option available iirc, but it seems 18.04 does not...



Currently, my workaround is to set blank screen to some time interval, and then just shut my computer lid (with the same HandLidSwitch=ignore setting), then let time pass until it auto-blanks the screen by itself. However this isn't exactly convenient and prevents you from having your own settings for how long screen blanking takes (for example, I prefer that my screen never blanks during idle usage - not compatible with this workaround).



Overall, Ubuntu 18.04's settings for sleeping your computer / blanking the screen seem very cumbersome... there doesn't seem to me to be a way to manually suspend / sleep my computer if I've changed the lid-close functionality, for example.






share|improve this answer


























  • Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

    – John-Rock Bilodeau
    Nov 12 '18 at 23:24



















0














After all this time I finally figured it out



Since Ubuntu 18.04 doesn't have a /etc/rc.local file by default we need to create one.



sudo vi /etc/rc.local


press i to enter insert mode



Type the following 3 lines



#!/bin/bash
setterm --blank 1
exit 0


Next press escape, then type :wq to save and quit vi



Now change the permissions so the file can execute



sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local


now restart the rc-local service. Type the following



systemctl restart rc-local





share|improve this answer
























  • I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

    – John-Rock Bilodeau
    31 mins ago












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1048063%2fubuntu-server-how-do-disable-sleep-when-laptop-screen-is-closed-but-allow-scre%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I have had the same issue and no luck trying to search online. Past Ubuntu versions had this option available iirc, but it seems 18.04 does not...



Currently, my workaround is to set blank screen to some time interval, and then just shut my computer lid (with the same HandLidSwitch=ignore setting), then let time pass until it auto-blanks the screen by itself. However this isn't exactly convenient and prevents you from having your own settings for how long screen blanking takes (for example, I prefer that my screen never blanks during idle usage - not compatible with this workaround).



Overall, Ubuntu 18.04's settings for sleeping your computer / blanking the screen seem very cumbersome... there doesn't seem to me to be a way to manually suspend / sleep my computer if I've changed the lid-close functionality, for example.






share|improve this answer


























  • Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

    – John-Rock Bilodeau
    Nov 12 '18 at 23:24
















0














I have had the same issue and no luck trying to search online. Past Ubuntu versions had this option available iirc, but it seems 18.04 does not...



Currently, my workaround is to set blank screen to some time interval, and then just shut my computer lid (with the same HandLidSwitch=ignore setting), then let time pass until it auto-blanks the screen by itself. However this isn't exactly convenient and prevents you from having your own settings for how long screen blanking takes (for example, I prefer that my screen never blanks during idle usage - not compatible with this workaround).



Overall, Ubuntu 18.04's settings for sleeping your computer / blanking the screen seem very cumbersome... there doesn't seem to me to be a way to manually suspend / sleep my computer if I've changed the lid-close functionality, for example.






share|improve this answer


























  • Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

    – John-Rock Bilodeau
    Nov 12 '18 at 23:24














0












0








0







I have had the same issue and no luck trying to search online. Past Ubuntu versions had this option available iirc, but it seems 18.04 does not...



Currently, my workaround is to set blank screen to some time interval, and then just shut my computer lid (with the same HandLidSwitch=ignore setting), then let time pass until it auto-blanks the screen by itself. However this isn't exactly convenient and prevents you from having your own settings for how long screen blanking takes (for example, I prefer that my screen never blanks during idle usage - not compatible with this workaround).



Overall, Ubuntu 18.04's settings for sleeping your computer / blanking the screen seem very cumbersome... there doesn't seem to me to be a way to manually suspend / sleep my computer if I've changed the lid-close functionality, for example.






share|improve this answer















I have had the same issue and no luck trying to search online. Past Ubuntu versions had this option available iirc, but it seems 18.04 does not...



Currently, my workaround is to set blank screen to some time interval, and then just shut my computer lid (with the same HandLidSwitch=ignore setting), then let time pass until it auto-blanks the screen by itself. However this isn't exactly convenient and prevents you from having your own settings for how long screen blanking takes (for example, I prefer that my screen never blanks during idle usage - not compatible with this workaround).



Overall, Ubuntu 18.04's settings for sleeping your computer / blanking the screen seem very cumbersome... there doesn't seem to me to be a way to manually suspend / sleep my computer if I've changed the lid-close functionality, for example.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 5 '18 at 7:25









Stephen Rauch

1,1546716




1,1546716










answered Aug 5 '18 at 4:09









bottledcapsbottledcaps

113




113













  • Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

    – John-Rock Bilodeau
    Nov 12 '18 at 23:24



















  • Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

    – John-Rock Bilodeau
    Nov 12 '18 at 23:24

















Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

– John-Rock Bilodeau
Nov 12 '18 at 23:24





Just wondering how you set the screen to blank? I tried googling it, but only found references to doing this via the UI and not by command line

– John-Rock Bilodeau
Nov 12 '18 at 23:24













0














After all this time I finally figured it out



Since Ubuntu 18.04 doesn't have a /etc/rc.local file by default we need to create one.



sudo vi /etc/rc.local


press i to enter insert mode



Type the following 3 lines



#!/bin/bash
setterm --blank 1
exit 0


Next press escape, then type :wq to save and quit vi



Now change the permissions so the file can execute



sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local


now restart the rc-local service. Type the following



systemctl restart rc-local





share|improve this answer
























  • I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

    – John-Rock Bilodeau
    31 mins ago
















0














After all this time I finally figured it out



Since Ubuntu 18.04 doesn't have a /etc/rc.local file by default we need to create one.



sudo vi /etc/rc.local


press i to enter insert mode



Type the following 3 lines



#!/bin/bash
setterm --blank 1
exit 0


Next press escape, then type :wq to save and quit vi



Now change the permissions so the file can execute



sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local


now restart the rc-local service. Type the following



systemctl restart rc-local





share|improve this answer
























  • I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

    – John-Rock Bilodeau
    31 mins ago














0












0








0







After all this time I finally figured it out



Since Ubuntu 18.04 doesn't have a /etc/rc.local file by default we need to create one.



sudo vi /etc/rc.local


press i to enter insert mode



Type the following 3 lines



#!/bin/bash
setterm --blank 1
exit 0


Next press escape, then type :wq to save and quit vi



Now change the permissions so the file can execute



sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local


now restart the rc-local service. Type the following



systemctl restart rc-local





share|improve this answer













After all this time I finally figured it out



Since Ubuntu 18.04 doesn't have a /etc/rc.local file by default we need to create one.



sudo vi /etc/rc.local


press i to enter insert mode



Type the following 3 lines



#!/bin/bash
setterm --blank 1
exit 0


Next press escape, then type :wq to save and quit vi



Now change the permissions so the file can execute



sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local


now restart the rc-local service. Type the following



systemctl restart rc-local






share|improve this answer












share|improve this answer



share|improve this answer










answered 33 mins ago









John-Rock BilodeauJohn-Rock Bilodeau

65




65













  • I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

    – John-Rock Bilodeau
    31 mins ago



















  • I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

    – John-Rock Bilodeau
    31 mins ago

















I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

– John-Rock Bilodeau
31 mins ago





I forgot to mention setterm --blank 1 makes the screen blank after 1 minute of inactivity. The number can be between 0 and 60 I believe. Since i'm using the laptop as a server and using SSH to connect to it, I want the screen to go to sleep quickly

– John-Rock Bilodeau
31 mins ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1048063%2fubuntu-server-how-do-disable-sleep-when-laptop-screen-is-closed-but-allow-scre%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...