#!/usr/bin/env bash
cat /lib/systemd/system-sleep/firefox.sleep
```bash
TARGET="firefox-bin"
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SLEEP=10
case $1 in
post)
sleep ${SLEEP}
ps aux | grep "${TARGET}" | awk '{print $2}' | xargs kill -9
sleep 2
sudo -u user bash -c "${TARGET} >/dev/null 2>&1"
;;
esac
Но не запускается ${TARGET}. Запускаю вручную
#sudo -u user "firefox-bin"
Error: no DISPLAY environment variable specified
#export DISPLAY=localhost:0.0
#sudo -u user "firefox-bin"
Error: cannot open display: localhost:0.0
#xauth list
gentoo-home/unix:0 MIT-MAGIC-COOKIE-1 9zb4af29186ec464214bz08db7a076d2
Как правильно прокинуть DISPLAY в root?