Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python3 compatibility + a few minor changes #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add Python3 compatibility + a few minor changes #86

wants to merge 3 commits into from

Conversation

deliberist
Copy link

Hi, I love you project! I needed the exact same thing to use images from Reddit as desktop wallpapers, but I'm running a system without Python2. I updated the code so that it can run under Python3. I do not believe I broke anything if yourself (or anyone else) has to still run the code with Python2. But I was not able to test that (sorry!).

If interested, I use this script to update my wallpaper given that all my downloaded Reddit pics are in a "backgrounds" directory in the RedditImageGrab project.

#!/usr/bin/env bash

set -o errexit
set -o nounset

LOG_FILE=${HOME}/.fehbg.log

function log() {
  date "+%Y/%m/%d %H-%M-%S: ${*}" | tee -a ${LOG_FILE}
}

WALLPAPER_DIR="${HOME}/Development/RedditImageGrab/backgrounds"
WALLPAPER_FILE="$(find "${WALLPAPER_DIR}" -type f | sort -R | head -n 1)"
WALLPAPER_CMD="feh --bg-scale ${WALLPAPER_FILE}"

log ${WALLPAPER_CMD}
eval ${WALLPAPER_CMD}

Feel free to reject the pull-request if something is broken when running with Python2 and I'll look into fixing it.

Thanks! And again, great project!

@rachmadaniHaryono
Copy link
Contributor

@rbprogrammer you may have better chance merging it with @jtara1 repo because it is more updated and adapted to python 3 already

see also other pr like #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants