[problem help] 怎么用命令更换Deepin V23壁纸? Resolved
Tofloor
poster avatar
深蓝
deepin
2023-10-12 08:21
Author

这个命令在Deepin V20中已经不再生效了,Deepin V23怎么用命令更换Deepin V23壁纸?求助
gsettings set com.deepin.wrap.gnome.desktop.background picture-uri "/home/user/Desktop/1.jpg"

Reply Favorite View the author
All Replies
avatar
谢克辉
deepin
2023-10-12 09:45
#1

为什么要用命令行更新壁纸呢

Reply View the author
avatar
Ligocut光剪视频剪辑软件
deepin
Backbone of ecological co-construction group
2023-10-12 14:26
#2
谢克辉

为什么要用命令行更新壁纸呢

应该是编写程序用到了这个功能

Reply View the author
avatar
neko
deepin
Ecological co-builder
Q&A Team
2023-10-12 14:41
#3

监听dbus信号,如何右键设置壁纸。然后找到设置壁纸的信号抄下来用

Reply View the author
avatar
dgmenghuan
deepin
2023-10-12 16:23
#4

为什么手动?

Reply View the author
avatar
忘记、过去
deepin
2023-10-12 19:08
#5

和 V20 没啥区别,除了 D-Bus 接口名称换了下

dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'屏幕名称' string:'图片绝对路径'

e.g. dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'VGA-0' string:'/usr/share/wallpapers/deepin/abc-124.jpg'

Reply View the author
avatar
vivian_me
deepin testing team
2023-10-12 19:30
#6
Reply View the author
avatar
深蓝
deepin
2023-10-15 22:40
#7
谢克辉

为什么要用命令行更新壁纸呢

写自动化脚本,用于初始化系统

Reply View the author
avatar
深蓝
deepin
2023-10-15 22:43
#8
忘记、过去

和 V20 没啥区别,除了 D-Bus 接口名称换了下

dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'屏幕名称' string:'图片绝对路径'

e.g. dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'VGA-0' string:'/usr/share/wallpapers/deepin/abc-124.jpg'

谢谢大佬,你这个命令测试可以

官网上org.deepin.dde.Appearance后边没有加1, 设置时报错is badly formed

使用xrandr命令来获取显示器的名字。

xrandr是一个用于配置和显示X服务器屏幕的命令行工具。

列出所有已连接的显示器,并提取出它们的名字。:

xrandr --query | grep " connected" | cut -d" " -f1

列出所有显示器

xrandr --query | grep "connected"

结果:

DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm

HDMI-1 disconnected (normal left inverted right x axis y axis)

Reply View the author
avatar
国产操作系统在茁壮成长
deepin
2025-11-10 17:01
#9
忘记、过去

和 V20 没啥区别,除了 D-Bus 接口名称换了下

dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'屏幕名称' string:'图片绝对路径'

e.g. dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'VGA-0' string:'/usr/share/wallpapers/deepin/abc-124.jpg'

上述命令只能指定一张固定图片吗?可以指定一个壁纸文件夹,运行一次命令就随机或者顺序切换文件夹中的图片设置为壁纸吗?想要写一个sh脚本文件,并设置一个全局快捷键,按一下快捷键切换一张壁纸。用处就是有的壁纸看腻了或者不符合当前的心情或不符合当前播放的音乐,就按一下立即切换。系统自带的定时切换只能是固定时间,有的时候一个壁纸看着正好呢,它给切走了,有的时候想换了,它还没到时间呢。

Reply View the author
avatar
国产操作系统在茁壮成长
deepin
2025-11-11 09:19
#10
国产操作系统在茁壮成长

上述命令只能指定一张固定图片吗?可以指定一个壁纸文件夹,运行一次命令就随机或者顺序切换文件夹中的图片设置为壁纸吗?想要写一个sh脚本文件,并设置一个全局快捷键,按一下快捷键切换一张壁纸。用处就是有的壁纸看腻了或者不符合当前的心情或不符合当前播放的音乐,就按一下立即切换。系统自带的定时切换只能是固定时间,有的时候一个壁纸看着正好呢,它给切走了,有的时候想换了,它还没到时间呢。

搞定了,适用于Deepin 23.1。

#!/bin/bash

# 指定图片所在的目录
path="/home/UserName/Pictures/壁纸"

# 随机选择一张图片,含子目录内图片
#fpath=$(find ${path} -type f | shuf -n 1)
# 随机选择一张图片,不含子目录内图片
fpath=$(find ${path} -maxdepth 1 -type f | shuf -n 1)

# 更换壁纸
dbus-send --session --print-reply=literal --dest=org.deepin.dde.Appearance1 /org/deepin/dde/Appearance1 org.deepin.dde.Appearance1.SetMonitorBackground string:'eDP-1' string:"$fpath"

Reply View the author