How to disable sleep/suspend at login screen?












4














I've been at trying to do this for the last several hours with no progress.



I'm running Ubuntu 16.04 and I want to disable the sleep/suspend at the login screen (before logging in with any user) so that the display stays active. The suspension/sleep starts after 5 minutes -- a setting I can't seem to find anywhere.



Things that I've tried:



GUI



Done for both (all) users:




  • Never suspend under Power

  • Never turn screen off under Brightness and Lock.


Terminal



gsettings set org.gnome.desktop.session idle-delay 0
sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
xset s noblank
xset s off
xset dpms force off
xset -dpms


crontab -e:



added



@reboot sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
@reboot /usr/bin/xset s noblank
@reboot /usr/bin/xset s off
@reboot /usr/bin/xset dpms force off
@reboot /usr/bin/xset -dpms


dconf org.gnome.settings-daemon.plugins.power



critical-battery-action nothing
idle-dim false
lid-close-ac-action nothing
lid-close-battery-action nothing
sleep-inactive-ac-timeout 0
sleep-inactive-ac-type nothing
sleep-inactive-battery-timeout 0
sleep-inactive-battery-type nothing
time-critical 36000
time-low 36000


(The computer has neither lid nor battery btw)



sudo gedit /etc/X11/xorg.conf



Added



Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection


Caffeine



Added



@reboot /usr/bin/caffeine &


in crontab. Also thought about doing the same with



@reboot /usr/bin/caffeine -t 36000


but



caffeine -t 36000


returns



usage: caffeinate [-h] [-V] COMMAND [ARGUMENT [ARGUMENT ...]]
caffeinate: error: unrecognized arguments: -t


acpi



Don't have it.



Any help would be much appreciated!










share|improve this question





























    4














    I've been at trying to do this for the last several hours with no progress.



    I'm running Ubuntu 16.04 and I want to disable the sleep/suspend at the login screen (before logging in with any user) so that the display stays active. The suspension/sleep starts after 5 minutes -- a setting I can't seem to find anywhere.



    Things that I've tried:



    GUI



    Done for both (all) users:




    • Never suspend under Power

    • Never turn screen off under Brightness and Lock.


    Terminal



    gsettings set org.gnome.desktop.session idle-delay 0
    sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    xset s noblank
    xset s off
    xset dpms force off
    xset -dpms


    crontab -e:



    added



    @reboot sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    @reboot /usr/bin/xset s noblank
    @reboot /usr/bin/xset s off
    @reboot /usr/bin/xset dpms force off
    @reboot /usr/bin/xset -dpms


    dconf org.gnome.settings-daemon.plugins.power



    critical-battery-action nothing
    idle-dim false
    lid-close-ac-action nothing
    lid-close-battery-action nothing
    sleep-inactive-ac-timeout 0
    sleep-inactive-ac-type nothing
    sleep-inactive-battery-timeout 0
    sleep-inactive-battery-type nothing
    time-critical 36000
    time-low 36000


    (The computer has neither lid nor battery btw)



    sudo gedit /etc/X11/xorg.conf



    Added



    Section "ServerFlags"
    Option "BlankTime" "0"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "0"
    EndSection


    Caffeine



    Added



    @reboot /usr/bin/caffeine &


    in crontab. Also thought about doing the same with



    @reboot /usr/bin/caffeine -t 36000


    but



    caffeine -t 36000


    returns



    usage: caffeinate [-h] [-V] COMMAND [ARGUMENT [ARGUMENT ...]]
    caffeinate: error: unrecognized arguments: -t


    acpi



    Don't have it.



    Any help would be much appreciated!










    share|improve this question



























      4












      4








      4







      I've been at trying to do this for the last several hours with no progress.



      I'm running Ubuntu 16.04 and I want to disable the sleep/suspend at the login screen (before logging in with any user) so that the display stays active. The suspension/sleep starts after 5 minutes -- a setting I can't seem to find anywhere.



      Things that I've tried:



      GUI



      Done for both (all) users:




      • Never suspend under Power

      • Never turn screen off under Brightness and Lock.


      Terminal



      gsettings set org.gnome.desktop.session idle-delay 0
      sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
      xset s noblank
      xset s off
      xset dpms force off
      xset -dpms


      crontab -e:



      added



      @reboot sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
      @reboot /usr/bin/xset s noblank
      @reboot /usr/bin/xset s off
      @reboot /usr/bin/xset dpms force off
      @reboot /usr/bin/xset -dpms


      dconf org.gnome.settings-daemon.plugins.power



      critical-battery-action nothing
      idle-dim false
      lid-close-ac-action nothing
      lid-close-battery-action nothing
      sleep-inactive-ac-timeout 0
      sleep-inactive-ac-type nothing
      sleep-inactive-battery-timeout 0
      sleep-inactive-battery-type nothing
      time-critical 36000
      time-low 36000


      (The computer has neither lid nor battery btw)



      sudo gedit /etc/X11/xorg.conf



      Added



      Section "ServerFlags"
      Option "BlankTime" "0"
      Option "StandbyTime" "0"
      Option "SuspendTime" "0"
      Option "OffTime" "0"
      EndSection


      Caffeine



      Added



      @reboot /usr/bin/caffeine &


      in crontab. Also thought about doing the same with



      @reboot /usr/bin/caffeine -t 36000


      but



      caffeine -t 36000


      returns



      usage: caffeinate [-h] [-V] COMMAND [ARGUMENT [ARGUMENT ...]]
      caffeinate: error: unrecognized arguments: -t


      acpi



      Don't have it.



      Any help would be much appreciated!










      share|improve this question















      I've been at trying to do this for the last several hours with no progress.



      I'm running Ubuntu 16.04 and I want to disable the sleep/suspend at the login screen (before logging in with any user) so that the display stays active. The suspension/sleep starts after 5 minutes -- a setting I can't seem to find anywhere.



      Things that I've tried:



      GUI



      Done for both (all) users:




      • Never suspend under Power

      • Never turn screen off under Brightness and Lock.


      Terminal



      gsettings set org.gnome.desktop.session idle-delay 0
      sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
      xset s noblank
      xset s off
      xset dpms force off
      xset -dpms


      crontab -e:



      added



      @reboot sudo /bin/systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
      @reboot /usr/bin/xset s noblank
      @reboot /usr/bin/xset s off
      @reboot /usr/bin/xset dpms force off
      @reboot /usr/bin/xset -dpms


      dconf org.gnome.settings-daemon.plugins.power



      critical-battery-action nothing
      idle-dim false
      lid-close-ac-action nothing
      lid-close-battery-action nothing
      sleep-inactive-ac-timeout 0
      sleep-inactive-ac-type nothing
      sleep-inactive-battery-timeout 0
      sleep-inactive-battery-type nothing
      time-critical 36000
      time-low 36000


      (The computer has neither lid nor battery btw)



      sudo gedit /etc/X11/xorg.conf



      Added



      Section "ServerFlags"
      Option "BlankTime" "0"
      Option "StandbyTime" "0"
      Option "SuspendTime" "0"
      Option "OffTime" "0"
      EndSection


      Caffeine



      Added



      @reboot /usr/bin/caffeine &


      in crontab. Also thought about doing the same with



      @reboot /usr/bin/caffeine -t 36000


      but



      caffeine -t 36000


      returns



      usage: caffeinate [-h] [-V] COMMAND [ARGUMENT [ARGUMENT ...]]
      caffeinate: error: unrecognized arguments: -t


      acpi



      Don't have it.



      Any help would be much appreciated!







      login suspend power-management login-screen






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 3 '17 at 21:55

























      asked Aug 2 '17 at 18:06









      JohanPI

      317




      317






















          2 Answers
          2






          active

          oldest

          votes


















          1














          I found a solution from here https://askubuntu.com/a/543861/718511, though they wanted to do the reverse so it's slightly modified. Essentially a script is made to disable dpms and lightdm told to run it.



          In /etc/lightdm/lightdm.conf.d/ make a file 50-dpms.conf:



          sudo nano /etc/lightdm/lightdm.conf.d/50-dpms.conf


          Add the lines



          [SeatDefaults]
          display-setup-script=/usr/local/bin/dpms-stop


          Close the file



          In /usr/local/bin/ create a file dpms-stop:



          sudo nano /usr/local/bin/dpms-stop


          Add the lines



          #!/bin/sh
          sudo xhost +si:localuser:lightdm # grants localuser rights to X session
          sudo su lightdm -s /bin/bash <<HERE
          /usr/bin/xset -dpms
          exit
          HERE


          Close the file



          Make the file executable:



          sudo chmod +x /usr/local/bin/dpms-stop


          At reboot it worked for me.






          share|improve this answer































            0














            I had the same issue and found the solution in this forum thread. Setting the appropriate value using gsettings worked for me. Note that this needs to be set for the lightdm user, not for your own account or for root. Maybe this was your problem?



            Here are the commands you need to run:



            sudo su
            su lightdm -s /bin/bash
            dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
            exit
            exit


            Note that this only disables sleep for the machine when on AC power. Since I am using a desktop machine, this was sufficient. If you also want to disable sleeping when on battery power, you also need to set the sleep-inactive-battery-timeout value to 0.



            After your have run these commands, restart LightDM and you should be good to go.



            sudo service lightdm restart





            share|improve this answer





















              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%2f942366%2fhow-to-disable-sleep-suspend-at-login-screen%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









              1














              I found a solution from here https://askubuntu.com/a/543861/718511, though they wanted to do the reverse so it's slightly modified. Essentially a script is made to disable dpms and lightdm told to run it.



              In /etc/lightdm/lightdm.conf.d/ make a file 50-dpms.conf:



              sudo nano /etc/lightdm/lightdm.conf.d/50-dpms.conf


              Add the lines



              [SeatDefaults]
              display-setup-script=/usr/local/bin/dpms-stop


              Close the file



              In /usr/local/bin/ create a file dpms-stop:



              sudo nano /usr/local/bin/dpms-stop


              Add the lines



              #!/bin/sh
              sudo xhost +si:localuser:lightdm # grants localuser rights to X session
              sudo su lightdm -s /bin/bash <<HERE
              /usr/bin/xset -dpms
              exit
              HERE


              Close the file



              Make the file executable:



              sudo chmod +x /usr/local/bin/dpms-stop


              At reboot it worked for me.






              share|improve this answer




























                1














                I found a solution from here https://askubuntu.com/a/543861/718511, though they wanted to do the reverse so it's slightly modified. Essentially a script is made to disable dpms and lightdm told to run it.



                In /etc/lightdm/lightdm.conf.d/ make a file 50-dpms.conf:



                sudo nano /etc/lightdm/lightdm.conf.d/50-dpms.conf


                Add the lines



                [SeatDefaults]
                display-setup-script=/usr/local/bin/dpms-stop


                Close the file



                In /usr/local/bin/ create a file dpms-stop:



                sudo nano /usr/local/bin/dpms-stop


                Add the lines



                #!/bin/sh
                sudo xhost +si:localuser:lightdm # grants localuser rights to X session
                sudo su lightdm -s /bin/bash <<HERE
                /usr/bin/xset -dpms
                exit
                HERE


                Close the file



                Make the file executable:



                sudo chmod +x /usr/local/bin/dpms-stop


                At reboot it worked for me.






                share|improve this answer


























                  1












                  1








                  1






                  I found a solution from here https://askubuntu.com/a/543861/718511, though they wanted to do the reverse so it's slightly modified. Essentially a script is made to disable dpms and lightdm told to run it.



                  In /etc/lightdm/lightdm.conf.d/ make a file 50-dpms.conf:



                  sudo nano /etc/lightdm/lightdm.conf.d/50-dpms.conf


                  Add the lines



                  [SeatDefaults]
                  display-setup-script=/usr/local/bin/dpms-stop


                  Close the file



                  In /usr/local/bin/ create a file dpms-stop:



                  sudo nano /usr/local/bin/dpms-stop


                  Add the lines



                  #!/bin/sh
                  sudo xhost +si:localuser:lightdm # grants localuser rights to X session
                  sudo su lightdm -s /bin/bash <<HERE
                  /usr/bin/xset -dpms
                  exit
                  HERE


                  Close the file



                  Make the file executable:



                  sudo chmod +x /usr/local/bin/dpms-stop


                  At reboot it worked for me.






                  share|improve this answer














                  I found a solution from here https://askubuntu.com/a/543861/718511, though they wanted to do the reverse so it's slightly modified. Essentially a script is made to disable dpms and lightdm told to run it.



                  In /etc/lightdm/lightdm.conf.d/ make a file 50-dpms.conf:



                  sudo nano /etc/lightdm/lightdm.conf.d/50-dpms.conf


                  Add the lines



                  [SeatDefaults]
                  display-setup-script=/usr/local/bin/dpms-stop


                  Close the file



                  In /usr/local/bin/ create a file dpms-stop:



                  sudo nano /usr/local/bin/dpms-stop


                  Add the lines



                  #!/bin/sh
                  sudo xhost +si:localuser:lightdm # grants localuser rights to X session
                  sudo su lightdm -s /bin/bash <<HERE
                  /usr/bin/xset -dpms
                  exit
                  HERE


                  Close the file



                  Make the file executable:



                  sudo chmod +x /usr/local/bin/dpms-stop


                  At reboot it worked for me.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 31 at 10:30









                  kevinf

                  660511




                  660511










                  answered Aug 4 '17 at 11:33









                  JohanPI

                  317




                  317

























                      0














                      I had the same issue and found the solution in this forum thread. Setting the appropriate value using gsettings worked for me. Note that this needs to be set for the lightdm user, not for your own account or for root. Maybe this was your problem?



                      Here are the commands you need to run:



                      sudo su
                      su lightdm -s /bin/bash
                      dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
                      exit
                      exit


                      Note that this only disables sleep for the machine when on AC power. Since I am using a desktop machine, this was sufficient. If you also want to disable sleeping when on battery power, you also need to set the sleep-inactive-battery-timeout value to 0.



                      After your have run these commands, restart LightDM and you should be good to go.



                      sudo service lightdm restart





                      share|improve this answer


























                        0














                        I had the same issue and found the solution in this forum thread. Setting the appropriate value using gsettings worked for me. Note that this needs to be set for the lightdm user, not for your own account or for root. Maybe this was your problem?



                        Here are the commands you need to run:



                        sudo su
                        su lightdm -s /bin/bash
                        dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
                        exit
                        exit


                        Note that this only disables sleep for the machine when on AC power. Since I am using a desktop machine, this was sufficient. If you also want to disable sleeping when on battery power, you also need to set the sleep-inactive-battery-timeout value to 0.



                        After your have run these commands, restart LightDM and you should be good to go.



                        sudo service lightdm restart





                        share|improve this answer
























                          0












                          0








                          0






                          I had the same issue and found the solution in this forum thread. Setting the appropriate value using gsettings worked for me. Note that this needs to be set for the lightdm user, not for your own account or for root. Maybe this was your problem?



                          Here are the commands you need to run:



                          sudo su
                          su lightdm -s /bin/bash
                          dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
                          exit
                          exit


                          Note that this only disables sleep for the machine when on AC power. Since I am using a desktop machine, this was sufficient. If you also want to disable sleeping when on battery power, you also need to set the sleep-inactive-battery-timeout value to 0.



                          After your have run these commands, restart LightDM and you should be good to go.



                          sudo service lightdm restart





                          share|improve this answer












                          I had the same issue and found the solution in this forum thread. Setting the appropriate value using gsettings worked for me. Note that this needs to be set for the lightdm user, not for your own account or for root. Maybe this was your problem?



                          Here are the commands you need to run:



                          sudo su
                          su lightdm -s /bin/bash
                          dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
                          exit
                          exit


                          Note that this only disables sleep for the machine when on AC power. Since I am using a desktop machine, this was sufficient. If you also want to disable sleeping when on battery power, you also need to set the sleep-inactive-battery-timeout value to 0.



                          After your have run these commands, restart LightDM and you should be good to go.



                          sudo service lightdm restart






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 24 at 23:43









                          Chris

                          152314




                          152314






























                              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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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%2f942366%2fhow-to-disable-sleep-suspend-at-login-screen%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 did Captain America manage to do this?

                              迪纳利

                              南乌拉尔铁路局