why zenity doesn't work with udev script?

35 Views Asked by At

i make this udev rule to ask me everytime i plug in a usb device if i want to authorize it

80-block-usb.rules

ACTION=="add", SUBSYSTEMS=="usb", RUN+="/usr/local/bin/usb-check.sh $env{DEVPATH}"

usb-check.sh

#!/bin/bash

devpath="$1" name="$2" export DISPLAY=:1

echo $devpath /bin/sh -c 'echo 0 > /sys'${devpath}'/authorized'
zenity --question --text='Do you want to authorize "'$name'"?' && /bin/sh -c 'echo 1 > /sys'${devpath}'/authorized' ```

when i plug in a device it doesn't get authorized (that's good) but there isn't the zenity popup

0

There are 0 best solutions below