diff --git a/i3lock-icon.png b/i3lock-icon.png new file mode 100644 index 0000000..aee85c7 --- /dev/null +++ b/i3lock-icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba0ca359d5de4a7055ee9ad44b4b0b0d224521a21ea6c2974a7d579d1812f539 +size 30218 diff --git a/i3lock.changes b/i3lock.changes index 62f3e35..83a3275 100644 --- a/i3lock.changes +++ b/i3lock.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 20 15:36:04 UTC 2014 - seife+obs@b1-systems.com + +- add i3lock-xlock-compat package which provides /usr/bin/xlock + for drop-in replacement in e.g. xflock4 + ------------------------------------------------------------------- Mon Feb 17 08:01:39 UTC 2014 - seife+obs@b1-systems.com diff --git a/i3lock.spec b/i3lock.spec index a2f1f01..53355b9 100644 --- a/i3lock.spec +++ b/i3lock.spec @@ -29,6 +29,9 @@ License: BSD-3-Clause Group: System/GUI/Other Source: http://i3wm.org/i3lock/i3lock-%{version}.tar.bz2 Source1: i3lock.pam +# borrowed from gnome-icon-theme +Source2: i3lock-icon.png +Source3: xlock.sh # PATCH-FEATURE-OPENSUSE i3lock-2.5-use-unix2_chkpwd.diff -- seife+obs@b1-systems.com Patch1: i3lock-2.5-use-unix2_chkpwd.diff Url: http://i3wm.org/i3lock/ @@ -57,6 +60,17 @@ i3lock is a simple screen locker like slock. After starting it, you will see a white screen (you can configure the color/an image). You can return to your screen by entering your password. +%package xlock-compat +Summary: xlock-compatibility script which calls i3lock +Group: System/GUI/Other +Requires: ImageMagick +Conflicts: xlockmore + +%description xlock-compat +This package provides a script /usr/bin/xlock which calls i3lock to lock your screen. +This is handy for hard-coded screen-saver invocations e.g. in XFCE4, so you can use +i3lock instead of xlock with them. + %prep %setup -q %patch1 -p1 @@ -82,9 +96,17 @@ install -m0644 "%{SOURCE1}" "%{buildroot}%{_sysconfdir}/pam.d/%{name}" install -D -m0644 i3lock.1 "%{buildroot}%{_mandir}/man1/i3lock.1" +install -D -m0644 %{SOURCE2} %{buildroot}/usr/share/i3lock-xlock-compat/i3lock-icon.png +install -m0755 %{SOURCE3} %{buildroot}/%{_bindir}/xlock + %clean %{?buildroot:%__rm -rf "%{buildroot}"} +%files xlock-compat +%defattr(-,root,root) +%{_bindir}/xlock +/usr/share/i3lock-xlock-compat + %files %defattr(-,root,root) %doc CHANGELOG LICENSE README diff --git a/xlock.sh b/xlock.sh new file mode 100644 index 0000000..7a51c90 --- /dev/null +++ b/xlock.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +XY=$(xdpyinfo |awk '/dimensions:/{print $2;exit}') +CACHEFILE=${HOME}/.cache/xlock-sim/lock-$XY.png +ICON=/usr/share/i3lock-xlock-compat/i3lock-icon.png +if ! test -e $CACHEFILE || test $ICON -nt $CACHEFILE; then + install -d ${HOME}/.cache/xlock-sim + convert $ICON -background none -gravity center -extent $XY $CACHEFILE +fi +# not totally black, so that we can see something is happening even if convert failed +exec /usr/bin/i3lock -n -c 444444 -i $CACHEFILE