joseluis / huion-linux-drivers

Linux user-space drivers for Huion Graphic Tablets
MIT License
168 stars 95 forks source link

Notifications won't display #46

Open lululock71 opened 4 years ago

lululock71 commented 4 years ago

Hi, I have no notifications displaying despite that I've activated the option in config.ini. I've checked the code, it should work. If I test the notification code in my terminal, it works. I tried to edit the code to use the Python implementation of libnotify but it doesn't work either. I'm under Arch with XFCE. I've installed all dependencies, I dunno if I'm missing something...

Lecraminos commented 4 years ago

Same here for Manjaro + DeepIn... I experimented a little and have the suspect that this is due to the execution of the script via sudo... Thus, notify-send is executed as another user than the one that your X is running for.

A quick&dirty workaround, which is user-specific in this raw form though, can be found in the Arch docs:

Replace the respective line in function keypress with: cmd='sudo -u <user_name> DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/<user_id>/bus notify-send "{}" "{}"'.format(title, sequence)

Feel free to replace the user info with dynamic expressions. This may be obsolete in upcoming releases, since a migration away from the sudo-approach towards a dbus-solution is in the todo list (#31)