Re: How to set a button setting via extension?
- From: Bazon Bloch <bazonbloch arcor de>
- To: Clemens <clemens lab21 org>
- Cc: gnome-shell-list <gnome-shell-list gnome org>
- Subject: Re: How to set a button setting via extension?
- Date: Sun, 17 Nov 2013 05:15:28 +0100
Sorry, I should have mentioned: Gnome-Shell 3.10
I know the extension you linked, but it is not 3.10 compatible.
Meanwhile, I found another solution:
Modding the example extension to suspend is really easy.
It's just:
const St =
imports.gi.St;
const Main = imports.ui.main;
const LoginManager = imports.misc.loginManager;
let button, loginManager;
loginManager = LoginManager.getLoginManager();
function _suspend() {
loginManager.suspend();
}
function init() {
button = new St.Bin({ style_class: 'panel-button',
reactive: true,
can_focus: true,
x_fill: true,
y_fill: false,
track_hover: true });
let icon = new St.Icon({ icon_name: 'media-playback-pause-symbolic',
style_class: 'system-status-icon' });
button.set_child(icon);
button.connect('button-press-event', _suspend);
}
function enable() {
Main.panel._rightBox.insert_child_at_index(button, 0);
}
function disable() {
Main.panel._rightBox.remove_child(button);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]