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.
- Loading branch information
0 parents
commit 2e9f2ef
Showing
4 changed files
with
79 additions
and
0 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,21 @@ | ||
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 menu. 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 in | ||
your gnome-shell extensions directory and restart gnome-shell (default: | ||
alt+f2, type r, press enter). | ||
|
||
git clone [email protected]: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/ |
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,50 @@ | ||
const DBus = imports.dbus; | ||
const Main = imports.ui.main; | ||
const Lang = imports.lang; | ||
const PopupMenu = imports.ui.popupMenu; | ||
|
||
const Gettext = imports.gettext.domain('gnome-shell'); | ||
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); | ||
|
||
function main(extensionMeta) { | ||
let Power = Main.Panel.STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION['battery']; | ||
|
||
Power.prototype.__init = Power.prototype._init; | ||
Power.prototype._init = function () { | ||
this.__init.apply(this, arguments); | ||
this._inhibit = undefined; | ||
this._sessionProxy = new SessionProxy(DBus.session, 'org.gnome.SessionManager', '/org/gnome/SessionManager'); | ||
this._presentationswitch = new PopupMenu.PopupSwitchMenuItem(_("Presentation mode"), false); | ||
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); | ||
this.menu.addMenuItem(this._presentationswitch); | ||
this._presentationswitch.connect('toggled', Lang.bind(this, function() { | ||
if(this._inhibit) { | ||
this._sessionProxy.UninhibitRemote(this._inhibit); | ||
this._inhibit = undefined; | ||
} else { | ||
try { | ||
this._sessionProxy.InhibitRemote("presentor", | ||
0, | ||
"Presentation mode", | ||
9, | ||
Lang.bind(this, this._onInhibit)); | ||
} catch(e) { | ||
// | ||
} | ||
} | ||
|
||
})); | ||
}; | ||
Power.prototype._onInhibit = function(cookie) { | ||
this._inhibit = cookie; | ||
}; | ||
}; |
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,7 @@ | ||
{ | ||
"shell-version": ["3.0.1"], | ||
"uuid": "[email protected]", | ||
"name": "Presentation mode", | ||
"description": "Add a presentation mode toggle to the power menu.", | ||
"url": "https://github.com/RaphaelKimmig/Gnome-Presentation-Mode" | ||
} |
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 @@ | ||
/* Example stylesheet */ |