Code Monkey home page Code Monkey logo

quickwall's Introduction

QuickWall


How It Works   |   Installation   |   Requirements   |   Usage   |   TODO   |   Acknowledgements   

forthebadge made-with-python

Travis (.org) License PyPI PyPI - Downloads PRs Welcome

How It Works

It detects your DE or WM, gets wallpapers from Unsplash and sets them using either your choice of wallpaper setter or by nitrogen. Not enough? It can also change your theme based on the wallpapers that it gets, thanks to pywal.

Installation

  • It is available in Pypi
pip3 install QuickWall
  • Available in AUR here
yay -S quickwall

NOTE: The directory is changed from ~/.QuickWall to ~/.cache/QuickWall. Early users can use --migrate option to move their data.

OR

  • Run the following command in the root directory to install QuickWall.
python setup.py install

NOTE: If you get permission denied error, run the above command with sudo.

Requirements

  1. Python 3.6+

  2. Currently supported wallpaper setters

NOTE: These dependencies in linux can be installed in other variants.
For arch linux, you can use pacman package manager accordingly.

Usage

usage: quickwall [-h] [--version] [--clear-cache] [--setter SETTER] [-d] [-t]
                 [--remove-id ID] [--dir DIR] [--id ID] [--random]
                 [--search TERM] [--migrate] [--set-lockscreen]
                 [--level LEVEL] [--list-level]

QuickWall - Quickly set latest wallpapers from Unsplash directly from the
commandline.

options:
  -h, --help            show this help message and exit
  --version             show the program version number and exit
  --clear-cache         Clear the cache from the cache folder
                        (~/.cache/QuickWall)
  --setter SETTER       Wallpaper setter to be used. Currently supported ones:
                        nitrogen, feh, xfce, kde, gnome, unity (default: auto)
  -d, --disable-blacklist
                        Disable adding the image to blacklisted ones.
  -t, --disable-theme   Disable setting a colorscheme extracted from the
                        wallpaper
  --remove-id ID        Remove the passed ID from the blacklist.
  --dir DIR             Directory to download the wallpapers
  --id ID               Get a photo by its ID.
  --random              Get random wallpapers.
  --search TERM         Show wallpapers based on the passed term
  --migrate             ONLY FOR EARLY USERS. Move the files from ~/.QuickWall
                        to ~/.cache/QuickWall.
  --set-lockscreen      Set lockscreen wallpaper (currently for KDE)

Logger:
  --level LEVEL         The level of the logger that will be used while
                        verbosing. Use `--list-level` to check available
                        options.
  --list-level          List all the available logger levels.

TODO

  • Add tests
  • Add support for different wallpaper setters (raise an issue if you want me to support some particular one)
  • Handle errors better
  • Add support for GNOME/Unity
  • Add support for XFCE
  • Add automatic detection of wallpaper setter depending on the OS. Fallback would be nitrogen.
  • Add support to restore wallpapers for KDE.
  • Add a logger
  • Add support to search

Acknowledgements

quickwall's People

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

quickwall's Issues

Getting "IndexError: list index out of range" when using feh

If I run QuickWall without arguments it works showing just a couple Gtk warnings which I don't think are related to QuickWall on its own. I'm on Linux Mint 19.2 with Cinnamon. Here's the output using feh:

➜  ~ QuickWall --setter feh
[Setter]: Using feh as wallpaper setter
Traceback (most recent call last):
  File "/usr/local/bin/QuickWall", line 119, in <module>
    main()
  File "/usr/local/bin/QuickWall", line 104, in main
    setter = wall_setter.get_setter()
  File "/usr/local/lib/python3.6/dist-packages/QuickWall/setter.py", line 36, in get_setter
    return self.setter()
  File "/usr/local/lib/python3.6/dist-packages/QuickWall/feh.py", line 16, in __init__
    self.current = self._find_current()
  File "/usr/local/lib/python3.6/dist-packages/QuickWall/feh.py", line 22, in _find_current
    return open(self.feh_config_path).read().split(' ')[4]
IndexError: list index out of range

The warnings shown after the wallpaper is set just by running QuickWall:

Gtk-Message: 19:26:59.369: Failed to load module "appmenu-gtk-module"
UNKNOWN ROOT WINDOW TYPE DETECTED (Nemo-desktop), please file a bug
Save this wallpapers? [Y]es [N]o [E]xit y
Gtk-Message: 19:27:02.695: Failed to load module "appmenu-gtk-module"
UNKNOWN ROOT WINDOW TYPE DETECTED (Nemo-desktop), please file a bug

Unsplash API Terms of Use violation?

Just wondering, because when we create a new Unsplash app, we have to click and agree that the app is not "🚫 a wallpaper app [which] returns Unsplash images for downloading. Without the integration, the app has no content and no value to users."

I'd say that matches this app. I wanted to write one of these applications myself but in Go, but this condition stopped me from going forward with using Unsplash.

Can you or someone with more knowledge verify this isn't the case?

See: Guideline: Replicating Unsplash

Error When Running

When I try to start it gives

Traceback (most recent call last):
  File "/usr/bin/QuickWall", line 7, in <module>
    from QuickWall.SetPaper import SetPaper
ModuleNotFoundError: No module named 'QuickWall'

error.(installed from aur, wm is i3, python version is 3.8)

Need testers for XFCE.

I am trying to add support for XFCE, need someone who is using XFCE and is willing to test the app.

FileNotFoundError: [Errno 2] No such file or directory: 'nitrogen'

Hi,
I am on XFCE image from xubuntu.org
Not running nitrogen.
Getting this error when run QuickWall without any parameters:

3 MB   | 2   Mb/s || ETA: 0 s                                                                                                                                                                  |----------------------------------------| 100%Traceback (most recent call last):
  File "/home/graff/.local/bin/QuickWall", line 96, in <module>
    main()
  File "/home/graff/.local/bin/QuickWall", line 91, in main
    set_paper.do()
  File "/home/graff/.local/lib/python3.8/site-packages/QuickWall/SetPaper.py", line 107, in do
    self._set()
  File "/home/graff/.local/lib/python3.8/site-packages/QuickWall/SetPaper.py", line 68, in _set
    self.setter_type.set(self._file_path)
  File "/home/graff/.local/lib/python3.8/site-packages/QuickWall/nitrogen.py", line 28, in set
    p = subprocess.Popen(c.split(' '), stdout=subprocess.PIPE)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nitrogen'

OS:

OS: Ubuntu 20.04.1 LTS x86_64 
Kernel: 5.4.0-59-generic 
Uptime: 2 days, 14 hours, 27 mins 
Packages: 2535 (dpkg), 27 (flatpak), 18 (snap) 
Shell: bash 5.0.17 
Resolution: 1920x1080 
DE: Xfce 
WM: Xfwm4 
WM Theme: Xfce-Simple-Dark 
Theme: Xfce-Simple-Dark [GTK2], Greybird [GTK3] 
Icons: elementary-xfce-darker [GTK2/3] 

raise ResolutionError( pkg_resources.ResolutionError: Script 'scripts/QuickWall' not found in metadata

Hello, I am having an issue using QuickWall after installing using the following commands:

git clone https://github.com/deepjyoti30/QuickWall
cd QuickWall
sudo python3 setup.py install

Python version: 3.8.1
Distro: Void Linux

Running QuickWall only outputs this error:

➜  ~ QuickWall --search
Traceback (most recent call last):
  File "/usr/sbin/QuickWall", line 4, in <module>
    __import__('pkg_resources').run_script('QuickWall==0.0.2', 'QuickWall')
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1451, in run_script
    raise ResolutionError(
pkg_resources.ResolutionError: Script 'scripts/QuickWall' not found in metadata at '/home/vic/.local/lib/python3.8/site-packages/QuickWall-0.0.2.dist-info'

Unable to start QuickWall

Hey, thanks for your nice looking project!

I wanted to try it and installed QuickWall with pip3 install QuickWall on a Debian 9 Maschine.
Current Python3 Version is 3.5.3.

This error appears on the first run of QuickWall:

Traceback (most recent call last):
  File "/home/jens/.local/bin/QuickWall", line 7, in <module>
    from QuickWall.SetPaper import SetPaper
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/SetPaper.py", line 8, in <module>
    from QuickWall.blacklist import Blacklist
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/blacklist.py", line 8, in <module>
    logger = Logger("blacklist")
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/logger.py", line 17, in __init__
    self._check_logfile()
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/logger.py", line 34, in _check_logfile
    os.makedirs(self._log_file.parent)
  File "/usr/lib/python3.5/os.py", line 226, in makedirs
    head, tail = path.split(name)
  File "/usr/lib/python3.5/posixpath.py", line 103, in split
    i = p.rfind(sep) + 1
AttributeError: 'PosixPath' object has no attribute 'rfind'

When I manually create ~/.QuickWall/logs the following error occours:

Traceback (most recent call last):
  File "/home/jens/.local/bin/QuickWall", line 7, in <module>
    from QuickWall.SetPaper import SetPaper
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/SetPaper.py", line 8, in <module>
    from QuickWall.blacklist import Blacklist
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/blacklist.py", line 8, in <module>
    logger = Logger("blacklist")
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/logger.py", line 17, in __init__
    self._check_logfile()
  File "/home/jens/.local/lib/python3.5/site-packages/QuickWall/logger.py", line 35, in _check_logfile
    f = open(self._log_file, 'w')
TypeError: invalid file: PosixPath('/home/jens/.QuickWall/logs/log.cat')

The path ~/.QuickWall/logs is valid and writable.

Please contact me if you need more information.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

PKGBUILD has nitrogen as dependency

AUR package has nitrogen as dependency, it isn't optional. I'm running Manjaro Xfce and I suppose there's no actual need for nitrogen unless it's explicitly run from the code by default?

Bug using ID

the application is a nice tools but is lacking a way to restore the configuration or/and there's a bug.

I checked all the parameters that the application allows since I could found way to "preserve" I decide to run

quickwall --search anime --setter feh --level DEBUG
[main] args passed:  Namespace(clear_cache=False, setter='feh', disable_blacklist=False, disable_theme=False, remove_id=None, dir=None, id=None, random=False, search='anime', migrate=False, set_lockscreen=False, level='DEBUG', list_level=False)
[Wall] Adding search term [anime] to URL 
[Setter] Using feh as wallpaper setter 
[feh] '/home/rkmax/.cache/QuickWall/Hxu9Q0V-ohc.jpg' 
[main] Getting the wallpapers using Unsplash API... 
[Wall] Found: 30 papers 
[SetPaper] Saving images to /home/rkmax/.cache/QuickWall 
[blacklist] ['bkjMDE3qdYE', 'mfb_evGFm78', 'sn9A10W1Lmk', 'UnfxhYIgHmc', 'PQekXBVXrlM', 'L2g7tEEAwV4', 'cYLwuQrTYYI', 'ljEXet84nL8', 'h13iaGlFOvs', 'F6G3RtH_Woo', 'Hxu9Q0V-ohc'] 
[SetPaper] Found in blacklisted ones 
[blacklist] ['bkjMDE3qdYE', 'mfb_evGFm78', 'sn9A10W1Lmk', 'UnfxhYIgHmc', 'PQekXBVXrlM', 'L2g7tEEAwV4', 'cYLwuQrTYYI', 'ljEXet84nL8', 'h13iaGlFOvs', 'F6G3RtH_Woo', 'Hxu9Q0V-ohc'] 
[SetPaper] Found in blacklisted ones 
[blacklist] ['bkjMDE3qdYE', 'mfb_evGFm78', 'sn9A10W1Lmk', 'UnfxhYIgHmc', 'PQekXBVXrlM', 'L2g7tEEAwV4', 'cYLwuQrTYYI', 'ljEXet84nL8', 'h13iaGlFOvs', 'F6G3RtH_Woo', 'Hxu9Q0V-ohc'] 
[SetPaper] a snow covered mountain under a night sky by Alain Bonnardeaux 
Size: 8 MB
Saving as: /home/rkmax/.cache/QuickWall/6V9YVAnHTJc.jpg
8 MB   | 17  Mb/s || ETA: 0 s                                                        |----------------------------------------| 100%[wal] /home/rkmax/.cache/QuickWall/6V9YVAnHTJc.jpg 

I Assume that 6V9YVAnHTJc is the ID

I run again quickwall --search anime --setter feh --level DEBUG to change the wallpaper

and now run

quickwall --id 6V9YVAnHTJc --setter feh --level DEBUG     
[main] args passed:  Namespace(clear_cache=False, setter='feh', disable_blacklist=False, disable_theme=False, remove_id=None, dir=None, id='6V9YVAnHTJc', random=False, search=None, migrate=False, set_lockscreen=False, level='DEBUG', list_level=False)
[Wall] Adding ID to URL 
[Setter] Using feh as wallpaper setter 
[feh] '/home/rkmax/.cache/QuickWall/6V9YVAnHTJc.jpg' 
[main] Getting the wallpapers using Unsplash API... 
[Wall] Found: 1 papers 
[SetPaper] Saving images to /home/rkmax/.cache/QuickWall 
[blacklist] ['bkjMDE3qdYE', 'mfb_evGFm78', 'sn9A10W1Lmk', 'UnfxhYIgHmc', 'PQekXBVXrlM', 'L2g7tEEAwV4', 'cYLwuQrTYYI', 'ljEXet84nL8', 'h13iaGlFOvs', 'F6G3RtH_Woo', 'Hxu9Q0V-ohc', '6V9YVAnHTJc'] 
[SetPaper] Found in blacklisted ones 

and nothing happens

it looks like anything that is in the cache will not be used again

QuickWall expects `feh` to have previously initialized

I had installed feh with QuickWall together and upon the first run of QuickWall there were errors thrown about missing files related to feh.

The error raised was a python missing file error that was looking for a .fehbg file. In this case the file in question was only missing because I hadn't previously run feh.

After running feh and setting a placeholder background, QuickWall was working as expected.

terminal colors lost on new window

This tool is really cool, thanks for putting it together for us. I use it on gnome, and whenever I open a new terminal it reverts back to the default palette. Is there a way to make it persist?

QuickWall Colors

The color scheme is removed if I restart the computer. (Arch Linux i3-gaps downloaded from AUR)

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.