Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.
/ paleta Public archive
forked from dylanaraps/paleta

Change terminal colors on-the-fly independent of terminal emulator.

License

Notifications You must be signed in to change notification settings

somasis/paleta

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paleta
________________________________________________________________________________

Change terminal colors on-the-fly independent of terminal emulator.

Most terminal emulators support a set of escape sequences which allow for the
modification of the terminal's color palette. Combined with the ability to write
to all open terminal devices, this allows for theming in a truly independent way.

Paleta reads a list of colors over <stdin>, transforms the input into the set of
escape sequences and sends these sequences to every open terminal in the system.
It additionally prints the sequences to <stdout>.

+------------------------------------------------------------------------------+
|                                                                              |
|  $ paleta < palettes/jellybeans-dark > ~/.cache/current-palette              |
|                                                                              |
+------------------------------------------------------------------------------+

This tool is small and generic. It reads input and writes output. Effortless to
incorporate with the system. This repository also contains 150~ popular palettes
ready for use with paleta.


terminal support
________________________________________________________________________________

+------------------------------------------------------------------------------+
|                                                                              |
|  this list is not complete                                                   |
|                                                                              |
|                                                                              |
|  alacritty  good        alacritty/alacritty#656    |
|  kitty      good                                                             |
|  vte [0]    good        1a651cf990e67c4046fbff7674249259bcaa89a8             |
|  xterm      good                                                             |
|  urxvt      good                                                             |
|                                                                              |
|  st         patch       ./misc/st-osc_10_11_12-20200418-66520e1.patch        |
|                                                                              |
|  hyper      clueless    vercel/hyper#2038          |
|                                                                              |
|                                                                              |
+------------------------------------------------------------------------------+

[0] vte includes Termite, XFCE terminal, GNOME terminal, Konsole and many more.


usage
________________________________________________________________________________

+------------------------------------------------------------------------------+
|                                                                              |
|  Set the colorscheme to jellybeans-dark in all open terminals.               |
|                                                                              |
|  $ paleta < palettes/jellybeans-dark                                         |
|                                                                              |
|  Set the colorscheme to jellybeans-dark in all open terminals, and           |
|  additionally write it to ~/.cache/paleta/current-palette.                   |
|                                                                              |
|  $ paleta < palettes/jellybeans-dark > ~/.cache/paleta/current-palette       |
|                                                                              |
+------------------------------------------------------------------------------+

Saving paleta's <stdout> to a file is how the current palette can be stored.
this file can then used to set the palette in newly opened terminals.
Scripts could store this in a variable, or ignore it entirely, maintaining the
state on their own.


setup
________________________________________________________________________________

Assuming you run paleta like the section command in the usage section, this line
 should be added to your shell's startup file.
It will tell future shells to load the current palette at launch.

+------------------------------------------------------------------------------+
|                                                                              |
|  $ echo 'cat ~/.cache/paleta/current-palette' >> ~/.bashrc                   |
|                                                                              |
+------------------------------------------------------------------------------+


input format
________________________________________________________________________________

Input is one hexadecimal color per line.
A leading # is optional, but recommended. The first three lines are reserved for
<foreground>, <background> and <cursor> with the remaining lines filling the
numerical palette (0-256); a maximum of 259 definitions in a palette.

Example: https://github.com/somasis/paleta/blob/main/palettes/gruvbox-dark

+------------------------------------------------------------------------------+
|  format                             |  example                               |
+-------------------------------------+----------------------------------------+
|                                     |                                        |
|  <foreground>                       |  #dedede                               |
|  <background>                       |  #121212                               |
|  <cursor>                           |  #dedede                               |
|  <color0>                           |  #929292                               |
|  <color1>                           |  #e27373                               |
|  <color2>                           |  #94b979                               |
|                                     |                                        |
|  ...                                |  ,,,                                   |
|                                     |                                        |
|  <color256>                         |  #1ab2a8                               |
|                                     |                                        |
|                                     |                                        |
+-------------------------------------+----------------------------------------+


software written around paleta
________________________________________________________________________________

- shuffle through palettes in a directory. https://github.com/dylanaraps/bin/blob/c06b2c0df0194487fc4cb9c65b451b6369e2c398/shuffle


todo
________________________________________________________________________________

- [ ] Find good 256 color palettes to include. All are currently 16 colors.
      256 color palettes added to this repository should contain -256 in their
      filenames.

About

Change terminal colors on-the-fly independent of terminal emulator.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Shell 71.9%
  • Makefile 28.1%