Merge lp:~fferrai/elementaryos/fix-locking into lp:~elementary-os/elementaryos/os-patch-indicator-session-trusty-old

Proposed by Fabrizio Ferrai
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~fferrai/elementaryos/fix-locking
Merge into: lp:~elementary-os/elementaryos/os-patch-indicator-session-trusty-old
Diff against target: 79 lines (+37/-0)
5 files modified
debian/control (+4/-0)
debian/install (+2/-0)
debian/postinst (+1/-0)
light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop (+7/-0)
light-locker-dbus-screenlock/light-locker-dbus-screenlock.py (+23/-0)
To merge this branch: bzr merge lp:~fferrai/elementaryos/fix-locking
Reviewer Review Type Date Requested Status
elementary OS team Pending
Review via email: mp+230560@code.launchpad.net

Description of the change

Fix locking, by adding a python script that emulates a dbus interface for light-locker.

To post a comment you must log in.
lp:~fferrai/elementaryos/fix-locking updated
5. By Fabrizio Ferrai

Add dependencies and conflicts.

Revision history for this message
Cody Garver (codygarver) wrote :

create debian/postinst that contains the symlink command

lp:~fferrai/elementaryos/fix-locking updated
6. By Fabrizio Ferrai

Add symlink to implement gnome-screensaver-command functionality.

Revision history for this message
Cameron Norman (cameronnemo) wrote :

This seems unnecessarily roundabout. Why not just run the light-locker-command from where the gnome-screensaver lock command is issued? That would work on light-locker and gnome-screensaver systems alike. The C code would look like so:

if (system("light-locker-command -l")) {
    /* On a light-locker system, and we just locked it */
} else {
    /* On a gnome-screensaver system */
    /* do gnome-screensaver stuff that was done previously */
}

I could put together something tomorrow if you guys think it is a better/simpler idea. Maybe if I actually called the dbus interface directly instead of went through light-locker-command, I could get something suitable for upstream inclusion, but I do not really like GObject C (which I would need to use for gdbus), so I can not say that I will be able to do it soon (however the logic and architecture would be the same).

Revision history for this message
Cameron Norman (cameronnemo) wrote :

I should clarify that I am talking about adding a little code to the actual indicator-session source.

Revision history for this message
Cody Garver (codygarver) wrote :

Cameron, that's exactly what we need. I just imported light-locker 1.5 to Freya and it "Added DBus interface to communicate with the running light-locker", so that would be perfect.

Unmerged revisions

6. By Fabrizio Ferrai

Add symlink to implement gnome-screensaver-command functionality.

5. By Fabrizio Ferrai

Add dependencies and conflicts.

4. By Fabrizio Ferrai

Fix the locking wiring between gnome screensaver and light-locker
with a python middleware that emulates a dbus light-locker interface.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-04-03 17:08:08 +0000
3+++ debian/control 2014-08-13 21:41:46 +0000
4@@ -26,6 +26,9 @@
5 systemd-services,
6 gnome-settings-daemon-schemas,
7 gsettings-desktop-schemas,
8+ python,
9+ light-locker,
10+ dbus,
11 Recommends: indicator-applet (>= 0.2) | indicator-renderer,
12 gnome-screensaver,
13 yelp,
14@@ -33,6 +36,7 @@
15 unity-control-center-signon | gnome-control-center-signon
16 Suggests: lightdm,
17 zenity
18+Conflicts: gnome-screensaver
19 Description: indicator showing session management, status and user switching
20 This indicator is designed to be placed on the right side of a panel and
21 give the user easy control for changing their instant message status.
22
23=== added file 'debian/install'
24--- debian/install 1970-01-01 00:00:00 +0000
25+++ debian/install 2014-08-13 21:41:46 +0000
26@@ -0,0 +1,2 @@
27+light-locker-dbus-screenlock/light-locker-dbus-screenlock.py /usr/bin/
28+light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop /etc/xdg/autostart/
29\ No newline at end of file
30
31=== added file 'debian/postinst'
32--- debian/postinst 1970-01-01 00:00:00 +0000
33+++ debian/postinst 2014-08-13 21:41:46 +0000
34@@ -0,0 +1,1 @@
35+ln -s /usr/bin/light-locker-command /usr/bin/gnome-screensaver-command
36\ No newline at end of file
37
38=== added directory 'light-locker-dbus-screenlock'
39=== added file 'light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop'
40--- light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop 1970-01-01 00:00:00 +0000
41+++ light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop 2014-08-13 21:41:46 +0000
42@@ -0,0 +1,7 @@
43+[Desktop Entry]
44+Type=Application
45+Name=Light-locker DBus Screenlock
46+Comment=Replace gnome-screensaver DBus service to call light-locker
47+TryExec=light-locker-dbus-screenlock.py
48+Exec=light-locker-dbus-screenlock.py
49+NotShownIn=Gnome;Unity
50\ No newline at end of file
51
52=== added file 'light-locker-dbus-screenlock/light-locker-dbus-screenlock.py'
53--- light-locker-dbus-screenlock/light-locker-dbus-screenlock.py 1970-01-01 00:00:00 +0000
54+++ light-locker-dbus-screenlock/light-locker-dbus-screenlock.py 2014-08-13 21:41:46 +0000
55@@ -0,0 +1,23 @@
56+#!/usr/bin/env python
57+# Replace gnome-screensaver DBus service to call light-locker
58+# http://ubuntuforums.org/showthread.php?t=1865593&s=1c7f28c50a3f258e1d3404e41f098a0b&p=11418175#post11418175
59+
60+import dbus
61+import dbus.service
62+import dbus.glib
63+import gobject
64+import subprocess
65+
66+class ScreenDbusObj(dbus.service.Object):
67+ def __init__(self):
68+ session_bus = dbus.SessionBus()
69+ bus_name=dbus.service.BusName("org.gnome.ScreenSaver",bus=session_bus)
70+ dbus.service.Object.__init__(self,bus_name, '/org/gnome/ScreenSaver')
71+
72+ @dbus.service.method("org.gnome.ScreenSaver")
73+ def Lock(self):
74+ subprocess.Popen(['light-locker-command', '-l'])
75+
76+if __name__ == '__main__':
77+ object=ScreenDbusObj()
78+ gobject.MainLoop().run()
79\ No newline at end of file

Subscribers

People subscribed via source and target branches