- Notifications
You must be signed in to change notification settings - Fork1
A global theme switcher using config templates.
License
fhennig/tint
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A theme switcher.
tint
allows fast and convenient theme switching for all yourapplications such asi3
,rofi
andurxvt
.
It works by by processing configtemplates in which the actual colorcodes are filled in.
A theme is defined in ayaml
file (seeleuven.yaml
for anexample). In there properties and colors are defined. A configtemplate could then look like this:
rofi.color-normal: {{rofi.bg}}, {{rofi.fg}}, {{rofi.bgalt}}, {{rofi.hlbg}}, {{rofi.hlfg}}rofi.color-window: {{rofi.background}}, {{rofi.border}}rofi.width: 20rofi.font: inconsolata 14
The{{...}}
syntax is part of the templating engine. It is replacedby a property defined in the theme.
The template defines which config files to process in apaths
section:
paths: - ~/.config/i3/config - ~/.config/rofi/config - ~/.Xdefaults
for every<path>
it expects the file<path>.template
to bepresent. If present, it will generate the config file from thetemplate.
config files can specify a base theme inmeta.base
. The base thememust be another theme in the themes directory. Before the config isapplied, the base theme is loaded. Properties defined in the themeitself take precedence over properties defined in the base.
Dependencies are in therequirements.txt
- PyYAML: For reading the yaml files
- jinja2: For handling the templating
Uses jinja for templating.
This project was inspired by(i3-style)[https://github.com/altdesktop/i3-style], from which theidea of using ayaml
configuration file was taken.
The idea to use templating was also inspired by(j4-make-config)[https://github.com/okraits/j4-make-config].
Add variable expansion in the paths.
Works well withurxvt
and(urxvt-config-reload)[https://github.com/regnarg/urxvt-config-reload],which allows to trigger reloading of urxvt config in urxvt instances.For example:
xrdb -merge ~/.Xdefaultspids=$(ps axo pid,comm | grep "^[ 0-9]* urxvt\$" | awk "{print \$1}")for pid in $pidsdo kill -1 $pid # send SIGHUP echo "TEST $pid"done