Merge ubiquity:disable-screen-blanking-in-shell into ubiquity:master

Proposed by Iain Lane
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 9017a4dfc3b7ded03dec0312231f0f89d7101871
Merge reported by: Iain Lane
Merged at revision: 9017a4dfc3b7ded03dec0312231f0f89d7101871
Proposed branch: ubiquity:disable-screen-blanking-in-shell
Merge into: ubiquity:master
Diff against target: 55 lines (+26/-0)
2 files modified
ubiquity/frontend/gtk_ui.py (+24/-0)
ubiquity/gsettings.py (+2/-0)
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Ubuntu Installer Team Pending
Review via email: mp+362788@code.launchpad.net

Commit message

With the switch to GNOME Shell, we're no longer using GNOME Screensaver to handle blanking the screen. Setting the `idle-delay' to 0 disables this for Shell.

To post a comment you must log in.
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubiquity/frontend/gtk_ui.py b/ubiquity/frontend/gtk_ui.py
2index e63046c..c451e7b 100644
3--- a/ubiquity/frontend/gtk_ui.py
4+++ b/ubiquity/frontend/gtk_ui.py
5@@ -587,6 +587,29 @@ class Wizard(BaseFrontend):
6
7 gsettings.set(gs_schema, gs_key, gs_value)
8
9+ def disable_screen_blanking(self):
10+ gs_schema = 'org.gnome.desktop.session'
11+ gs_key = 'idle-delay'
12+ gs_previous = '%s/%s' % (gs_schema, gs_key)
13+ if gs_previous in self.gsettings_previous:
14+ return
15+
16+ gs_value = gsettings.get(gs_schema, gs_key)
17+ self.gsettings_previous[gs_previous] = gs_value
18+
19+ if gs_value:
20+ gsettings.set(gs_schema, gs_key, 0)
21+
22+ atexit.register(self.enable_screen_blanking)
23+
24+ def enable_screen_blanking(self):
25+ gs_schema = 'org.gnome.desktop.session'
26+ gs_key = 'idle-delay'
27+ gs_previous = '%s/%s' % (gs_schema, gs_key)
28+ gs_value = self.gsettings_previous[gs_previous]
29+
30+ gsettings.set(gs_schema, gs_key, gs_value)
31+
32 def disable_powermgr(self):
33 gs_schema = 'org.gnome.settings-daemon.plugins.power'
34 gs_key = 'active'
35@@ -738,6 +761,7 @@ class Wizard(BaseFrontend):
36
37 self.disable_volume_manager()
38 self.disable_screensaver()
39+ self.disable_screen_blanking()
40 self.disable_powermgr()
41
42 if 'UBIQUITY_ONLY' in os.environ:
43diff --git a/ubiquity/gsettings.py b/ubiquity/gsettings.py
44index 7f06f6e..7b1cced 100644
45--- a/ubiquity/gsettings.py
46+++ b/ubiquity/gsettings.py
47@@ -68,6 +68,8 @@ def get(schema, key, user=None):
48 # Parse ints
49 if value.isdigit():
50 return int(value)
51+ if value.startswith('uint32'): # uint32 100
52+ return int(value.split()[1])
53
54 # Parse booleans
55 if value == 'false':

Subscribers

People subscribed via source and target branches