aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <[email protected]>2017-06-17 17:02:47 +1000
committerDylan Araps <[email protected]>2017-06-17 17:02:47 +1000
commit8ff0009bf8b568f85e64209ea4d0e8d9d7e76d0b (patch)
treeac1b4a6d1697eee438d08e7889f31ba0fc0dcbfa
parentGeneral: Set all colors (diff)
downloadpywal-8ff0009bf8b568f85e64209ea4d0e8d9d7e76d0b.tar.xz
pywal-8ff0009bf8b568f85e64209ea4d0e8d9d7e76d0b.zip
General: Add function to export colors.
-rw-r--r--wal.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/wal.py b/wal.py
index 444d2d4..cd48660 100644
--- a/wal.py
+++ b/wal.py
@@ -253,6 +253,16 @@ def set_wallpaper(img):
return 0
+def export_plain(colors):
+ """Export colors to a plain text file."""
+ plain_file = CACHE_DIR + "/" + "colors"
+
+ term_file = open(plain_file, 'w')
+ for color in colors:
+ term_file.write(color + "\n")
+ term_file.close()
+
+
def main():
"""Main script function."""
args = get_args()
@@ -264,6 +274,7 @@ def main():
colors = get_colors(image)
send_sequences(colors, args.t)
set_wallpaper(image)
+ export_plain(colors)
return 0