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

Commit

Permalink
Rebranding to inhibit-applet and some fixes
Browse files Browse the repository at this point in the history
Fixed locale issues, also added french translation, new translations welcome.
  • Loading branch information
Mystro256 committed Feb 18, 2012
1 parent c54a201 commit ac6ed5e
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 59 deletions.
28 changes: 8 additions & 20 deletions README
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
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 Shell Extension Inhibit Applet is gnome shell extension that gives you the ability to inhibit suspend or screensaver, simular to the original applet in gnome 2. It will place a switch in the power menu if it's available, if not in in the a11y menu, or the usermenu if all else fails.

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.
This has been forked from Gnome-Presentation-Mode by Raphael Kimmig, and I don't take an credit for the work that he has done on this extension so far. I only wish to make it better.


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 [email protected] ~/.local/share/gnome-shell/extensions/

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

Copyright (C) 2012, Jeremy Newton

Forked from Gnome-Presentation-Mode by Raphael Kimmig:
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.
Expand Down
20 changes: 10 additions & 10 deletions [email protected]/extension.js → [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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 = imports.gettext.domain('gnome-shell-extension-inhibitapplet');
const _ = Gettext.gettext;

const SessionIface = {
Expand All @@ -25,9 +25,9 @@ function init(extensionMeta) {
//Default Value on batteryMenu, it maybe changed on enable()
batteryMenu = Main.panel._statusArea.battery;

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

function enable() {
Expand All @@ -48,27 +48,27 @@ function enable() {
{ //If all else is good, the battery menu is fine
batteryMenu = Main.panel._statusArea.battery;
}
//Add the Presentation mode Option
//Add the Inhibit Option
batteryMenu._itemSeparator = new PopupMenu.PopupSeparatorMenuItem();
batteryMenu.menu.addMenuItem(batteryMenu._itemSeparator);
batteryMenu._presentationswitch = new PopupMenu.PopupSwitchMenuItem(_("Presentation mode"), false);
batteryMenu.menu.addMenuItem(batteryMenu._presentationswitch);
batteryMenu._inhibitswitch = new PopupMenu.PopupSwitchMenuItem(_("Inhibit Suspend"), false);
batteryMenu.menu.addMenuItem(batteryMenu._inhibitswitch);
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() {
batteryMenu._inhibitswitch.connect('toggled', Lang.bind(batteryMenu, function() {
if(batteryMenu._inhibit) {
batteryMenu._sessionProxy.UninhibitRemote(batteryMenu._inhibit);
batteryMenu._inhibit = undefined;
} else {
try {
batteryMenu._sessionProxy.InhibitRemote("presentor",
batteryMenu._sessionProxy.InhibitRemote("inhibitor",
0,
"Presentation mode",
"inhibit mode",
9,
Lang.bind(batteryMenu, batteryMenu._onInhibit));
} catch(e) {
Expand All @@ -79,7 +79,7 @@ function enable() {
}

function disable() {
batteryMenu._presentationswitch.destroy();
batteryMenu._inhibitswitch.destroy();
batteryMenu._itemSeparator.destroy();
if(batteryMenu._inhibit) {
batteryMenu._sessionProxy.UninhibitRemote(batteryMenu._inhibit);
Expand Down
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:54
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:54
msgid "Inhibit Suspend"
msgstr "Inhiber la Pause"

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

Please sign in to comment.