diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-07-22 10:04:56 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-07-22 10:04:56 +1000 |
| commit | c6147fd0eb0387c5cc4334dfe9c17f097fdea246 (patch) | |
| tree | dc649ac99a225e6bdeab15af666a21d7d6bd1aba | |
| parent | c8dd8f4d03fc79b5594e8d873e0aba77e360796a (diff) | |
examples: Move examples out of the repo to the wiki.
| -rw-r--r-- | examples/example.py | 31 | ||||
| -rw-r--r-- | examples/example_custom_cache.py | 46 |
2 files changed, 0 insertions, 77 deletions
diff --git a/examples/example.py b/examples/example.py deleted file mode 100644 index b4b40e1..0000000 --- a/examples/example.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Simple script for wal api.""" -import pywal - - -def main(): - """Main function.""" - # Validate image and pick a random image if a - # directory is given below. - image = pywal.get_image("/home/dylan/Pictures/Wallpapers/") - - # Return a dict with the palette. - # Set quiet to 'True' to disable notifications. - colors = pywal.create_palette(image, quiet=False) - - # 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, vte=False) - - # Reload xrdb, i3 and polybar. - pywal.reload_env() - - # Export template files. - pywal.export_all_templates(colors) - - # Set the wallpaper. - pywal.set_wallpaper(image) - - -main() diff --git a/examples/example_custom_cache.py b/examples/example_custom_cache.py deleted file mode 100644 index 5e74350..0000000 --- a/examples/example_custom_cache.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Test script for wal api. - This script uses a custom cache location for the files.""" -import pathlib -import pywal - - -CACHE_DIR = pathlib.Path.home() / "wal-test" -COLOR_COUNT = 16 - - -def main(): - """Main function.""" - # Create the custom cache directory. - pywal.util.create_dir(CACHE_DIR / "schemes") - - # Validate image and pick a random image if a - # directory is given below. - # - # CACHE_DIR is an optional argument and is used to check the current - # wallpaper against the random selection. This prevents shuffling to - # the identical image when a directory is passed as an argument. - image = pywal.get_image("/home/dylan/Pictures/Wallpapers/", CACHE_DIR) - - # Return a dict with the palette. - # - # The last argument is 'quiet' mode. When set to true, no notifications - # are displayed. - colors = pywal.create_palette(image, CACHE_DIR, COLOR_COUNT, quiet=True) - - # 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, CACHE_DIR) - - # Reload xrdb, i3 and polybar. - pywal.reload_env(CACHE_DIR) - - # Export template files. - pywal.export_all_templates(colors, CACHE_DIR) - - # Set the wallpaper. - pywal.set_wallpaper(image) - - -main() |
