Skip to content
Lachlan Shoesmith edited this page Jul 22, 2019 · 17 revisions

Creating Colorschemes

This will create the colorschemes according to your wallpaper, but it will not actually set your colorscheme, after this your new colorscheme will be named the same as your image which in the example case is image.jpg.

After you've done this the export files will be under $HOME/.config/wpg/wallpapers, xres will hold Xresources files for each wallpaper, schemes will hold the pywal generated json and sample will hold the image preview for the colors.

CLI

$ wpg -a ~/path/to/image.jpg

GUI

add-theme

Click on the add button on the main screen and navigate to your image.

Set a Colorscheme

To actually set a theme created on the previoius step you need to do the following, this is the step where all your templates get parsed and the colorscheme gets applied to them, you can also pass the -n flag to avoid setting the wallpaper.

CLI

$ wpg -s wallpaper.jpg [colorscheme.jpg] # or
$ wpg -ns colorscheme.jpg

The second argument is just in case you want to combine a wallpaper with another colorscheme generated by another image.

After you've set your colorscheme a few export formats should appear in your $HOME/.config/wpg folder, with the names current.css, current.json, current.Xres that represent your current colorscheme in different formats.

Using the command line you can also choose to use a random wallpaper and colorscheme, or maybe you just want a random colorscheme, either way, you can do this easily, just specify a wallpaper if you only want to get a random colorscheme.

$ wpg -m # or
$ wpg -nm

GUI

set-theme

Select your theme on the first select and click on Set button, you can also specify a different colorscheme to go with the wallpaper by using the second select.

Edit a Colorscheme

CLI

You can do a few things to edit your colorschemes from the command line, I will try to illustrate in the code section several use cases and what they do.

$ wpg -z wallpaper.jpg # shuffles the positions of the colors in your colorscheme
$ wpg --sat wallpaper.jpg 0.1 # increases the saturation of all colors by 0.1
$ wpg --brt wallpaper.jpg 100 # increases the brightness of all colors by 100
$ wpg -A wallpaper.jpg # gives you a distinct foreground and background

You can do pretty interesting things by chaining wpgtk actions in the shell, for example:

# This adds 0.1 saturation to your colorscheme and
# then it gets re-applied
$ wpg --sat $(wpg -c) 0.1 && wpg -s $(wpg -c)

# This gives you the 'light' version of the theme you're
# using.
$ wpg -LA $(wpg -c) && wpg -s $(wpg -c)

GUI

colors

Auto-adjust will give you fg and bg colors based on the first 8 colors and shuffle moves around all colors except the first one and last one (since they're bg and fg), same as the -z flag.

You can also auto-adjust your colorscheme, which will give you more distinct foreground and background colors for your terminals, you can perform this action from console with the -A flag.

You can also add and substract either saturation or brightness from all the colors at once, be careful though, if you take out to much saturation the colors will be lost, luckily you can preview the results!

editor

Here you can edit your colorscheme at your leisure, nothing is out of reach! make sure you save your colorscheme after you edit, otherwise changes will have no effect whatsoever, adjust the lightness and saturation to achieve other tones of the same color, or choose a random color from the image itself.

Import a Colorscheme

You can easily import JSON colorschemes like the ones found in https://terminal.sexy and the ones pywal generates and manipulate them in wpgtk, this means you can now backup your colorschemes or use pre-established colorschemes, share away!

// example terminal.sexy format
{
  "name": "",
  "author": "",
  "color": [
    "#272822",
    "#f92672",
    "#a6e22e",
    "#f4bf75",
    "#66d9ef",
    "#ae81ff",
    "#a1efe4",
    "#f8f8f2",
    "#75715e",
    "#f92672",
    "#a6e22e",
    "#f4bf75",
    "#66d9ef",
    "#ae81ff",
    "#a1efe4",
    "#f9f8f5"
  ],
  "foreground": "#f8f8f2",
  "background": "#272822"
}

CLI

$ wpg -i <theme-name-to-apply-to> <path to json>

This will override the colorscheme generated for that wallpaper and place the new colors instead.

GUI

import

Just click on import and choose a JSON colorscheme, you're good to go, remember on the GUI you have to actually click on save before the import is permanent, this way you can edit without really loosing your original colorscheme.

Export a Colorscheme

You can now easily export a colorscheme via the command line like this:

$ wpg -o <theme-to-export> [<path-to-export-to>]

If no path is provided, the current directory will be used, you can also specify a filename in the path, then the exported json will have that name.

Restore on Terminals

If you have a terminal that doesn't use Xresources to load their colors, you need to add the following to your .bashrc, .zshrc or whatever shell config file you have to restore your colorscheme when starting a new terminal.

(cat $HOME/.config/wpg/sequences &)

Pywal's Preset themes

There are two ways to apply preset themes

$ wpg -Ti <wallpaper> <preset theme> # or
$ wpg --theme <preset theme>

The -Ti flag will only override the indicated colorscheme without applying immediately, while the --theme flag will replace and apply the current theme, if --theme is used without arguments, it will simply display a list of available preset themes.

Restore on Startup

In order to restore the colorscheme applied at startup, wpg creates a small script that you can execute in your startup scripts, it is located under $HOME/.config/wpg/wp_init.sh.