Background image has root permission and can't be accessed by /home/

I have a multi-monitor setup and I am trying to configure pscircle by Ruslan Kuchumov as my background for my secondary monitor (“HDMI-1” according to xrandr).

By default, it prints to the X11 root window, which I don’t know how to find and the documentation suggest that "as pscircle is not tested yet in multi-display environment [sic] to make it work correctly, I suggest trying the following options:

  • specify --output-display=... argument to print the image to the correct display or,
  • change DISPLAY environment variable before running the program, or
  • output image to the file using --output=…“argument and then set it as the wallpaper using external comand (e.g. feh).”

I trie dto set the --output-display option by doing output--display="HDMI-1" but that gave an error:

pscircle --output-display="HDMI-1"
Unable to open display: 'HDMI-1'

So instead I did just did pscircle --output=/home/usr/Pictures/pscircle.png

which worked perfectly except for the fact that the output image has root permissions and so can’t be set as the wallpaper.

(I should note, I created the ~/.config/systemd/user/pscircle.service file and tried to change the parameters there but I must have bad syntax because those never seemed to work, and all the CLI arguments did)

Hopefully this is enough background, and I’m sorry for the long post, but my questions are:

Where can I view my monitors X11 root window so I can use the program as default if that works? If not, how can I write this in a way so that I can set it as my background (i.e. the file is written without root permissions).

As usual, I’m probably drastically misunderstanding something, so if so I would love pointers as to where my misconceptions are.

EDIT: I missed this in the documentation: " GNOME, KDE, XFCE and, probably, some other DE do not display X11 root window as desktop wallpaper. But you can still save the image to the file (by using --output=path.png) and either:

  • Set the path to the image in wallpaper system config. DE is likely to update the wallpaper automatically, when the image has changed."

So the X11 route seems moot but I’d still like to know where in the FS the x11 root window is, and this still leaves me with a file that is not usable as a wallpaper as it has root permissions

Is there a way that I can grant /home/ root privileges for setting the wallpaper as another way around this?

I’ve tried to change the file .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml

I’m running two monitors and so I try to add the following property tag to the “monitorHDMI-1” section:

<property name="image-path" type="string" value="/tmp/pscircle.png"/>
...
</property>

however this doesn’t seem to actually save and it still creates an image which my wallpaper settings can’t seem to access. I tried writing to /tmp since the readme suggested " you can place the image in /tmp directory which is often mapped to the main memory. It omits writing to the disk and improves performance."

It seems that my issue was the --output=/tmp/pscircle.png wasn’t formatted correctly in my .config/systemd/user/pscircle.service file.

I’ve configured it correctly now:

[Unit]
Description=Runs pscircle to continuously update desktop wallpaper

[Service]
Environment=DISPLAY=:0
ExecStart=/bin/bash -c "while true; do pscircle --output=/tmp/pscircle.png; sleep 5; done"

[Install]
WantedBy=default.target

For a second I thought I had to add a chmod a+rw /tmp/pscircle.png but it seems the permissions are working as expected now

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.