boramalper / himawaripy

Set near-realtime picture of Earth as your desktop background
http://labs.boramalper.org/himawaripy
MIT License
1.62k stars 239 forks source link

Added support for simple window managers #28

Closed yupyupp closed 8 years ago

yupyupp commented 8 years ago

I added support for systems without DMs (ie WMs like DWM/Awesome/i3). If all other conditions fail I assume that we are running a simple WM and use feh to set the wallpaper. It also does not require any additional flags to be set.

Also, you should consider tossing a license in your repo when you get around to it (MIT might be a good choice). :)

rbong commented 8 years ago

I like how you throw "use_feh" from get_desktop_environment (). You can check if feh exists with this function so it doesn't fail on call ():

def has_program(program):
    try:
        subprocess.check_output (["which", "--", program])
        return True
    except subprocess.CalledProcessError:
        return False
yupyupp commented 8 years ago

Heh. Yea, good call. Went ahead and threw that in/tested it (with and without feh installed) and it works :)

Stephen Haffner  Computer Science and Engineering | The Ohio State University  www.haffner.me  (513) 969-6754  stephen@kd8zev.net

On February 5, 2016 1:46:44 PM EST, rbong notifications@github.com wrote:

I like how you throw "use_feh" from get_desktop_environment (). You can check if feh exists with this function so it doesn't fail on call ():

def has_program(program):
   try:
       subprocess.check_output (["which", "--", program])
       return True
   except subprocess.CalledProcessError:
       return False

Reply to this email directly or view it on GitHub: https://github.com/boramalper/himawaripy/pull/28#issuecomment-180494700

boramalper commented 8 years ago

Instead of putting the logic in get_desktop_environment(), I added another conditional branch to himawaripy.py, which checks if feh is installed if we couldn't detect the DE and then uses it. I think it's better to keep get_desktop_environment() for getting desktop environment instead of deciding what to do. :)

yupyupp commented 8 years ago

Yea. That makes way more sense. I was about to head to work when I made that change so I didn't think it through all the way.

On February 5, 2016 2:16:15 PM EST, "Bora M. Alper" notifications@github.com wrote:

Instead of putting the logic in get_desktop_environment(), I added another conditional branch to himawaripy.py, which checks if feh is installed if we couldn't detect the DE and then uses it. I think it's better to keep get_desktop_environment() for getting desktop environment instead of deciding what to do. :)


Reply to this email directly or view it on GitHub: https://github.com/boramalper/himawaripy/pull/28#issuecomment-180507186

boramalper commented 8 years ago

No problem. Thanks a lot!