Skip to content

Commit

Permalink
Adding light-locker-dbus-screenlock
Browse files Browse the repository at this point in the history
Based on xscreensaver-dbus-screenlock: calls light-locker in place
of gnome-screensaver lock (ie, from indicator-session).
  • Loading branch information
Que Quotion committed Aug 10, 2014
1 parent 098df8c commit e60cdd2
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
31 changes: 31 additions & 0 deletions EXTRAS/light-locker-dbus-screenlock/PKGBUILD
@@ -0,0 +1,31 @@
# Maintainer: Que Quotion <quequotion@bugmenot.com>

pkgname=light-locker-dbus-screenlock
pkgver=1
pkgrel=1
pkgdesc="Emulate's gnome-screensaver's dbus for screen locking with gnome DE's"
arch=('i686' 'x86_64')
url="http://ubuntuforums.org/showthread.php?t=1865593&s=1c7f28c50a3f258e1d3404e41f098a0b&p=11418175#post11418175"
license=('GPL')
depends=('light-locker' 'python' 'dbus')
optdepends=('indicator-session: Lock without gnome-screensaver or Unity')
provides=('gnome-screensaver')
conflicts=('gnome-screensaver')
install=${pkgname}.install
source=('light-locker-dbus-screenlock.py'
'light-locker-dbus-screenlock.desktop')
md5sums=('4bf71f9f23255d3b2a65473011040448'
'2190f3207bec78776b7563e2ea4e1c2b')

package() {

# Don't install light-locker-dbus-screenlock.py script if user has a personalized copy
if [ ! -f "/usr/local/sbin/light-locker-dbus-screenlock.py" ]; then
install -Ddm755 "${pkgdir}/usr/bin/"
install -Dm755 "${srcdir}/light-locker-dbus-screenlock.py" "${pkgdir}/usr/bin/"
fi

install -Ddm755 "${pkgdir}/etc/xdg/autostart/"
install -Dm644 "${srcdir}/light-locker-dbus-screenlock.desktop" "${pkgdir}/etc/xdg/autostart/"

}
@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=Light-locker DBus Screenlock
Comment=Replace gnome-screensaver DBus service to call light-locker
TryExec=light-locker-dbus-screenlock.py
Exec=light-locker-dbus-screenlock.py
NotShownIn=Gnome;Unity
@@ -0,0 +1,12 @@
post_install() {
ln -s /usr/bin/light-locker-command usr/bin/gnome-screensaver-command
}

post_upgrade() {
post_install
}

post_remove() {
rm usr/bin/gnome-screensaver-command
}

@@ -0,0 +1,24 @@
#!/usr/bin/env python
# Replace gnome-screensaver DBus service to call light-locker
# http://ubuntuforums.org/showthread.php?t=1865593&s=1c7f28c50a3f258e1d3404e41f098a0b&p=11418175#post11418175

import dbus
import dbus.service
import dbus.glib
import gobject
import subprocess

class ScreenDbusObj(dbus.service.Object):
def __init__(self):
session_bus = dbus.SessionBus()
bus_name=dbus.service.BusName("org.gnome.ScreenSaver",bus=session_bus)
dbus.service.Object.__init__(self,bus_name, '/org/gnome/ScreenSaver')

@dbus.service.method("org.gnome.ScreenSaver")
def Lock(self):
subprocess.Popen(['light-locker-command', '-l'])


if __name__ == '__main__':
object=ScreenDbusObj()
gobject.MainLoop().run()

0 comments on commit e60cdd2

Please sign in to comment.