Scripts launched from udev do not have DISPLAY access anymore?

后端 未结 5 937
慢半拍i
慢半拍i 2020-12-16 00:38

I have a script that runs from udev when I plug in my external drive. It always worked. But after upgrading from Linux 3.8/Xorg 1.12/Mint 14 (<

5条回答
  •  失恋的感觉
    2020-12-16 01:01

    I had to use this in Kali Linux 2016 to get it to work:

    #!/bin/bash
    set -x
    xhost local:root
    export DISPLAY=:0.0
    su root -c 'zenity --notification --text="I am a notification!"'
    

提交回复
热议问题