Compare commits

..

6 Commits

8 changed files with 409 additions and 26 deletions

View File

@@ -6,32 +6,32 @@ draw_bold_text_with_bright_colors = false
# Default colors
[colors.primary]
background = '0x{{base00}}'
foreground = '0x{{base05}}'
background = "#{{base00}}"
foreground = "#{{base05}}"
# Colors the cursor will use if `custom_cursor_colors` is true
[colors.cursor]
text = '0x{{base00}}'
cursor = '0x{{base05}}'
text = "#{{base00}}"
cursor = "#{{base05}}"
# Normal colors
[colors.normal]
black = '0x{{base00}}'
red = '0x{{base08}}'
green = '0x{{base0B}}'
yellow = '0x{{base0A}}'
blue = '0x{{base0D}}'
magenta = '0x{{base0E}}'
cyan = '0x{{base0C}}'
white = '0x{{base05}}'
black = "#{{base00}}"
red = "#{{base08}}"
green = "#{{base0B}}"
yellow = "#{{base0A}}"
blue = "#{{base0D}}"
magenta = "#{{base0E}}"
cyan = "#{{base0C}}"
white = "#{{base05}}"
# Bright colors
[colors.bright]
black = '0x{{base03}}'
red = '0x{{base09}}'
green = '0x{{base01}}'
yellow = '0x{{base02}}'
blue = '0x{{base04}}'
magenta = '0x{{base06}}'
cyan = '0x{{base0F}}'
white = '0x{{base07}}'
black = "#{{base03}}"
red = "#{{base09}}"
green = "#{{base01}}"
yellow = "#{{base02}}"
blue = "#{{base04}}"
magenta = "#{{base06}}"
cyan = "#{{base0F}}"
white = "#{{base07}}"

View File

@@ -0,0 +1,27 @@
# :root {
# --vii: #{{base01}};
# --vi: #{{base03}};
# --v: #{{base08}};
# --iv: #{{base05}};
# --iiv: #{{base07}};
# --a: #{{base0C}};
# }
:root {
--base00: #{{base00}};
--base01: #{{base01}};
--base02: #{{base02}};
--base03: #{{base03}};
--base04: #{{base04}};
--base05: #{{base05}};
--base06: #{{base06}};
--base07: #{{base07}};
--base08: #{{base08}};
--base09: #{{base09}};
--base0A: #{{base0A}};
--base0B: #{{base0B}};
--base0C: #{{base0C}};
--base0D: #{{base0D}};
--base0E: #{{base0E}};
--base0F: #{{base0F}};
}

View File

@@ -0,0 +1,45 @@
# Base16 {{scheme-name}} - kitty color config
# Scheme by {{scheme-author}}
visual_bell_color #{{darken base00 "5"}}
background #{{base00}}
foreground #{{base05}}
selection_background #{{base05}}
selection_foreground #{{base00}}
url_color #{{base0D}}
cursor #{{base0D}}
cursor_text_color #{{base00}}
active_border_color #{{base03}}
inactive_border_color #{{base01}}
active_tab_background #{{base00}}
active_tab_foreground #{{base05}}
inactive_tab_background #{{base01}}
inactive_tab_foreground #{{base04}}
# Normal
color0 #{{base00}}
color1 #{{base08}}
color2 #{{base0B}}
color3 #{{base0A}}
color4 #{{base0D}}
color5 #{{base0E}}
color6 #{{base0C}}
color7 #{{base05}}
# Bright (same as Normal except 8/15)
color8 #{{base03}}
color9 #{{base08}}
color10 #{{base0B}}
color11 #{{base0A}}
color12 #{{base0D}}
color13 #{{base0E}}
color14 #{{base0C}}
color15 #{{base07}}
# Other (like base16-shell)
color16 #{{base09}}
color17 #{{base0F}}
color18 #{{base01}}
color19 #{{base02}}
color20 #{{base04}}
color21 #{{base06}}

View File

@@ -0,0 +1,121 @@
/* Base16 {{scheme-name}}
* Scheme author: {{scheme-author}}
* Obsidian theme author: acidghost (https://github.com/acidghost)
*/
:root {
--font-monospace: 'Hack Nerd Font', 'Source Code Pro', monospace;
}
.theme-dark {
--background-primary: #{{base00}};
--background-primary-alt: #{{base01}};
--background-secondary: #{{base00}};
--background-secondary-alt: #{{base01}};
--background-modifier-border: #{{base03}};
--background-modifier-form-field: rgba(0, 0, 0, 0.3);
--background-modifier-form-field-highlighted: rgba(0, 0, 0, 0.22);
--background-modifier-box-shadow: rgba(0, 0, 0, 0.3);
--background-modifier-success: #{{base0B}};
--background-modifier-error: #{{base08}};
--background-modifier-error-rgb: {{rgb_r base08}}, {{rgb_g base08}}, {{rgb_b base08}};
/* --background-modifier-error-hover: #470000; */
--background-modifier-cover: rgba(0, 0, 0, 0.8);
--text-accent: #{{base0F}};
--text-accent-hover: #{{base0D}};
--text-normal: #{{base07}};
--text-muted: #{{base05}};
--text-muted-rgb: {{rgb_r base05}}, {{rgb_g base05}}, {{rgb_b base05}};
--text-faint: #{{base03}};
--text-error: #{{base0E}};
--text-error-hover: #{{base08}};
--text-highlight-bg: rgba(255, 255, 0, 0.4);
--text-highlight-bg-active: rgba(255, 128, 0, 0.4);
--text-selection: rgba(23, 48, 77, 0.99);
--text-on-accent: #dcddde;
--interactive-normal: #2a2a2a;
--interactive-hover: #303030;
--interactive-accent: #{{base0F}};
--interactive-accent-rgb: {{rgb_r base0F}}, {{rgb_g base0F}}, {{rgb_b base0F}};
--interactive-accent-hover: #{{base0E}};
--interactive-success: #197300;
--scrollbar-active-thumb-bg: rgba(255, 255, 255, 0.1);
--scrollbar-bg: rgba(255, 255, 255, 0.05);
--scrollbar-thumb-bg: rgba(255, 255, 255, 0.1);
--highlight-mix-blend-mode: lighten;
}
.CodeMirror-lines {
font-family: var(--font-monospace);
}
.graph-view.color-fill,
.graph-view.color-circle,
.graph-view.color-line,
.graph-view.color-text,
.graph-view.color-arrow {
color: var(--text-accent);
}
.graph-view.color-fill-highlight,
.graph-view.color-line-highlight {
color: var(--text-accent-hover);
}
.graph-view.color-fill-unresolved {
color: #600;
}
.workspace-tabs .workspace-leaf {
background-color: var(--background-primary);
}
.workspace-tab-header-container {
background-color: var(--background-primary);
}
.workspace-tab-header.is-active {
background-color: var(--background-primary);
color: var(--text-accent);
}
.workspace-tab-header.is-after-active .workspace-tab-header-inner,
.workspace-tab-header.is-before-active .workspace-tab-header-inner {
background-color: var(--background-primary);
}
.workspace-tab-container-before.is-before-active .workspace-tab-header-inner,
.workspace-tab-container-after.is-after-active .workspace-tab-header-inner,
.workspace-tab-header.is-before-active .workspace-tab-header-inner,
.workspace-tab-header.is-after-active .workspace-tab-header-inner {
background-color: var(--background-primary);
}
.workspace-split.mod-root > .workspace-leaf:last-of-type .workspace-leaf-content {
border-top-right-radius: 0;
}
.workspace-split.mod-root > .workspace-leaf:first-of-type .workspace-leaf-content {
border-top-left-radius: 0;
}
.workspace-split.mod-left-split .workspace-tabs .workspace-leaf {
border-top-left-radius: 0;
}
.workspace-split.mod-right-split .workspace-tabs .workspace-leaf {
border-top-right-radius: 0;
}
.suggestion-item.is-selected {
background-color: var(--background-primary-alt);
}
.markdown-preview-view.is-readable-line-width .markdown-preview-sizer {
max-width: 900px;
}
.markdown-source-view.is-readable-line-width .CodeMirror,
.markdown-source-view.mod-cm6.is-line-wrap.is-readable-line-width .cm-content,
.markdown-source-view.mod-cm6.is-line-wrap.is-readable-line-width .cm-line:not(.HyperMD-table-row),
.markdown-source-view.mod-cm6.is-readable-line-width:not(.is-rtl) .cm-contentContainer {
max-width: 900px;
}

View File

@@ -0,0 +1,95 @@
/*******************************************************************************
* ROFI SQUARED THEME USING THE NORD PALETTE
* User : LR-Tech
* Theme Repo : https://github.com/lr-tech/rofi-themes-collection
*******************************************************************************/
* {
font: "FiraCode Nerd Font Medium 12";
bg0: #{{base00}};
bg1: #{{base01}};
fg0: #{{base07}};
accent-color: #{{base0C}};
urgent-color: #{{base08}};
background-color: transparent;
text-color: @fg0;
margin: 0;
padding: 0;
spacing: 0;
}
window {
location: center;
width: 480;
background-color: @bg0;
}
inputbar {
spacing: 8px;
padding: 8px;
background-color: @bg1;
}
prompt, entry, element-icon, element-text {
vertical-align: 0.5;
}
prompt {
text-color: @accent-color;
}
textbox {
padding: 8px;
background-color: @bg1;
}
listview {
padding: 4px 0;
lines: 8;
columns: 1;
fixed-height: false;
}
element {
padding: 8px;
spacing: 8px;
}
element normal normal {
text-color: @fg0;
}
element normal urgent {
text-color: @urgent-color;
}
element normal active {
text-color: @accent-color;
}
element selected {
text-color: @bg0;
}
element selected normal, element selected active {
background-color: @accent-color;
}
element selected urgent {
background-color: @urgent-color;
}
element-icon {
size: 0.8em;
}
element-text {
text-color: inherit;
}

View File

@@ -0,0 +1,8 @@
ColorForeground=#{{base05}}
ColorBackground=#{{base00}}
ColorCursor=#{{base0C}}
ColorSelection=#{{base00}}
ColorBold=#{{base05}}
ColorBoldUseDefault=FALSE
ColorPalette=#{{base00}};#{{base08}};#{{base0B}};#{{base0A}};#{{base0D}};#{{base0E}};#{{base0C}};#{{base05}};#{{base03}};#{{base08}};#{{base0B}};#{{base0A}};#{{base0D}};#{{base0E}};#{{base0C}};#{{base07}}
TabActivityColor=#{{base0A}}

View File

@@ -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.

View File

@@ -170,6 +170,24 @@ ENDFILE {
' "$path" > "$tmp" && mv "$tmp" "$path"
}
# TODO: multiple format support, check that line actually has multiple fields
merge() {
path=$1
tmp=$(mktemp)
awk -F "=" '
FILENAME == "-" {
a[$1] = $2
next
}
a[$1] {
print $1 "=" a[$1]
next
}
{ print }
' - "$path" > "$tmp" && mv "$tmp" "$path"
}
convert_tinted_scheme() {
path=$1
tmp=$(mktemp)
@@ -177,7 +195,12 @@ convert_tinted_scheme() {
awk -F ' *: *' '
/^#/ { print }
$1 ~ "palette" { p = 1; next }
p && /^ +/ { gsub(/ /, "", $1); print $1 "=" $2 }
p && /^ +/ {
gsub(/ /, "", $1);
gsub(/^"#/, "", $2);
gsub(/"$/, "", $2);
print $1 "=\"" $2 "\""
}
' "$path" > "$tmp" && mv -f "$tmp" "$path"
}
@@ -242,6 +265,10 @@ if [ "$method" != "" ]; then
inject "${args[1]}" "${args[2]}"
;;
merge)
merge "${args[1]}" "${args[2]}"
;;
convert_tinted_template)
convert_tinted_template "${args[1]}"
;;