diff options
| author | Dylan Araps <dylanaraps@users.noreply.github.com> | 2017-07-24 22:29:11 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-24 22:29:11 +1000 |
| commit | 7f2bc603c3944707a07f856f98bc29dfe45d6d9b (patch) | |
| tree | c8a2f1dd67b8b82b0fba7c714aa1fb0e2a05b997 /pywal/reload.py | |
| parent | ed49a5c793b47e8b8e701a06a4372770babb950d (diff) | |
| parent | 4fecce6e9c326970a73f8f3a599be8a02aeea381 (diff) | |
Merge pull request #57 from dylanaraps/gtk2
general: Added GTK2 support.
Diffstat (limited to 'pywal/reload.py')
| -rw-r--r-- | pywal/reload.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pywal/reload.py b/pywal/reload.py index 322f581..36c3770 100644 --- a/pywal/reload.py +++ b/pywal/reload.py @@ -1,6 +1,7 @@ """ Reload programs. """ +import pathlib import re import shutil import subprocess @@ -19,6 +20,24 @@ def xrdb(xrdb_file=None): stderr=subprocess.DEVNULL) +def gtk(): + """Move gtkrc files to the correct location.""" + home = pathlib.Path.home() + theme_path = home / ".themes" / "Flatabulous-wal" + gtk2_file = __cache_dir__ / "colors-gtk2.rc" + + if theme_path.is_dir(): + if gtk2_file.is_file(): + shutil.copy(gtk2_file, theme_path / "gtk-2.0") + + # Here we call a Python 2 script to reload the GTK themes. + # This is done because the Python 3 GTK/Gdk libraries don't + # provide a way of doing this. + if shutil.which("python2"): + module_dir = pathlib.Path(__file__).parent + util.disown("python2", module_dir / "scripts" / "gtk_reload.py") + + def i3(): """Reload i3 colors.""" if shutil.which("i3-msg"): @@ -34,6 +53,7 @@ def polybar(): def env(xrdb_file=None): """Reload environment.""" xrdb(xrdb_file) + gtk() i3() polybar() print("reload: Reloaded environment.") |
