Downloads daily Bing images and sets them as desktop wallpaper
[TOC]
Please do not download or use any image that violates its copyright terms.
Recommended option:
git clone https://github.com/alexbigkid/abk_bwp
cd abk_bwp
or
pip install abk_bwp
make install
make bwp
Please see the file abk_bwp/config/bwp_config.toml file. There are some setting you might want to change. Like the image size, which should ideally correspond to the size of your display. In the config file you will find also detailed explanation, what exactly each configuration item is for.
For Uploading the images to TV please see the abk_bwp/config/ftv_data.toml configuration.
If you are like me and don't want to mix your python packages, you want to create python virtual environment before installing dependencies. I use pyenv tool for that. Here are the steps on MacOS:
- install brew. Google for it if you don't have it already
- brew install pyenv - will install pyenv tool
- brew install pyenv-virtualenv - installs virtualenv pyenv version
- pyenv versions - will show you currently installed python versions and virtual envs on your system
- pyenv install --list - will show you all available python versions you could install.
- pyenv install 3.11.0 - installs python 3.8.9 version
- pyenv virtualenv 3.11.0 bwp - creates virtual environment [bing wall paper] with python 3.11.0
- cd <your_project_dir> - change into your project directory e.g.: cd abk_bwp
- pyenv local bwp - setting the current directory to use [bwp] virtual environment
- make install - will install all needed python dependency packages into [bwp] virtual environment.
- make bwp - will download bing image and add title to the image
If it is too many steps for you and just want to get it working "quick and dirty". Warning: there might be some python packages, which might collide with already installed packages.
- cd abk_bwp - change to the project directory
- make install - to install python dependency packages in default location
- make bwp - will download bing image and add title to the image
There are some Makefile rules, which are created for your convenience. For more help with rules type: make help Here are some described in the table
makefile rule | description |
---|---|
bwp | executes the abk_bwp program, which downloads Bing images and creates a desktop image |
bwp_log | executes the abk_bwp program with logging into a file |
bwp_trace | executes the abk_bwp program with traces in console |
bwp_desktop_enable | executes the abk_bwp program, enables auto download (time configured in bwp_config.toml) |
bwp_desktop_disable | executes the abk_bwp program, disables auto download (time configured in bwp_config.toml) |
bwp_ftv_enable | WIP: executes the abk_bwp program, enables Samsung frame TV support (Not working yet) |
bwp_ftv_disable | WIP: executes the abk_bwp program, disables Samsung frame TV support (Not working yet) |
install | installs required packages |
install_test | installs required packages for test |
install_dev | installs required packages for development |
test | runs test |
test_v | runs test with verbose messaging |
test_ff | runs test fast fail |
test_vff | runs test fast fail with verbose messaging |
test_1 <file.class.test> | runs a single test |
coverage | runs test, produces coverage and displays it |
clean | cleans some auto generated build files |
settings | outputs current settings |
help | outputs this info |
In order to debug python scripts, you could enable the traces in the logging.yaml file by changing levels from CRITICAL to DEBUG
The project contains com.abk.bingwallpaper_debug.sh.plist file, which can be used to debug scheduler problems.
- Copy com.abk.bingwallpaper_debug.sh.plist to ~/Library/LaunchAgents/ directory.
- change to directory: cd ~/Library/LaunchAgents
- load the scheduler with: launchctl load -w com.abk.bingwallpaper_debug.sh.plist
- start the job with: launchctl start com.abk.bingwallpaper_debug.sh
- check the job run: launchctl list | grep com.abk.bingwallpaper_debug.sh if it return 0 the job ran successfully
- the traces will be available in /tmp/com.abk.bingwallpaper_debug.sh.stderr and /tmp/com.abk.bingwallpaper_debug.sh.stdout
- after troubleshooting don't forget to disable the job for the debug scheduler
- execute following launchctl stop com.abk.bingwallpaper_debug.sh launchctl unload -w com.abk.bingwallpaper_debug.sh.plist
- delete the debug file from ~/Library/LaunchAgents rm com.abk.bingwallpaper_debug.sh.plist in: ~/Library/LaunchAgents
- MacOS Ventura (local machine) / Python 3.11.5
- Linux Ubuntu 20.04 / Python 3.11.5
- Windows 10 / Python 3.11.5
- Linux latest / Python 3.8.x, 3.9.x, 3.10.x, 3.11.x
- MacOS latest / Python 3.8.x, 3.9.x, 3.10.x, 3.11.x
- Windows latest / Python 3.8.x, 3.9.x, 3.10.x, 3.11.x