diff --git a/README b/README deleted file mode 100644 index 600fe01..0000000 --- a/README +++ /dev/null @@ -1,32 +0,0 @@ -Have you been annoyed by gnome 3 turning off your display while you were -trying to watch eg Youtube videos? No worries, you shall be helped :-) - -Gnome-Presentation-Mode is a tiny gnome-shell extension that adds a new -entry to the power indicator (the menu that opens when you click the -battery icon). While presentation mode is on the screensaver and the -automatic suspend will not kick in, allowing you to sit back and enjoy -whatever you are doing without having to wiggle the mouse every few -minutes. - - -Installation instructions: Just clone the repo, copy the extension to -your gnome-shell extensions directory and restart gnome-shell (default: -alt+f2, type r, press enter). - -git clone https://github.com/RaphaelKimmig/Gnome-Presentation-Mode.git - -cd Gnome-Presentation-Mode - -mkdir -p ~/.local/share/gnome-shell/extensions/ - -cp -r presentationmode@ampad.de ~/.local/share/gnome-shell/extensions/ - - - -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..27d555b --- /dev/null +++ b/README.md @@ -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 "inhibit-applet@alexjnewt.hotmail.com" 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 diff --git a/Screenshot.png b/Screenshot.png new file mode 100644 index 0000000..92670d6 Binary files /dev/null and b/Screenshot.png differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/extension.js b/inhibit-applet@alexjnewt.hotmail.com/extension.js new file mode 100644 index 0000000..2284728 --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/extension.js @@ -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(); +} diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo b/inhibit-applet@alexjnewt.hotmail.com/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo new file mode 100644 index 0000000..07e318f Binary files /dev/null and b/inhibit-applet@alexjnewt.hotmail.com/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po b/inhibit-applet@alexjnewt.hotmail.com/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po new file mode 100644 index 0000000..5a9c1f8 --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/locale/de/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po @@ -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 \n" +"Language-Team: Christian Schramm \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" + diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo b/inhibit-applet@alexjnewt.hotmail.com/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo new file mode 100644 index 0000000..5cc6271 Binary files /dev/null and b/inhibit-applet@alexjnewt.hotmail.com/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po b/inhibit-applet@alexjnewt.hotmail.com/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po new file mode 100644 index 0000000..ce52956 --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/locale/en/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po @@ -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 \n" +"Language-Team: Jeremy Newton \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" + diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo b/inhibit-applet@alexjnewt.hotmail.com/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo new file mode 100644 index 0000000..80dbd90 Binary files /dev/null and b/inhibit-applet@alexjnewt.hotmail.com/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po b/inhibit-applet@alexjnewt.hotmail.com/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po new file mode 100644 index 0000000..50346be --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/locale/fr/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po @@ -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 \n" +"Language-Team: Jeremy Newton \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" + diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo b/inhibit-applet@alexjnewt.hotmail.com/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo new file mode 100644 index 0000000..73cc163 Binary files /dev/null and b/inhibit-applet@alexjnewt.hotmail.com/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po b/inhibit-applet@alexjnewt.hotmail.com/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po new file mode 100644 index 0000000..5d2d585 --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/locale/he/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po @@ -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 \n" +"Language-Team: Lavi .A \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 "מנע השהייה" + diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo b/inhibit-applet@alexjnewt.hotmail.com/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo new file mode 100644 index 0000000..4376543 Binary files /dev/null and b/inhibit-applet@alexjnewt.hotmail.com/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po b/inhibit-applet@alexjnewt.hotmail.com/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po new file mode 100644 index 0000000..6bc2e9a --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/locale/it/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po @@ -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 \n" +"Language-Team: Jeremy Newton \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" + diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo b/inhibit-applet@alexjnewt.hotmail.com/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo new file mode 100644 index 0000000..66743ff Binary files /dev/null and b/inhibit-applet@alexjnewt.hotmail.com/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.mo differ diff --git a/inhibit-applet@alexjnewt.hotmail.com/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po b/inhibit-applet@alexjnewt.hotmail.com/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po new file mode 100644 index 0000000..e20fef5 --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/locale/pl/LC_MESSAGES/gnome-shell-extension-inhibitapplet.po @@ -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 \n" +"Language-Team: Jeremy Newton \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" + diff --git a/inhibit-applet@alexjnewt.hotmail.com/metadata.json b/inhibit-applet@alexjnewt.hotmail.com/metadata.json new file mode 100644 index 0000000..275a8ae --- /dev/null +++ b/inhibit-applet@alexjnewt.hotmail.com/metadata.json @@ -0,0 +1,8 @@ +{ +"shell-version": ["3.2","3.4"], +"uuid": "inhibit-applet@alexjnewt.hotmail.com", +"name": "Inhibit Applet", +"description": "Adds the ability to inhibit suspend/screensaver", +"url": "https://github.com/Mystro256/gnome-shell-extension-inhibit-applet", +"version": 5 +} diff --git a/presentationmode@ampad.de/stylesheet.css b/inhibit-applet@alexjnewt.hotmail.com/stylesheet.css similarity index 100% rename from presentationmode@ampad.de/stylesheet.css rename to inhibit-applet@alexjnewt.hotmail.com/stylesheet.css diff --git a/presentationmode@ampad.de/extension.js b/presentationmode@ampad.de/extension.js deleted file mode 100644 index ccfa92b..0000000 --- a/presentationmode@ampad.de/extension.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- 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 PopupMenu = imports.ui.popupMenu; -const GnomeSession = imports.misc.gnomeSession; -const UserMenu = imports.ui.userMenu; - -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -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); - -// Put your extension initialization code here -function init(extensionMeta) { - imports.gettext.bindtextdomain("gnome-shell-extension-presentationmode", - extensionMeta.path + "/locale"); - imports.gettext.textdomain("gnome-shell-extension-presentationmode"); -} - -function enable() { - let batteryMenu = Main.panel._statusArea.battery; - - batteryMenu._itemSeparator = new PopupMenu.PopupSeparatorMenuItem(); - batteryMenu.menu.addMenuItem(batteryMenu._itemSeparator); - batteryMenu._presentationswitch = new PopupMenu.PopupSwitchMenuItem(_("Presentation mode"), false); - batteryMenu.menu.addMenuItem(batteryMenu._presentationswitch); - batteryMenu._inhibit = undefined; - batteryMenu._sessionProxy = new SessionProxy(DBus.session, 'org.gnome.SessionManager', '/org/gnome/SessionManager'); - - batteryMenu._onInhibit = function(cookie) { - batteryMenu._inhibit = cookie; - }; - - batteryMenu._presentationswitch.connect('toggled', Lang.bind(batteryMenu, function() { - if(batteryMenu._inhibit) { - batteryMenu._sessionProxy.UninhibitRemote(batteryMenu._inhibit); - batteryMenu._inhibit = undefined; - } else { - try { - batteryMenu._sessionProxy.InhibitRemote("presentor", - 0, - "Presentation mode", - 9, - Lang.bind(batteryMenu, batteryMenu._onInhibit)); - } catch(e) { - // - } - } - })); -} - -function disable() { - let batteryMenu = Main.panel._statusArea.battery; - - batteryMenu._presentationswitch.destroy(); - batteryMenu._itemSeparator.destroy(); - if(batteryMenu._inhibit) { - batteryMenu._sessionProxy.UninhibitRemote(batteryMenu._inhibit); - batteryMenu._inhibit = undefined; - } -} diff --git a/presentationmode@ampad.de/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.mo b/presentationmode@ampad.de/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.mo deleted file mode 100644 index 4f8116d..0000000 Binary files a/presentationmode@ampad.de/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.mo and /dev/null differ diff --git a/presentationmode@ampad.de/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.po b/presentationmode@ampad.de/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.po deleted file mode 100644 index 44e4528..0000000 --- a/presentationmode@ampad.de/locale/de/LC_MESSAGES/gnome-shell-extension-presentationmode.po +++ /dev/null @@ -1,11 +0,0 @@ - -msgid "" -msgstr "Project-Id-Version: Gnome-Presentation-Mode git\n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=utf-8\n" - "Content-Transfer-Encoding: 8bit\n" - -#: extension.js:26 -msgid "Presentation mode" -msgstr "Präsentationsmodus" - diff --git a/presentationmode@ampad.de/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.mo b/presentationmode@ampad.de/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.mo deleted file mode 100644 index 2c888c7..0000000 Binary files a/presentationmode@ampad.de/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.mo and /dev/null differ diff --git a/presentationmode@ampad.de/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.po b/presentationmode@ampad.de/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.po deleted file mode 100644 index 17bc4e5..0000000 --- a/presentationmode@ampad.de/locale/en/LC_MESSAGES/gnome-shell-extension-presentationmode.po +++ /dev/null @@ -1,11 +0,0 @@ - -msgid "" -msgstr "Project-Id-Version: Gnome-Presentation-Mode git\n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=utf-8\n" - "Content-Transfer-Encoding: 8bit\n" - -#: extension.js:26 -msgid "Presentation mode" -msgstr "Presentation mode" - diff --git a/presentationmode@ampad.de/metadata.json b/presentationmode@ampad.de/metadata.json deleted file mode 100644 index 233dbe6..0000000 --- a/presentationmode@ampad.de/metadata.json +++ /dev/null @@ -1,7 +0,0 @@ -{ -"shell-version": ["3.2", "3.3", "3.4" ], -"uuid": "presentationmode@ampad.de", -"name": "Presentation mode", -"description": "Add a presentation mode toggle to the power menu.", -"url": "https://github.com/RaphaelKimmig/Gnome-Presentation-Mode" -}