nu_scripts/modules/base16
Auca Coyan 13a73ab635
🐛 fix more parser errors (#783)
Hi! I reduced some of the errors in the daily CI. Still there are a few
of them, but at least is something

- Added the badge for the `daily.yml` (currently failing)
- removed old `docker` from v0.60
- removed old `git` from auto-generate completions
- removed `nethack` from auto-generate completions (wasn't very useful)
- removed `root` from auto-generate completions (wasn't very useful)
- removed `valgrind` from auto-generate completions (wasn't very useful)
- moved `less` from auto-generate to custom-completions.
- moved `mix` from auto-generate to custom-completions.
- moved `tar` from auto-generate to custom-completions.
- moved `tcpdump` from auto-generate to custom-completions.
- moved `virsh` from auto-generate to custom-completions.
- moved `zef` from auto-generate to custom-completions.
- fixed `base16.nu`
- fixed `from-cpuinfo.nu`
- fixed `from-dmicode.nu`
- fixed `to-number-format.nu`
- fixed `to-json-schema.nu`
2024-03-15 21:10:27 -05:00
..
alacritty_colors.mustache refactor: (#418) 2023-04-25 17:56:25 -05:00
auto_base16.nu refactor: (#418) 2023-04-25 17:56:25 -05:00
base16.nu 🐛 fix more parser errors (#783) 2024-03-15 21:10:27 -05:00
README.md use $env. instead of let-env (#543) 2023-07-01 10:40:16 +02:00

Base16 themes integration

This folder contains a couple of files that let you configure Nushell and other terminal tools to use base16 themes.

Requirements

Assumes a Linux system with an X-based window manager. Specific packages and environment variable requirements are listed in each file.

Files explanation

  • base16.nu - Main module -- see comments inside
  • auto_base16.nu - Generates a base16 theme from a wallpaper
  • alacritty_colors.template - Template for Alacritty terminal colors

Example integration

Fist, set up base16 theme generation from a wallpaper:

# ~/.xinitrc

...

[ -f ~/.auto_base16.nu ] && ~/.auto_base16.nu &

This will generate a base16 theme to a file from a current wallpaper. You can combine this with a random wallpaper generation using the fehbg.nu script for more chaos fun.

Next, set up Nushell config, assuming the base16 colors are generated

# config.nu

use ~/.config/nushell/base16.nu

# File containing base16 colors
$env.BASE16_TXT = "/tmp/base16.txt"

let config = {
    color_config: (base16 build-nu-config $env.BASE16_TXT)
}

To select a new wallpaper and regenerate the base16 config:

> base16 new-wallpaper

> source ~/.config/nushell/config.nu