diff options
| author | dylan araps <dylan.araps@gmail.com> | 2017-07-20 10:44:21 +1000 |
|---|---|---|
| committer | dylan araps <dylan.araps@gmail.com> | 2017-07-20 10:44:21 +1000 |
| commit | 6678fa7953fde67d7371a28f6ddfe5b1aae03cdc (patch) | |
| tree | 807be65012f2ea0d6e05a128bc366613e157eca7 /examples | |
| parent | 9587854303e66cba93738dac026e438cd3318673 (diff) | |
general: Add example script.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/example.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/example.py b/examples/example.py new file mode 100644 index 0000000..9f7bf57 --- /dev/null +++ b/examples/example.py @@ -0,0 +1,22 @@ +"""pywal api example.""" +import pywal + + +def main(): + """Main function.""" + image = "/home/dylan/Pictures/Wallpapers/anVmEaA.jpg" + + # Return a dict with the palette. + colors = pywal.create_palette(image) + + # Apply the palette to all open terminals. + # Second argument is a boolean for VTE terminals. + # Set it to true if the terminal you're using is + # VTE based. (xfce4-terminal, termite, gnome-terminal.) + pywal.send_sequences(colors, False) + + # Reload xrdb, i3 and polybar. + pywal.reload_env() + + # Set the wallpaper. + pywal.set_wallpaper(image) |
