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