Documentation cleanup, etc

This commit is contained in:
2024-03-22 09:31:43 -06:00
parent f6e856be2c
commit 2307b5c56d
6 changed files with 75 additions and 236 deletions

View File

@@ -1,5 +1,51 @@
# Cookbook
## ImageMagick
## Qutebrowser
### Apply a color scheme to an image
### Remotely reloading your Qutebrowser configuration
Qutebrowser can be remotely reloaded by sending it a SIGHUP signal.
```sh
pkill -HUP qutebrowser
```
Note on older versions (<=3.1.0) this will simply kill Qutebrowser.
## ImageMagick
Shchemes can create [ImageMagick pixel enumeration files](https://imagemagick.org/Usage/files/#txt), with a vertical strip of all the colors in the scheme. This is optimal for getting the color data into an image, or simply displaying the palette.
### Displaying a palette at a reasonable size
This converts the pixel enumeration to a png and resizes it to 24px high with no interpolation.
```sh
shchemes create_theme imagemagick -s=base16:monokai | convert txt:- -filter point -resize 2400% palette.png
```
Result:
![A strip of all the colors in the monokai scheme](./palette.png)
### Apply a color scheme to an image using [`-remap`](https://imagemagick.org/script/command-line-options.php#remap)
```sh
shchemes create_theme --scheme=base16:blueforest imagemagick | \
| convert source.jpg -colorspace srgb -remap txt:- out.jpg
```
Note that this is isn't like theming an app where your colors are simply slotted into the theme. It's trying to recreate your image the best it can with your color scheme. Images with a palette closer to your scheme will yield better results.
A trick I've found for wallpapers is using an image twice your actual monitor resolution--This makes the dithering less visible while still somewhat retaining the color scheme change.
### Apply a color scheme to an image with [`-dither`](https://www.imagemagick.org/Usage/quantize/#dither)
```sh
shchemes create_theme --scheme=base16:blueforest imagemagick | \
| convert source.jpg -colorspace srgb -dither FloydSteinberg -remap txt:- out.jpg
```
Another dithering model available is `Riemersma`, which gives a more splotchy, "boiled" look.
## BSPWM
### Generate a script to set bspwm colors
```sh
bspwm_theme="$HOME/.config/bspwm/colors"
shchemes create_theme bspwm > "$bspwm_theme"
"$bspwm_theme"
```
You'll need to call it from your bspwmrc
```sh
"$(dirname $0)/colors"
```

View File

@@ -1,212 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>manual</title>
<style>
html {
line-height: 1.5;
font-family: Georgia, serif;
font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
body {
margin: 0 auto;
max-width: 36em;
padding-left: 50px;
padding-right: 50px;
padding-top: 50px;
padding-bottom: 50px;
hyphens: auto;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media (max-width: 600px) {
body {
font-size: 0.9em;
padding: 1em;
}
h1 {
font-size: 1.8em;
}
}
@media print {
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
font-size: 85%;
margin: 0;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
background-color: #1a1a1a;
border: none;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC ul {
padding-left: 1.3em;
}
#TOC > ul {
padding-left: 0;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<h1 id="name">NAME</h1>
<p>shchemes - Automatically theming your apps with the power of the
shell.</p>
<h1 id="synopsis">SYNOPSIS</h1>
<pre><code>shchemes METHOD [OPTIONS]</code></pre>
<h1 id="description">DESCRIPTION</h1>
<h2 id="SCHEME">SCHEME</h2>
<p>SCHEME is an environment variable that determines the default color
scheme to operate on.</p>
<p>Schemes are in a format of &lt;scheme format&gt;:&lt;scheme
name&gt;.</p>
<p>If no format is provided, base16 is assumed.</p>
<h2 id="examples">Examples</h2>
<pre><code>SCHEME=&quot;base16:heetch&quot;
SCHEME=&quot;base24:monokai&quot;</code></pre>
<p>See also: <a href="#scheme"><code>--scheme</code></a></p>
<h2 id="options">OPTIONS</h2>
<h2 id="scheme"><code>--scheme</code></h2>
<p>Sets the color scheme to operate on, regardless of the value of
SCHEME.</p>
<h2 id="example">Example</h2>
<pre><code>shchemes create_theme kitty --scheme=base16:blueforest</code></pre>
<p>See also: <span id="scheme">SCHEME</span></p>
<h2 id="format"><code>--format</code></h2>
<p>Sets the color scheme format of the output file. This defaults to the
same format as your color scheme.</p>
<h2 id="example-1">Example</h2>
<pre><code>shchemes create_theme alacritty --format=base24</code></pre>
<h2 id="methods">METHODS</h2>
<h2 id="create_theme">create_theme</h2>
<p>Apply the color scheme to the template for a given app</p>
<pre><code>shchemes create_theme TARGET</code></pre>
<p>See also: <a href="#format"><code>--format</code></a></p>
<h2 id="inject">inject</h2>
<p>In the given file, looks for a comment that indicates a Shchemes
injection block, runs its command in a shell with Shchemes sourced, and
pipes the stdout into the content of the injection block.</p>
<pre><code>shchemes inject PATH</code></pre>
<h2 id="install_tinted_scheme">install_tinted_scheme</h2>
<p>Installs a color scheme from the <a
href="https://github.com/tinted-theming/schemes">tinted-theming/schemes</a>.</p>
<p>You can find a gallery of the base16 themes here: <a
href="https://tinted-theming.github.io/base16-gallery/">https://tinted-theming.github.io/base16-gallery/</a></p>
<pre><code>shchemes install_tinted_scheme</code></pre>
<p>See also: <a href="#SCHEME"><code>SCHEME</code></a> <a
href="#scheme"><code>--scheme</code></a></p>
<h1 id="author">AUTHOR</h1>
<p>Shchemes is written by Dakedres</p>
</body>
</html>

BIN
doc/palette.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B