Skip to content

Commit

Permalink
Changed gksu to pkexec root prompt dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
neumann89 committed May 24, 2015
1 parent 6800552 commit 5cf350e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Shutdown your device after a specific time. This extension adds a submenu to the
There is a settings menu where you can change the following:
* Maximum timer value
* Slider position
* Root mode: Uses "gksu shutdown" command instead of default GNOME shutdown dialog. If monitor turns off while shutdown timer is running, then default timer in rootless mode gets interrupted.
With root mode activated this can not happen, but you have to enter the root password. Make sure "gksu" is installed.
* Root mode: Uses "pkexec shutdown" command instead of default GNOME shutdown dialog. If monitor turns off while shutdown timer is running, then default timer in rootless mode gets interrupted.
With root mode activated this can not happen, but you have to enter the root password.

Binary file modified ShutdownTimer@neumann/locale/de/LC_MESSAGES/ShutdownTimer.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions ShutdownTimer@neumann/locale/de/LC_MESSAGES/ShutdownTimer.po
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ msgid "Slider position (in % from 0 to 100)"
msgstr "Schieberegler Position (in % von 0 bis 100)"

#: prefs.js:70
msgid "Root mode (uses 'gksu' and 'shutdown' command,\nno interruption of timer, but needs root password)"
msgstr "Root Modus (verwendet den 'gksu' und 'shutdown' Befehl,\nkeine Unterbrechung der Ausschaltuhr möglich, aber benötigt das Root-Passwort)"
msgid "Root mode (uses 'pkexec shutdown' command,\nno interruption of timer, but needs root password)"
msgstr "Root Modus (verwendet den 'pkexec shutdown' Befehl,\nkeine Unterbrechung der Ausschaltuhr möglich, aber benötigt das Root-Passwort)"

2 changes: 1 addition & 1 deletion ShutdownTimer@neumann/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const ShutdownTimerPrefsWidget = new GObject.Class({

this.add(new Gtk.Label({ label: '', halign: Gtk.Align.START }));

this.add(new Gtk.Label({ label: '<b>' + _("Root mode (uses 'gksu' and 'shutdown' command,\nno interruption of timer, but needs root password)") + '</b>',
this.add(new Gtk.Label({ label: '<b>' + _("Root mode (uses 'pkexec shutdown' command,\nno interruption of timer, but needs root password)") + '</b>',
use_markup: true,
halign: Gtk.Align.START }));
let rootMode = settings.get_boolean('root-mode-value');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key type="b" name="root-mode-value">
<default>false</default>
<summary>Root mode</summary>
<description>Set root mode on/off. In root mode powering off is done via 'gksu' and 'shutdown' commandline command.</description>
<description>Set root mode on/off. In root mode powering off is done via 'pkexec' and 'shutdown' terminal command.</description>
</key>

</schema>
Expand Down
4 changes: 3 additions & 1 deletion ShutdownTimer@neumann/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const Timer = new Lang.Class({
this._timerId = Mainloop.timeout_add_seconds(1, Lang.bind(this, this._timerCallback));
this._menuLabel.text = this._timerValue.toString() + ' ' + _("min till shutdown");
} else {
Util.spawnCommandLine('gksu "shutdown -h ' + this._timerValue+ '"');
let pkexec_path = GLib.find_program_in_path('pkexec');
let shutdown_path = GLib.find_program_in_path('shutdown');
Util.spawnCommandLine(pkexec_path + " " + shutdown_path + " -h " + this._timerValue);
}
}
},
Expand Down

0 comments on commit 5cf350e

Please sign in to comment.