From de5791ddb42d5b609b6b2d2e0c03f6524f12647c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 8 Oct 2018 11:16:26 +0200 Subject: Reimplement i3lock script handling Now there is central package for my specific i3lock script and pm trigger. Package background-lnxpcs is not solely for images and background. --- x11-misc/myi3lock/files/myi3lock | 12 ++++++++++++ x11-misc/myi3lock/files/pm-utils-lock | 13 +++++++++++++ x11-misc/myi3lock/myi3lock-1.0-r1.ebuild | 22 ++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100755 x11-misc/myi3lock/files/myi3lock create mode 100755 x11-misc/myi3lock/files/pm-utils-lock create mode 100644 x11-misc/myi3lock/myi3lock-1.0-r1.ebuild (limited to 'x11-misc') diff --git a/x11-misc/myi3lock/files/myi3lock b/x11-misc/myi3lock/files/myi3lock new file mode 100755 index 0000000..f466def --- /dev/null +++ b/x11-misc/myi3lock/files/myi3lock @@ -0,0 +1,12 @@ +#!/bin/sh +BACKS="/usr/share/backgrounds" + +# Set pidgin to offline +purple-remote 'setstatus?status=offline' +# Run lock in background and when unlocked switch pidgin back to online +nohup /bin/sh -ec " +i3lock -n -c 000000 -i $(shuf -n1 -e "$BACKS"/*) +purple-remote 'setstatus?status=available' +" >/dev/null 2>&1 & +# Power off screen +xset dpms force off diff --git a/x11-misc/myi3lock/files/pm-utils-lock b/x11-misc/myi3lock/files/pm-utils-lock new file mode 100755 index 0000000..901b1b1 --- /dev/null +++ b/x11-misc/myi3lock/files/pm-utils-lock @@ -0,0 +1,13 @@ +#!/bin/sh +# +# 10sleep: lock i3 season before suspend + +case "$1" in + hibernate|suspend) + for socket in $(find /run/user/*/i3 /tmp/i3-* -name ipc-socket\* 2>/dev/null); do + i3-msg -s $socket "exec myi3lock" + done + ;; + *) exit $NA + ;; +esac diff --git a/x11-misc/myi3lock/myi3lock-1.0-r1.ebuild b/x11-misc/myi3lock/myi3lock-1.0-r1.ebuild new file mode 100644 index 0000000..89dc0b0 --- /dev/null +++ b/x11-misc/myi3lock/myi3lock-1.0-r1.ebuild @@ -0,0 +1,22 @@ +EAPI=7 + +DESCRIPTION="Script calling i3lock used to automate some tasks on lock" +HOMEPAGE="https://git.cynerd.cz" + +LICENSE="GPL-3.0+" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + x11-misc/i3lock + x11-themes/background-lnxpcs + sys-power/pm-utils + x11-wm/i3" +BDEPEND="" + +src_install() { + dobin "${FILESDIR}/myi3lock" + + exeinto /etc/pm/sleep.d + newexe "${FILESDIR}/pm-utils-lock" "10lock" +} -- cgit v1.2.3