用于在XFCE4中切换壁纸的Bash脚本

时间:2017-07-22 23:29:00

标签: bash archlinux xfce

你可以帮我编写一个bash脚本,用于在XFCE下的日夜版本之间切换壁纸吗?我想设置一个运行它的cron作业,以便它会根据一天中的时间自动切换。

1 个答案:

答案 0 :(得分:0)

我写了一个剧本:

#!/bin/bash
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image -s /home/maciek/Pictures/day.jpg

从终端运行时它可以正常工作。但是当我在cron中设置它时它不起作用。我收到一个错误:

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

一些信息:

Name            : xfce4-session
Version         : 4.12.1-7
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  : 1972.00 KiB
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : Tue 27 Jun 2017 05:48:04 AM CEST
Install Date    : Fri 21 Jul 2017 11:49:41 PM CEST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature


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