This repository has been archived by the owner on Dec 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Mystro256/gnome-shell-ext…
…ension-inhibit-applet into Mystro256-master Conflicts (file removed): [email protected]/metadata.json
- Loading branch information
Showing
24 changed files
with
231 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+549 Bytes
[email protected]/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
[email protected]/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+514 Bytes
[email protected]/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
[email protected]/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+523 Bytes
[email protected]/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
[email protected]/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+497 Bytes
[email protected]/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
[email protected]/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+518 Bytes
[email protected]/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
[email protected]/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+517 Bytes
[email protected]/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
[email protected]/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-258 Bytes
[email protected]/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.mo
Binary file not shown.
11 changes: 0 additions & 11 deletions
11
[email protected]/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.po
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-256 Bytes
[email protected]/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.mo
Binary file not shown.
11 changes: 0 additions & 11 deletions
11
[email protected]/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.po
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.