From 4539f742fc14012663ac4719f8bc3b82421447cd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Aug 2018 00:38:16 +0800 Subject: [PATCH] Add install hook to replace xflock4 --- hooks/ebuild_install_post/xflock4.bash | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 hooks/ebuild_install_post/xflock4.bash diff --git a/hooks/ebuild_install_post/xflock4.bash b/hooks/ebuild_install_post/xflock4.bash new file mode 100644 index 0000000..bfd0260 --- /dev/null +++ b/hooks/ebuild_install_post/xflock4.bash @@ -0,0 +1,31 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" + +if [[ "${CATEGORY}/${PN}" == "xfce-base/xfce4-session" ]] ; then + elog "Replacing /usr/$(exhost --target)/bin/xflock4!" + + cat << EOF > "${IMAGE}"/usr/$(exhost --target)/bin/xflock4 +#!/bin/sh + +PATH=/bin:/usr/bin +export PATH + +# else run another access locking utility, if installed +for lock_cmd in \ + "i3lock -c 000000" + do + set -- \$lock_cmd + if command -v -- \$1 >/dev/null 2>&1; then + \$lock_cmd >/dev/null 2>&1 & + # turn off display backlight: + xset dpms force off + exit + fi +done + +# else access locking failed +exit 1 +EOF + +fi