colors: Reload i3 colors
@@ -469,6 +469,15 @@ def export_xrdb(colors, export_file):
subprocess.call(["xrdb", "-merge", export_file])
+def reload_i3():
+ """Reload i3 colors."""
+ if shutil.which("i3-msg"):
+ subprocess.Popen(["i3-msg", "reload"],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ preexec_fn=os.setpgrp)
+
+
def export_colors(colors):
"""Export colors in various formats."""
save_colors(ColorType.plain, CACHE_DIR / "colors", "plain hex colors")
@@ -487,6 +496,9 @@ def export_colors(colors):
export_emacs(colors)
export_xrdb(ColorType.xrdb, CACHE_DIR / "xcolors")
+ # i3 colors.
+ reload_i3()
+
# }}}
