Bing 每日必应图片作为桌面壁纸?

Ami*_*hab 30 wallpaper

任何人都可以帮助我如何将 Bing 图片制作到我的桌面壁纸?

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

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

don*_*oey 23

Probably the easiest thing to do would be to install variety. It is a wall-paper manager that really does an excellent job to change your wallpaper at the frequency you want.

Here are some of its settings:

  • the frequency of the download
  • the frequency of changing the image (once a day, at every reboot, every minute,...)
  • where you want to download your images from
  • where you want to store them on your computer
  • quotes (either automatically or from a source)
  • a nice clock.

There is also a setting to run it at login. If you enable that and then add your bing image of the day url (http://www.bing.com/images/search?q=picture+of+the+day&qpvt=picture+of+the+day&FORM=IGRE?), you are all set.

It can be found in the software center and it has a 5* rating!

Here are some screenshots:

在此处输入图片说明 在此处输入图片说明 在此处输入图片说明


Dor*_*hal 16

我写了一个小节点脚本,正是这样做的:https://github.com/dorian-marhal/bing-daily-wallpaper

要安装它,您需要 nodejs :

sudo apt-get install nodejs npm
Run Code Online (Sandbox Code Playgroud)

安装 :

在命令行中,运行:

sudo npm install -g bing-daily-wallpaper
Run Code Online (Sandbox Code Playgroud)

用法 :

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

bing-daily-wallpaper
Run Code Online (Sandbox Code Playgroud)


Rad*_*anu 8

前段时间我找到了以下脚本(我不记得现在具体在哪里,但是当我找到时,我也会添加源代码)我稍微更改了哪个脚本,哪个对您的要求非常有用设置为 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 "<urlBase>(.*)</urlBase>" | 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 "<url>(.*)</url>" | 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
Run Code Online (Sandbox Code Playgroud)