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
=== modified file 'debian/control'
--- debian/control 2014-04-03 17:08:08 +0000
+++ debian/control 2014-08-13 21:41:46 +0000
@@ -26,6 +26,9 @@
26 systemd-services,26 systemd-services,
27 gnome-settings-daemon-schemas,27 gnome-settings-daemon-schemas,
28 gsettings-desktop-schemas,28 gsettings-desktop-schemas,
29 python,
30 light-locker,
31 dbus,
29Recommends: indicator-applet (>= 0.2) | indicator-renderer,32Recommends: indicator-applet (>= 0.2) | indicator-renderer,
30 gnome-screensaver,33 gnome-screensaver,
31 yelp,34 yelp,
@@ -33,6 +36,7 @@
33 unity-control-center-signon | gnome-control-center-signon36 unity-control-center-signon | gnome-control-center-signon
34Suggests: lightdm,37Suggests: lightdm,
35 zenity38 zenity
39Conflicts: gnome-screensaver
36Description: indicator showing session management, status and user switching40Description: indicator showing session management, status and user switching
37 This indicator is designed to be placed on the right side of a panel and41 This indicator is designed to be placed on the right side of a panel and
38 give the user easy control for changing their instant message status. 42 give the user easy control for changing their instant message status.
3943
=== added file 'debian/install'
--- debian/install 1970-01-01 00:00:00 +0000
+++ debian/install 2014-08-13 21:41:46 +0000
@@ -0,0 +1,2 @@
1light-locker-dbus-screenlock/light-locker-dbus-screenlock.py /usr/bin/
2light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop /etc/xdg/autostart/
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'debian/postinst'
--- debian/postinst 1970-01-01 00:00:00 +0000
+++ debian/postinst 2014-08-13 21:41:46 +0000
@@ -0,0 +1,1 @@
1ln -s /usr/bin/light-locker-command /usr/bin/gnome-screensaver-command
0\ No newline at end of file2\ No newline at end of file
13
=== added directory 'light-locker-dbus-screenlock'
=== added file 'light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop'
--- light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop 1970-01-01 00:00:00 +0000
+++ light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop 2014-08-13 21:41:46 +0000
@@ -0,0 +1,7 @@
1[Desktop Entry]
2Type=Application
3Name=Light-locker DBus Screenlock
4Comment=Replace gnome-screensaver DBus service to call light-locker
5TryExec=light-locker-dbus-screenlock.py
6Exec=light-locker-dbus-screenlock.py
7NotShownIn=Gnome;Unity
0\ No newline at end of file8\ No newline at end of file
19
=== added file 'light-locker-dbus-screenlock/light-locker-dbus-screenlock.py'
--- light-locker-dbus-screenlock/light-locker-dbus-screenlock.py 1970-01-01 00:00:00 +0000
+++ light-locker-dbus-screenlock/light-locker-dbus-screenlock.py 2014-08-13 21:41:46 +0000
@@ -0,0 +1,23 @@
1#!/usr/bin/env python
2# Replace gnome-screensaver DBus service to call light-locker
3# http://ubuntuforums.org/showthread.php?t=1865593&s=1c7f28c50a3f258e1d3404e41f098a0b&p=11418175#post11418175
4
5import dbus
6import dbus.service
7import dbus.glib
8import gobject
9import subprocess
10
11class ScreenDbusObj(dbus.service.Object):
12 def __init__(self):
13 session_bus = dbus.SessionBus()
14 bus_name=dbus.service.BusName("org.gnome.ScreenSaver",bus=session_bus)
15 dbus.service.Object.__init__(self,bus_name, '/org/gnome/ScreenSaver')
16
17 @dbus.service.method("org.gnome.ScreenSaver")
18 def Lock(self):
19 subprocess.Popen(['light-locker-command', '-l'])
20
21if __name__ == '__main__':
22 object=ScreenDbusObj()
23 gobject.MainLoop().run()
0\ No newline at end of file24\ No newline at end of file

Subscribers

People subscribed via source and target branches