gdm: add a power button
Making users have to log in to power off the machine isn't a good idea. This commit adds a power menu similar to the one in the fallback greeter which offers 3 items: - Suspend - Restart - Power off https://bugzilla.gnome.org/show_bug.cgi?id=657822
This commit is contained in:
32
js/gdm/consoleKit.js
Normal file
32
js/gdm/consoleKit.js
Normal file
@ -0,0 +1,32 @@
|
||||
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
|
||||
|
||||
const DBus = imports.dbus;
|
||||
|
||||
const ConsoleKitManagerIface = {
|
||||
name: 'org.freedesktop.ConsoleKit.Manager',
|
||||
methods: [{ name: 'CanRestart',
|
||||
inSignature: '',
|
||||
outSignature: 'b' },
|
||||
{ name: 'CanStop',
|
||||
inSignature: '',
|
||||
outSignature: 'b' },
|
||||
{ name: 'Restart',
|
||||
inSignature: '',
|
||||
outSignature: '' },
|
||||
{ name: 'Stop',
|
||||
inSignature: '',
|
||||
outSignature: '' }]
|
||||
};
|
||||
|
||||
function ConsoleKitManager() {
|
||||
this._init();
|
||||
};
|
||||
|
||||
ConsoleKitManager.prototype = {
|
||||
_init: function() {
|
||||
DBus.system.proxifyObject(this,
|
||||
'org.freedesktop.ConsoleKit',
|
||||
'/org/freedesktop/ConsoleKit/Manager');
|
||||
}
|
||||
};
|
||||
DBus.proxifyPrototype(ConsoleKitManager.prototype, ConsoleKitManagerIface);
|
Reference in New Issue
Block a user