I have a python3-script which uses the
Gtk-module (imported from
gi.repository, for recent-manager functionality), requiring a link to the current xserver session (
lightdm service in Ubuntu).
Running it manually via console (in a xserver session) works, but i want it to autorun.
An init.d script won't work (setting the DISPLAY variable to 0.0). Using
xvfb-run made the init.d script run my script, but in a virtual xserver environment as expected (not mine).
Is there no equivalent, which connects a init.d script to the current xserver-session?
So far i've tried an
.xinitrc file (in
~/, yes it is executable), as well as creating
.xprofile, .xsession, .xsessionrc which all link to the first one via
ln -s. I've tried to add
gnome-terminal & for testing but the terminal didn't show up either, be it after either restarting
lightdm or even the entire PC and logging in again.
I've also tried Run configuration script at X session resume, but that gives the error
Can't open /usr/share/acpi-support/power-funcs.
upstart, as suggested by Run a startup script with lightdm wouldn't provide the xserver display variable (or handle?) either, just run it after
lightdm started, correct?
Maybe put it somewhere in
xorg.conf? (How can I make xrandr customization permanent?)
(My script makes quicklists of recent files and adds them to the unity launcher's rightclick-menues, similar to windows: https://github.com/thirschbuechler/ubuntu-recentquicklists)