/pybingwallpaper

Download wallpaper from bing.com

Primary LanguagePythonMIT LicenseMIT

PyBingWallpaper

What pybingwallpaper does

Download the wallpaper offered by Bing.com and set it current wallpaper background.

Another project for the same purpose but download from National Geographic can be found here


Auto startup

Windows

Download installer from any of following links and install it.

**Note: Please backup the `settings.conf` under the installation path before upgrading!**

**注意:建议升级前备份安装目录下的`settings.conf`文件!**

Latest Release 1.4.4

A shortcut will be created in your startup folder. You can edit the configuration to adjust features.

Linux with Gnome

You just need to add a startup application:

gnome-session-properties

then add a startup program with:

Name: pybingwallpaper
Command: python3 /path/to/pybingwallpaper/src/main.py -b
Comment: download and update wallpaper!

You can also append arguments in Command box.


Donation

If you like this tool, consider buying a cup of coffee for nocturnal coders. This tool is totally free. Donation will NOT add any additonal features.

Donate with PayPal USD

PayPal - The safer, easier way to pay online!

Donate with PayPal EUR

PayPal - The safer, easier way to pay online!

如果喜欢本软件,请考虑给我们昼伏夜出的码农捐助一杯咖啡吧!软件及其所有功能均为免费且无广告,捐助与否不影响使用。

使用支付宝付款


Usage

usage: pybingwallpaper [-h] [-v] [--config-file CONFIG_FILE]
                       [--generate-config] [-b] [--foreground]
                       [-c {au,br,ca,cn,de,fr,jp,nz,us,uk,auto}]
                       [--market MARKET] [-d] [-i INTERVAL] [-k]
                       [-m {prefer,collect,highest,insist,manual,never}]
                       [--image-size IMAGE_SIZE] [-o OFFSET]
                       [--proxy-server PROXY_SERVER] [--proxy-port PROXY_PORT]
                       [--proxy-username PROXY_USERNAME]
                       [--proxy-password PROXY_PASSWORD] [--redownload]
                       [-s {no,win}] [--setter-args SETTER_ARGS]
                       [-t OUTPUT_FOLDER] [--database-file DATABASE_FILE]
                       [--database-no-image] [--server {global,china,custom}]
                       [--custom-server CUSTOMSERVER]

Download the wallpaper offered by Bing.com and set it current wallpaper
background.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version information
  --config-file CONFIG_FILE
                        'specify configuration file, use 'settings.conf' in
                        installation directory by default.
  --generate-config     generate a configuration file containing arguments
                        specified in command line and exit. to generate
                        default config file, issue without other command
                        arguments. path and name of configuration file can be
                        specified with --config-file
  -b, --background      work in background (daemon mode) and check wallpaper
                        periodically (interval can be set by --interval).
  --foreground          force working in foreground mode to cancel the effect
                        of `background` in config file.
  -c {au,br,ca,cn,de,fr,jp,nz,us,uk,auto}, --country {au,br,ca,cn,de,fr,jp,nz,us,uk,auto}
                        select country code sent to bing.com. bing.com in
                        different countries may show different backgrounds.
                        au: Australia br: Brazil ca: Canada cn: China
                        de:Germany fr: France jp: Japan nz: New Zealand us: USA
                        uk: United Kingdom auto: select country according to
                        your IP address (by Bing.com) Note: only China(cn),
                        New Zealand(nz) and USA(us) have high resolution
                        (1920x1200) wallpapers; the rest offer 1366x768 only.
  --market MARKET       specify market from which the wallpaper should be
                        downloaded. Market is a more generic way to specify
                        language-country of bing.com. The list of markets may
                        grow sometimes, and different language of the same
                        country may have different image, so consider using it
                        instead of country. Market code should be specified in
                        format 'xy-ab' such as en-us. Note: specify this
                        parameter will override any settings to --country.
  -d, --debug           enable debug outputs. The more --debug the more
                        detailed the log will be
  -i INTERVAL, --interval INTERVAL
                        interval between each two wallpaper checkings in unit
                        of hours. applicable only in `background` mode. at
                        lease 1 hour; 2 hours by default.
  -k, --keep-file-name  keep the original filename. By default downloaded file
                        will be renamed as 'wallpaper.jpg'. Keep file name
                        will retain all downloaded photos
  -m {prefer,collect,highest,insist,manual,never}, --size-mode {prefer,collect,highest,insist,manual,never}
                        set selecting strategy when wallpapers in different
                        size are available (normally 1920x1200 and 1366x768).
                        `prefer` (default) uses high resolution if it's
                        available, otherwise downloads normal resolution;
                        `insist` always use high resolution and ignore other
                        pictures (Note: some countries have only normal size
                        wallpapers, if `insist` is adopted with those sites,
                        no wallpaper can be downloaded, see `--country` for
                        more); `highest` use the highest available resolution,
                        that is, 1920x1200 for HD sites, 1920x1080 for others;
                        `never` always use normal resolution; `manual` use
                        resolution specified in `--image-size` `collect` acts
                        exactly as highest in most of cases, however it will
                        also download the picture with Chinese bing logo if
                        the picture is ROW and in the size of 1920x1200 (try
                        --market=en-ww). In collect mode, only the first
                        picture (usually the one with English bing logo) will
                        be set as wallpaper.
  --image-size IMAGE_SIZE
                        specify resolution of image to download. check
                        `--size-mode` for more
  -o OFFSET, --offset OFFSET
                        start downloading from the photo of 'N' days ago.
                        specify 0 to download photo of today.
  --proxy-server PROXY_SERVER
                        proxy server url, ex: http://10.1.1.1
  --proxy-port PROXY_PORT
                        port of proxy server, default: 80
  --proxy-username PROXY_USERNAME
                        optional username for proxy server authentication
  --proxy-password PROXY_PASSWORD
                        optional password for proxy server authentication
  --redownload          do not check history records. Download must be done.
                        downloaded picture will still be recorded in history
                        file.
  -s {no,win,gnome2,gnome3}, --setter {no,win,gnome2,gnome3}
                        specify interface to be called for setting wallpaper.
                        'no' indicates downloading-only; 'gnome2/3' are only
                        for Linux with gnome; 'win' is for Windows only.
                        Customized setter can be added as dev doc described.
  --setter-args SETTER_ARGS
                        arguments for external setters
  -t OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
                        specify the folder to store photos. Use
                        '~/MyBingWallpapers' folder in Linux, 'C:/Documents
                        and Settings/<your-username>/MyBingWallpapers in
                        Windows XP or 'C:/Users/<your-
                        username>/MyBingWallpapers' in Windows 7 by default
  --database-file DATABASE_FILE
                        specify the sqlite3 database used to store meta info
                        of photos. leave it blank to disable database storage.
  --database-no-image   images will be embedded into database by default.
                        Exclude images from database can reduce the size of
                        database file.
  --server {global,china,custom}
                        select bing server used for meta data and wallpaper
                        pictures. it seems bing.com uses different servers and
                        domain names in china. global: use bing.com of course.
                        china: use s.cn.bing.net. (note: use this may freeze
                        market or country to China zh-CN) custom: use the
                        server specified in option "customserver"
  --custom-server CUSTOMSERVER
                        specify server used for meta data and wallpaper photo.
                        you need to set --server to 'custom' to enable the
                        custom server address.

Release Note

  • 2014-09-08 1.4.4

    • Support configurable bing server address (#27)
  • 2014-04-18 1.4.4b01

    • Support download records database (#18), you can build you own bing album now.
  • 2013-12-24 1.4.3

    • Fix #13 enhance robustness of network connection status: retry in 60 seconds after network failure
    • Fix #14 download image with Chinese logo whenever a 1920x1200 picture is downloaded: add a collect mode, read use collect mode 使用收集模式 for more
    • Fix #15 use n=1 instead of n=10 for more backtracking room: change default n to 1
    • Fix #16 can't read settings.conf when run out of installation dir: read settings.conf from the same path of main.py by default
  • 2013-12-24 1.4.2

  • 2013-12-21 1.4.1

    • Background mode bugfix
  • 2013-12-21 1.4.0

    • Use configuration file;
    • Support specify market
    • Support manually set picture resolution
    • Support downloading 1920x1080 images for pages without wallpaper link
  • 2013-09-24 1.3.0

    • supports high resolution wallpapers
    • change default checking interval to 2 hours
    • obsolete option -f and --persistence
    • fix none type error when offset exceeds boundary issue #2
    • fix none type error when download picture fails issue #3