reload: Call oomox last.

This commit is contained in:
Dylan Araps 2018-01-08 19:00:30 +11:00
parent deffe200c5
commit 1d9925f454
2 changed files with 9 additions and 3 deletions

View File

@ -143,6 +143,10 @@ def process_args(args):
if args.o: if args.o:
util.disown([args.o]) util.disown([args.o])
if not args.e:
reload.oomox()
reload.gtk()
def main(): def main():
"""Main script function.""" """Main script function."""

View File

@ -29,8 +29,8 @@ def xrdb(xrdb_files=None):
subprocess.run(["xrdb", "-merge", "-nocpp", file]) subprocess.run(["xrdb", "-merge", "-nocpp", file])
def gtk(): def oomox():
"""Move gtkrc files to the correct location.""" """Call oomox to generate a theme."""
oomox_file = os.path.join(CACHE_DIR, "colors-oomox") oomox_file = os.path.join(CACHE_DIR, "colors-oomox")
if shutil.which("oomox-cli"): if shutil.which("oomox-cli"):
@ -38,6 +38,9 @@ def gtk():
subprocess.run(["oomox-cli", "-o", "wal", oomox_file], subprocess.run(["oomox-cli", "-o", "wal", oomox_file],
stdout=subprocess.DEVNULL) stdout=subprocess.DEVNULL)
def gtk():
"""Reload GTK theme on the fly."""
# Here we call a Python 2 script to reload the GTK themes. # Here we call a Python 2 script to reload the GTK themes.
# This is done because the Python 3 GTK/Gdk libraries don't # This is done because the Python 3 GTK/Gdk libraries don't
# provide a way of doing this. # provide a way of doing this.
@ -81,7 +84,6 @@ def colors(cache_dir=CACHE_DIR):
def env(xrdb_file=None): def env(xrdb_file=None):
"""Reload environment.""" """Reload environment."""
xrdb(xrdb_file) xrdb(xrdb_file)
gtk()
i3() i3()
sway() sway()
polybar() polybar()