Expanded cookbook
This commit is contained in:
parent
1e2354a092
commit
39ecaf6c7d
@ -1,13 +1,24 @@
|
||||
# Cookbook
|
||||
This document is a collection of ways to use shchemes. While many of these examples are useful for creating scripts to [automatically change your whole desktop's color scheme](#change-scheme-script), many of the examples given are meant to be ran in the terminal, to grow a greater familiarity with the techniques used.
|
||||
|
||||
## Qutebrowser
|
||||
## GTK
|
||||
|
||||
### Oomox
|
||||
Shchemes can generate colors for [oomox-gtk-theme](https://github.com/themix-project/oomox-gtk-theme), allowing your theme to spread to most of your desktop, providing it uses the GTK toolkit. `oomox-gtk-theme` includes a script we can call with the theme Shchemes generates to install a GTK theme with your colors.
|
||||
|
||||
### Remotely reloading your Qutebrowser configuration
|
||||
Qutebrowser can be remotely reloaded by sending it a SIGHUP signal.
|
||||
```sh
|
||||
pkill -HUP qutebrowser
|
||||
"./change_color.sh" -o shchemes <(shchemes create_theme oomox-gtk -s=base16:horizon-terminal-dark)
|
||||
```
|
||||
Note on older versions (<=3.1.0) this will simply kill Qutebrowser.
|
||||
This will install the theme to `~/.themes/shchemes`.
|
||||
|
||||
### Reload XFCE theme
|
||||
If you're generating an Oomox theme, as detailed above, you may want some way of automatically setting or refreshing the GTK theme XFCE uses.
|
||||
|
||||
```sh
|
||||
xfconf-query -c xsettings -p /Net/ThemeName -r
|
||||
xfconf-query -c xsettings -p /Net/ThemeName -s shchemes
|
||||
```
|
||||
You may need to replace `shchemes` with the name of your theme in `~/.themes`
|
||||
|
||||
## 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.
|
||||
@ -49,3 +60,52 @@ You'll need to call it from your bspwmrc
|
||||
```sh
|
||||
"$(dirname $0)/colors"
|
||||
```
|
||||
|
||||
## Reloading configs
|
||||
|
||||
### Remotely reloading your Qutebrowser configuration
|
||||
Qutebrowser can be remotely reloaded by sending it a HUP signal.
|
||||
```sh
|
||||
pkill -HUP qutebrowser
|
||||
```
|
||||
Note on older versions (<=3.1.0) this will simply kill Qutebrowser.
|
||||
|
||||
### Remotely reloading your Kitty configuration
|
||||
Kitty will reload it's configuration on a USR1 signal.
|
||||
```sh
|
||||
pkill -USR1 kitty
|
||||
```
|
||||
|
||||
## Creating an script to automatically theme your whole desktop {#change-scheme-script}
|
||||
This is the use case that shchemes was designed to fulfill.
|
||||
|
||||
### `SCHEME` environment variable
|
||||
To avoid having to use `-s` or `--scheme` in every command of your script, shchemes will also read a `SCHEME` environment variable if those flags aren't set.
|
||||
|
||||
This is a useful pattern to put at the top of a script.
|
||||
```bash
|
||||
export SCHEME=$1
|
||||
```
|
||||
|
||||
### Automatically installing a `tinted-theming` scheme
|
||||
This snippet will automatically install your scheme from the [tinted-theming collection](https://github.com/tinted-theming/schemes) and exit if it can't be found.
|
||||
|
||||
```sh
|
||||
if ! shchemes install_tinted_scheme ; then
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
### `.profile` injection
|
||||
Sometimes you have other scripts that need to know what theme is currently applied on your system. One way to do this is to set the `SCHEME` environment variable in your `.profile`.
|
||||
|
||||
```sh
|
||||
echo '#START SHCHEMES BLOCK : printf "SCHEME=\"%s\"\n" "$SCHEME"' > ~/.profile
|
||||
```
|
||||
And in your script:
|
||||
```sh
|
||||
shchemes inject "$HOME/.profile"
|
||||
```
|
||||
|
||||
> [!CAUTION]
|
||||
> Shchemes injection is literally one Awk script. While lots of care has been taken, we are not liable for it mangling your configuration files, and we give no guarantees. It is recommended you backup your configs, preferably in something with version control in case you don't realise something's gone wrong until later.
|
Loading…
x
Reference in New Issue
Block a user