All my programs closes after I close the laptop












2















I use Ubuntu 18.04. When I close my laptop, and open it again, I find all my previously opened programs are lost. My Power configurations has "Off" in the "Automatic Suspend". Also, in "When the Power Button is pressed" I have "Off". But closing the laptop is not pressing the power button.



The lid close action seems to already be set to "suspend":



$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
'suspend'


This is very annoying. I want to close my laptop (i.e., closed the screen. This is different from pressing the power button) and find all my previously opened programs.










share|improve this question

























  • what is your result of gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action and gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action? Are they logout or shutdown?

    – Alvin Liang
    Dec 14 '18 at 12:20













  • The results for both commands are: 'suspend'

    – user9371654
    Dec 14 '18 at 12:30






  • 1





    Also gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action

    – Vijay
    Dec 14 '18 at 14:12











  • Thanks I have copy & paste error

    – Alvin Liang
    Dec 15 '18 at 4:43
















2















I use Ubuntu 18.04. When I close my laptop, and open it again, I find all my previously opened programs are lost. My Power configurations has "Off" in the "Automatic Suspend". Also, in "When the Power Button is pressed" I have "Off". But closing the laptop is not pressing the power button.



The lid close action seems to already be set to "suspend":



$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
'suspend'


This is very annoying. I want to close my laptop (i.e., closed the screen. This is different from pressing the power button) and find all my previously opened programs.










share|improve this question

























  • what is your result of gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action and gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action? Are they logout or shutdown?

    – Alvin Liang
    Dec 14 '18 at 12:20













  • The results for both commands are: 'suspend'

    – user9371654
    Dec 14 '18 at 12:30






  • 1





    Also gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action

    – Vijay
    Dec 14 '18 at 14:12











  • Thanks I have copy & paste error

    – Alvin Liang
    Dec 15 '18 at 4:43














2












2








2








I use Ubuntu 18.04. When I close my laptop, and open it again, I find all my previously opened programs are lost. My Power configurations has "Off" in the "Automatic Suspend". Also, in "When the Power Button is pressed" I have "Off". But closing the laptop is not pressing the power button.



The lid close action seems to already be set to "suspend":



$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
'suspend'


This is very annoying. I want to close my laptop (i.e., closed the screen. This is different from pressing the power button) and find all my previously opened programs.










share|improve this question
















I use Ubuntu 18.04. When I close my laptop, and open it again, I find all my previously opened programs are lost. My Power configurations has "Off" in the "Automatic Suspend". Also, in "When the Power Button is pressed" I have "Off". But closing the laptop is not pressing the power button.



The lid close action seems to already be set to "suspend":



$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
'suspend'


This is very annoying. I want to close my laptop (i.e., closed the screen. This is different from pressing the power button) and find all my previously opened programs.







suspend power-management shutdown






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 14 '18 at 12:55









terdon

65.4k12138220




65.4k12138220










asked Dec 14 '18 at 11:45









user9371654user9371654

1697




1697













  • what is your result of gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action and gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action? Are they logout or shutdown?

    – Alvin Liang
    Dec 14 '18 at 12:20













  • The results for both commands are: 'suspend'

    – user9371654
    Dec 14 '18 at 12:30






  • 1





    Also gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action

    – Vijay
    Dec 14 '18 at 14:12











  • Thanks I have copy & paste error

    – Alvin Liang
    Dec 15 '18 at 4:43



















  • what is your result of gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action and gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action? Are they logout or shutdown?

    – Alvin Liang
    Dec 14 '18 at 12:20













  • The results for both commands are: 'suspend'

    – user9371654
    Dec 14 '18 at 12:30






  • 1





    Also gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action

    – Vijay
    Dec 14 '18 at 14:12











  • Thanks I have copy & paste error

    – Alvin Liang
    Dec 15 '18 at 4:43

















what is your result of gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action and gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action? Are they logout or shutdown?

– Alvin Liang
Dec 14 '18 at 12:20







what is your result of gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action and gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action? Are they logout or shutdown?

– Alvin Liang
Dec 14 '18 at 12:20















The results for both commands are: 'suspend'

– user9371654
Dec 14 '18 at 12:30





The results for both commands are: 'suspend'

– user9371654
Dec 14 '18 at 12:30




1




1





Also gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action

– Vijay
Dec 14 '18 at 14:12





Also gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action

– Vijay
Dec 14 '18 at 14:12













Thanks I have copy & paste error

– Alvin Liang
Dec 15 '18 at 4:43





Thanks I have copy & paste error

– Alvin Liang
Dec 15 '18 at 4:43










1 Answer
1






active

oldest

votes


















0














Note: Suspend works on RAM, therefore you should have enough RAM to sustain all your open apps otherwise 'suspend' won't work properly. See the output of free m with all the apps usually open when you 'suspend'.




  1. Check System Settings > Power


Open terminal and run:



sudo apt install pm-utils


and



gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'




  1. If that doesn't work:



    sudo gedit /etc/systemd/logind.conf




and uncomment (remove "#") from the lines



#HandleLidSwitch=suspend
#HandleSuspendKey=suspend
#HandleLidSwitchDocked=suspend
#HandleHibernateKey=suspend





share|improve this answer


























  • It is already 'suspend' as you see in my comment in the OP.

    – user9371654
    Dec 14 '18 at 12:34











  • @user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

    – Vijay
    Dec 14 '18 at 12:40













  • I did all what you suggest. Still programs close when I close the laptop screen.

    – user9371654
    Dec 15 '18 at 21:34











  • By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

    – Vijay
    Dec 17 '18 at 12:30











  • yes. This is what I mean.

    – user9371654
    Dec 17 '18 at 13:38











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%2f1100844%2fall-my-programs-closes-after-i-close-the-laptop%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









0














Note: Suspend works on RAM, therefore you should have enough RAM to sustain all your open apps otherwise 'suspend' won't work properly. See the output of free m with all the apps usually open when you 'suspend'.




  1. Check System Settings > Power


Open terminal and run:



sudo apt install pm-utils


and



gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'




  1. If that doesn't work:



    sudo gedit /etc/systemd/logind.conf




and uncomment (remove "#") from the lines



#HandleLidSwitch=suspend
#HandleSuspendKey=suspend
#HandleLidSwitchDocked=suspend
#HandleHibernateKey=suspend





share|improve this answer


























  • It is already 'suspend' as you see in my comment in the OP.

    – user9371654
    Dec 14 '18 at 12:34











  • @user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

    – Vijay
    Dec 14 '18 at 12:40













  • I did all what you suggest. Still programs close when I close the laptop screen.

    – user9371654
    Dec 15 '18 at 21:34











  • By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

    – Vijay
    Dec 17 '18 at 12:30











  • yes. This is what I mean.

    – user9371654
    Dec 17 '18 at 13:38
















0














Note: Suspend works on RAM, therefore you should have enough RAM to sustain all your open apps otherwise 'suspend' won't work properly. See the output of free m with all the apps usually open when you 'suspend'.




  1. Check System Settings > Power


Open terminal and run:



sudo apt install pm-utils


and



gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'




  1. If that doesn't work:



    sudo gedit /etc/systemd/logind.conf




and uncomment (remove "#") from the lines



#HandleLidSwitch=suspend
#HandleSuspendKey=suspend
#HandleLidSwitchDocked=suspend
#HandleHibernateKey=suspend





share|improve this answer


























  • It is already 'suspend' as you see in my comment in the OP.

    – user9371654
    Dec 14 '18 at 12:34











  • @user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

    – Vijay
    Dec 14 '18 at 12:40













  • I did all what you suggest. Still programs close when I close the laptop screen.

    – user9371654
    Dec 15 '18 at 21:34











  • By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

    – Vijay
    Dec 17 '18 at 12:30











  • yes. This is what I mean.

    – user9371654
    Dec 17 '18 at 13:38














0












0








0







Note: Suspend works on RAM, therefore you should have enough RAM to sustain all your open apps otherwise 'suspend' won't work properly. See the output of free m with all the apps usually open when you 'suspend'.




  1. Check System Settings > Power


Open terminal and run:



sudo apt install pm-utils


and



gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'




  1. If that doesn't work:



    sudo gedit /etc/systemd/logind.conf




and uncomment (remove "#") from the lines



#HandleLidSwitch=suspend
#HandleSuspendKey=suspend
#HandleLidSwitchDocked=suspend
#HandleHibernateKey=suspend





share|improve this answer















Note: Suspend works on RAM, therefore you should have enough RAM to sustain all your open apps otherwise 'suspend' won't work properly. See the output of free m with all the apps usually open when you 'suspend'.




  1. Check System Settings > Power


Open terminal and run:



sudo apt install pm-utils


and



gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'




  1. If that doesn't work:



    sudo gedit /etc/systemd/logind.conf




and uncomment (remove "#") from the lines



#HandleLidSwitch=suspend
#HandleSuspendKey=suspend
#HandleLidSwitchDocked=suspend
#HandleHibernateKey=suspend






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 17 '18 at 18:18

























answered Dec 14 '18 at 12:33









VijayVijay

1,5811618




1,5811618













  • It is already 'suspend' as you see in my comment in the OP.

    – user9371654
    Dec 14 '18 at 12:34











  • @user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

    – Vijay
    Dec 14 '18 at 12:40













  • I did all what you suggest. Still programs close when I close the laptop screen.

    – user9371654
    Dec 15 '18 at 21:34











  • By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

    – Vijay
    Dec 17 '18 at 12:30











  • yes. This is what I mean.

    – user9371654
    Dec 17 '18 at 13:38



















  • It is already 'suspend' as you see in my comment in the OP.

    – user9371654
    Dec 14 '18 at 12:34











  • @user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

    – Vijay
    Dec 14 '18 at 12:40













  • I did all what you suggest. Still programs close when I close the laptop screen.

    – user9371654
    Dec 15 '18 at 21:34











  • By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

    – Vijay
    Dec 17 '18 at 12:30











  • yes. This is what I mean.

    – user9371654
    Dec 17 '18 at 13:38

















It is already 'suspend' as you see in my comment in the OP.

– user9371654
Dec 14 '18 at 12:34





It is already 'suspend' as you see in my comment in the OP.

– user9371654
Dec 14 '18 at 12:34













@user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

– Vijay
Dec 14 '18 at 12:40







@user9371654 gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action is not there in "both" the commands by @Alvin Liang

– Vijay
Dec 14 '18 at 12:40















I did all what you suggest. Still programs close when I close the laptop screen.

– user9371654
Dec 15 '18 at 21:34





I did all what you suggest. Still programs close when I close the laptop screen.

– user9371654
Dec 15 '18 at 21:34













By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

– Vijay
Dec 17 '18 at 12:30





By "close the laptop screen" I assume you mean close the laptop lid. If not so please tell.

– Vijay
Dec 17 '18 at 12:30













yes. This is what I mean.

– user9371654
Dec 17 '18 at 13:38





yes. This is what I mean.

– user9371654
Dec 17 '18 at 13:38


















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%2f1100844%2fall-my-programs-closes-after-i-close-the-laptop%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

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents