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.
43 lines
1.8 KiB
43 lines
1.8 KiB
#!/usr/bin/bash
|
|
#
|
|
# Author: Dmitry Razumov <asmeron@ublinux.com>
|
|
# Copyright (c) 2021-2025 UBLinux <support@ublinux.com>
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
#
|
|
|
|
ENABLED=yes
|
|
[[ ${ENABLED} == "yes" ]] || { return 0 2>/dev/null && return 0 || exit 0; }
|
|
DEBUGMODE=no
|
|
|
|
unset ROOTFS; [[ -d /usr/lib/ublinux ]] || ROOTFS=.
|
|
SOURCE=${ROOTFS}/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
|
|
SOURCE=${ROOTFS}/usr/lib/ublinux/default; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
|
|
debug_mode "$0" "$@"
|
|
|
|
SYSCONF="${ROOTFS}${SYSCONF}"
|
|
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
|