deepjyoti30 / QuickWall

Set latest wallpapers from Unsplash from the commandline
https://deepjyoti30.github.io/quickwall
MIT License
189 stars 8 forks source link

Need testers for XFCE. #10

Closed deepjyoti30 closed 4 years ago

deepjyoti30 commented 4 years ago

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

jimbob88 commented 4 years ago

I'm free to test this, feel free to drop me an e-mail - blackburnfjames@gmail.com

twisp007 commented 4 years ago

I am interested, let me know what I can do.

deepjyoti30 commented 4 years ago

@twisp007 Can you please try installing and running the latest commits and give me the logs.

Also give me the output of echo $DESKTOP_SESSION

Report back to this thread with your errors etc.

twisp007 commented 4 years ago
$ echo $DESKTOP_SESSION
/usr/share/xsessions/xfce

Pulled the latest version from git.

$ python QuickWall.py --setter xfce
[Setter]: Using xfce as wallpaper setter
[Setter]: --set-lockscreen not available for the current wallpaper setter
/home/xxxx/var/QuickWall/QuickWall/xfce.py:21: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 21 of the file /home/xxxx/var/QuickWall/QuickWall/xfce.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.

  soup = BeautifulSoup(open(FILE, 'r'))
[main]: Getting the wallpapers using Unsplash API...
[SetPaper]: Saving images to /home/xxxx/.cache/QuickWall
[SetPaper]: black and white photo of people riding motorcycle by Harley-Davidson
Size: 3 MB
Saving as: /home/xxxx/.cache/QuickWall/QD6GvrDFPAA.jpg
3 MB   | 780 Kb/s || ETA: 0 s                                                                                                                  |----------------------------------------| 100%

Save this wallpapers? [Y]es [N]o [E]xit Y
$ python QuickWall.py
[Setter]: Using nitrogen as wallpaper setter
[Setter]: --set-lockscreen not available for the current wallpaper setter
[main]: Getting the wallpapers using Unsplash API...
[SetPaper]: Saving images to /home/xxxx/.cache/QuickWall
[SetPaper]: black and white photo of people riding motorcycle by Harley-Davidson
Size: 3 MB
Saving as: /home/xxxx/.cache/QuickWall/QD6GvrDFPAA.jpg
3 MB   | 779 Kb/s || ETA: 0 s                                                                                                                  |----------------------------------------| 100%

(nitrogen:9467): GLib-GIO-ERROR **: 16:50:35.008: Settings schema 'org.gnome.desktop.background' does not contain a key named 'draw-background'

Save this wallpapers? [Y]es [N]o [E]xit Y

(nitrogen:9483): GLib-GIO-ERROR **: 16:50:40.426: Settings schema 'org.gnome.desktop.background' does not contain a key named 'draw-background

Fails to set wallpaper in both cases.

deepjyoti30 commented 4 years ago

@twisp007 Thanks for the reply.

Seems like there's some issue with detecting the setter in case of xfce. I'll reply back to you soon.

Also, are you sure it didn't work when you selected --setter xfce???

Edit: Can you please try running the app in debug mode and gimme the logs as well.?

To run in DEBUG mode, change line 12 in the logger.py to "DEBUG" from "INFO" and then install using sudo python setup.py install

jimbob88 commented 4 years ago

I downloaded the latest version and the result from the terminal, when forcing XFCE:

$ QuickWall --setter xfce
[Setter]: Using xfce as wallpaper setter
[Setter]: --set-lockscreen not available for the current wallpaper setter
/home/james/Documents/QuickWall-master/my_venv/lib/python3.7/site-packages/QuickWall-0.0.2-py3.7.egg/QuickWall/xfce.py:21: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 21 of the file /home/james/Documents/QuickWall-master/my_venv/lib/python3.7/site-packages/QuickWall-0.0.2-py3.7.egg/QuickWall/xfce.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.

[main]: Getting the wallpapers using Unsplash API...
[Wall]: Found: 30 papers
[SetPaper]: Saving images to /home/james/.cache/QuickWall
[blacklist]: ['BIufEmUshec', 'lxDYQM5E0bI']
[SetPaper]: Found in blacklisted ones
[blacklist]: ['BIufEmUshec', 'lxDYQM5E0bI']
[SetPaper]: Found in blacklisted ones
[blacklist]: ['BIufEmUshec', 'lxDYQM5E0bI']
[SetPaper]: Wallpaper by Tomas Robertson
Size: 3 MB
Saving as: /home/james/.cache/QuickWall/kZKqLbP_lU8.jpg
3 MB   | 2   Mb/s || ETA: 0 s                                                                                                                    |----------------------------------------| 100%Property "/backdrop/screen0/monitor0/workspace0/last-image" does not exist on channel "xfce4-desktop". If a new property should be created, use the --create option.
[wal]: /home/james/.cache/QuickWall/kZKqLbP_lU8.jpg
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 16
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 17
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 18
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 19
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 20
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 21
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 22
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 23
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 24
WARNING:root:Imagemagick couldn't generate a palette.
WARNING:root:Trying a larger palette size 25
WARNING:root:Couldn't write to /dev/pts/0.

Save this wallpapers? [Y]es [N]o [E]xit Y
Property "/backdrop/screen0/monitor0/workspace0/last-image" does not exist on channel "xfce4-desktop". If a new property should be created, use the --create option.
$ cat ~/.cache/QuickWall/logs/log.cat 
[Setter]-[2019-12-26 21:47:34]: Using xfce as wallpaper setter
[Setter]-[2019-12-26 21:47:34]: --set-lockscreen not available for the current wallpaper setter
[main]-[2019-12-26 21:47:34]: Getting the wallpapers using Unsplash API...
[Wall]-[2019-12-26 21:47:34]: Found: 30 papers
[SetPaper]-[2019-12-26 21:47:34]: Saving images to /home/james/.cache/QuickWall
[blacklist]-[2019-12-26 21:47:34]: ['BIufEmUshec', 'lxDYQM5E0bI']
[SetPaper]-[2019-12-26 21:47:34]: Found in blacklisted ones
[blacklist]-[2019-12-26 21:47:34]: ['BIufEmUshec', 'lxDYQM5E0bI']
[SetPaper]-[2019-12-26 21:47:34]: Found in blacklisted ones
[blacklist]-[2019-12-26 21:47:34]: ['BIufEmUshec', 'lxDYQM5E0bI']
[SetPaper]-[2019-12-26 21:47:34]: Wallpaper by Tomas Robertson
[wal]-[2019-12-26 21:47:36]: /home/james/.cache/QuickWall/kZKqLbP_lU8.jpg

This is with debug mode set and QuickWall reinstalled.

jimbob88 commented 4 years ago

Hi, I believe I have found two issues surrounding the source of your issue: For a start I believe you have made a mistake with your use of the string.format command, as it returns a string you need to place it back into the variable, so it should read self.cmd = self.cmd.format(wallpaper).

Next some monitors use different naming schemes, for example on one of my systems it uses the wallpaper /backdrop/screen0/monitor0/workspace0/last-image; however, on my other machine it uses: /backdrop/screen0/monitorLVDS-1/workspace0/last-image. To work this out I wrote this code:

from bs4 import BeautifulSoup
from pathlib import Path
FILE = Path("~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml").expanduser()
soup = BeautifulSoup(open(FILE, 'r'))
monitor = soup.find("property", attrs={"name": "last-image", "type": "string"}).parent.parent["name"] #["value"]
workspace = soup.find("property", attrs={"name": "last-image", "type": "string"}).parent["name"]
print(monitor, workspace)

Which grabs the name of the monitor & workspace of the monitor which has an already set wallpaper (it assumes that if you have that monitor active it will have a wallpaper)

Also one could run this command to get all of the monitors (Source):

xfconf-query --channel xfce4-desktop --list

Hope this helps, Jim

netguino commented 4 years ago

So, I see that the readme mentions that XFCE is supported, and I even see it striked out: https://github.com/deepjyoti30/QuickWall/blame/master/README.md#L58 https://github.com/deepjyoti30/QuickWall/blame/master/README.md#L79 and https://github.com/deepjyoti30/QuickWall/blame/master/README.md#L101

But this issue is still open, and I cannot seem to be able to use it either.

 QuickWall --setter xfce                                                                                                        [9:55:01]
[Setter]: Passed wallpaper setter is not supported yet!

Is there something that was not commited upstream, or simply bad docs? Happy to help where I can.

deepjyoti30 commented 4 years ago

@markitoxs XFCE support is added but a new release is yet to be drafted. You can clone and install the latest commits as xfce would be supported in it.

But I think you're using the last release which didn't have the support.