Bing作为桌面壁纸的一天图片?

谁能帮我解决如何将Bing图片制作成我的桌面壁纸?

  • 所以它通过下载当今最高质量的图片来工作。
  • 然后将其存储在您帐户的Picture文件夹中。
  • 之后自动更改图片本身。
  • 它应该在每天没有麻烦的情况下继续下去。
  • 可能是我必须在启动应用程序中添加的东西。
  • Ubuntu版本之间有什么区别吗?

– 我必须写一个剧本吗? 这也会受到许多其他人的赞赏! 先感谢您 :)

可能最简单的事情就是安装多样化 。 这是一个墙纸经理,能够以您想要的频率更换壁纸。

以下是一些设置:

  • 下载的频率
  • 更改图像的频率(每天一次,每次重启,每分钟……)
  • 你想从哪里下载你的图像
  • 您要将它们存储在计算机上的位置
  • 引号(自动或来自源)
  • 一个漂亮的时钟。

还有一个设置可以在登录时运行它。 如果您启用该function,然后添加日期url的bing图像( http://www.bing.com/images/search?q=picture+of+the+day&qpvt=picture+of+the+day&FORM=IGRE ?) ,你们都准备好了。

它可以在软件中心找到,它有5 *的评级!

以下是一些截图:

在此处输入图像描述在此处输入图像描述在此处输入图像描述

我写了一个小节点脚本,它完全是这样的: https : //github.com/dorian-marchal/bing-daily-wallpaper

要安装它,你需要nodejs:

 sudo apt-get install nodejs npm 

安装:

在命令行中,运行:

 sudo npm install -g bing-daily-wallpaper 

用法:

要更改壁纸,请执行(您可以将此命令添加到启动应用程序中):

 bing-daily-wallpaper 

前段时间我发现了以下脚本(我不记得在这一刻的确切位置,但是当我发现时,我也会添加源代码)哪一个我改变了一点,哪个适用于你问的是否是设置为cron作业(请参阅此处如何执行此操作):

 #!/bin/bash # export DBUS_SESSION_BUS_ADDRESS environment variable useful when the script is set as a cron job PID=$(pgrep gnome-session) export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) # $bing is needed to form the fully qualified URL for # the Bing pic of the day bing="www.bing.com" # $xmlURL is needed to get the xml data from which # the relative URL for the Bing pic of the day is extracted # # The mkt parameter determines which Bing market you would like to # obtain your images from. # Valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA. # # The idx parameter determines where to start from. 0 is the current day, # 1 the previous day, etc. xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=1&n=1&mkt=en-US" # $saveDir is used to set the location where Bing pics of the day # are stored. $HOME holds the path of the current user's home directory saveDir="$HOME/Pictures/BingDesktopImages/" # Create saveDir if it does not already exist mkdir -p $saveDir # Set picture options # Valid options are: none,wallpaper,centered,scaled,stretched,zoom,spanned picOpts="zoom" # The desired Bing picture resolution to download # Valid options: "_1024x768" "_1280x720" "_1366x768" "_1920x1200" desiredPicRes="_1366x768" # The file extension for the Bing pic picExt=".jpg" # Extract the relative URL of the Bing pic of the day from # the XML data retrieved from xmlURL, form the fully qualified # URL for the pic of the day, and store it in $picURL # Form the URL for the desired pic resolution desiredPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "(.*)" | cut -d ">" -f 2 | cut -d "<" -f 1)$desiredPicRes$picExt # Form the URL for the default pic resolution defaultPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "(.*)" | cut -d ">" -f 2 | cut -d "<" -f 1) # $picName contains the filename of the Bing pic of the day # Attempt to download the desired image resolution. If it doesn't # exist then download the default image resolution if wget --quiet --spider "$desiredPicURL" then # Set picName to the desired picName picName=${desiredPicURL##*/} # Download the Bing pic of the day at desired resolution curl -s -o $saveDir$picName $desiredPicURL else # Set picName to the default picName picName=${defaultPicURL##*/} # Download the Bing pic of the day at default resolution curl -s -o $saveDir$picName $defaultPicURL fi # Set the GNOME3 wallpaper gsettings set org.gnome.desktop.background picture-uri "file://$saveDir$picName" # Set the GNOME 3 wallpaper picture options gsettings set org.gnome.desktop.background picture-options $picOpts # Remove pictures older than 30 days #find $saveDir -atime 30 -delete # Exit the script exit 

这里列出了一个很好的脚本,它在Ubuntu 14.04上仍能正常运行(需要安装curl):

http://ubuntuforums.org/showthread.php?t=2074098

我会在这里复制最新版本:

 #!/bin/bash # $bing is needed to form the fully qualified URL for # the Bing pic of the day bing="www.bing.com" # $xmlURL is needed to get the xml data from which # the relative URL for the Bing pic of the day is extracted # # The mkt parameter determines which Bing market you would like to # obtain your images from. # Valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA. # # The idx parameter determines where to start from. 0 is the current day, # 1 the previous day, etc. xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=en-US" # $saveDir is used to set the location where Bing pics of the day # are stored. $HOME holds the path of the current user's home directory saveDir=$HOME'/Pictures/BingDesktopImages/' # Create saveDir if it does not already exist mkdir -p $saveDir # Set picture options # Valid options are: none,wallpaper,centered,scaled,stretched,zoom,spanned picOpts="zoom" # The desired Bing picture resolution to download # Valid options: "_1024x768" "_1280x720" "_1366x768" "_1920x1200" desiredPicRes="_1920x1200" # The file extension for the Bing pic picExt=".jpg" # Extract the relative URL of the Bing pic of the day from # the XML data retrieved from xmlURL, form the fully qualified # URL for the pic of the day, and store it in $picURL # Form the URL for the desired pic resolution desiredPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "(.*)" | cut -d ">" -f 2 | cut -d "<" -f 1)$desiredPicRes$picExt # Form the URL for the default pic resolution defaultPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "(.*)" | cut -d ">" -f 2 | cut -d "<" -f 1) # $picName contains the filename of the Bing pic of the day # Attempt to download the desired image resolution. If it doesn't # exist then download the default image resolution if wget --quiet --spider "$desiredPicURL" then # Set picName to the desired picName picName=${desiredPicURL##*/} # Download the Bing pic of the day at desired resolution curl -s -o $saveDir$picName $desiredPicURL else # Set picName to the default picName picName=${defaultPicURL##*/} # Download the Bing pic of the day at default resolution curl -s -o $saveDir$picName $defaultPicURL fi # Set the GNOME3 wallpaper DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-uri '"file://'$saveDir$picName'"' # Set the GNOME 3 wallpaper picture options DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-options $picOpts # Exit the script exit 

我检查了一段时间,似乎工作。

 #!/bin/bash cd rm ./dodo.html wget --no-proxy --output-document=dodo.html http://www.bing.com rm ./dwallpaper.jpg wget --no-proxy --output-document=dwallpaper `sed -n "s/^.*g_img *= *{ *url:'\([^']*\)'.*$/\1/p" < dodo.html | sed 's/^"\(.*\)"$/\1/' | sed 's/^\/\(.*\)/http:\/\/www.bing.com\/\1/'` rm ./dodo.html gsettings set org.gnome.desktop.background picture-uri 'file:///home/YourName/dwallpaper' 

如果您在代理服务器下工作,请从第4行和第6行删除--no-proxy ,并代替YourName ,输入您的主文件夹的名称。

将其保存为某些脚本,使其可执行,然后在您希望更新壁纸时执行它。

我不知道如何在启动时安全地执行此操作。 根据我的理解, 将此添加到rc.local是不安全的。

如果出现任何问题,请评论。

这是我的工具,从Bing下载最新的wallpapapers并将其设置为桌面壁纸。 你可以看一下https://github.com/bachvtuan/Bing-Linux-Wallpaper

我搜索了答案,但没有找到,所以我写了一个脚本来设置bing壁纸。 这是剧本……

 #!/ bin / sh的

 ping -q -c5 bing.com

如果[$?  -eq 0]

然后

 wget“http://www.bing.com/HPImageArchive.aspx?format=rss&idx=0&n=1&mkt=en-US”-O bing.txt
 img_result = $(grep -o'src =“[^”] *“'bing.txt | grep -o'/.*.jpg')
 wget“http://www.bing.com”$ img_result
 img_name = $(grep -o'src =“[^”] *“'bing.txt | grep -o'[^ /] *。jpg')
 pwdPath = $(PWD)
 picPath =“/ home / YOUR USERNAME / Pictures / Wallpapers”
 cp $ pwdPath“/”$ img_name $ picPath
 gsettings set org.gnome.desktop.background picture-uri“file://”$ picPath“/”$ img_name

睡10
 rm $ img_name
 rm bing.txt 
科幻