Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-04-23 16:19:10

DopustimVladimir
Member
From: Bishkek (Kyrgyzstan)
Registered: 2017-04-23
Posts: 3
Website

How to set the wallpaper using cron

Here is a script and it works, but fails to run with cron:

#!/bin/bash
xfconf-query -c xfce4-desktop \
    -p /backdrop/screen0/monitor0/workspace0/last-image \
    -s /home/user/Pictures/wallpaper.png

But the cronie does not want to execute it (for example, notify-send works good).

Log:

CMDOUT (Failed to init libxfconf: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead.)

I suppose it's a problem with dbus.

Here is my question also:

http://stackoverflow.com/questions/4355 … using-cron

May be i have to use another tool, but interesting - what's a trouble?

Thanks!


Web oriented programmer

Offline

#2 2017-04-24 10:30:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: How to set the wallpaper using cron

Hello and welcome.

This command works for me on Arch:

* * * * * DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus /usr/bin/xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorLVDS1/workspace0/last-image -s /home/toz/Pictures/Arc/699086.png

However, looking at the stackexchange post, it doesn't look like your session dbus is being properly set. On Arch, how do you start Xfce? Do you use a display manager? If so which one? Or are you using startx/.xinitrc?

One potential workaround you could use is simply replacing the wallpaper.png with a new image. xfdesktop will monitor the file and if the file changes, it will refresh the desktop. That way, you only need to have cron overwrite wallpaper.png with a new file.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-04-24 12:33:49

DopustimVladimir
Member
From: Bishkek (Kyrgyzstan)
Registered: 2017-04-23
Posts: 3
Website

Re: How to set the wallpaper using cron

Hi, thanks for the reply! My lightdm.service is inactive. I use sddm and my wm is xfwm4 (without .xinitrc in my home dir).


Web oriented programmer

Offline

#4 2017-04-24 17:01:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: How to set the wallpaper using cron

Assuming you are using your Arch system, what do the following commands return?

env | grep -i dbus
pacman -Qi xfce4-session
fgrep -ri dbus-launch ~/.cache/sessions/

Also, are you using Arch proper or one of the derivative distros (manjaro, antegeros, etc)?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2017-04-24 17:32:29

DopustimVladimir
Member
From: Bishkek (Kyrgyzstan)
Registered: 2017-04-23
Posts: 3
Website

Re: How to set the wallpaper using cron

It's Arch Linux. 3-rd output part is empty

DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Q2j5HzezrV,guid=01592909c43b40b83c888eb758fe34e9
DBUS_SESSION_BUS_PID=1419
Name            : xfce4-session
Version         : 4.12.1-6
Description     : A session manager for Xfce
Architecture    : x86_64
URL             : http://www.xfce.org/
Licenses        : GPL2
Groups          : xfce4
Provides        : None
Depends On      : libxfce4ui  libwnck  libsm  polkit  xorg-iceauth  xorg-xinit  xorg-xrdb
                  polkit-gnome  hicolor-icon-theme
Optional Deps   : gnome-keyring: for keyring support when GNOME compatibility is enabled
                  xscreensaver: for locking screen with xflock4
                  gnome-screensaver: for locking screen with xflock4
                  xlockmore: for locking screen with xflock4
                  slock: for locking screen with xflock4
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : xfce-utils
Installed Size  : 1974.00 KiB
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : Fri Mar 3 08:22:20 2017
Install Date    : Sun Mar 5 03:19:35 2017
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
¯ \ _ (ツ) _ / ¯

Last edited by DopustimVladimir (2017-04-24 17:46:04)


Web oriented programmer

Offline

#6 2017-04-24 20:25:22

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: How to set the wallpaper using cron

DopustimVladimir wrote:
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Q2j5HzezrV,guid=01592909c43b40b83c888eb758fe34e9
DBUS_SESSION_BUS_PID=1419

Your DBus Session Address isn't set correctly. It should be something like:

DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

Are you still using dbus-launch anywhere? I asked you to search your saved sessions in case something was saved in there from before, but can you search for that string elsewhere in your system? Maybe /etc and /usr and ~/.config .


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB