Announcement

Collapse
No announcement yet.

How to shut down Kubuntu 16.04 from the keyboard?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to shut down Kubuntu 16.04 from the keyboard?

    Hi!

    In Kubuntu 16.04, when I press Ctrl+Alt+Del, I get a logout prompt. In order to shut down the computer instead of merely logging out, apparently I need to click a button in the right-hand corner with the mouse. I seem unable to change from "log out" to "shut down" using the keyboard - at least, arrow keys and tab do nothing.

    Is there a nice way to shut down without having to use mouse?

    Thanks a lot in advance!
    Spectrum

    #2
    I too am on Kubuntu 16.04 with kubuntu-backports enabled. I can, just by using the keyboard, get to the following screen.

    Press the super key and release.
    Use the down arrow to get to Power/Session.
    Use the right-arrow and then the down arrow to get to shutdown.

    I haven't pressed <enter> and so I don't know what will happen after that. I would expect to shutdown rather than be given a choice all over again. I don't want to shutdown now and so I'll try this later.
    Attached Files
    Kubuntu 20.04

    Comment


      #3
      You can also set a keyboard shortcut for shutting down (without confirmation)
      SystemSettings>KeyboardShortcuts>GlobalShortcuts> Select "ksmserver">Set shortcut for Shutdown without confirmation
      Last edited by kubicle; Nov 05, 2017, 01:44 AM.

      Comment


        #4
        sudo shutdown now

        Comment


          #5
          Originally posted by mr_raider View Post
          sudo shutdown now
          This is a rather bad way to shutdown from a desktop session.

          It will kill the desktop and it's running processes rather abruptly and prevent clean exit from the desktop, which may lead to data loss or other problems.

          Generally better to use the tools provided by the desktop in question, as they know how to exit the desktop gracefully (even if it takes a bit longer).

          Comment


            #6
            Originally posted by chimak111 View Post
            I too am on Kubuntu 16.04 with kubuntu-backports enabled. I can, just by using the keyboard, get to the following screen.

            Press the super key and release.
            Use the down arrow to get to Power/Session.
            Use the right-arrow and then the down arrow to get to shutdown.

            I haven't pressed <enter> and so I don't know what will happen after that. I would expect to shutdown rather than be given a choice all over again. I don't want to shutdown now and so I'll try this later.
            And that works exactly the way that using the mouse to make the same selection works. Y'all having mouse problems? Or just looking for alternatives?
            The next brick house on the left
            Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



            Comment


              #7
              Originally posted by kubicle View Post
              You can also set a keyboard shortcut for shutting down (without confirmation)
              SystemSettings>KeyboardShortcuts>GlobalShortcuts>S elect "ksmserver">Set shortcut for Shutdown without confirmation
              @kubicle, please confirm whether the code is Select "kmserver" or whether there's a space between "S" and "elect" because the latter is how I see the code on two different browsers. Could it be some smilie mischief?

              >S
              Kubuntu 20.04

              Comment


                #8
                Originally posted by jglen490 View Post
                And that works exactly the way that using the mouse to make the same selection works. Y'all having mouse problems? Or just looking for alternatives?
                My mouse is well-behaved but it's nice to know the alternative!

                For another 16.04 running an Openbox session, I had set Ctrl+Alt+` to trigger a shutdown without using sudo. That would run
                Code:
                dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
                (I also included a line for Zenity to ask for confirmation.)
                Kubuntu 20.04

                Comment


                  #9
                  Originally posted by chimak111 View Post
                  @kubicle, please confirm whether the code is Select "kmserver" or whether there's a space between "S" and "elect" because the latter is how I see the code on two different browsers. Could it be some smilie mischief?

                  >S
                  There wasn't a space there (even though the post showed one on my end as well), probably some bug in forum software...fixed it by putting a space between > and S. It seems to not be as simple as ">S" problem as it worked fine in ">Set shortcut" .
                  I have seem similar problems in some posts in the past, but not regularly.

                  Comment


                    #10
                    Originally posted by kubicle View Post
                    There wasn't a space there (even though the post showed one on my end as well), probably some bug in forum software...fixed it by putting a space between > and S. It seems to not be as simple as ">S" problem as it worked fine in ">Set shortcut" .
                    I have seem similar problems in some posts in the past, but not regularly.
                    Thanks for clarifying! I'll try out your shortcut tonight bound to Ctrl+Alt+`.
                    Kubuntu 20.04

                    Comment


                      #11
                      @kubicle, this is what I have in ~/.config/khotkeysrc
                      Code:
                      [Data_29]
                      Comment=Shutdown via keyboard
                      Enabled=true
                      Name=Shutdown
                      Type=SIMPLE_ACTION_DATA
                      
                      [Data_29Actions]
                      ActionsCount=1
                      
                      [Data_29Actions0]
                      CommandURL=Select "ksmserver"
                      Type=COMMAND_URL
                      
                      [Data_29Conditions]
                      Comment=
                      ConditionsCount=0
                      
                      [Data_29Triggers]
                      Comment=Simple_action
                      TriggersCount=1
                      
                      [Data_29Triggers0]
                      Key=Ctrl+Alt+`
                      Type=SHORTCUT
                      Uuid={e14b2908-c991-4a33-b309-75e9ab5d500f}
                      but there was no effect. I had to shutdown the normal way.
                      I misunderstood kubicle's post
                      Last edited by chimak111; Nov 06, 2017, 05:11 AM. Reason: strike-through
                      Kubuntu 20.04

                      Comment


                        #12
                        Originally posted by chimak111 View Post
                        @kubicle, this is what I have in ~/.config/khotkeysrc
                        Code:
                        [Data_29]
                        Comment=Shutdown via keyboard
                        Enabled=true
                        Name=Shutdown
                        Type=SIMPLE_ACTION_DATA
                        
                        [Data_29Actions]
                        ActionsCount=1
                        
                        [Data_29Actions0]
                        CommandURL=Select "ksmserver"
                        Type=COMMAND_URL
                        
                        [Data_29Conditions]
                        Comment=
                        ConditionsCount=0
                        
                        [Data_29Triggers]
                        Comment=Simple_action
                        TriggersCount=1
                        
                        [Data_29Triggers0]
                        Key=Ctrl+Alt+`
                        Type=SHORTCUT
                        Uuid={e14b2908-c991-4a33-b309-75e9ab5d500f}
                        but there was no effect. I had to shutdown the normal way.
                        Are you sure you are making changes in SystemSettings>KeyboardShortcuts>GlobalShortcuts> Select "ksmserver"
                        And not in
                        CustomShortcuts?

                        Global shortcuts should be saved in ~/.config/kglobalshortcutsrc

                        Comment


                          #13
                          Originally posted by kubicle View Post
                          Are you sure you are making changes in SystemSettings>KeyboardShortcuts>GlobalShortcuts> Select "ksmserver"
                          And not in
                          CustomShortcuts?

                          Global shortcuts should be saved in ~/.config/kglobalshortcutsrc
                          Stupid me I totally misread and misunderstood your instructions.

                          I'll fix that and try again tonight. Thanks!
                          Last edited by chimak111; Nov 06, 2017, 05:09 AM.
                          Kubuntu 20.04

                          Comment


                            #14
                            Thanks for the replies, all. I ended up just doing this: Go to System Settings -> Startup and Shutdown -> Desktop Session and set Default Leave Option to Turn off computer.

                            I can also do this (similar to what chimak111 suggested):

                            1. Alt+F1 to open K Menu.
                            2. Left arrow key to go to the tab Leave.
                            3. Up/down arrow keys to select an option.

                            Comment

                            Working...
                            X