markubiak / wallpaper-reddit

Downloads and sets wallpapers pulled from reddit.com
GNU General Public License v3.0
113 stars 42 forks source link

added i3 desktop detection #35

Closed alexmohr closed 7 years ago

alexmohr commented 7 years ago

Because the last update broke the usage of environment variables, like ~ , this commit adds an option to detect the i3 desktop and set the wallpaper by using 'feh'

Before the last commit it was possible to use the following configuration. [SetCommand] setcommand = feh --bg-max ~/.wallpaper/wallpaper.jpg

It would be great if something would be implemented that the configuration above can be used again.

markubiak commented 7 years ago

Hi there, sorry for the late response.

I'd love to make ~ resolution work again. I migrated from os.system() to subprocess.check_call(), which is a good move, but I did not know that it broke user path expansion. I'll do some testing to confirm this and do some googling for workarounds.

As for i3, was under the impression that it was a window manager and did not have a standard method to set wallpapers. At least this was my impression when I briefly used it.

Mark

alexmohr commented 7 years ago

Your impression on i3 is correct, although using 'feh' might​ be the most common approach. But fixing path expansion would probably be the smartest move.

markubiak commented 7 years ago

Alex, If you can, please try the latest fix on the Dev branch. It runs the custom command in shell mode instead of normal mode. This isn't recommended due to the possible injection of fork bombs and other syntactical nightmares, but I have no issue using it for custom commands since the user is already setting that parameter. If they want to screw up their own computer, that's fine by me.

alexmohr commented 7 years ago

Sorry for the late answer. I've tried the dev branch and it works like a charm. I'm closing this pull request because it is not really necessary anymore. Thanks for your work.

Stolous commented 7 years ago

Hi there. I was wondering, why isn't this PR accepted ? feh is widly used to set wallpaper for a lot of window managers. It'd be great if this was supported by default. I was about to make this change myself and do a pull request when I saw this one.

alexmohr commented 7 years ago

I've closed the PR because @markubiak fixed the issue with the path resolution. If you want to use feh it is possible to define a set command in your configuration.

[SetCommand] setcommand = feh --bg-max ~/.wallpaper/wallpaper.jpg

Stolous commented 7 years ago

Yeah that's what I use but I thought it would be great to implement so the program could use feh by default if i3 is detected.

markubiak commented 7 years ago

Thought about this a bit. If either of you can provide a source from someone who works on i3 or works closely with i3 stating that "feh" is the recommended way to set wallpapers, I'll accept this PR. I just want to make sure that the methods I'm using to automatically set wallpapers is universally correct and accepted.

Mark