You are not logged in.
Hello guys,
I have a doubt with systemd/systemctl that I didn't get much information reading the man page of it. On the Dunst repository at git, they are doing the approach of not setting the DISPLAY environment variable explicitly on the service file, to make it more flexible in case someone is using Wayland instead of Xorg. The solution is to use:
systemctl --user set-environment DISPLAY="the value"
I did, and later enabled and started the service as user. All good.
But when I logout and login back, the service has failed to start because it doesn't know which display it will show. And when I put the command:
systemctl --user show-environment
DISPLAY is not set, so this is the reason the Dunst service isn't working
What is the way to set DISPLAY permanently on systemd environment variables?
Last edited by Mr.Doko (2017-05-21 17:24:46)
Offline
Offline
Thanks for the response. I was reading https://wiki.archlinux.org/index.php/Sy … XAUTHORITY, but it seems it is not importing DISPLAY. Should I move the script from /etc/X11/xinit/xinitrc.d/50-systemd-user.sh to another place?
EDIT: I executed it and it imports the variables. So it seems it must be loaded when the session starts. I have a clue of what to do.
Last edited by Mr.Doko (2017-05-21 16:23:26)
Offline
Are you using gdm by any chance?
Online
Are you using gdm by any chance?
No, I'm not using any DM for now
Offline
How are you starting X? If it is startx please post the relevant .xinitrc.
Online
How are you starting X? If it is startx please post the relevant .xinitrc.
conky -d
exec i3
Offline
Please see the third note on Xinit.
Online
I seem to get what's going on, but I'm still having problems.
https://wiki.archlinux.org/index.php/Sy … _variables indicates that the script at xinitrc.d (50-systemd-user.sh) is the one that sets the DISPLAY environment at systemd.
If there is no .xinitrc, it executes the xinitrc at /etc/X11/xinit/xinitrc, which by default loads the script I need for the display.
I copied the line that reads all the scripts inside xinitrc.d to my own .xinitrc, and even I tried to execute this only script directly on my .zprofile file, but the service is loading before the DISPLAY variable is exported on systemd, still giving me the same error of "cannot open display".
Just in case, the service is located in here https://github.com/dunst-project/dunst/ … service.in. It has a PartOf=graphical-session.target, which seems to work when the graphical session is executed.
Anything I might not be looking?
EDIT: It was a typo with .zshenv before, it was .zprofile. I added the lines that load the files at xinitrc.d at the beginning of the .zshenv and now it is working. Thanks for the help!
Last edited by Mr.Doko (2017-05-21 17:24:25)
Offline