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. --- profiles/desktop/x/packages | 3 +- sys-power/pm-i3lock/files/10lock | 13 ------- sys-power/pm-i3lock/pm-i3lock-1.0.ebuild | 18 --------- x11-misc/myi3lock/files/myi3lock | 12 ++++++ x11-misc/myi3lock/files/pm-utils-lock | 13 +++++++ x11-misc/myi3lock/myi3lock-1.0-r1.ebuild | 22 +++++++++++ .../background-lnxpcs-0.3-r1.ebuild | 38 +++++++++++++++++++ .../background-lnxpcs/background-lnxpcs-0.3.ebuild | 43 ---------------------- x11-themes/background-lnxpcs/files/i3lock-lnxpcs | 4 -- 9 files changed, 86 insertions(+), 80 deletions(-) delete mode 100755 sys-power/pm-i3lock/files/10lock delete mode 100644 sys-power/pm-i3lock/pm-i3lock-1.0.ebuild 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 create mode 100644 x11-themes/background-lnxpcs/background-lnxpcs-0.3-r1.ebuild delete mode 100644 x11-themes/background-lnxpcs/background-lnxpcs-0.3.ebuild delete mode 100755 x11-themes/background-lnxpcs/files/i3lock-lnxpcs diff --git a/profiles/desktop/x/packages b/profiles/desktop/x/packages index 3601a6d..1511065 100644 --- a/profiles/desktop/x/packages +++ b/profiles/desktop/x/packages @@ -1,7 +1,6 @@ # i3 x11-wm/i3 -sys-power/pm-i3lock -x11-themes/background-lnxpcs +x11-misc/myi3lock # My extensions x11-misc/xshot diff --git a/sys-power/pm-i3lock/files/10lock b/sys-power/pm-i3lock/files/10lock deleted file mode 100755 index 109dbfe..0000000 --- a/sys-power/pm-i3lock/files/10lock +++ /dev/null @@ -1,13 +0,0 @@ -#!/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 i3lock-lnxpcs" - done - ;; - *) exit $NA - ;; -esac diff --git a/sys-power/pm-i3lock/pm-i3lock-1.0.ebuild b/sys-power/pm-i3lock/pm-i3lock-1.0.ebuild deleted file mode 100644 index e8e9072..0000000 --- a/sys-power/pm-i3lock/pm-i3lock-1.0.ebuild +++ /dev/null @@ -1,18 +0,0 @@ -EAPI=6 - -DESCRIPTION="pm-utils hook to lock all i3 sessions on suspend" -HOMEPAGE="http://git.cynerd.cz/gentoo-personal-overlay/" -S="${WORKDIR}" - -LICENSE="GPL-3.0+" -SLOT="0" -KEYWORDS="amd64 x86" - -RDEPEND=" - x11-misc/i3lock - sys-power/pm-utils" - -src_install() { - exeinto /etc/pm/sleep.d - doexe "${FILESDIR}/10lock" -} 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" +} diff --git a/x11-themes/background-lnxpcs/background-lnxpcs-0.3-r1.ebuild b/x11-themes/background-lnxpcs/background-lnxpcs-0.3-r1.ebuild new file mode 100644 index 0000000..78c334a --- /dev/null +++ b/x11-themes/background-lnxpcs/background-lnxpcs-0.3-r1.ebuild @@ -0,0 +1,38 @@ +EAPI=7 + +DESCRIPTION="Background pictures from lnxpcs and relevant scripts" +HOMEPAGE="https://gitlab.com/jstpcs/lnxpcs" + +HASH="99cf0bdafe6d9c6e0554c422eddc3f7b7adf25c8" +SRC_URI="https://gitlab.com/jstpcs/lnxpcs/-/archive/${HASH}/lnxpcs-${HASH}.tar.gz -> ${PN}.tar.gz" +S="${WORKDIR}/lnxpcs-${HASH}" + +KEYWORDS="amd64" +LICENSE="GPL-3.0+" +SLOT="0" +IUSE="1440p" + +RDEPEND="media-gfx/feh[xinerama]" +BDEPEND="media-gfx/imagemagick[png]" + +WALLPAPERS="bash cron gcc gnu gnu-linux iptables kernel kill python root su sudo vim" + +src_compile() { + local resolution="1920 1080" + use 1440p && resolution="2560 1440" + + for img in $WALLPAPERS; do + ./makemywall $resolution "cards/black/$img-card-black.png" + done +} + +src_install() { + local resolution="1920x1080" + use 1440p && resolution="2560x1440" + + insinto "/usr/share/backgrounds" + for img in $WALLPAPERS; do + doins "$img-card-black-$resolution.png" + done + dobin "${FILESDIR}/i3background" +} diff --git a/x11-themes/background-lnxpcs/background-lnxpcs-0.3.ebuild b/x11-themes/background-lnxpcs/background-lnxpcs-0.3.ebuild deleted file mode 100644 index 511ee9d..0000000 --- a/x11-themes/background-lnxpcs/background-lnxpcs-0.3.ebuild +++ /dev/null @@ -1,43 +0,0 @@ -EAPI=6 - -DESCRIPTION="Background pictures from lnxpcs and relevant scripts" -HOMEPAGE="https://gitlab.com/jstpcs/lnxpcs" - -HASH="99cf0bdafe6d9c6e0554c422eddc3f7b7adf25c8" -SRC_URI="https://gitlab.com/jstpcs/lnxpcs/-/archive/${HASH}/lnxpcs-${HASH}.tar.gz -> ${PN}.tar.gz" -S="${WORKDIR}/lnxpcs-${HASH}" - -KEYWORDS="amd64" -LICENSE="GPL-3.0+" -SLOT="0" -IUSE="1440p" - -DEPENDS="media-gfx/imagemagick[png]" -RDEPEND=" - x11-misc/i3lock - media-gfx/feh[xinerama]" - -WALLPAPERS="bash cron gcc gnu gnu-linux iptables kernel kill python root su sudo vim" - -src_compile() { - local RESOL="1920 1080" - if use 1440p; then - RESOL="2560 1440" - fi - for IMG in $WALLPAPERS; do - ./makemywall $RESOL "cards/black/$IMG-card-black.png" - done -} - -src_install() { - local RES="1920x1080" - if use 1440p; then - RES="2560x1440" - fi - insinto "/usr/share/backgrounds" - for IMG in $WALLPAPERS; do - doins "$IMG-card-black-$RES.png" - done - dobin "${FILESDIR}/i3background" - dobin "${FILESDIR}/i3lock-lnxpcs" -} diff --git a/x11-themes/background-lnxpcs/files/i3lock-lnxpcs b/x11-themes/background-lnxpcs/files/i3lock-lnxpcs deleted file mode 100755 index 7584750..0000000 --- a/x11-themes/background-lnxpcs/files/i3lock-lnxpcs +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -BACKS="/usr/share/backgrounds" -i3lock -c 000000 -i $(shuf -n1 -e "$BACKS"/*) -xset dpms force off -- cgit v1.2.3