and alternatively, script this via 'dbus-send' :

dbus-send --print-reply --session --dest=org.kde.ksmserver \
    /KSMServer org.kde.KSMServerInterface.logout \
        int32:${ShutdownConfirm} \
        int32:${ShutdownType} \
        int32:${ShutdownMode}
(See Below for enums for the Shutdown{Confirm,Type,Mode} values)

e.g.:
dbus-send --print-reply --session --dest=org.kde.ksmserver \
    /KSMServer org.kde.KSMServerInterface.logout \
        int32:0  int32:1  int32:2

will invoke a forced reboot immediately without prompting.

You can bind that to a key/combo as others have suggested.

btw, a developer going by the moniker 'nowardev' has some
interesting plasma stuff, including a better Logout widget scheme
than the plasma Lock/Logout widget.

Instead, use the plasma "Application Launcher" widget and only enable

    Switch User
    Save Session
    Lock Screen
    Restart
    Shut down
    Log out

icons in the "View" tab.  In options, specify to use the
Actions->'system-shutdown' icon. it's much nicer (IMHO) than using
the plasma Lock/Logout widget, though it doesn't change the
behavior of prompting/waiting 30 seconds (default), by itself.

--stephen
---------------------------------------------
For:

ShutdownConfirmDefault="-1"
ShutdownConfirmNo="0"
ShutdownConfirmYes="1"

ShutdownTypeDefault="-1"    # Select previous action or the default if it's the 
first time.
ShutdownTypeNone="0"        # Only log out.
ShutdownTypeReboot="1"      # Log out and reboot the machine.
ShutdownTypeHalt="2"        # Log out and halt the machine.
ShutdownTypeLogout="3"      # ? Same as ShutdownTypeNone/0 ?

ShutdownModeDefault="-1"    # Select previous mode or the default if it's the 
first time.
ShutdownModeSchedule="0"    # Schedule a shutdown (halt or reboot) for the time 
all active sessions have exited.
ShutdownModeTryNow="1"      # Shut down, if no sessions are active.
ShutdownModeForceNow="2"    # Force shutdown.
ShutdownModeInteractive="3" # Pop up a dialog asking the user what to do if 
sessions are still active.

# Default Operations
ShutdownConfirm=${ShutdownConfirmNo}
#ShutdownConfirm=${ShutdownConfirmYes}
#ShutdownMode=${ShutdownModeForceNow}
ShutdownMode=${ShutdownModeTryNow}
#ShutdownMode=${ShutdownModeSchedule}


This all gleaned from:
http://api.kde.org/4.4-api/kdebase-workspace-apidocs/libs/kworkspace/html/kworkspace_8h_source.html

--stephen
-- 
Stephen Dowdy  -  Systems Administrator  -  NCAR/RAL
303.497.2869   -  sdo...@ucar.edu        -  http://www.ral.ucar.edu/~sdowdy/

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

Reply via email to