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.desktop/deonly/xfce4-screensaver-fix

25 lines
1.1 KiB

#!/bin/bash
ENABLED=yes
[[ ${ENABLED} == "yes" ]] || exit 0
#. /etc/ublinux/config
# Если не загружен ни один драйвер видео KMS, то xfce4-screensaver закрываем, т.к. не правильно отрабатывает блокировка
sleep 5
if pidof -qx xfce4-screensaver; then
if ! lspci -k | egrep -i -A 3 'VGA|3D' | grep -q 'Kernel driver in use:'; then
BLOBPS=$(ps -u $(id -u) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n')
DISPLAY=$(grep -m1 '^DISPLAY=' <<< "${BLOBPS}")
# XAUTHORITY=$(grep -m1 '^XAUTHORITY=' <<< "${BLOBPS}")
DBUS_SESSION_BUS_ADDRESS=$(grep -m1 '^DBUS_SESSION_BUS_ADDRESS=' <<< "${BLOBPS}")
# USER=$(cut -d/ -f3 <<< "${XAUTHORITY}")
# su -l ${USER} -c "${DISPLAY} ${XAUTHORITY} ${DBUS_SESSION_BUS_ADDRESS} xfce4-screensaver-command -i -r 'UBLinux fix: KMS video driver not loaded' &"
export ${DISPLAY}
export ${DBUS_SESSION_BUS_ADDRESS}
# xfce4-screensaver-command -i -r 'UBLinux fix: KMS video driver not loaded' &
xfce4-screensaver-command --exit
fi
fi