Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/" | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
EXTRAS/light-locker-dbus-screenlock/light-locker-dbus-screenlock.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
12 changes: 12 additions & 0 deletions
12
EXTRAS/light-locker-dbus-screenlock/light-locker-dbus-screenlock.install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
EXTRAS/light-locker-dbus-screenlock/light-locker-dbus-screenlock.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |