You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ublinux-init/ublinux/rc.post.d/17-kiosk-gtk

36 lines
1.5 KiB

#!/usr/bin/env bash
ENABLED=yes
[[ ${ENABLED} != "yes" ]] && exit 0
DEBUGMODE=no
SOURCE=/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=/usr/lib/ublinux/os-config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/kiosk; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
XFCE4_LOGOUT_BUTTON=".xfsm-logout-buttons > box:first-child button:nth-child(1) { margin-left: -160px; margin-right: 160px; }"
## Настройка GTK3 для XFCE4
if [[ -n ${XFCE4_DIALOGPOWER_LOGOUT[@]} ]]; then
for SELECT_USERS in "${!XFCE4_DIALOGPOWER_LOGOUT[@]}"; do
USERS=$(cut -d: -f1 <<< ${SELECT_USERS} | tr " ,;" "\n")
# Выбрать пользователей из указанных групп %..
USERS_GROUP=$(grep "^%" <<< ${USERS} | tr -d "%" | xargs -rl getent group | cut -d: -f4 | tr "," "\n")
[[ ${USERS} == 0 ]] && USERS=$(ls -1 /home/ 2>/dev/null)
while read SELECT_USER; do
FILE_GTKCSS="/home/${SELECT_USER}/.config/gtk-3.0/gtk.css"
if [[ -d ${FILE_GTKCSS%/*} ]]; then
if [[ ${XFCE4_DIALOGPOWER_LOGOUT[${SELECT_USERS}],,} == "hide" ]]; then
grep -q "${XFCE4_LOGOUT_BUTTON}" ${FILE_GTKCSS} 2>/dev/null || echo "${XFCE4_LOGOUT_BUTTON}" >> ${FILE_GTKCSS}
else
sed "/${XFCE4_LOGOUT_BUTTON}/d" -i ${FILE_GTKCSS}
fi
fi
done < <(echo -e "$(grep -v "^%" <<< ${USERS})\n${USERS_GROUP}" | uniq)
done
fi