mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-18 23:56:37 +02:00
General: Add function to export colors.
This commit is contained in:
parent
3ae52996ff
commit
8ff0009bf8
11
wal.py
11
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user