我想从 shell/bash 脚本更改 Linux 上的壁纸(使用其完整路径更改为特定文件)。
我已经找到了几种方法(见下文)来做到这一点 - 但这些方法并不适用于所有桌面环境。
a) 使用 gnome-settings-daemon / gsettings:
gsettings set org.gnome.desktop.background picture-uri file://$fullPathToMyImage
b) 使用 gconftool-2
gconftool-2 --type=string --set /desktop/gnome/background/picture_filename $fullPathToMyImage
c) 使用 feh
feh --bg-scale $fullPathToMyImage
我现在正在寻找其他方法(而 Gnome 似乎涵盖了 a、b 和 c)——对于所有桌面环境(以及所有 Linux 发行版)来说更可取。
到目前为止我至少缺少 KDE4/5 和 XFCE 的方法
类似帖子:Shell脚本改变桌面壁纸 https://stackoverflow.com/questions/5550895/shell-script-changing-desktop-wallpaper
对于xfce你可以使用这个命令:
xfconf-query -c xfce4-desktop -p $xfce_desktop_prop_prefix/workspace1/last-image -s /path/to/file
例如,将图像设置为缩放也很有用
xfconf-query -c xfce4-desktop -p $xfce_desktop_prop_prefix/workspace1/image-style -s 5
你可以在我的脚本中看到我是如何做到的 -https://github.com/yatsenko-ihor/himawari8-wallaper/blob/master/himawari8_wallaper.sh https://github.com/yatsenko-ihor/himawari8-wallaper/blob/master/himawari8_wallaper.sh
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)