有没有自动更新墙纸的软件
Tofloor
poster avatar
seachen
deepin
2019-04-17 07:38
Author
每天对着一样的墙纸,看腻了。有没有那种每次开机都换一个新的墙纸。这样可以提升工作效率
Reply Favorite View the author
All Replies
打击越
deepin
2019-04-17 09:43
#1
桌面设置壁纸,在设置界面左上角有个定时切换桌面壁纸的按钮。
Reply View the author
atongmu518
deepin
2019-04-17 17:55
#2
深度商店里的Variety,你值得拥有。
Reply View the author
liuyandi
deepin
2019-04-17 19:25
#3
同推荐Variety,不过deepin本身现在也可以自动换壁纸了,就是没法添加新的壁纸
Reply View the author
199******15
deepin
2019-04-17 20:29
#4
deepin原生自带
Reply View the author
seachen
deepin
2019-04-25 20:53
#5
deepin自带的不会自动添加新的墙纸吧。
Reply View the author
ivo_wang
deepin
2019-04-25 21:01
#6
我写了一个脚本天天自动换
Reply View the author
ivo_wang
deepin
2019-04-25 21:02
#7
  1. #!/bin/bash
  2. # Fuction auto download and chang wallpaper for kdedesktop
  3. # date 20180228
  4. # author ivo_wang
  5. # depence   at curl wget jq

  6. # When network is offline ,use this fuction to wait 5 minutes restart this / script
  7. sleep 10
  8. at_time()
  9. {
  10.         /usr/bin/echo "/home/ivo/my_file/script/deepin/wallpaper_deepin.sh" | /usr/bin/at "now +5 minutes"
  11. }


  12. # Download Pictures from bing;
  13. # If you not in china please chang china bing url. example http://cn.bing.com  chang to http://bing.com
  14. download_pic()
  15. {
  16.         # use http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US get base_url
  17.         base_url=`curl -s 'http://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=zh-CN'|jq .images[0].url|awk '{print $1}'|sed 's/"//g'`

  18.         #use_url=`echo $base_url |awk '{print $1}'|sed 's/"//g'`;
  19.         head_url="http://cn.bing.com"
  20.         original_url=$head_url$base_url
  21.         #get Pictures_name;
  22.         Pictures_name=`echo $original_url|awk -F\/ '{print $NF}'`
  23.         #download;
  24.         wget -c $original_url
  25.         # Easy to identify dates
  26.         fs=_
  27.         # add backup Pictures_name
  28.         echo $current_date$fs$Pictures_name > used_Pictures_name
  29.         # rename add date
  30.         mv $Pictures_name $current_date$fs$Pictures_name
  31. }

  32. # Can be used for xfce4
  33. setxfce4_tmp()
  34. {
  35.         xfconf-query -c  xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image -s  $(cat ./used_Pictures_name)
  36. }

  37. setxfce4()
  38. {
  39.         #Number of worspaces
  40.         workspace_count=$(xfconf-query -v -c xfwm4 -p /general/workspace_count)
  41.         connected_monitor=$(xrandr -q | awk '/ connected/{print $1}')
  42.         xfce_desktop_prop_prefix=/backdrop/screen0/monitor$connected_monitor

  43. #        echo "Wallaper path: $wallaper_path"
  44. #        echo "Outfile: $outfile"

  45. #Set wallaper for all worspaces(only for XFCE)
  46.         for ((i=0; i <= $workspace_count; i++))
  47.         do
  48.        xfconf-query -c xfce4-desktop -p $xfce_desktop_prop_prefix/workspace$i/last-image -s "/home/ivo/Pictures/$(cat ./used_Pictures_name)"
  49.            xfconf-query -c xfce4-desktop -p $xfce_desktop_prop_prefix/workspace$i/image-style -s 5
  50.            echo "Set $wallaper_path$outfile for workspace $i"
  51.         done
  52. #                xfconf-query -c  xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image -s  "/home/ivo/Pictures/$current_date$fs$Pictures_name";
  53. }

  54. # Can be used for kde
  55. setkde()
  56. {
  57.         # dbus-send --session --dest=org.kde.plasmashell --type=method_call /PlasmaShell org.kde.PlasmaShell.evaluateScript 'string:
  58.         # var Desktops = desktops();
  59.         # for (i=0;i
  60.         #         d = Desktops[i];
  61.         #         d.wallpaperPlugin = "org.kde.image";
  62.         #         d.currentConfigGroup = Array("Wallpaper",
  63.         #                                     "org.kde.image",
  64.         #                                     "General");
  65.         #         d.writeConfig("Image", "file:///home/ivo/Pictures/Wallpaper.jpg");
  66.         # }';

  67.         sed -i "s/Pictures\/[[:alpha:]]*.*/Pictures\/$current_date$fs$Pictures_name\")}\'/" /home/ivo/my_file/script/kde/kdeset.sh
  68.         chmod +x /home/ivo/my_file/script/kde/kdeset.sh
  69.         /home/ivo/my_file/script/kde/kdeset.sh
  70. }

  71. setkde_exist()
  72. {
  73.         tmp_name=`cat ./used_Pictures_name`
  74.         sed -i "s/Pictures\/[[:alpha:]]*.*/Pictures\/$tmp_name\")}\'/" /home/ivo/my_file/script/kde/kdeset.sh
  75.         chmod +x /home/ivo/my_file/script/kde/kdeset.sh
  76.         /home/ivo/my_file/script/kde/kdeset.sh
  77. }

  78. # Can be used for Gnome3
  79. setgnome()
  80. {
  81.         DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background  picture-uri '"file://'$downpath$current_date$fs$Pictures_name'"'
  82. }

  83. setgnome_exist()
  84. {
  85.         exist_gnome=`cat ./used_Pictures_name`
  86.         DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background  picture-uri '"file://'$downpath$exist_gnome'"'
  87. }


  88. setdeepin()
  89. {
  90.         qdbus --literal com.deepin.wm /com/deepin/wm com.deepin.wm.ChangeCurrentWorkspaceBackground  "file://$downpath$current_date$fs$Pictures_name"
  91. }

  92. setdeepin_exist()
  93. {
  94.         exit_deepin=`cat ./used_Pictures_name`
  95.         qdbus --literal com.deepin.wm /com/deepin/wm com.deepin.wm.ChangeCurrentWorkspaceBackground  "file://$downpath$exit_deepin"
  96. }




  97. current_date=`date +%Y%m%d`
  98. #downpath
  99. downpath=/home/ivo/Pictures/
  100. #test backup directory
  101. backupath=/home/ivo/Pictures/backup
  102. if [ ! -d "$backupath" ];then
  103.         mkdir -p $backupath
  104. fi

  105. cd $downpath

  106. netstat=$(ping -c3 baidu.com|grep transmitted |awk '{print $4}')

  107.   # Determine if the network status is online
  108. if [[ $netstat == 0 ]]; then
  109.         # offline status
  110.         at_time
  111.     exit
  112. # online status
  113. else
  114.         # test the first time
  115.         if [[ ! -f $downpath/used_Pictures_name ]]; then
  116.                 download_pic
  117.                 setdeepin
  118.         #test wallpaper exist
  119.         else
  120.                 date_result=$(grep $current_date*.jpg $downpath/used_Pictures_name|wc -l)
  121.                 if [[ $date_result == 1 ]]; then
  122.                         setdeepin_exist
  123.             #setgnome
  124.                         # a nice day
  125.                 else
  126.             if [ ! -f `cat ./used_Pictures_name` ]; then
  127.                rm -rf ./used_Pictures_name
  128.                download_pic
  129.                setdeepin
  130.             else
  131.                             mv $(cat ./used_Pictures_name) ./backup/
  132.                             rm -rf ./used_Pictures_name
  133.                             download_pic
  134.                             setdeepin
  135.             fi
  136.                 fi

  137.         fi

  138. fi
Copy the Code
Reply View the author
z2******[email protected]
deepin
2022-02-19 17:05
#8

这个脚本在deepin 20.3 和 20.4上好像换不了墙纸了。是qdbus --literal com.deepin.wm /com/deepin/wm com.deepin.wm.ChangeCurrentWorkspaceBackground 命令更换了吗?

求大神指导一下。

Reply View the author