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/16-kiosk-desktop

45 lines
1.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/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
## TODO Настройка desktop файлов
if [[ -n ${APPDESKTOP_WHITELIST[@]} ]]; then
for USER in "${!APPDESKTOP_WHITELIST[@]}"; do
true
done
fi
if [[ -n ${APPDESKTOP_BLACKLIST[@]} ]]; then
for USER in "${!APPDESKTOP_BLACKLIST[@]}"; do
if [[ ${USER} == "LOCAL" ]]; then
# for DESKTOP_FILE in $(tr ',;' '\n' <<< ${APPDESKTOP_BLACKLIST[${USER}]}); do
true
# done
elif [[ ${USER} == "GLOBAL" ]]; then
for DESKTOP_FILE in $(tr ',;' '\n' <<< ${APPDESKTOP_BLACKLIST[${USER}]}); do
if [[ ${DESKTOP_FILE} == "*" ]]; then
for DESKTOP_FILE_FIND in $(find /usr/share/applications/ /usr/share/local/applications/ /home/*/.local/share/applications/ -type f -iname "*.desktop"); do
DESKTOP_FILE_FIND_NAME=${DESKTOP_FILE_FIND##*/}; DESKTOP_FILE_FIND_NAME=${DESKTOP_FILE_FIND_NAME%.desktop}
#Нужно сравнить с белым списком, и то что в белом списке есть не удалить
# if [[ ${DESKTOP_FILE_FIND_NAME} ==
done
else
rm -f /usr/share/applications/${DESKTOP_FILE}.desktop
rm -f /usr/share/local/applications/${DESKTOP_FILE}.desktop
rm -f /home/*/.local/share/applications/${DESKTOP_FILE}.desktop
fi
done
else
true
fi
done
fi