Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…ension-inhibit-applet into Mystro256-master

Conflicts (file removed):
	[email protected]/metadata.json
  • Loading branch information
Mystro256 committed May 15, 2012
2 parents 7f4b1dc + d7dc0ae commit d691733
Show file tree
Hide file tree
Showing 24 changed files with 231 additions and 132 deletions.
32 changes: 0 additions & 32 deletions README

This file was deleted.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## About

Gnome Shell Extension Inhibit Applet is a gnome shell extension that gives you the ability to inhibit auto-suspend or screensaver from activating, simular to the original applet in gnome 2. It will add a new menu on the panel with a dynamically changing icon to allow the user to see if the inhibit applet is on without having to open the menu.

This was forked from Raphael Kimmig's Gnome-Presentation-Mode, in hopes to improve it and add more translations. I don't take an credit for the work that he has done on this extension so far.

![Screenshot](https://github.com/Mystro256/gnome-shell-extension-inhibit-applet/raw/master/Screenshot.png)

## Installation instructions:
Go onto https://extensions.gnome.org and find the extension. It's much easier to install it through that website than manually.
If you wish to install it manually, just copy the "[email protected]" folder into:
~/.local/share/gnome-shell/extensions


## Licensing, etc

Copyright (C) 2012, Jeremy Newton and
Copyright (C) 2011, Raphael Kimmig

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
Binary file added Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/* -*- mode: js2 - indent-tabs-mode: nil - js2-basic-offset: 4 -*- */
const DBus = imports.dbus;
const Lang = imports.lang;
const St = imports.gi.St;

const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const GnomeSession = imports.misc.gnomeSession;
const UserMenu = imports.ui.userMenu;

const Gettext = imports.gettext.domain('gnome-shell-extension-inhibitapplet');
const _ = Gettext.gettext;

const SessionIface = {
name: "org.gnome.SessionManager",
methods: [
{ name: "Inhibit", inSignature: "susu", outSignature: "u" },
{ name: "Uninhibit", inSignature: "u", outSignature: "" }
]
};

let SessionProxy = DBus.makeProxyClass(SessionIface);
let indicationmenu;

//Icon variables for easy editing/customization:
let DisabledIcon = 'preferences-desktop-screensaver-symbolic';
let EnabledIcon = 'system-run-symbolic';
////An alternative icon could be:
//let EnabledIcon = 'action-unavailable-symbolic';

function init(extensionMeta) {
imports.gettext.bindtextdomain("gnome-shell-extension-inhibitapplet",
extensionMeta.path + "/locale");
}

function InhibitMenu() {
this._init.apply(this, arguments);
}

function enable() {
indicationmenu = new InhibitMenu();
Main.panel.addToStatusArea('inhibit-menu', indicationmenu);
}

InhibitMenu.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,

_init: function() {
PanelMenu.SystemStatusButton.prototype._init.call(this, DisabledIcon);

//Add the Inhibit Option
this._inhibitswitch = new PopupMenu.PopupSwitchMenuItem(_("Inhibit Suspend"), false);
this.menu.addMenuItem(this._inhibitswitch);
this._inhibit = undefined;
this._sessionProxy = new SessionProxy(DBus.session, 'org.gnome.SessionManager', '/org/gnome/SessionManager');

this._onInhibit = function(cookie) {
this._inhibit = cookie;
};

this._inhibitswitch.connect('toggled', Lang.bind(this, function() {
if(this._inhibit) {
this._sessionProxy.UninhibitRemote(this._inhibit);
this._inhibit = undefined;
this.setIcon(DisabledIcon);
} else {
try {
this._sessionProxy.InhibitRemote("inhibitor",
0,
"inhibit mode",
9,
Lang.bind(this, this._onInhibit));
this.setIcon(EnabledIcon);
} catch(e) {
//
}
}
}));
},
};

function disable() {
indicationmenu.destroy();
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome Shell Extension Inhibit Applet\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Christian Schramm <[email protected]>\n"
"Language-Team: Christian Schramm <[email protected]>\n"
"X-Poedit-Language: German\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-Basepath: ../../../\n"
"X-Poedit-SearchPath-0: .\n"

#: extension.js:53
msgid "Inhibit Suspend"
msgstr "Bereitschaft verhindern"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome Shell Extension Inhibit Applet\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Jeremy Newton <[email protected]>\n"
"Language-Team: Jeremy Newton <[email protected]>\n"
"X-Poedit-Language: English\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-Basepath: ../../../\n"
"X-Poedit-SearchPath-0: .\n"

#: extension.js:53
msgid "Inhibit Suspend"
msgstr "Inhibit Suspend"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome Shell Extension Inhibit Applet\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Jeremy Newton <[email protected]>\n"
"Language-Team: Jeremy Newton <[email protected]>\n"
"X-Poedit-Language: French\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-Basepath: ../../../\n"
"X-Poedit-SearchPath-0: .\n"

#: extension.js:53
msgid "Inhibit Suspend"
msgstr "Inhiber la mise en veille"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome Shell Extension Inhibit Applet\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Lavi .A <[email protected]>\n"
"Language-Team: Lavi .A <[email protected]>\n"
"X-Poedit-Language: Hebrew\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-Basepath: ../../../\n"
"X-Poedit-SearchPath-0: .\n"

#: extension.js:53
msgid "Inhibit Suspend"
msgstr "מנע השהייה"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome Shell Extension Inhibit Applet\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Jeremy Newton <[email protected]>\n"
"Language-Team: Jeremy Newton <[email protected]>\n"
"X-Poedit-Language: Italian\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-Basepath: ../../../\n"
"X-Poedit-SearchPath-0: .\n"

#: extension.js:53
msgid "Inhibit Suspend"
msgstr "Sospendi Inibizione"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome Shell Extension Inhibit Applet\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Jeremy Newton <[email protected]>\n"
"Language-Team: Jeremy Newton <[email protected]>\n"
"X-Poedit-Language: Polish\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-Basepath: ../../../\n"
"X-Poedit-SearchPath-0: .\n"

#: extension.js:53
msgid "Inhibit Suspend"
msgstr "Wstrzymaj usypianie"

8 changes: 8 additions & 0 deletions [email protected]/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"shell-version": ["3.2","3.4"],
"uuid": "[email protected]",
"name": "Inhibit Applet",
"description": "Adds the ability to inhibit suspend/screensaver",
"url": "https://github.com/Mystro256/gnome-shell-extension-inhibit-applet",
"version": 5
}
File renamed without changes.
71 changes: 0 additions & 71 deletions [email protected]/extension.js

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

7 changes: 0 additions & 7 deletions [email protected]/metadata.json

This file was deleted.

0 comments on commit d691733

Please sign in to comment.