Add install hook to replace xflock4

This commit is contained in:
root 2018-08-15 00:38:16 +08:00
parent c1d780be2c
commit 4539f742fc
1 changed files with 31 additions and 0 deletions

View File

@ -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