在 Vagrant provision 脚本中设置 gsettings
Set gsettings in Vagrant provision script
我是 运行 一个无所事事的供应脚本,我正在尝试设置桌面背景,但我无法获取 gsettings。它在命令行上运行良好,而不是在脚本中运行。 Vagrantfile 中的其他所有内容都工作正常。
config.vm.provision "file", source: "image.jpg", destination: "~/image.jpg"
我使用文件配置将文件移动过来,然后从非sudo调用gsettings bootstrap.sh。
config.vm.provision :shell, path: "sudo-bootstrap.sh"
config.vm.provision :shell, path: "bootstrap.sh", privileged: false
在bootstrap.sh中:
gsettings set org.gnome.desktop.background picture-uri file:///home/vagrant/image.jpg
我了解到没有 DBUS Session bus address, but adding the line to get the PID didn't work in the provisioning script. Also found it was perhaps missing schemas,但我在 .local 中没有任何架构。
现在已经为此苦苦思索了几个小时,不知道我错过了什么。
虽然采纳了答案DBUS Session question didn't work for me, the linked answer under it did, Run DBUS。
dbus-launch gsettings set ...
我是 运行 一个无所事事的供应脚本,我正在尝试设置桌面背景,但我无法获取 gsettings。它在命令行上运行良好,而不是在脚本中运行。 Vagrantfile 中的其他所有内容都工作正常。
config.vm.provision "file", source: "image.jpg", destination: "~/image.jpg"
我使用文件配置将文件移动过来,然后从非sudo调用gsettings bootstrap.sh。
config.vm.provision :shell, path: "sudo-bootstrap.sh"
config.vm.provision :shell, path: "bootstrap.sh", privileged: false
在bootstrap.sh中:
gsettings set org.gnome.desktop.background picture-uri file:///home/vagrant/image.jpg
我了解到没有 DBUS Session bus address, but adding the line to get the PID didn't work in the provisioning script. Also found it was perhaps missing schemas,但我在 .local 中没有任何架构。
现在已经为此苦苦思索了几个小时,不知道我错过了什么。
虽然采纳了答案DBUS Session question didn't work for me, the linked answer under it did, Run DBUS。
dbus-launch gsettings set ...