summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2019-03-23 13:01:00 +0100
committersegfault <segfault@riseup.net>2019-03-23 16:53:01 +0100
commit16581fb1b7292993db43a2212bb2a97d8a4e86ed (patch)
treeb05c8c7daf276b783bec5467d4e3b391a5daa4f0
parent8de80aca8343bc6cadbcbbbeff056341af167429 (diff)
Add suspend button to status-menu-helper (refs: #14556)
-rw-r--r--config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js b/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js
index a68f7c7..973ff5d 100644
--- a/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js
+++ b/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js
@@ -80,6 +80,9 @@ const Extension = new Lang.Class({
this._poweroffButton = this.statusMenu._createActionButton('system-shutdown-symbolic', _("Power Off"));
this._poweroffButtonId = this._poweroffButton.connect('clicked', Lang.bind(this, this._onPowerOffClicked));
+
+ this._suspendButton = this.statusMenu._createActionButton('media-playback-pause-symbolic', _("Suspend"));
+ this._suspendButtonId = this._suspendButton.connect('clicked', Lang.bind(this, this._onSuspendClicked));
},
_removeAltSwitcher: function() {
@@ -92,6 +95,7 @@ const Extension = new Lang.Class({
_addSeparateButtons: function() {
this.statusMenu._actionsItem.actor.add(this._lockScreenButton, { expand: true, x_fill: false });
+ this.statusMenu._actionsItem.actor.add(this._suspendButton, { expand: true, x_fill: false });
this.statusMenu._actionsItem.actor.add(this._restartButton, { expand: true, x_fill: false });
this.statusMenu._actionsItem.actor.add(this._poweroffButton, { expand: true, x_fill: false });
},
@@ -112,6 +116,11 @@ const Extension = new Lang.Class({
this._lockScreenButtonId = 0;
}
+ if (this._suspendButtonId) {
+ this._suspendButton.disconnect(this._suspendButtonId);
+ this._suspendButtonId = 0;
+ }
+
if (this._restartButton) {
this._restartButton.destroy();
this._restartButton = 0;
@@ -126,6 +135,11 @@ const Extension = new Lang.Class({
this._lockScreenButton.destroy();
this._lockScreenButton = 0;
}
+
+ if (this._suspendButton) {
+ this._suspendButton.destroy();
+ this._suspendButton = 0;
+ }
},
_onPowerOffClicked: function() {
@@ -142,6 +156,10 @@ const Extension = new Lang.Class({
Util.spawn(['tails-screen-locker']);
},
+ _onSuspendClicked: function() {
+ Util.spawn(['systemctl', 'suspend'])
+ },
+
_sessionUpdated: function() {
this._lockScreenButton.setSensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
},