Git Product home page Git Product logo

daily-reddit-wallpaper's People

Contributors

acidduk avatar joesanford avatar krabby127 avatar naps62 avatar ouo avatar remggo avatar silencecm avatar ssimunic avatar troeggla avatar wynro avatar yeonsh avatar zwparchman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

daily-reddit-wallpaper's Issues

Conflicts between Daily-Reddit-Wallpaper and update-checker

Hi, users are unable to run Daily-Reddit-Wallpaper due to dependency conflict with update-checker package.
As shown in the following full dependency graph of Daily-Reddit-Wallpaper, it directly requires update-checker==0.11,while praw==5.4.0 requires update-checker>=0.16.

According to pip’s “first found wins” installation strategy, update-checker==0.11 is the actually installed version.
However, update-checker==0.11 does not satisfy update-checker>=0.16.

Dependency tree

daily-reddit-wallpaper-master
| +-decorator(version range:==4.0.10)
| +-future(version range:==0.15.2)
| | +-argparse(version range:*)
| | +-importlib(version range:*)
| | +-unittest2(version range:*)
| +-praw(version range:==5.4.0)
| | +-prawcore(version range:<0.15,>=0.14.0)
| | | +-requests(version range:<3.0,>=2.6.0)
| | +-update-checker(version range:>=0.16)
| | | +-requests(version range:>=2.3.0)
| +-requests(version range:==2.10.0)
| +-six(version range:==1.10.0)
| +-update-checker(version range:==0.11)
| | +-requests(version range:>=2.3.0)

Thanks for your help.
Best,
Neolith

Suggestion: use a library for handling wallpaper

There is a library, libdesktop, that you can use to ease development, maintenance and add support for more platforms.

Install:

pip install libdesktop

And then it's just:

import libdesktop

libdesktop.set_desktop_wallpaper(image)

Also:

It even has a add_to_system_startup() function, but probably you'll not want it since you want users to handle that through cron/Task Scheduler.

Check if the photo is still available at execution

Once, a photo hosted on Imgur made it's way to the top of the subreddit. However when I ran the script, the photo was no longer available on Imgur. As a result my desktop background was a big 'not available' or something.

Do you think there is a way to prevent that ?

An issue with installing praw in Ubuntu via pip

For me (Ubuntu 14.04LTS, python 2.6.7) sudo pip install praw or installing it with requirements.txt does not work. Using sudo python -m pip install praw works just fine. Sure, it's not an issue with your script, but if other users experience it as well, it'd be better to use python -m pip method in README.md. Complete log below.

morozov@pozdnyak-desktop:~/tools/Daily-Reddit-Wallpaper-master$ sudo pip install -r requirements.txt 
[sudo] password for morozov: 
The directory '/home/morozov/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/morozov/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting decorator==4.0.10 (from -r requirements.txt (line 1))
  Downloading decorator-4.0.10-py2.py3-none-any.whl
Collecting future==0.15.2 (from -r requirements.txt (line 2))
  Downloading future-0.15.2.tar.gz (1.6MB)
    100% |████████████████████████████████| 1.6MB 49kB/s 
Collecting praw==3.5.0 (from -r requirements.txt (line 3))
  Downloading praw-3.5.0-py2.py3-none-any.whl (69kB)
    100% |████████████████████████████████| 71kB 41kB/s 
Collecting requests==2.10.0 (from -r requirements.txt (line 4))
  Downloading requests-2.10.0-py2.py3-none-any.whl (506kB)
    100% |████████████████████████████████| 512kB 164kB/s 
Collecting six==1.10.0 (from -r requirements.txt (line 5))
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting update-checker==0.11 (from -r requirements.txt (line 6))
  Downloading update_checker-0.11-py2.py3-none-any.whl
Installing collected packages: decorator, future, six, requests, update-checker, praw
  Running setup.py install for future ... done
  Found existing installation: six 1.5.2
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.5.2:
      Successfully uninstalled six-1.5.2
  Found existing installation: requests 2.13.0
    Uninstalling requests-2.13.0:
      Successfully uninstalled requests-2.13.0
Successfully installed decorator-4.0.10 future-0.15.2 praw-3.5.0 requests-2.10.0 six-1.10.0 update-checker-0.11
morozov@pozdnyak-desktop:~/tools/Daily-Reddit-Wallpaper-master$ ./change_wallpaper_reddit.py 
Traceback (most recent call last):
  File "./change_wallpaper_reddit.py", line 7, in <module>
    import praw
ImportError: No module named praw 
morozov@pozdnyak-desktop:~/tools/Daily-Reddit-Wallpaper-master$ python
Python 2.7.6 (default, Oct 26 2016, 20:32:47) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import praw
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named praw
>>> 
morozov@pozdnyak-desktop:~/tools/Daily-Reddit-Wallpaper-master$ sudo pip install praw
The directory '/home/morozov/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/morozov/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: praw in /usr/local/lib/python3.4/dist-packages
Requirement already satisfied: requests>=2.3.0 in /usr/local/lib/python3.4/dist-packages (from praw)
Requirement already satisfied: decorator<4.1,>=4.0.9 in /usr/local/lib/python3.4/dist-packages (from praw)
Requirement already satisfied: update-checker==0.11 in /usr/local/lib/python3.4/dist-packages (from praw)
Requirement already satisfied: six==1.10 in /usr/local/lib/python3.4/dist-packages (from praw)
morozov@pozdnyak-desktop:~/tools/Daily-Reddit-Wallpaper-master$ python
Python 2.7.6 (default, Oct 26 2016, 20:32:47) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import praw
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named praw

PRAW 4.0.0b23 does not have "get_subreddit" call and now requires auth

Traceback (most recent call last): File "./change_wallpaper_reddit.py", line 166, in <module> r = praw.Reddit(user_agent="Get top wallpaper from /r/{subreddit} by /u/ssimunic".format(subreddit=subreddit)) File "/usr/local/lib/python2.7/dist-packages/praw-4.0.0b23-py2.7.egg/praw/reddit.py", line 101, in __init__ raise ClientException(required_message.format(attribute)) praw.exceptions.ClientException: Required configuration setting 'client_id' missing. This setting can be provided in a praw.ini file, as a keyword argument to the Reddit class constructor, or as an environment variable.

If I add my client_id and client_secret to the initializer, I get a different error:

r = praw.Reddit(user_agent="Get top wallpaper from /r/{subreddit} by u/ssimunic".format(subreddit=subreddit), client_id='[redacted]', client_secret='[redacted]')

Traceback (most recent call last): File "./change_wallpaper_reddit.py", line 171, in <module> image = get_top_image(r.get_subreddit(subreddit)) AttributeError: 'Reddit' object has no attribute 'get_subreddit'

Script does not work as a cron job.

It appears that when running this script as a cron job, the code falls through all of the desktop environment checks. The image is downloaded from reddit, but it never gets set as a wallpaper. Here's what I captured in my log.

Traceback (most recent call last):
File "./change_wallpaper_reddit.py", line 205, in
desktop_environment = detect_desktop_environment()
File "./change_wallpaper_reddit.py", line 148, in detect_desktop_environment
info = subprocess.getoutput("xprop -root _DT_SAVE_MODE")
AttributeError: 'module' object has no attribute 'getoutput'

Add support for resolution detection

I guess we can all agree that a full hd wallpaper won't look good on a normal laptop, it's better to get first matching wallpaper with local resolution or at least provide a resize option

Not working on Plasma 5.7

method void org.kde.PlasmaShell.evaluateScript(QString script)
method void org.kde.PlasmaShell.loadKWinScriptInInteractiveConsole(QString script)
method void org.kde.PlasmaShell.loadScriptInInteractiveConsole(QString script)
method void org.kde.PlasmaShell.setDashboardShown(bool show)
method void org.kde.PlasmaShell.showInteractiveConsole()
method void org.kde.PlasmaShell.showInteractiveKWinConsole()
method void org.kde.PlasmaShell.toggleActivityManager()
method void org.kde.PlasmaShell.toggleDashboard()
signal void org.freedesktop.DBus.Properties.PropertiesChanged(QString interface_name, QVariantMap changed_properties, QStringList invalidated_properties)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
sh: line 13: org.kde.PlasmaShell.evaluateScript: command not found

Fails If Image Not Found

At lines 169-170, if a suitable image isn't found, the script crashes, since nothing is returned from the get_top_image function in that case. Here's the error message:

Traceback (most recent call last):
  File "./change_wallpaper_reddit.py", line 170, in <module>
    if "url" not in image:
TypeError: argument of type 'NoneType' is not iterable

It's causing problems when trying to change my background hourly with the --time hour option.

Accept a parameter for subreddit

So you can pick the subreddit on each run. I like using earthporn. I've just manually changed it in the code for now but would be easier for the casual end-user.

Add fallback option to feh

i3, awesome and similar desktop users usually use feh to set background for desktop. Adding a fallback option to feh easily adds support for this desktops.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.