Skip to content

Commit

Permalink
xfce_displays removed from configuration.
Browse files Browse the repository at this point in the history
Now, it is completely automatic.
  • Loading branch information
boramalper committed Aug 16, 2016
1 parent 2bd487b commit cb1f47f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions himawaripy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import appdirs

import subprocess

# Increases the quality and the size. Possible values: 4, 8, 16, 20
level = 4

Expand All @@ -19,8 +17,3 @@
output_file = os.path.join(appdirs.user_cache_dir(appname="himawaripy",
appauthor=False),
"latest.png")

# Xfce4 displays to change the background of
xfce_displays = subprocess.getoutput(
'xfconf-query --channel xfce4-desktop --list | grep last-image').split()

7 changes: 4 additions & 3 deletions himawaripy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import subprocess
from distutils.version import LooseVersion

from .config import xfce_displays


def set_background(file_path):
de = get_desktop_environment()
Expand All @@ -22,7 +20,10 @@ def set_background(file_path):
elif de == 'i3':
subprocess.call(['feh','--bg-max',file_path])
elif de == "xfce4":
for display in xfce_displays:
# Xfce4 displays to change the background of
displays = subprocess.getoutput('xfconf-query --channel xfce4-desktop --list | grep last-image').split()

for display in displays:
subprocess.call(["xfconf-query", "--channel", "xfce4-desktop", "--property", display, "--set", file_path])
elif de == "lxde":
subprocess.call(["pcmanfm", "--set-wallpaper", file_path, "--wallpaper-mode=fit", ])
Expand Down

0 comments on commit cb1f47f

Please sign in to comment.