Skip to content
Fernando Vásquez edited this page Jan 27, 2018 · 16 revisions

Table of Contents

What are Templates

In wpgtk templates are textfiles with .base extension which gets read parsed and has special keywords in it replaced, then copied over to a file that is sym-linked to the original config file, this way it is ensured that the original file only receives already processed information and is updated on the fly, the base files created are stored under $HOME/.config/wpg/templates.

A tipical template will look like this rofi.base

rofi.columns:                        1
rofi.font:                           roboto mono 10
rofi.color-normal:                   #COLOR0, #COLORX15, #COLOR0, #COLORACT, #COLORX15
rofi.color-urgent:                   #COLOR0, #d6b48d, #22231D, #d6b48d, #COLORX15
rofi.color-active:                   #COLOR0, #COLORX14, #COLOR0, #COLORX14, #COLOR0
rofi.color-window:                   #COLOR0, #COLORACT, #COLORIN

You can install a set of default templates with a script included with wpgtk just follow this steps

Default Keywords

Here are the default keywords included with wpgtk, these might change with the passage of time.

COLOR0 through COLOR9
COLORX10 through COLORX15
COLORACT  # for active color
COLORIN   # for inactive color
COLORBG  
COLORTOOL # for tooltips (needed in old templates)

Adding a Template

This will create a backup in the location specified under filename.bak to avoid losing any precious data if you regret adding the file later, it also creates a copy of that file under $HOME/.config/wpg/templates with the .base extension, in which you can edit and place keywords for wpgtk to replace.

CLI

wpg -xa ./path/to/file

GUI

Using the Add button under the Templates tab

Remove a Template

This will remove the .base file from your templates folder, it will not restore your backup, you'll have to do that yourself if you wish to, the config file that remains will have the latest colorscheme applied.

CLI

wpg -xd basefilename.base
# you can get a list of these names with
wpg -xl

GUI

After selecting the Template you wish to remove, click the Remove button under the Templates tab

Restore a Template

If you're coming from a fresh install and keep your .base files somewhere you are probably gonna want them back without going through the hassle of re-adding them so here's an easy way to re-attach this base files to their respective configuration files

wpg -y ./path/to/config ./path/to/basefile.base

Ignore a Template

If you don't want to delete a template but don't want to apply a new colorscheme to it simply add a coment in the first line of the .base that says wpgtk-ignore, this way the template remains in your added templates but is ignored in each colorscheme change, use a format that is ignored by that configuration or text file.

Clone this wiki locally