From bd1ab4e7a7c54bbe43a5c2c4bec62b0abbc66daa Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:39:46 -0400 Subject: [PATCH] Simplify theme usage (#896) * Primary change: Simplifies theme usage by adding an `export-env` to each theme so that `$env.config.color_config` is automatically set when importing the module. Rather than the old: ```nu use nu-themes/nushell-dark.nu $env.config.color_config = (nushell-dark) ``` It's now a single-step: ```nu use nu-themes/nushell-dark.nu ``` * Updates `make.nu` to create the theme files (uses the previously added `str dedent` for clean output). * A couple (literally, 2) of the remote themes did not have all necessary colors and failed. Updated `make.nu` to continue on error, but report the failures. * Updated `README.md` --- themes/README.md | 77 ++++-- themes/make.nu | 223 +++++++++++------- themes/nu-themes/3024-day.nu | 199 +++++++++------- themes/nu-themes/3024-night.nu | 199 +++++++++------- themes/nu-themes/3024.nu | 121 ++++++++++ themes/nu-themes/3024r.nu | 82 ------- themes/nu-themes/abyss.nu | 199 +++++++++------- themes/nu-themes/aci.nu | 199 +++++++++------- themes/nu-themes/aco.nu | 199 +++++++++------- themes/nu-themes/adventuretime.nu | 199 +++++++++------- themes/nu-themes/afterglow.nu | 199 +++++++++------- themes/nu-themes/alien-blood.nu | 199 +++++++++------- themes/nu-themes/alucard.nu | 199 +++++++++------- themes/nu-themes/amora.nu | 199 +++++++++------- themes/nu-themes/apathy.nu | 199 +++++++++------- themes/nu-themes/apprentice.nu | 199 +++++++++------- themes/nu-themes/argonaut.nu | 199 +++++++++------- themes/nu-themes/arthur.nu | 199 +++++++++------- themes/nu-themes/ashes.nu | 199 +++++++++------- themes/nu-themes/atelier-cave-light.nu | 199 +++++++++------- themes/nu-themes/atelier-cave.nu | 199 +++++++++------- themes/nu-themes/atelier-dune-light.nu | 199 +++++++++------- themes/nu-themes/atelier-dune.nu | 199 +++++++++------- themes/nu-themes/atelier-estuary-light.nu | 199 +++++++++------- themes/nu-themes/atelier-estuary.nu | 199 +++++++++------- themes/nu-themes/atelier-forest-light.nu | 199 +++++++++------- themes/nu-themes/atelier-forest.nu | 199 +++++++++------- themes/nu-themes/atelier-heath-light.nu | 199 +++++++++------- themes/nu-themes/atelier-heath.nu | 199 +++++++++------- themes/nu-themes/atelier-lakeside-light.nu | 199 +++++++++------- themes/nu-themes/atelier-lakeside.nu | 199 +++++++++------- themes/nu-themes/atelier-plateau-light.nu | 199 +++++++++------- themes/nu-themes/atelier-plateau.nu | 199 +++++++++------- themes/nu-themes/atelier-savanna-light.nu | 199 +++++++++------- themes/nu-themes/atelier-savanna.nu | 199 +++++++++------- themes/nu-themes/atelier-seaside-light.nu | 199 +++++++++------- themes/nu-themes/atelier-seaside.nu | 199 +++++++++------- themes/nu-themes/atelier-sulphurpool-light.nu | 199 +++++++++------- themes/nu-themes/atelier-sulphurpool.nu | 199 +++++++++------- themes/nu-themes/atlas.nu | 199 +++++++++------- themes/nu-themes/atom-one-light.nu | 199 +++++++++------- themes/nu-themes/atom.nu | 199 +++++++++------- themes/nu-themes/ayu-light.nu | 199 +++++++++------- themes/nu-themes/ayu-mirage-simple-cursor.nu | 199 +++++++++------- themes/nu-themes/ayu-mirage.nu | 199 +++++++++------- themes/nu-themes/ayu.nu | 199 +++++++++------- themes/nu-themes/azu.nu | 199 +++++++++------- themes/nu-themes/batman.nu | 199 +++++++++------- themes/nu-themes/belafonte-day.nu | 199 +++++++++------- themes/nu-themes/belafonte-night.nu | 199 +++++++++------- themes/nu-themes/bespin.nu | 199 +++++++++------- themes/nu-themes/bim.nu | 199 +++++++++------- themes/nu-themes/birds-of-paradise.nu | 199 +++++++++------- themes/nu-themes/black-metal-bathory.nu | 199 +++++++++------- themes/nu-themes/black-metal-burzum.nu | 199 +++++++++------- themes/nu-themes/black-metal-dark-funeral.nu | 199 +++++++++------- themes/nu-themes/black-metal-gorgoroth.nu | 199 +++++++++------- themes/nu-themes/black-metal-immortal.nu | 199 +++++++++------- themes/nu-themes/black-metal-khold.nu | 199 +++++++++------- themes/nu-themes/black-metal-marduk.nu | 199 +++++++++------- themes/nu-themes/black-metal-mayhem.nu | 199 +++++++++------- themes/nu-themes/black-metal-nile.nu | 199 +++++++++------- themes/nu-themes/black-metal-venom.nu | 199 +++++++++------- themes/nu-themes/black-metal.nu | 199 +++++++++------- themes/nu-themes/blazer.nu | 199 +++++++++------- themes/nu-themes/borland.nu | 199 +++++++++------- themes/nu-themes/brewer.nu | 199 +++++++++------- themes/nu-themes/bright-lights.nu | 199 +++++++++------- themes/nu-themes/bright.nu | 199 +++++++++------- themes/nu-themes/broadcast.nu | 199 +++++++++------- themes/nu-themes/brogrammer.nu | 199 +++++++++------- themes/nu-themes/brushtrees-dark.nu | 199 +++++++++------- themes/nu-themes/brushtrees.nu | 199 +++++++++------- themes/nu-themes/c64.nu | 199 +++++++++------- themes/nu-themes/cai.nu | 199 +++++++++------- themes/nu-themes/catppuccin-latte.nu | 114 --------- themes/nu-themes/catppuccin-mocha.nu | 113 --------- themes/nu-themes/chalk.nu | 199 +++++++++------- themes/nu-themes/chalkboard.nu | 199 +++++++++------- themes/nu-themes/challenger-deep.nu | 199 +++++++++------- themes/nu-themes/ciapre.nu | 199 +++++++++------- themes/nu-themes/circus.nu | 199 +++++++++------- themes/nu-themes/classic-dark.nu | 199 +++++++++------- themes/nu-themes/classic-light.nu | 199 +++++++++------- themes/nu-themes/clone-of-ubuntu.nu | 199 +++++++++------- themes/nu-themes/clrs.nu | 199 +++++++++------- themes/nu-themes/cobalt-neon.nu | 199 +++++++++------- themes/nu-themes/cobalt2.nu | 199 +++++++++------- themes/nu-themes/codeschool.nu | 199 +++++++++------- themes/nu-themes/corvine.nu | 199 +++++++++------- themes/nu-themes/crayon-pony-fish.nu | 199 +++++++++------- themes/nu-themes/cupcake.nu | 199 +++++++++------- themes/nu-themes/cupertino.nu | 199 +++++++++------- themes/nu-themes/danqing.nu | 199 +++++++++------- themes/nu-themes/darcula.nu | 199 +++++++++------- themes/nu-themes/dark-pastel.nu | 199 +++++++++------- themes/nu-themes/darkmoss.nu | 199 +++++++++------- themes/nu-themes/darkside.nu | 199 +++++++++------- themes/nu-themes/darktooth.nu | 199 +++++++++------- themes/nu-themes/darkviolet.nu | 199 +++++++++------- themes/nu-themes/decaf.nu | 199 +++++++++------- themes/nu-themes/default-dark.nu | 199 +++++++++------- themes/nu-themes/default-light.nu | 199 +++++++++------- themes/nu-themes/desert-night.nu | 199 +++++++++------- themes/nu-themes/desert.nu | 199 +++++++++------- themes/nu-themes/dimmed-monokai.nu | 199 +++++++++------- themes/nu-themes/dirtysea.nu | 199 +++++++++------- themes/nu-themes/dot-gov.nu | 199 +++++++++------- themes/nu-themes/dracula.nu | 199 +++++++++------- themes/nu-themes/dumbledore.nu | 199 +++++++++------- themes/nu-themes/duotone-dark.nu | 199 +++++++++------- themes/nu-themes/e-n-c-o-m.nu | 199 +++++++++------- themes/nu-themes/earthsong.nu | 199 +++++++++------- themes/nu-themes/edge-dark.nu | 199 +++++++++------- themes/nu-themes/edge-light.nu | 199 +++++++++------- themes/nu-themes/eighties.nu | 199 +++++++++------- themes/nu-themes/elemental.nu | 199 +++++++++------- themes/nu-themes/elementary.nu | 199 +++++++++------- themes/nu-themes/elic.nu | 199 +++++++++------- themes/nu-themes/elio.nu | 199 +++++++++------- themes/nu-themes/embark.nu | 199 +++++++++------- themes/nu-themes/embers.nu | 199 +++++++++------- themes/nu-themes/equilibrium-dark.nu | 199 +++++++++------- themes/nu-themes/equilibrium-gray-dark.nu | 199 +++++++++------- themes/nu-themes/equilibrium-gray-light.nu | 199 +++++++++------- themes/nu-themes/equilibrium-light.nu | 199 +++++++++------- themes/nu-themes/espresso-libre.nu | 199 +++++++++------- themes/nu-themes/espresso.nu | 199 +++++++++------- themes/nu-themes/eva-dim.nu | 199 +++++++++------- themes/nu-themes/eva.nu | 199 +++++++++------- themes/nu-themes/everforest-light.nu | 199 +++++++++------- themes/nu-themes/everforest.nu | 199 +++++++++------- themes/nu-themes/falcon.nu | 199 +++++++++------- themes/nu-themes/farin.nu | 199 +++++++++------- themes/nu-themes/ffive.nu | 199 +++++++++------- themes/nu-themes/fideloper.nu | 199 +++++++++------- themes/nu-themes/fishtank.nu | 199 +++++++++------- themes/nu-themes/flat.nu | 199 +++++++++------- themes/nu-themes/flatland.nu | 199 +++++++++------- themes/nu-themes/floraverse.nu | 199 +++++++++------- themes/nu-themes/forest-night.nu | 199 +++++++++------- themes/nu-themes/foxnightly.nu | 199 +++++++++------- themes/nu-themes/framer.nu | 199 +++++++++------- themes/nu-themes/freya.nu | 199 +++++++++------- themes/nu-themes/frontend-delight.nu | 199 +++++++++------- themes/nu-themes/frontend-fun-forrest.nu | 199 +++++++++------- themes/nu-themes/frontend-galaxy.nu | 199 +++++++++------- themes/nu-themes/fruit-soda.nu | 199 +++++++++------- themes/nu-themes/gigavolt.nu | 199 +++++++++------- themes/nu-themes/github-dark-colorblind.nu | 199 +++++++++------- themes/nu-themes/github-dark-default.nu | 199 +++++++++------- themes/nu-themes/github-dark.nu | 199 +++++++++------- themes/nu-themes/github-dimmed.nu | 199 +++++++++------- themes/nu-themes/github-light-colorblind.nu | 199 +++++++++------- themes/nu-themes/github-light-default.nu | 199 +++++++++------- themes/nu-themes/github-light.nu | 199 +++++++++------- themes/nu-themes/github.nu | 199 +++++++++------- themes/nu-themes/glacier.nu | 199 +++++++++------- themes/nu-themes/goa-base.nu | 199 +++++++++------- themes/nu-themes/gooey.nu | 199 +++++++++------- themes/nu-themes/google-dark.nu | 199 +++++++++------- themes/nu-themes/google-light.nu | 199 +++++++++------- themes/nu-themes/grape.nu | 199 +++++++++------- themes/nu-themes/grass.nu | 199 +++++++++------- themes/nu-themes/grayscale-dark.nu | 199 +++++++++------- themes/nu-themes/grayscale-light.nu | 199 +++++++++------- themes/nu-themes/green-screen.nu | 199 +++++++++------- themes/nu-themes/greenscreen.nu | 199 +++++++++------- themes/nu-themes/gruvbit.nu | 199 +++++++++------- themes/nu-themes/gruvbox-dark-hard.nu | 199 +++++++++------- themes/nu-themes/gruvbox-dark-medium.nu | 199 +++++++++------- themes/nu-themes/gruvbox-dark-pale.nu | 199 +++++++++------- themes/nu-themes/gruvbox-dark-soft.nu | 199 +++++++++------- themes/nu-themes/gruvbox-dark.nu | 199 +++++++++------- themes/nu-themes/gruvbox-light-hard.nu | 199 +++++++++------- themes/nu-themes/gruvbox-light-medium.nu | 199 +++++++++------- themes/nu-themes/gruvbox-light-soft.nu | 199 +++++++++------- .../nu-themes/gruvbox-material-dark-hard.nu | 199 +++++++++------- .../nu-themes/gruvbox-material-dark-medium.nu | 199 +++++++++------- .../nu-themes/gruvbox-material-dark-soft.nu | 199 +++++++++------- .../nu-themes/gruvbox-material-light-hard.nu | 199 +++++++++------- .../gruvbox-material-light-medium.nu | 199 +++++++++------- .../nu-themes/gruvbox-material-light-soft.nu | 199 +++++++++------- themes/nu-themes/gruvbox-mix-dark-hard.nu | 199 +++++++++------- themes/nu-themes/gruvbox-mix-dark-medium.nu | 199 +++++++++------- themes/nu-themes/gruvbox-mix-dark-soft.nu | 199 +++++++++------- themes/nu-themes/gruvbox-mix-light-hard.nu | 199 +++++++++------- themes/nu-themes/gruvbox-mix-light-medium.nu | 199 +++++++++------- themes/nu-themes/gruvbox-mix-light-soft.nu | 199 +++++++++------- .../nu-themes/gruvbox-original-dark-hard.nu | 199 +++++++++------- .../nu-themes/gruvbox-original-dark-medium.nu | 199 +++++++++------- .../nu-themes/gruvbox-original-dark-soft.nu | 199 +++++++++------- .../nu-themes/gruvbox-original-light-hard.nu | 199 +++++++++------- .../gruvbox-original-light-medium.nu | 199 +++++++++------- .../nu-themes/gruvbox-original-light-soft.nu | 199 +++++++++------- themes/nu-themes/gruvbox.nu | 199 +++++++++------- themes/nu-themes/hardcore.nu | 199 +++++++++------- themes/nu-themes/harmonic-dark.nu | 199 +++++++++------- themes/nu-themes/harmonic-light.nu | 199 +++++++++------- themes/nu-themes/harmonic16-dark.nu | 199 +++++++++------- themes/nu-themes/harmonic16-light.nu | 199 +++++++++------- themes/nu-themes/harper.nu | 199 +++++++++------- themes/nu-themes/heetch-light.nu | 199 +++++++++------- themes/nu-themes/heetch.nu | 199 +++++++++------- themes/nu-themes/helios.nu | 199 +++++++++------- themes/nu-themes/hemisu-dark.nu | 199 +++++++++------- themes/nu-themes/hemisu-light.nu | 199 +++++++++------- themes/nu-themes/highway.nu | 199 +++++++++------- themes/nu-themes/hipster-green.nu | 199 +++++++++------- themes/nu-themes/homebrew.nu | 199 +++++++++------- themes/nu-themes/hopscotch.nu | 199 +++++++++------- themes/nu-themes/horizon-dark.nu | 199 +++++++++------- themes/nu-themes/horizon-light.nu | 199 +++++++++------- themes/nu-themes/horizon-terminal-dark.nu | 199 +++++++++------- themes/nu-themes/horizon-terminal-light.nu | 199 +++++++++------- themes/nu-themes/humanoid-dark.nu | 199 +++++++++------- themes/nu-themes/humanoid-light.nu | 199 +++++++++------- themes/nu-themes/hurtado.nu | 199 +++++++++------- themes/nu-themes/hybrid.nu | 199 +++++++++------- themes/nu-themes/ia-dark.nu | 199 +++++++++------- themes/nu-themes/ia-light.nu | 199 +++++++++------- themes/nu-themes/ibm3270.nu | 199 +++++++++------- themes/nu-themes/ic-green-ppl.nu | 199 +++++++++------- themes/nu-themes/ic-orange-ppl.nu | 199 +++++++++------- themes/nu-themes/iceberg-light.nu | 199 +++++++++------- themes/nu-themes/icy.nu | 199 +++++++++------- themes/nu-themes/idle-toes.nu | 199 +++++++++------- themes/nu-themes/idm_3b.nu | 199 +++++++++------- themes/nu-themes/ir-black.nu | 199 +++++++++------- themes/nu-themes/irblack.nu | 199 +++++++++------- themes/nu-themes/isotope.nu | 199 +++++++++------- themes/nu-themes/jackie-brown.nu | 199 +++++++++------- themes/nu-themes/japanesque.nu | 199 +++++++++------- themes/nu-themes/jellybeans.nu | 199 +++++++++------- themes/nu-themes/jet-brains-darcula.nu | 199 +++++++++------- themes/nu-themes/jup.nu | 199 +++++++++------- themes/nu-themes/kibble.nu | 199 +++++++++------- themes/nu-themes/kimber.nu | 199 +++++++++------- themes/nu-themes/later-this-evening.nu | 199 +++++++++------- themes/nu-themes/lavandula.nu | 199 +++++++++------- themes/nu-themes/liquid-carbon-transparent.nu | 199 +++++++++------- themes/nu-themes/liquid-carbon.nu | 199 +++++++++------- themes/nu-themes/london-tube.nu | 199 +++++++++------- themes/nu-themes/macintosh.nu | 199 +++++++++------- themes/nu-themes/maia.nu | 199 +++++++++------- themes/nu-themes/man-page.nu | 199 +++++++++------- themes/nu-themes/mar.nu | 199 +++++++++------- themes/nu-themes/marrakesh.nu | 199 +++++++++------- themes/nu-themes/materia.nu | 199 +++++++++------- themes/nu-themes/material-dark.nu | 199 +++++++++------- themes/nu-themes/material-darker.nu | 199 +++++++++------- themes/nu-themes/material-lighter.nu | 199 +++++++++------- themes/nu-themes/material-palenight.nu | 199 +++++++++------- themes/nu-themes/material-vivid.nu | 199 +++++++++------- themes/nu-themes/material.nu | 199 +++++++++------- themes/nu-themes/mathias.nu | 199 +++++++++------- themes/nu-themes/medallion.nu | 199 +++++++++------- themes/nu-themes/mellow-purple.nu | 199 +++++++++------- themes/nu-themes/mexico-light.nu | 199 +++++++++------- themes/nu-themes/miramare.nu | 199 +++++++++------- themes/nu-themes/misterioso.nu | 199 +++++++++------- themes/nu-themes/miu.nu | 199 +++++++++------- themes/nu-themes/mocha.nu | 199 +++++++++------- themes/nu-themes/molokai.nu | 199 +++++++++------- themes/nu-themes/mona-lisa.nu | 199 +++++++++------- themes/nu-themes/mono-amber.nu | 199 +++++++++------- themes/nu-themes/mono-cyan.nu | 199 +++++++++------- themes/nu-themes/mono-green.nu | 199 +++++++++------- themes/nu-themes/mono-red.nu | 199 +++++++++------- themes/nu-themes/mono-white.nu | 199 +++++++++------- themes/nu-themes/mono-yellow.nu | 199 +++++++++------- themes/nu-themes/monokai-dark.nu | 199 +++++++++------- themes/nu-themes/monokai-soda.nu | 199 +++++++++------- themes/nu-themes/monokai.nu | 199 +++++++++------- themes/nu-themes/mountaineer-grey.nu | 199 +++++++++------- themes/nu-themes/mountaineer.nu | 199 +++++++++------- themes/nu-themes/n0tch2k.nu | 199 +++++++++------- themes/nu-themes/nebula.nu | 199 +++++++++------- themes/nu-themes/neon-night.nu | 199 +++++++++------- themes/nu-themes/neopolitan.nu | 199 +++++++++------- themes/nu-themes/nep.nu | 199 +++++++++------- themes/nu-themes/neutron.nu | 199 +++++++++------- themes/nu-themes/nightfly.nu | 199 +++++++++------- themes/nu-themes/nightlion-v1.nu | 199 +++++++++------- themes/nu-themes/nightlion-v2.nu | 199 +++++++++------- themes/nu-themes/nighty.nu | 199 +++++++++------- themes/nu-themes/nord-alt.nu | 199 +++++++++------- themes/nu-themes/nord-light.nu | 199 +++++++++------- themes/nu-themes/nord.nu | 199 +++++++++------- themes/nu-themes/nova.nu | 199 +++++++++------- themes/nu-themes/novel.nu | 199 +++++++++------- themes/nu-themes/nushell-dark.nu | 88 ------- themes/nu-themes/nushell-light.nu | 88 ------- themes/nu-themes/obsidian.nu | 199 +++++++++------- themes/nu-themes/ocean-dark.nu | 199 +++++++++------- themes/nu-themes/ocean.nu | 199 +++++++++------- themes/nu-themes/oceanic-material.nu | 199 +++++++++------- themes/nu-themes/oceanic-next.nu | 199 +++++++++------- themes/nu-themes/oceanicnext.nu | 199 +++++++++------- themes/nu-themes/ollie.nu | 199 +++++++++------- themes/nu-themes/one-dark.nu | 199 +++++++++------- themes/nu-themes/one-half-black.nu | 199 +++++++++------- themes/nu-themes/one-half-light.nu | 199 +++++++++------- themes/nu-themes/one-light.nu | 199 +++++++++------- themes/nu-themes/onedark.nu | 199 +++++++++------- themes/nu-themes/orbital.nu | 199 +++++++++------- themes/nu-themes/outrun-dark.nu | 199 +++++++++------- themes/nu-themes/pali.nu | 199 +++++++++------- themes/nu-themes/palmtree.nu | 199 +++++++++------- themes/nu-themes/papercolor-dark.nu | 199 +++++++++------- themes/nu-themes/papercolor-light.nu | 199 +++++++++------- themes/nu-themes/paraiso-dark.nu | 199 +++++++++------- themes/nu-themes/paraiso.nu | 199 +++++++++------- themes/nu-themes/pasque.nu | 199 +++++++++------- themes/nu-themes/paul-millr.nu | 199 +++++++++------- themes/nu-themes/pencil-dark.nu | 199 +++++++++------- themes/nu-themes/pencil-light.nu | 199 +++++++++------- themes/nu-themes/peppermint.nu | 199 +++++++++------- themes/nu-themes/phd.nu | 199 +++++++++------- themes/nu-themes/piatto-light.nu | 199 +++++++++------- themes/nu-themes/pico.nu | 199 +++++++++------- themes/nu-themes/pnevma.nu | 199 +++++++++------- themes/nu-themes/pop.nu | 199 +++++++++------- themes/nu-themes/porple.nu | 199 +++++++++------- themes/nu-themes/pro.nu | 199 +++++++++------- themes/nu-themes/railscasts.nu | 199 +++++++++------- themes/nu-themes/rebecca.nu | 199 +++++++++------- themes/nu-themes/red-alert.nu | 199 +++++++++------- themes/nu-themes/red-sands.nu | 199 +++++++++------- themes/nu-themes/relaxed-afterglow.nu | 199 +++++++++------- themes/nu-themes/renault-style-light.nu | 199 +++++++++------- themes/nu-themes/rippedcasts.nu | 199 +++++++++------- themes/nu-themes/rose-pine-dawn.nu | 199 +++++++++------- themes/nu-themes/rose-pine-moon.nu | 199 +++++++++------- themes/nu-themes/rose-pine.nu | 199 +++++++++------- themes/nu-themes/royal.nu | 199 +++++++++------- themes/nu-themes/sagelight.nu | 199 +++++++++------- themes/nu-themes/sandcastle.nu | 199 +++++++++------- themes/nu-themes/sat.nu | 199 +++++++++------- themes/nu-themes/sea-shells.nu | 199 +++++++++------- themes/nu-themes/seafoam-pastel.nu | 199 +++++++++------- themes/nu-themes/selenized-black.nu | 199 +++++++++------- themes/nu-themes/selenized-dark.nu | 199 +++++++++------- themes/nu-themes/selenized-light.nu | 199 +++++++++------- themes/nu-themes/selenized-white.nu | 199 +++++++++------- themes/nu-themes/seoul256.nu | 199 +++++++++------- themes/nu-themes/seti-ui.nu | 199 +++++++++------- themes/nu-themes/seti.nu | 199 +++++++++------- themes/nu-themes/shaman.nu | 199 +++++++++------- themes/nu-themes/shapeshifter.nu | 199 +++++++++------- themes/nu-themes/shel.nu | 199 +++++++++------- themes/nu-themes/sierra.nu | 199 +++++++++------- themes/nu-themes/silk-dark.nu | 199 +++++++++------- themes/nu-themes/silk-light.nu | 199 +++++++++------- themes/nu-themes/slate.nu | 199 +++++++++------- themes/nu-themes/smyck.nu | 199 +++++++++------- themes/nu-themes/snazzy.nu | 199 +++++++++------- themes/nu-themes/snow-dark.nu | 199 +++++++++------- themes/nu-themes/snow-light.nu | 199 +++++++++------- themes/nu-themes/soft-server.nu | 199 +++++++++------- themes/nu-themes/solar-flare.nu | 199 +++++++++------- themes/nu-themes/solarflare-light.nu | 199 +++++++++------- themes/nu-themes/solarflare.nu | 199 +++++++++------- themes/nu-themes/solarized-darcula.nu | 199 +++++++++------- .../solarized-dark-higher-contrast.nu | 199 +++++++++------- themes/nu-themes/solarized-dark.nu | 199 +++++++++------- themes/nu-themes/solarized-light.nu | 199 +++++++++------- themes/nu-themes/source-code-x.nu | 199 +++++++++------- themes/nu-themes/sourcerer.nu | 199 +++++++++------- themes/nu-themes/sourcerer2.nu | 199 +++++++++------- themes/nu-themes/spaceduck.nu | 199 +++++++++------- themes/nu-themes/spacedust.nu | 199 +++++++++------- themes/nu-themes/spacegray-eighties-dull.nu | 199 +++++++++------- themes/nu-themes/spacegray-eighties.nu | 199 +++++++++------- themes/nu-themes/spacegray.nu | 199 +++++++++------- themes/nu-themes/spacemacs.nu | 199 +++++++++------- themes/nu-themes/spiderman.nu | 199 +++++++++------- themes/nu-themes/spring.nu | 199 +++++++++------- themes/nu-themes/square.nu | 199 +++++++++------- themes/nu-themes/srcery.nu | 199 +++++++++------- themes/nu-themes/substrata.nu | 199 +++++++++------- themes/nu-themes/summercamp.nu | 199 +++++++++------- themes/nu-themes/summerfruit-dark.nu | 199 +++++++++------- themes/nu-themes/summerfruit-light.nu | 199 +++++++++------- themes/nu-themes/sundried.nu | 199 +++++++++------- themes/nu-themes/symphonic.nu | 199 +++++++++------- themes/nu-themes/synth-midnight-dark.nu | 199 +++++++++------- themes/nu-themes/synth-midnight-light.nu | 199 +++++++++------- themes/nu-themes/tango-dark.nu | 199 +++++++++------- themes/nu-themes/tango-light.nu | 199 +++++++++------- themes/nu-themes/tango.nu | 199 +++++++++------- themes/nu-themes/teerb.nu | 199 +++++++++------- themes/nu-themes/tempus-autumn.nu | 199 +++++++++------- themes/nu-themes/tempus-classic.nu | 199 +++++++++------- themes/nu-themes/tempus-dawn.nu | 199 +++++++++------- themes/nu-themes/tempus-day.nu | 199 +++++++++------- themes/nu-themes/tempus-dusk.nu | 199 +++++++++------- themes/nu-themes/tempus-fugit.nu | 199 +++++++++------- themes/nu-themes/tempus-future.nu | 199 +++++++++------- themes/nu-themes/tempus-night.nu | 199 +++++++++------- themes/nu-themes/tempus-past.nu | 199 +++++++++------- themes/nu-themes/tempus-rift.nu | 199 +++++++++------- themes/nu-themes/tempus-spring.nu | 199 +++++++++------- themes/nu-themes/tempus-summer.nu | 199 +++++++++------- themes/nu-themes/tempus-tempest.nu | 199 +++++++++------- themes/nu-themes/tempus-totus.nu | 199 +++++++++------- themes/nu-themes/tempus-warp.nu | 199 +++++++++------- themes/nu-themes/tempus-winter.nu | 199 +++++++++------- themes/nu-themes/tender.nu | 199 +++++++++------- themes/nu-themes/terminal-basic.nu | 199 +++++++++------- themes/nu-themes/terminix-dark.nu | 199 +++++++++------- themes/nu-themes/thayer-bright.nu | 199 +++++++++------- themes/nu-themes/the-hulk.nu | 199 +++++++++------- themes/nu-themes/tin.nu | 199 +++++++++------- themes/nu-themes/tokyo-day.nu | 199 +++++++++------- themes/nu-themes/tokyo-moon.nu | 82 ------- themes/nu-themes/tokyo-night.nu | 199 +++++++++------- themes/nu-themes/tokyo-storm.nu | 199 +++++++++------- themes/nu-themes/tomorrow-night-blue.nu | 199 +++++++++------- themes/nu-themes/tomorrow-night-bright.nu | 199 +++++++++------- themes/nu-themes/tomorrow-night-eighties.nu | 199 +++++++++------- themes/nu-themes/tomorrow-night.nu | 199 +++++++++------- themes/nu-themes/tomorrow.nu | 199 +++++++++------- themes/nu-themes/toy-chest.nu | 199 +++++++++------- themes/nu-themes/treehouse.nu | 199 +++++++++------- themes/nu-themes/tube.nu | 199 +++++++++------- themes/nu-themes/twilight.nu | 199 +++++++++------- themes/nu-themes/two-firewatch.nu | 199 +++++++++------- themes/nu-themes/unikitty-dark.nu | 199 +++++++++------- themes/nu-themes/unikitty-light.nu | 199 +++++++++------- themes/nu-themes/ura.nu | 199 +++++++++------- themes/nu-themes/urple.nu | 199 +++++++++------- themes/nu-themes/vag.nu | 199 +++++++++------- themes/nu-themes/vaughn.nu | 199 +++++++++------- themes/nu-themes/vibrant-ink.nu | 199 +++++++++------- themes/nu-themes/vs-code-dark-plus.nu | 199 +++++++++------- themes/nu-themes/vulcan.nu | 199 +++++++++------- themes/nu-themes/warm-neon.nu | 199 +++++++++------- themes/nu-themes/wez.nu | 199 +++++++++------- themes/nu-themes/wild-cherry.nu | 199 +++++++++------- themes/nu-themes/windows-10-light.nu | 199 +++++++++------- themes/nu-themes/windows-10.nu | 199 +++++++++------- themes/nu-themes/windows-95-light.nu | 199 +++++++++------- themes/nu-themes/windows-95.nu | 199 +++++++++------- .../nu-themes/windows-highcontrast-light.nu | 199 +++++++++------- themes/nu-themes/windows-highcontrast.nu | 199 +++++++++------- themes/nu-themes/windows-nt-light.nu | 199 +++++++++------- themes/nu-themes/windows-nt.nu | 199 +++++++++------- themes/nu-themes/wombat.nu | 199 +++++++++------- themes/nu-themes/woodland.nu | 199 +++++++++------- themes/nu-themes/wryan.nu | 199 +++++++++------- themes/nu-themes/xcode-dusk.nu | 199 +++++++++------- themes/nu-themes/yachiyo.nu | 199 +++++++++------- themes/nu-themes/zenburn.nu | 199 +++++++++------- .../scripts}/preview-generate-script.nu | 0 .../scripts}/preview-screenshot-script.nu | 0 .../scripts}/preview-terminal.nu | 0 .../scripts}/preview-theme.nu | 0 458 files changed, 53269 insertions(+), 36274 deletions(-) create mode 100644 themes/nu-themes/3024.nu delete mode 100644 themes/nu-themes/3024r.nu delete mode 100644 themes/nu-themes/catppuccin-latte.nu delete mode 100644 themes/nu-themes/catppuccin-mocha.nu delete mode 100644 themes/nu-themes/nushell-dark.nu delete mode 100644 themes/nu-themes/nushell-light.nu delete mode 100644 themes/nu-themes/tokyo-moon.nu rename themes/{nu-themes => screenshots/scripts}/preview-generate-script.nu (100%) rename themes/{nu-themes => screenshots/scripts}/preview-screenshot-script.nu (100%) rename themes/{nu-themes => screenshots/scripts}/preview-terminal.nu (100%) rename themes/{nu-themes => screenshots/scripts}/preview-theme.nu (100%) diff --git a/themes/README.md b/themes/README.md index 7d0d000..eb447f4 100644 --- a/themes/README.md +++ b/themes/README.md @@ -1,42 +1,79 @@ -# Nushell themes +# Nushell Themes Credit to @lemnos and [all contributors](https://github.com/lemnos/theme.sh/blob/master/CREDITS.md). ## Use a colorscheme -### The manual way -Currently, the theme change has to be a bit manual. -To have access to the list of all the themes, +### Without Nupm + +To list all the themes, from the root of the repository run: + ```rust ls ./themes/nu-themes ``` -To use the `dracula` theme for instance, please run +To use the `dracula` theme for instance, please run: + ```rust -use ./themes/nu-themes/dracula.nu -$env.config = ($env.config | merge {color_config: (dracula)}) +source ./themes/nu-themes/dracula.nu ``` The theme should be activated! ### Using Nupm -- install [Nupm] by following the [Nupm instructions] -- download the `nu_scripts` repository -```shell -git clone https://github.com/nushell/nu_scripts -``` -- activate the `nupm` module with `use nupm` -- install the `nu-scripts` package + +1. Install [Nupm] by following the [Nupm instructions] +2. Download the `nu_scripts` repository + + ```shell + git clone https://github.com/nushell/nu_scripts + ``` + +3. Activate the `nupm` module with `use nupm` +4. Install the `nu-scripts` package + + ```nushell + nupm install --path --force nu_scripts + ``` + + > **Note** + > installing the `nu-scripts` package will install `nu-themes` and other modules + +5. Add the following in your config, substituting the `theme_name` as desired: + + ```nushell + source nu-themes/.nu + ``` + +## Loading a theme's color_config + +When sourcing the theme, as above, the theme will: + +* Set Nushell's `$env.config.color_config` to the appropriate theme colors +* If supported, set your terminal's foreground, background, and cursor colors to match the theme + +If you would like to do *just* one or the other, you can load a theme's color definition and terminal settings separately. + +### Load a color_config + +For example, to load and use the `tokyo-night` theme's colors: + ```nushell -nupm install --path --force nu_scripts +> use nu-themes/tokyo-night.nu * + # Display the values +> tokyo-night + # Set the color_config to that scheme +> tokyo-night set color_config + # Or +> $env.config.color_config = (tokyo-night) ``` -> **Note** -> installing the `nu-scripts` package will install `nu-themes` and other modules +### Set terminal colors + +Again, using the `tokyo-night` theme as an example: -- now, add the following in your config ```nushell -use nu-themes/nushell-dark.nu -$env.config.color_config = (nushell-dark) +> use nu-themes/tokyo-night.nu * +> tokyo-night update terminal ``` ## Screenshots diff --git a/themes/make.nu b/themes/make.nu index 6af4399..e0e09a7 100755 --- a/themes/make.nu +++ b/themes/make.nu @@ -1,4 +1,5 @@ #!/usr/bin/env nu +use ../stdlib-candidate/std-rfc str let current_dir = ($env.CURRENT_FILE | path dirname) @@ -7,9 +8,9 @@ let SOURCE = { local: ($current_dir | path join "lemnos") remote: "https://github.com/lemnos/theme.sh" } -let THEMES = ($current_dir | path join "themes") +let themes_dir = ($current_dir | path join "nu-themes") -def make-theme [name: string] { +def make_theme [ name: string ] { let colors = ( open ($SOURCE.dir | path join $name) | lines --skip-empty @@ -20,97 +21,140 @@ def make-theme [name: string] { | into record ) - $'export def main [] { return { - separator: "($colors.color7)" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "($colors.color2)" attr: "b" } - empty: "($colors.color4)" - bool: {|| if $in { "($colors.color14)" } else { "light_gray" } } - int: "($colors.color7)" - filesize: {|e| - if $e == 0b { - "($colors.color7)" - } else if $e < 1mb { - "($colors.color6)" - } else {{ fg: "($colors.color4)" }} - } - duration: "($colors.color7)" - date: {|| (char lparen)date now(char rparen) - $in | - if $in < 1hr { - { fg: "($colors.color1)" attr: "b" } - } else if $in < 6hr { - "($colors.color1)" - } else if $in < 1day { - "($colors.color3)" - } else if $in < 3day { - "($colors.color2)" - } else if $in < 1wk { - { fg: "($colors.color2)" attr: "b" } - } else if $in < 6wk { - "($colors.color6)" - } else if $in < 52wk { - "($colors.color4)" - } else { "dark_gray" } - } - range: "($colors.color7)" - float: "($colors.color7)" - string: "($colors.color7)" - nothing: "($colors.color7)" - binary: "($colors.color7)" - cellpath: "($colors.color7)" - row_index: { fg: "($colors.color2)" attr: "b" } - record: "($colors.color7)" - list: "($colors.color7)" - block: "($colors.color7)" - hints: "dark_gray" - search_result: { fg: "($colors.color1)" bg: "($colors.color7)" } + $" + # Update terminal colors + export def \"update terminal\" [] { + let theme = \(main) - shape_and: { fg: "($colors.color5)" attr: "b" } - shape_binary: { fg: "($colors.color5)" attr: "b" } - shape_block: { fg: "($colors.color4)" attr: "b" } - shape_bool: "($colors.color14)" - shape_custom: "($colors.color2)" - shape_datetime: { fg: "($colors.color6)" attr: "b" } - shape_directory: "($colors.color6)" - shape_external: "($colors.color6)" - shape_externalarg: { fg: "($colors.color2)" attr: "b" } - shape_filepath: "($colors.color6)" - shape_flag: { fg: "($colors.color4)" attr: "b" } - shape_float: { fg: "($colors.color5)" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "($colors.color6)" attr: "b" } - shape_int: { fg: "($colors.color5)" attr: "b" } - shape_internalcall: { fg: "($colors.color6)" attr: "b" } - shape_list: { fg: "($colors.color6)" attr: "b" } - shape_literal: "($colors.color4)" - shape_match_pattern: "($colors.color2)" - shape_matching_brackets: { attr: "u" } - shape_nothing: "($colors.color14)" - shape_operator: "($colors.color3)" - shape_or: { fg: "($colors.color5)" attr: "b" } - shape_pipe: { fg: "($colors.color5)" attr: "b" } - shape_range: { fg: "($colors.color3)" attr: "b" } - shape_record: { fg: "($colors.color6)" attr: "b" } - shape_redirection: { fg: "($colors.color5)" attr: "b" } - shape_signature: { fg: "($colors.color2)" attr: "b" } - shape_string: "($colors.color2)" - shape_string_interpolation: { fg: "($colors.color6)" attr: "b" } - shape_table: { fg: "($colors.color4)" attr: "b" } - shape_variable: "($colors.color5)" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $\" + \(ansi -o $osc_screen_foreground_color)\($theme.foreground)\(char bel) + \(ansi -o $osc_screen_background_color)\($theme.background)\(char bel) + \(ansi -o $osc_cursor_color)\($theme.cursor)\(char bel) + \" + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all \"\\n\" '' + | print $in + } - background: "($colors.background)" - foreground: "($colors.foreground)" - cursor: "($colors.cursor)" -}}' + # Update the Nushell configuration + export def --env \"set color_config\" [] { + $env.config.color_config = \(main) + } + + # Retrieve the theme settings + export def main [] { + return { + separator: '($colors.color7)' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '($colors.color2)' attr: 'b' } + empty: '($colors.color4)' + bool: {|| if $in { '($colors.color14)' } else { 'light_gray' } } + int: '($colors.color7)' + filesize: {|e| + if $e == 0b { + '($colors.color7)' + } else if $e < 1mb { + '($colors.color6)' + } else {{ fg: '($colors.color4)' }} + } + duration: '($colors.color7)' + date: {|| (char lparen)date now(char rparen) - $in | + if $in < 1hr { + { fg: '($colors.color1)' attr: 'b' } + } else if $in < 6hr { + '($colors.color1)' + } else if $in < 1day { + '($colors.color3)' + } else if $in < 3day { + '($colors.color2)' + } else if $in < 1wk { + { fg: '($colors.color2)' attr: 'b' } + } else if $in < 6wk { + '($colors.color6)' + } else if $in < 52wk { + '($colors.color4)' + } else { 'dark_gray' } + } + range: '($colors.color7)' + float: '($colors.color7)' + string: '($colors.color7)' + nothing: '($colors.color7)' + binary: '($colors.color7)' + cellpath: '($colors.color7)' + row_index: { fg: '($colors.color2)' attr: 'b' } + record: '($colors.color7)' + list: '($colors.color7)' + block: '($colors.color7)' + hints: 'dark_gray' + search_result: { fg: '($colors.color1)' bg: '($colors.color7)' } + + shape_and: { fg: '($colors.color5)' attr: 'b' } + shape_binary: { fg: '($colors.color5)' attr: 'b' } + shape_block: { fg: '($colors.color4)' attr: 'b' } + shape_bool: '($colors.color14)' + shape_custom: '($colors.color2)' + shape_datetime: { fg: '($colors.color6)' attr: 'b' } + shape_directory: '($colors.color6)' + shape_external: '($colors.color6)' + shape_externalarg: { fg: '($colors.color2)' attr: 'b' } + shape_filepath: '($colors.color6)' + shape_flag: { fg: '($colors.color4)' attr: 'b' } + shape_float: { fg: '($colors.color5)' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '($colors.color6)' attr: 'b' } + shape_int: { fg: '($colors.color5)' attr: 'b' } + shape_internalcall: { fg: '($colors.color6)' attr: 'b' } + shape_list: { fg: '($colors.color6)' attr: 'b' } + shape_literal: '($colors.color4)' + shape_match_pattern: '($colors.color2)' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '($colors.color14)' + shape_operator: '($colors.color3)' + shape_or: { fg: '($colors.color5)' attr: 'b' } + shape_pipe: { fg: '($colors.color5)' attr: 'b' } + shape_range: { fg: '($colors.color3)' attr: 'b' } + shape_record: { fg: '($colors.color6)' attr: 'b' } + shape_redirection: { fg: '($colors.color5)' attr: 'b' } + shape_signature: { fg: '($colors.color2)' attr: 'b' } + shape_string: '($colors.color2)' + shape_string_interpolation: { fg: '($colors.color6)' attr: 'b' } + shape_table: { fg: '($colors.color4)' attr: 'b' } + shape_variable: '($colors.color5)' + + background: '($colors.background)' + foreground: '($colors.foreground)' + cursor: '($colors.cursor)' + } + } + + export module activate { + export-env { + set color_config + update terminal + } + } + + # Activate the theme when sourced + use activate + " + | str dedent | save --force ({ - parent: $THEMES - stem: $name + parent: $themes_dir + stem: $"($name)" extension: "nu" } | path join) + } def main [] { - mkdir $THEMES + mkdir $themes_dir try { git clone $SOURCE.remote $SOURCE.local } @@ -119,8 +163,13 @@ def main [] { | path parse | get stem | each {|theme| - print -n $"(ansi erase_line)($theme)\r" - make-theme $theme + print $"Converting ($theme)" + try { + make_theme $theme + } catch {|e| + print -e $"Error converting ($theme)" + print -e $e.debug + } } | ignore diff --git a/themes/nu-themes/3024-day.nu b/themes/nu-themes/3024-day.nu index 6174185..e22f570 100644 --- a/themes/nu-themes/3024-day.nu +++ b/themes/nu-themes/3024-day.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a5a2a2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#01a252" attr: "b" } - empty: "#01a0e4" - bool: {|| if $in { "#cdab53" } else { "light_gray" } } - int: "#a5a2a2" - filesize: {|e| - if $e == 0b { - "#a5a2a2" - } else if $e < 1mb { - "#b5e4f4" - } else {{ fg: "#01a0e4" }} - } - duration: "#a5a2a2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#db2d20" attr: "b" } - } else if $in < 6hr { - "#db2d20" - } else if $in < 1day { - "#fded02" - } else if $in < 3day { - "#01a252" - } else if $in < 1wk { - { fg: "#01a252" attr: "b" } - } else if $in < 6wk { - "#b5e4f4" - } else if $in < 52wk { - "#01a0e4" - } else { "dark_gray" } - } - range: "#a5a2a2" - float: "#a5a2a2" - string: "#a5a2a2" - nothing: "#a5a2a2" - binary: "#a5a2a2" - cellpath: "#a5a2a2" - row_index: { fg: "#01a252" attr: "b" } - record: "#a5a2a2" - list: "#a5a2a2" - block: "#a5a2a2" - hints: "dark_gray" - search_result: { fg: "#db2d20" bg: "#a5a2a2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a16a94" attr: "b" } - shape_binary: { fg: "#a16a94" attr: "b" } - shape_block: { fg: "#01a0e4" attr: "b" } - shape_bool: "#cdab53" - shape_custom: "#01a252" - shape_datetime: { fg: "#b5e4f4" attr: "b" } - shape_directory: "#b5e4f4" - shape_external: "#b5e4f4" - shape_externalarg: { fg: "#01a252" attr: "b" } - shape_filepath: "#b5e4f4" - shape_flag: { fg: "#01a0e4" attr: "b" } - shape_float: { fg: "#a16a94" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b5e4f4" attr: "b" } - shape_int: { fg: "#a16a94" attr: "b" } - shape_internalcall: { fg: "#b5e4f4" attr: "b" } - shape_list: { fg: "#b5e4f4" attr: "b" } - shape_literal: "#01a0e4" - shape_match_pattern: "#01a252" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#cdab53" - shape_operator: "#fded02" - shape_or: { fg: "#a16a94" attr: "b" } - shape_pipe: { fg: "#a16a94" attr: "b" } - shape_range: { fg: "#fded02" attr: "b" } - shape_record: { fg: "#b5e4f4" attr: "b" } - shape_redirection: { fg: "#a16a94" attr: "b" } - shape_signature: { fg: "#01a252" attr: "b" } - shape_string: "#01a252" - shape_string_interpolation: { fg: "#b5e4f4" attr: "b" } - shape_table: { fg: "#01a0e4" attr: "b" } - shape_variable: "#a16a94" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f7f7f7" - foreground: "#4a4543" - cursor: "#4a4543" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a5a2a2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#01a252' attr: 'b' } + empty: '#01a0e4' + bool: {|| if $in { '#cdab53' } else { 'light_gray' } } + int: '#a5a2a2' + filesize: {|e| + if $e == 0b { + '#a5a2a2' + } else if $e < 1mb { + '#b5e4f4' + } else {{ fg: '#01a0e4' }} + } + duration: '#a5a2a2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#db2d20' attr: 'b' } + } else if $in < 6hr { + '#db2d20' + } else if $in < 1day { + '#fded02' + } else if $in < 3day { + '#01a252' + } else if $in < 1wk { + { fg: '#01a252' attr: 'b' } + } else if $in < 6wk { + '#b5e4f4' + } else if $in < 52wk { + '#01a0e4' + } else { 'dark_gray' } + } + range: '#a5a2a2' + float: '#a5a2a2' + string: '#a5a2a2' + nothing: '#a5a2a2' + binary: '#a5a2a2' + cellpath: '#a5a2a2' + row_index: { fg: '#01a252' attr: 'b' } + record: '#a5a2a2' + list: '#a5a2a2' + block: '#a5a2a2' + hints: 'dark_gray' + search_result: { fg: '#db2d20' bg: '#a5a2a2' } + + shape_and: { fg: '#a16a94' attr: 'b' } + shape_binary: { fg: '#a16a94' attr: 'b' } + shape_block: { fg: '#01a0e4' attr: 'b' } + shape_bool: '#cdab53' + shape_custom: '#01a252' + shape_datetime: { fg: '#b5e4f4' attr: 'b' } + shape_directory: '#b5e4f4' + shape_external: '#b5e4f4' + shape_externalarg: { fg: '#01a252' attr: 'b' } + shape_filepath: '#b5e4f4' + shape_flag: { fg: '#01a0e4' attr: 'b' } + shape_float: { fg: '#a16a94' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b5e4f4' attr: 'b' } + shape_int: { fg: '#a16a94' attr: 'b' } + shape_internalcall: { fg: '#b5e4f4' attr: 'b' } + shape_list: { fg: '#b5e4f4' attr: 'b' } + shape_literal: '#01a0e4' + shape_match_pattern: '#01a252' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#cdab53' + shape_operator: '#fded02' + shape_or: { fg: '#a16a94' attr: 'b' } + shape_pipe: { fg: '#a16a94' attr: 'b' } + shape_range: { fg: '#fded02' attr: 'b' } + shape_record: { fg: '#b5e4f4' attr: 'b' } + shape_redirection: { fg: '#a16a94' attr: 'b' } + shape_signature: { fg: '#01a252' attr: 'b' } + shape_string: '#01a252' + shape_string_interpolation: { fg: '#b5e4f4' attr: 'b' } + shape_table: { fg: '#01a0e4' attr: 'b' } + shape_variable: '#a16a94' + + background: '#f7f7f7' + foreground: '#4a4543' + cursor: '#4a4543' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/3024-night.nu b/themes/nu-themes/3024-night.nu index 793ba49..f1354f7 100644 --- a/themes/nu-themes/3024-night.nu +++ b/themes/nu-themes/3024-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a5a2a2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#01a252" attr: "b" } - empty: "#01a0e4" - bool: {|| if $in { "#cdab53" } else { "light_gray" } } - int: "#a5a2a2" - filesize: {|e| - if $e == 0b { - "#a5a2a2" - } else if $e < 1mb { - "#b5e4f4" - } else {{ fg: "#01a0e4" }} - } - duration: "#a5a2a2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#db2d20" attr: "b" } - } else if $in < 6hr { - "#db2d20" - } else if $in < 1day { - "#fded02" - } else if $in < 3day { - "#01a252" - } else if $in < 1wk { - { fg: "#01a252" attr: "b" } - } else if $in < 6wk { - "#b5e4f4" - } else if $in < 52wk { - "#01a0e4" - } else { "dark_gray" } - } - range: "#a5a2a2" - float: "#a5a2a2" - string: "#a5a2a2" - nothing: "#a5a2a2" - binary: "#a5a2a2" - cellpath: "#a5a2a2" - row_index: { fg: "#01a252" attr: "b" } - record: "#a5a2a2" - list: "#a5a2a2" - block: "#a5a2a2" - hints: "dark_gray" - search_result: { fg: "#db2d20" bg: "#a5a2a2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a16a94" attr: "b" } - shape_binary: { fg: "#a16a94" attr: "b" } - shape_block: { fg: "#01a0e4" attr: "b" } - shape_bool: "#cdab53" - shape_custom: "#01a252" - shape_datetime: { fg: "#b5e4f4" attr: "b" } - shape_directory: "#b5e4f4" - shape_external: "#b5e4f4" - shape_externalarg: { fg: "#01a252" attr: "b" } - shape_filepath: "#b5e4f4" - shape_flag: { fg: "#01a0e4" attr: "b" } - shape_float: { fg: "#a16a94" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b5e4f4" attr: "b" } - shape_int: { fg: "#a16a94" attr: "b" } - shape_internalcall: { fg: "#b5e4f4" attr: "b" } - shape_list: { fg: "#b5e4f4" attr: "b" } - shape_literal: "#01a0e4" - shape_match_pattern: "#01a252" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#cdab53" - shape_operator: "#fded02" - shape_or: { fg: "#a16a94" attr: "b" } - shape_pipe: { fg: "#a16a94" attr: "b" } - shape_range: { fg: "#fded02" attr: "b" } - shape_record: { fg: "#b5e4f4" attr: "b" } - shape_redirection: { fg: "#a16a94" attr: "b" } - shape_signature: { fg: "#01a252" attr: "b" } - shape_string: "#01a252" - shape_string_interpolation: { fg: "#b5e4f4" attr: "b" } - shape_table: { fg: "#01a0e4" attr: "b" } - shape_variable: "#a16a94" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#090300" - foreground: "#a5a2a2" - cursor: "#a5a2a2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a5a2a2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#01a252' attr: 'b' } + empty: '#01a0e4' + bool: {|| if $in { '#cdab53' } else { 'light_gray' } } + int: '#a5a2a2' + filesize: {|e| + if $e == 0b { + '#a5a2a2' + } else if $e < 1mb { + '#b5e4f4' + } else {{ fg: '#01a0e4' }} + } + duration: '#a5a2a2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#db2d20' attr: 'b' } + } else if $in < 6hr { + '#db2d20' + } else if $in < 1day { + '#fded02' + } else if $in < 3day { + '#01a252' + } else if $in < 1wk { + { fg: '#01a252' attr: 'b' } + } else if $in < 6wk { + '#b5e4f4' + } else if $in < 52wk { + '#01a0e4' + } else { 'dark_gray' } + } + range: '#a5a2a2' + float: '#a5a2a2' + string: '#a5a2a2' + nothing: '#a5a2a2' + binary: '#a5a2a2' + cellpath: '#a5a2a2' + row_index: { fg: '#01a252' attr: 'b' } + record: '#a5a2a2' + list: '#a5a2a2' + block: '#a5a2a2' + hints: 'dark_gray' + search_result: { fg: '#db2d20' bg: '#a5a2a2' } + + shape_and: { fg: '#a16a94' attr: 'b' } + shape_binary: { fg: '#a16a94' attr: 'b' } + shape_block: { fg: '#01a0e4' attr: 'b' } + shape_bool: '#cdab53' + shape_custom: '#01a252' + shape_datetime: { fg: '#b5e4f4' attr: 'b' } + shape_directory: '#b5e4f4' + shape_external: '#b5e4f4' + shape_externalarg: { fg: '#01a252' attr: 'b' } + shape_filepath: '#b5e4f4' + shape_flag: { fg: '#01a0e4' attr: 'b' } + shape_float: { fg: '#a16a94' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b5e4f4' attr: 'b' } + shape_int: { fg: '#a16a94' attr: 'b' } + shape_internalcall: { fg: '#b5e4f4' attr: 'b' } + shape_list: { fg: '#b5e4f4' attr: 'b' } + shape_literal: '#01a0e4' + shape_match_pattern: '#01a252' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#cdab53' + shape_operator: '#fded02' + shape_or: { fg: '#a16a94' attr: 'b' } + shape_pipe: { fg: '#a16a94' attr: 'b' } + shape_range: { fg: '#fded02' attr: 'b' } + shape_record: { fg: '#b5e4f4' attr: 'b' } + shape_redirection: { fg: '#a16a94' attr: 'b' } + shape_signature: { fg: '#01a252' attr: 'b' } + shape_string: '#01a252' + shape_string_interpolation: { fg: '#b5e4f4' attr: 'b' } + shape_table: { fg: '#01a0e4' attr: 'b' } + shape_variable: '#a16a94' + + background: '#090300' + foreground: '#a5a2a2' + cursor: '#a5a2a2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/3024.nu b/themes/nu-themes/3024.nu new file mode 100644 index 0000000..ae9e63e --- /dev/null +++ b/themes/nu-themes/3024.nu @@ -0,0 +1,121 @@ +# Update terminal colors +export def "update terminal" [] { + let theme = (main) + + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} + +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a5a2a2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#01a252' attr: 'b' } + empty: '#01a0e4' + bool: {|| if $in { '#b5e4f4' } else { 'light_gray' } } + int: '#a5a2a2' + filesize: {|e| + if $e == 0b { + '#a5a2a2' + } else if $e < 1mb { + '#b5e4f4' + } else {{ fg: '#01a0e4' }} + } + duration: '#a5a2a2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#db2d20' attr: 'b' } + } else if $in < 6hr { + '#db2d20' + } else if $in < 1day { + '#fded02' + } else if $in < 3day { + '#01a252' + } else if $in < 1wk { + { fg: '#01a252' attr: 'b' } + } else if $in < 6wk { + '#b5e4f4' + } else if $in < 52wk { + '#01a0e4' + } else { 'dark_gray' } + } + range: '#a5a2a2' + float: '#a5a2a2' + string: '#a5a2a2' + nothing: '#a5a2a2' + binary: '#a5a2a2' + cellpath: '#a5a2a2' + row_index: { fg: '#01a252' attr: 'b' } + record: '#a5a2a2' + list: '#a5a2a2' + block: '#a5a2a2' + hints: 'dark_gray' + search_result: { fg: '#db2d20' bg: '#a5a2a2' } + + shape_and: { fg: '#a16a94' attr: 'b' } + shape_binary: { fg: '#a16a94' attr: 'b' } + shape_block: { fg: '#01a0e4' attr: 'b' } + shape_bool: '#b5e4f4' + shape_custom: '#01a252' + shape_datetime: { fg: '#b5e4f4' attr: 'b' } + shape_directory: '#b5e4f4' + shape_external: '#b5e4f4' + shape_externalarg: { fg: '#01a252' attr: 'b' } + shape_filepath: '#b5e4f4' + shape_flag: { fg: '#01a0e4' attr: 'b' } + shape_float: { fg: '#a16a94' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b5e4f4' attr: 'b' } + shape_int: { fg: '#a16a94' attr: 'b' } + shape_internalcall: { fg: '#b5e4f4' attr: 'b' } + shape_list: { fg: '#b5e4f4' attr: 'b' } + shape_literal: '#01a0e4' + shape_match_pattern: '#01a252' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b5e4f4' + shape_operator: '#fded02' + shape_or: { fg: '#a16a94' attr: 'b' } + shape_pipe: { fg: '#a16a94' attr: 'b' } + shape_range: { fg: '#fded02' attr: 'b' } + shape_record: { fg: '#b5e4f4' attr: 'b' } + shape_redirection: { fg: '#a16a94' attr: 'b' } + shape_signature: { fg: '#01a252' attr: 'b' } + shape_string: '#01a252' + shape_string_interpolation: { fg: '#b5e4f4' attr: 'b' } + shape_table: { fg: '#01a0e4' attr: 'b' } + shape_variable: '#a16a94' + + background: '#090300' + foreground: '#a5a2a2' + cursor: '#a5a2a2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/3024r.nu b/themes/nu-themes/3024r.nu deleted file mode 100644 index 697ccdc..0000000 --- a/themes/nu-themes/3024r.nu +++ /dev/null @@ -1,82 +0,0 @@ -export def main [] { return { - separator: "#a5a2a2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#01a252" attr: "b" } - empty: "#01a0e4" - bool: {|| if $in { "#b5e4f4" } else { "light_gray" } } - int: "#a5a2a2" - filesize: {|e| - if $e == 0b { - "#a5a2a2" - } else if $e < 1mb { - "#b5e4f4" - } else {{ fg: "#01a0e4" }} - } - duration: "#a5a2a2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#db2d20" attr: "b" } - } else if $in < 6hr { - "#db2d20" - } else if $in < 1day { - "#fded02" - } else if $in < 3day { - "#01a252" - } else if $in < 1wk { - { fg: "#01a252" attr: "b" } - } else if $in < 6wk { - "#b5e4f4" - } else if $in < 52wk { - "#01a0e4" - } else { "dark_gray" } - } - range: "#a5a2a2" - float: "#a5a2a2" - string: "#a5a2a2" - nothing: "#a5a2a2" - binary: "#a5a2a2" - cellpath: "#a5a2a2" - row_index: { fg: "#01a252" attr: "b" } - record: "#a5a2a2" - list: "#a5a2a2" - block: "#a5a2a2" - hints: "dark_gray" - search_result: { fg: "#db2d20" bg: "#a5a2a2" } - - shape_and: { fg: "#a16a94" attr: "b" } - shape_binary: { fg: "#a16a94" attr: "b" } - shape_block: { fg: "#01a0e4" attr: "b" } - shape_bool: "#b5e4f4" - shape_custom: "#01a252" - shape_datetime: { fg: "#b5e4f4" attr: "b" } - shape_directory: "#b5e4f4" - shape_external: "#b5e4f4" - shape_externalarg: { fg: "#01a252" attr: "b" } - shape_filepath: "#b5e4f4" - shape_flag: { fg: "#01a0e4" attr: "b" } - shape_float: { fg: "#a16a94" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b5e4f4" attr: "b" } - shape_int: { fg: "#a16a94" attr: "b" } - shape_internalcall: { fg: "#b5e4f4" attr: "b" } - shape_list: { fg: "#b5e4f4" attr: "b" } - shape_literal: "#01a0e4" - shape_match_pattern: "#01a252" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b5e4f4" - shape_operator: "#fded02" - shape_or: { fg: "#a16a94" attr: "b" } - shape_pipe: { fg: "#a16a94" attr: "b" } - shape_range: { fg: "#fded02" attr: "b" } - shape_record: { fg: "#b5e4f4" attr: "b" } - shape_redirection: { fg: "#a16a94" attr: "b" } - shape_signature: { fg: "#01a252" attr: "b" } - shape_string: "#01a252" - shape_string_interpolation: { fg: "#b5e4f4" attr: "b" } - shape_table: { fg: "#01a0e4" attr: "b" } - shape_variable: "#a16a94" - - background: "#090300" - foreground: "#a5a2a2" - cursor: "#a5a2a2" -}} \ No newline at end of file diff --git a/themes/nu-themes/abyss.nu b/themes/nu-themes/abyss.nu index 83cc9e6..dfffac3 100644 --- a/themes/nu-themes/abyss.nu +++ b/themes/nu-themes/abyss.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a0cce2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#10598b" attr: "b" } - empty: "#277bb1" - bool: {|| if $in { "#2592d3" } else { "light_gray" } } - int: "#a0cce2" - filesize: {|e| - if $e == 0b { - "#a0cce2" - } else if $e < 1mb { - "#2592d3" - } else {{ fg: "#277bb1" }} - } - duration: "#a0cce2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#48697e" attr: "b" } - } else if $in < 6hr { - "#48697e" - } else if $in < 1day { - "#1f6ca1" - } else if $in < 3day { - "#10598b" - } else if $in < 1wk { - { fg: "#10598b" attr: "b" } - } else if $in < 6wk { - "#2592d3" - } else if $in < 52wk { - "#277bb1" - } else { "dark_gray" } - } - range: "#a0cce2" - float: "#a0cce2" - string: "#a0cce2" - nothing: "#a0cce2" - binary: "#a0cce2" - cellpath: "#a0cce2" - row_index: { fg: "#10598b" attr: "b" } - record: "#a0cce2" - list: "#a0cce2" - block: "#a0cce2" - hints: "dark_gray" - search_result: { fg: "#48697e" bg: "#a0cce2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#4595bd" attr: "b" } - shape_binary: { fg: "#4595bd" attr: "b" } - shape_block: { fg: "#277bb1" attr: "b" } - shape_bool: "#2592d3" - shape_custom: "#10598b" - shape_datetime: { fg: "#2592d3" attr: "b" } - shape_directory: "#2592d3" - shape_external: "#2592d3" - shape_externalarg: { fg: "#10598b" attr: "b" } - shape_filepath: "#2592d3" - shape_flag: { fg: "#277bb1" attr: "b" } - shape_float: { fg: "#4595bd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2592d3" attr: "b" } - shape_int: { fg: "#4595bd" attr: "b" } - shape_internalcall: { fg: "#2592d3" attr: "b" } - shape_list: { fg: "#2592d3" attr: "b" } - shape_literal: "#277bb1" - shape_match_pattern: "#10598b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2592d3" - shape_operator: "#1f6ca1" - shape_or: { fg: "#4595bd" attr: "b" } - shape_pipe: { fg: "#4595bd" attr: "b" } - shape_range: { fg: "#1f6ca1" attr: "b" } - shape_record: { fg: "#2592d3" attr: "b" } - shape_redirection: { fg: "#4595bd" attr: "b" } - shape_signature: { fg: "#10598b" attr: "b" } - shape_string: "#10598b" - shape_string_interpolation: { fg: "#2592d3" attr: "b" } - shape_table: { fg: "#277bb1" attr: "b" } - shape_variable: "#4595bd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#040f18" - foreground: "#c0c7ca" - cursor: "#10598b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a0cce2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#10598b' attr: 'b' } + empty: '#277bb1' + bool: {|| if $in { '#2592d3' } else { 'light_gray' } } + int: '#a0cce2' + filesize: {|e| + if $e == 0b { + '#a0cce2' + } else if $e < 1mb { + '#2592d3' + } else {{ fg: '#277bb1' }} + } + duration: '#a0cce2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#48697e' attr: 'b' } + } else if $in < 6hr { + '#48697e' + } else if $in < 1day { + '#1f6ca1' + } else if $in < 3day { + '#10598b' + } else if $in < 1wk { + { fg: '#10598b' attr: 'b' } + } else if $in < 6wk { + '#2592d3' + } else if $in < 52wk { + '#277bb1' + } else { 'dark_gray' } + } + range: '#a0cce2' + float: '#a0cce2' + string: '#a0cce2' + nothing: '#a0cce2' + binary: '#a0cce2' + cellpath: '#a0cce2' + row_index: { fg: '#10598b' attr: 'b' } + record: '#a0cce2' + list: '#a0cce2' + block: '#a0cce2' + hints: 'dark_gray' + search_result: { fg: '#48697e' bg: '#a0cce2' } + + shape_and: { fg: '#4595bd' attr: 'b' } + shape_binary: { fg: '#4595bd' attr: 'b' } + shape_block: { fg: '#277bb1' attr: 'b' } + shape_bool: '#2592d3' + shape_custom: '#10598b' + shape_datetime: { fg: '#2592d3' attr: 'b' } + shape_directory: '#2592d3' + shape_external: '#2592d3' + shape_externalarg: { fg: '#10598b' attr: 'b' } + shape_filepath: '#2592d3' + shape_flag: { fg: '#277bb1' attr: 'b' } + shape_float: { fg: '#4595bd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2592d3' attr: 'b' } + shape_int: { fg: '#4595bd' attr: 'b' } + shape_internalcall: { fg: '#2592d3' attr: 'b' } + shape_list: { fg: '#2592d3' attr: 'b' } + shape_literal: '#277bb1' + shape_match_pattern: '#10598b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2592d3' + shape_operator: '#1f6ca1' + shape_or: { fg: '#4595bd' attr: 'b' } + shape_pipe: { fg: '#4595bd' attr: 'b' } + shape_range: { fg: '#1f6ca1' attr: 'b' } + shape_record: { fg: '#2592d3' attr: 'b' } + shape_redirection: { fg: '#4595bd' attr: 'b' } + shape_signature: { fg: '#10598b' attr: 'b' } + shape_string: '#10598b' + shape_string_interpolation: { fg: '#2592d3' attr: 'b' } + shape_table: { fg: '#277bb1' attr: 'b' } + shape_variable: '#4595bd' + + background: '#040f18' + foreground: '#c0c7ca' + cursor: '#10598b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/aci.nu b/themes/nu-themes/aci.nu index 577e37b..c4ffb7b 100644 --- a/themes/nu-themes/aci.nu +++ b/themes/nu-themes/aci.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b6b6b6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#83ff08" attr: "b" } - empty: "#0883ff" - bool: {|| if $in { "#1eff8e" } else { "light_gray" } } - int: "#b6b6b6" - filesize: {|e| - if $e == 0b { - "#b6b6b6" - } else if $e < 1mb { - "#08ff83" - } else {{ fg: "#0883ff" }} - } - duration: "#b6b6b6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0883" attr: "b" } - } else if $in < 6hr { - "#ff0883" - } else if $in < 1day { - "#ff8308" - } else if $in < 3day { - "#83ff08" - } else if $in < 1wk { - { fg: "#83ff08" attr: "b" } - } else if $in < 6wk { - "#08ff83" - } else if $in < 52wk { - "#0883ff" - } else { "dark_gray" } - } - range: "#b6b6b6" - float: "#b6b6b6" - string: "#b6b6b6" - nothing: "#b6b6b6" - binary: "#b6b6b6" - cellpath: "#b6b6b6" - row_index: { fg: "#83ff08" attr: "b" } - record: "#b6b6b6" - list: "#b6b6b6" - block: "#b6b6b6" - hints: "dark_gray" - search_result: { fg: "#ff0883" bg: "#b6b6b6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8308ff" attr: "b" } - shape_binary: { fg: "#8308ff" attr: "b" } - shape_block: { fg: "#0883ff" attr: "b" } - shape_bool: "#1eff8e" - shape_custom: "#83ff08" - shape_datetime: { fg: "#08ff83" attr: "b" } - shape_directory: "#08ff83" - shape_external: "#08ff83" - shape_externalarg: { fg: "#83ff08" attr: "b" } - shape_filepath: "#08ff83" - shape_flag: { fg: "#0883ff" attr: "b" } - shape_float: { fg: "#8308ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#08ff83" attr: "b" } - shape_int: { fg: "#8308ff" attr: "b" } - shape_internalcall: { fg: "#08ff83" attr: "b" } - shape_list: { fg: "#08ff83" attr: "b" } - shape_literal: "#0883ff" - shape_match_pattern: "#83ff08" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1eff8e" - shape_operator: "#ff8308" - shape_or: { fg: "#8308ff" attr: "b" } - shape_pipe: { fg: "#8308ff" attr: "b" } - shape_range: { fg: "#ff8308" attr: "b" } - shape_record: { fg: "#08ff83" attr: "b" } - shape_redirection: { fg: "#8308ff" attr: "b" } - shape_signature: { fg: "#83ff08" attr: "b" } - shape_string: "#83ff08" - shape_string_interpolation: { fg: "#08ff83" attr: "b" } - shape_table: { fg: "#0883ff" attr: "b" } - shape_variable: "#8308ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0d1926" - foreground: "#b4e1fd" - cursor: "#b4e1fd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b6b6b6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#83ff08' attr: 'b' } + empty: '#0883ff' + bool: {|| if $in { '#1eff8e' } else { 'light_gray' } } + int: '#b6b6b6' + filesize: {|e| + if $e == 0b { + '#b6b6b6' + } else if $e < 1mb { + '#08ff83' + } else {{ fg: '#0883ff' }} + } + duration: '#b6b6b6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0883' attr: 'b' } + } else if $in < 6hr { + '#ff0883' + } else if $in < 1day { + '#ff8308' + } else if $in < 3day { + '#83ff08' + } else if $in < 1wk { + { fg: '#83ff08' attr: 'b' } + } else if $in < 6wk { + '#08ff83' + } else if $in < 52wk { + '#0883ff' + } else { 'dark_gray' } + } + range: '#b6b6b6' + float: '#b6b6b6' + string: '#b6b6b6' + nothing: '#b6b6b6' + binary: '#b6b6b6' + cellpath: '#b6b6b6' + row_index: { fg: '#83ff08' attr: 'b' } + record: '#b6b6b6' + list: '#b6b6b6' + block: '#b6b6b6' + hints: 'dark_gray' + search_result: { fg: '#ff0883' bg: '#b6b6b6' } + + shape_and: { fg: '#8308ff' attr: 'b' } + shape_binary: { fg: '#8308ff' attr: 'b' } + shape_block: { fg: '#0883ff' attr: 'b' } + shape_bool: '#1eff8e' + shape_custom: '#83ff08' + shape_datetime: { fg: '#08ff83' attr: 'b' } + shape_directory: '#08ff83' + shape_external: '#08ff83' + shape_externalarg: { fg: '#83ff08' attr: 'b' } + shape_filepath: '#08ff83' + shape_flag: { fg: '#0883ff' attr: 'b' } + shape_float: { fg: '#8308ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#08ff83' attr: 'b' } + shape_int: { fg: '#8308ff' attr: 'b' } + shape_internalcall: { fg: '#08ff83' attr: 'b' } + shape_list: { fg: '#08ff83' attr: 'b' } + shape_literal: '#0883ff' + shape_match_pattern: '#83ff08' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1eff8e' + shape_operator: '#ff8308' + shape_or: { fg: '#8308ff' attr: 'b' } + shape_pipe: { fg: '#8308ff' attr: 'b' } + shape_range: { fg: '#ff8308' attr: 'b' } + shape_record: { fg: '#08ff83' attr: 'b' } + shape_redirection: { fg: '#8308ff' attr: 'b' } + shape_signature: { fg: '#83ff08' attr: 'b' } + shape_string: '#83ff08' + shape_string_interpolation: { fg: '#08ff83' attr: 'b' } + shape_table: { fg: '#0883ff' attr: 'b' } + shape_variable: '#8308ff' + + background: '#0d1926' + foreground: '#b4e1fd' + cursor: '#b4e1fd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/aco.nu b/themes/nu-themes/aco.nu index 96a16f8..c6c1af0 100644 --- a/themes/nu-themes/aco.nu +++ b/themes/nu-themes/aco.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bebebe" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#83ff08" attr: "b" } - empty: "#0883ff" - bool: {|| if $in { "#1eff8e" } else { "light_gray" } } - int: "#bebebe" - filesize: {|e| - if $e == 0b { - "#bebebe" - } else if $e < 1mb { - "#08ff83" - } else {{ fg: "#0883ff" }} - } - duration: "#bebebe" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0883" attr: "b" } - } else if $in < 6hr { - "#ff0883" - } else if $in < 1day { - "#ff8308" - } else if $in < 3day { - "#83ff08" - } else if $in < 1wk { - { fg: "#83ff08" attr: "b" } - } else if $in < 6wk { - "#08ff83" - } else if $in < 52wk { - "#0883ff" - } else { "dark_gray" } - } - range: "#bebebe" - float: "#bebebe" - string: "#bebebe" - nothing: "#bebebe" - binary: "#bebebe" - cellpath: "#bebebe" - row_index: { fg: "#83ff08" attr: "b" } - record: "#bebebe" - list: "#bebebe" - block: "#bebebe" - hints: "dark_gray" - search_result: { fg: "#ff0883" bg: "#bebebe" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8308ff" attr: "b" } - shape_binary: { fg: "#8308ff" attr: "b" } - shape_block: { fg: "#0883ff" attr: "b" } - shape_bool: "#1eff8e" - shape_custom: "#83ff08" - shape_datetime: { fg: "#08ff83" attr: "b" } - shape_directory: "#08ff83" - shape_external: "#08ff83" - shape_externalarg: { fg: "#83ff08" attr: "b" } - shape_filepath: "#08ff83" - shape_flag: { fg: "#0883ff" attr: "b" } - shape_float: { fg: "#8308ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#08ff83" attr: "b" } - shape_int: { fg: "#8308ff" attr: "b" } - shape_internalcall: { fg: "#08ff83" attr: "b" } - shape_list: { fg: "#08ff83" attr: "b" } - shape_literal: "#0883ff" - shape_match_pattern: "#83ff08" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1eff8e" - shape_operator: "#ff8308" - shape_or: { fg: "#8308ff" attr: "b" } - shape_pipe: { fg: "#8308ff" attr: "b" } - shape_range: { fg: "#ff8308" attr: "b" } - shape_record: { fg: "#08ff83" attr: "b" } - shape_redirection: { fg: "#8308ff" attr: "b" } - shape_signature: { fg: "#83ff08" attr: "b" } - shape_string: "#83ff08" - shape_string_interpolation: { fg: "#08ff83" attr: "b" } - shape_table: { fg: "#0883ff" attr: "b" } - shape_variable: "#8308ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1305" - foreground: "#b4e1fd" - cursor: "#b4e1fd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bebebe' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#83ff08' attr: 'b' } + empty: '#0883ff' + bool: {|| if $in { '#1eff8e' } else { 'light_gray' } } + int: '#bebebe' + filesize: {|e| + if $e == 0b { + '#bebebe' + } else if $e < 1mb { + '#08ff83' + } else {{ fg: '#0883ff' }} + } + duration: '#bebebe' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0883' attr: 'b' } + } else if $in < 6hr { + '#ff0883' + } else if $in < 1day { + '#ff8308' + } else if $in < 3day { + '#83ff08' + } else if $in < 1wk { + { fg: '#83ff08' attr: 'b' } + } else if $in < 6wk { + '#08ff83' + } else if $in < 52wk { + '#0883ff' + } else { 'dark_gray' } + } + range: '#bebebe' + float: '#bebebe' + string: '#bebebe' + nothing: '#bebebe' + binary: '#bebebe' + cellpath: '#bebebe' + row_index: { fg: '#83ff08' attr: 'b' } + record: '#bebebe' + list: '#bebebe' + block: '#bebebe' + hints: 'dark_gray' + search_result: { fg: '#ff0883' bg: '#bebebe' } + + shape_and: { fg: '#8308ff' attr: 'b' } + shape_binary: { fg: '#8308ff' attr: 'b' } + shape_block: { fg: '#0883ff' attr: 'b' } + shape_bool: '#1eff8e' + shape_custom: '#83ff08' + shape_datetime: { fg: '#08ff83' attr: 'b' } + shape_directory: '#08ff83' + shape_external: '#08ff83' + shape_externalarg: { fg: '#83ff08' attr: 'b' } + shape_filepath: '#08ff83' + shape_flag: { fg: '#0883ff' attr: 'b' } + shape_float: { fg: '#8308ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#08ff83' attr: 'b' } + shape_int: { fg: '#8308ff' attr: 'b' } + shape_internalcall: { fg: '#08ff83' attr: 'b' } + shape_list: { fg: '#08ff83' attr: 'b' } + shape_literal: '#0883ff' + shape_match_pattern: '#83ff08' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1eff8e' + shape_operator: '#ff8308' + shape_or: { fg: '#8308ff' attr: 'b' } + shape_pipe: { fg: '#8308ff' attr: 'b' } + shape_range: { fg: '#ff8308' attr: 'b' } + shape_record: { fg: '#08ff83' attr: 'b' } + shape_redirection: { fg: '#8308ff' attr: 'b' } + shape_signature: { fg: '#83ff08' attr: 'b' } + shape_string: '#83ff08' + shape_string_interpolation: { fg: '#08ff83' attr: 'b' } + shape_table: { fg: '#0883ff' attr: 'b' } + shape_variable: '#8308ff' + + background: '#1f1305' + foreground: '#b4e1fd' + cursor: '#b4e1fd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/adventuretime.nu b/themes/nu-themes/adventuretime.nu index 25899de..dd4e733 100644 --- a/themes/nu-themes/adventuretime.nu +++ b/themes/nu-themes/adventuretime.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f8dcc0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4ab118" attr: "b" } - empty: "#0f4ac6" - bool: {|| if $in { "#c8faf4" } else { "light_gray" } } - int: "#f8dcc0" - filesize: {|e| - if $e == 0b { - "#f8dcc0" - } else if $e < 1mb { - "#70a598" - } else {{ fg: "#0f4ac6" }} - } - duration: "#f8dcc0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bd0013" attr: "b" } - } else if $in < 6hr { - "#bd0013" - } else if $in < 1day { - "#e7741e" - } else if $in < 3day { - "#4ab118" - } else if $in < 1wk { - { fg: "#4ab118" attr: "b" } - } else if $in < 6wk { - "#70a598" - } else if $in < 52wk { - "#0f4ac6" - } else { "dark_gray" } - } - range: "#f8dcc0" - float: "#f8dcc0" - string: "#f8dcc0" - nothing: "#f8dcc0" - binary: "#f8dcc0" - cellpath: "#f8dcc0" - row_index: { fg: "#4ab118" attr: "b" } - record: "#f8dcc0" - list: "#f8dcc0" - block: "#f8dcc0" - hints: "dark_gray" - search_result: { fg: "#bd0013" bg: "#f8dcc0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#665993" attr: "b" } - shape_binary: { fg: "#665993" attr: "b" } - shape_block: { fg: "#0f4ac6" attr: "b" } - shape_bool: "#c8faf4" - shape_custom: "#4ab118" - shape_datetime: { fg: "#70a598" attr: "b" } - shape_directory: "#70a598" - shape_external: "#70a598" - shape_externalarg: { fg: "#4ab118" attr: "b" } - shape_filepath: "#70a598" - shape_flag: { fg: "#0f4ac6" attr: "b" } - shape_float: { fg: "#665993" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#70a598" attr: "b" } - shape_int: { fg: "#665993" attr: "b" } - shape_internalcall: { fg: "#70a598" attr: "b" } - shape_list: { fg: "#70a598" attr: "b" } - shape_literal: "#0f4ac6" - shape_match_pattern: "#4ab118" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c8faf4" - shape_operator: "#e7741e" - shape_or: { fg: "#665993" attr: "b" } - shape_pipe: { fg: "#665993" attr: "b" } - shape_range: { fg: "#e7741e" attr: "b" } - shape_record: { fg: "#70a598" attr: "b" } - shape_redirection: { fg: "#665993" attr: "b" } - shape_signature: { fg: "#4ab118" attr: "b" } - shape_string: "#4ab118" - shape_string_interpolation: { fg: "#70a598" attr: "b" } - shape_table: { fg: "#0f4ac6" attr: "b" } - shape_variable: "#665993" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1d45" - foreground: "#f8dcc0" - cursor: "#f8dcc0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f8dcc0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4ab118' attr: 'b' } + empty: '#0f4ac6' + bool: {|| if $in { '#c8faf4' } else { 'light_gray' } } + int: '#f8dcc0' + filesize: {|e| + if $e == 0b { + '#f8dcc0' + } else if $e < 1mb { + '#70a598' + } else {{ fg: '#0f4ac6' }} + } + duration: '#f8dcc0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bd0013' attr: 'b' } + } else if $in < 6hr { + '#bd0013' + } else if $in < 1day { + '#e7741e' + } else if $in < 3day { + '#4ab118' + } else if $in < 1wk { + { fg: '#4ab118' attr: 'b' } + } else if $in < 6wk { + '#70a598' + } else if $in < 52wk { + '#0f4ac6' + } else { 'dark_gray' } + } + range: '#f8dcc0' + float: '#f8dcc0' + string: '#f8dcc0' + nothing: '#f8dcc0' + binary: '#f8dcc0' + cellpath: '#f8dcc0' + row_index: { fg: '#4ab118' attr: 'b' } + record: '#f8dcc0' + list: '#f8dcc0' + block: '#f8dcc0' + hints: 'dark_gray' + search_result: { fg: '#bd0013' bg: '#f8dcc0' } + + shape_and: { fg: '#665993' attr: 'b' } + shape_binary: { fg: '#665993' attr: 'b' } + shape_block: { fg: '#0f4ac6' attr: 'b' } + shape_bool: '#c8faf4' + shape_custom: '#4ab118' + shape_datetime: { fg: '#70a598' attr: 'b' } + shape_directory: '#70a598' + shape_external: '#70a598' + shape_externalarg: { fg: '#4ab118' attr: 'b' } + shape_filepath: '#70a598' + shape_flag: { fg: '#0f4ac6' attr: 'b' } + shape_float: { fg: '#665993' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#70a598' attr: 'b' } + shape_int: { fg: '#665993' attr: 'b' } + shape_internalcall: { fg: '#70a598' attr: 'b' } + shape_list: { fg: '#70a598' attr: 'b' } + shape_literal: '#0f4ac6' + shape_match_pattern: '#4ab118' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c8faf4' + shape_operator: '#e7741e' + shape_or: { fg: '#665993' attr: 'b' } + shape_pipe: { fg: '#665993' attr: 'b' } + shape_range: { fg: '#e7741e' attr: 'b' } + shape_record: { fg: '#70a598' attr: 'b' } + shape_redirection: { fg: '#665993' attr: 'b' } + shape_signature: { fg: '#4ab118' attr: 'b' } + shape_string: '#4ab118' + shape_string_interpolation: { fg: '#70a598' attr: 'b' } + shape_table: { fg: '#0f4ac6' attr: 'b' } + shape_variable: '#665993' + + background: '#1f1d45' + foreground: '#f8dcc0' + cursor: '#f8dcc0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/afterglow.nu b/themes/nu-themes/afterglow.nu index a37d3dc..60e2034 100644 --- a/themes/nu-themes/afterglow.nu +++ b/themes/nu-themes/afterglow.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7b9246" attr: "b" } - empty: "#6c99bb" - bool: {|| if $in { "#7dd6cf" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#7dd6cf" - } else {{ fg: "#6c99bb" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a53c23" attr: "b" } - } else if $in < 6hr { - "#a53c23" - } else if $in < 1day { - "#d3a04d" - } else if $in < 3day { - "#7b9246" - } else if $in < 1wk { - { fg: "#7b9246" attr: "b" } - } else if $in < 6wk { - "#7dd6cf" - } else if $in < 52wk { - "#6c99bb" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#7b9246" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#a53c23" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9f4e85" attr: "b" } - shape_binary: { fg: "#9f4e85" attr: "b" } - shape_block: { fg: "#6c99bb" attr: "b" } - shape_bool: "#7dd6cf" - shape_custom: "#7b9246" - shape_datetime: { fg: "#7dd6cf" attr: "b" } - shape_directory: "#7dd6cf" - shape_external: "#7dd6cf" - shape_externalarg: { fg: "#7b9246" attr: "b" } - shape_filepath: "#7dd6cf" - shape_flag: { fg: "#6c99bb" attr: "b" } - shape_float: { fg: "#9f4e85" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7dd6cf" attr: "b" } - shape_int: { fg: "#9f4e85" attr: "b" } - shape_internalcall: { fg: "#7dd6cf" attr: "b" } - shape_list: { fg: "#7dd6cf" attr: "b" } - shape_literal: "#6c99bb" - shape_match_pattern: "#7b9246" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7dd6cf" - shape_operator: "#d3a04d" - shape_or: { fg: "#9f4e85" attr: "b" } - shape_pipe: { fg: "#9f4e85" attr: "b" } - shape_range: { fg: "#d3a04d" attr: "b" } - shape_record: { fg: "#7dd6cf" attr: "b" } - shape_redirection: { fg: "#9f4e85" attr: "b" } - shape_signature: { fg: "#7b9246" attr: "b" } - shape_string: "#7b9246" - shape_string_interpolation: { fg: "#7dd6cf" attr: "b" } - shape_table: { fg: "#6c99bb" attr: "b" } - shape_variable: "#9f4e85" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7b9246' attr: 'b' } + empty: '#6c99bb' + bool: {|| if $in { '#7dd6cf' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#7dd6cf' + } else {{ fg: '#6c99bb' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a53c23' attr: 'b' } + } else if $in < 6hr { + '#a53c23' + } else if $in < 1day { + '#d3a04d' + } else if $in < 3day { + '#7b9246' + } else if $in < 1wk { + { fg: '#7b9246' attr: 'b' } + } else if $in < 6wk { + '#7dd6cf' + } else if $in < 52wk { + '#6c99bb' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#7b9246' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#a53c23' bg: '#d0d0d0' } + + shape_and: { fg: '#9f4e85' attr: 'b' } + shape_binary: { fg: '#9f4e85' attr: 'b' } + shape_block: { fg: '#6c99bb' attr: 'b' } + shape_bool: '#7dd6cf' + shape_custom: '#7b9246' + shape_datetime: { fg: '#7dd6cf' attr: 'b' } + shape_directory: '#7dd6cf' + shape_external: '#7dd6cf' + shape_externalarg: { fg: '#7b9246' attr: 'b' } + shape_filepath: '#7dd6cf' + shape_flag: { fg: '#6c99bb' attr: 'b' } + shape_float: { fg: '#9f4e85' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7dd6cf' attr: 'b' } + shape_int: { fg: '#9f4e85' attr: 'b' } + shape_internalcall: { fg: '#7dd6cf' attr: 'b' } + shape_list: { fg: '#7dd6cf' attr: 'b' } + shape_literal: '#6c99bb' + shape_match_pattern: '#7b9246' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7dd6cf' + shape_operator: '#d3a04d' + shape_or: { fg: '#9f4e85' attr: 'b' } + shape_pipe: { fg: '#9f4e85' attr: 'b' } + shape_range: { fg: '#d3a04d' attr: 'b' } + shape_record: { fg: '#7dd6cf' attr: 'b' } + shape_redirection: { fg: '#9f4e85' attr: 'b' } + shape_signature: { fg: '#7b9246' attr: 'b' } + shape_string: '#7b9246' + shape_string_interpolation: { fg: '#7dd6cf' attr: 'b' } + shape_table: { fg: '#6c99bb' attr: 'b' } + shape_variable: '#9f4e85' + + background: '#222222' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/alien-blood.nu b/themes/nu-themes/alien-blood.nu index 13b221a..2162115 100644 --- a/themes/nu-themes/alien-blood.nu +++ b/themes/nu-themes/alien-blood.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#647d75" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2f7e25" attr: "b" } - empty: "#2f6a7f" - bool: {|| if $in { "#00e0c4" } else { "light_gray" } } - int: "#647d75" - filesize: {|e| - if $e == 0b { - "#647d75" - } else if $e < 1mb { - "#327f77" - } else {{ fg: "#2f6a7f" }} - } - duration: "#647d75" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#7f2b27" attr: "b" } - } else if $in < 6hr { - "#7f2b27" - } else if $in < 1day { - "#717f24" - } else if $in < 3day { - "#2f7e25" - } else if $in < 1wk { - { fg: "#2f7e25" attr: "b" } - } else if $in < 6wk { - "#327f77" - } else if $in < 52wk { - "#2f6a7f" - } else { "dark_gray" } - } - range: "#647d75" - float: "#647d75" - string: "#647d75" - nothing: "#647d75" - binary: "#647d75" - cellpath: "#647d75" - row_index: { fg: "#2f7e25" attr: "b" } - record: "#647d75" - list: "#647d75" - block: "#647d75" - hints: "dark_gray" - search_result: { fg: "#7f2b27" bg: "#647d75" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#47587f" attr: "b" } - shape_binary: { fg: "#47587f" attr: "b" } - shape_block: { fg: "#2f6a7f" attr: "b" } - shape_bool: "#00e0c4" - shape_custom: "#2f7e25" - shape_datetime: { fg: "#327f77" attr: "b" } - shape_directory: "#327f77" - shape_external: "#327f77" - shape_externalarg: { fg: "#2f7e25" attr: "b" } - shape_filepath: "#327f77" - shape_flag: { fg: "#2f6a7f" attr: "b" } - shape_float: { fg: "#47587f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#327f77" attr: "b" } - shape_int: { fg: "#47587f" attr: "b" } - shape_internalcall: { fg: "#327f77" attr: "b" } - shape_list: { fg: "#327f77" attr: "b" } - shape_literal: "#2f6a7f" - shape_match_pattern: "#2f7e25" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e0c4" - shape_operator: "#717f24" - shape_or: { fg: "#47587f" attr: "b" } - shape_pipe: { fg: "#47587f" attr: "b" } - shape_range: { fg: "#717f24" attr: "b" } - shape_record: { fg: "#327f77" attr: "b" } - shape_redirection: { fg: "#47587f" attr: "b" } - shape_signature: { fg: "#2f7e25" attr: "b" } - shape_string: "#2f7e25" - shape_string_interpolation: { fg: "#327f77" attr: "b" } - shape_table: { fg: "#2f6a7f" attr: "b" } - shape_variable: "#47587f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0f1610" - foreground: "#637d75" - cursor: "#637d75" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#647d75' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2f7e25' attr: 'b' } + empty: '#2f6a7f' + bool: {|| if $in { '#00e0c4' } else { 'light_gray' } } + int: '#647d75' + filesize: {|e| + if $e == 0b { + '#647d75' + } else if $e < 1mb { + '#327f77' + } else {{ fg: '#2f6a7f' }} + } + duration: '#647d75' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#7f2b27' attr: 'b' } + } else if $in < 6hr { + '#7f2b27' + } else if $in < 1day { + '#717f24' + } else if $in < 3day { + '#2f7e25' + } else if $in < 1wk { + { fg: '#2f7e25' attr: 'b' } + } else if $in < 6wk { + '#327f77' + } else if $in < 52wk { + '#2f6a7f' + } else { 'dark_gray' } + } + range: '#647d75' + float: '#647d75' + string: '#647d75' + nothing: '#647d75' + binary: '#647d75' + cellpath: '#647d75' + row_index: { fg: '#2f7e25' attr: 'b' } + record: '#647d75' + list: '#647d75' + block: '#647d75' + hints: 'dark_gray' + search_result: { fg: '#7f2b27' bg: '#647d75' } + + shape_and: { fg: '#47587f' attr: 'b' } + shape_binary: { fg: '#47587f' attr: 'b' } + shape_block: { fg: '#2f6a7f' attr: 'b' } + shape_bool: '#00e0c4' + shape_custom: '#2f7e25' + shape_datetime: { fg: '#327f77' attr: 'b' } + shape_directory: '#327f77' + shape_external: '#327f77' + shape_externalarg: { fg: '#2f7e25' attr: 'b' } + shape_filepath: '#327f77' + shape_flag: { fg: '#2f6a7f' attr: 'b' } + shape_float: { fg: '#47587f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#327f77' attr: 'b' } + shape_int: { fg: '#47587f' attr: 'b' } + shape_internalcall: { fg: '#327f77' attr: 'b' } + shape_list: { fg: '#327f77' attr: 'b' } + shape_literal: '#2f6a7f' + shape_match_pattern: '#2f7e25' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e0c4' + shape_operator: '#717f24' + shape_or: { fg: '#47587f' attr: 'b' } + shape_pipe: { fg: '#47587f' attr: 'b' } + shape_range: { fg: '#717f24' attr: 'b' } + shape_record: { fg: '#327f77' attr: 'b' } + shape_redirection: { fg: '#47587f' attr: 'b' } + shape_signature: { fg: '#2f7e25' attr: 'b' } + shape_string: '#2f7e25' + shape_string_interpolation: { fg: '#327f77' attr: 'b' } + shape_table: { fg: '#2f6a7f' attr: 'b' } + shape_variable: '#47587f' + + background: '#0f1610' + foreground: '#637d75' + cursor: '#637d75' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/alucard.nu b/themes/nu-themes/alucard.nu index 0adcde8..e549936 100644 --- a/themes/nu-themes/alucard.nu +++ b/themes/nu-themes/alucard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#fa0074" attr: "b" } - empty: "#3282ff" - bool: {|| if $in { "#8ae9fc" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#0037fc" - } else {{ fg: "#3282ff" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff5555" attr: "b" } - } else if $in < 6hr { - "#ff5555" - } else if $in < 1day { - "#7f0a1f" - } else if $in < 3day { - "#fa0074" - } else if $in < 1wk { - { fg: "#fa0074" attr: "b" } - } else if $in < 6wk { - "#0037fc" - } else if $in < 52wk { - "#3282ff" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#fa0074" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#ff5555" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#1b3cff" attr: "b" } - shape_binary: { fg: "#1b3cff" attr: "b" } - shape_block: { fg: "#3282ff" attr: "b" } - shape_bool: "#8ae9fc" - shape_custom: "#fa0074" - shape_datetime: { fg: "#0037fc" attr: "b" } - shape_directory: "#0037fc" - shape_external: "#0037fc" - shape_externalarg: { fg: "#fa0074" attr: "b" } - shape_filepath: "#0037fc" - shape_flag: { fg: "#3282ff" attr: "b" } - shape_float: { fg: "#1b3cff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0037fc" attr: "b" } - shape_int: { fg: "#1b3cff" attr: "b" } - shape_internalcall: { fg: "#0037fc" attr: "b" } - shape_list: { fg: "#0037fc" attr: "b" } - shape_literal: "#3282ff" - shape_match_pattern: "#fa0074" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ae9fc" - shape_operator: "#7f0a1f" - shape_or: { fg: "#1b3cff" attr: "b" } - shape_pipe: { fg: "#1b3cff" attr: "b" } - shape_range: { fg: "#7f0a1f" attr: "b" } - shape_record: { fg: "#0037fc" attr: "b" } - shape_redirection: { fg: "#1b3cff" attr: "b" } - shape_signature: { fg: "#fa0074" attr: "b" } - shape_string: "#fa0074" - shape_string_interpolation: { fg: "#0037fc" attr: "b" } - shape_table: { fg: "#3282ff" attr: "b" } - shape_variable: "#1b3cff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222330" - foreground: "#cef3ff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#fa0074' attr: 'b' } + empty: '#3282ff' + bool: {|| if $in { '#8ae9fc' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#0037fc' + } else {{ fg: '#3282ff' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff5555' attr: 'b' } + } else if $in < 6hr { + '#ff5555' + } else if $in < 1day { + '#7f0a1f' + } else if $in < 3day { + '#fa0074' + } else if $in < 1wk { + { fg: '#fa0074' attr: 'b' } + } else if $in < 6wk { + '#0037fc' + } else if $in < 52wk { + '#3282ff' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#fa0074' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#ff5555' bg: '#bbbbbb' } + + shape_and: { fg: '#1b3cff' attr: 'b' } + shape_binary: { fg: '#1b3cff' attr: 'b' } + shape_block: { fg: '#3282ff' attr: 'b' } + shape_bool: '#8ae9fc' + shape_custom: '#fa0074' + shape_datetime: { fg: '#0037fc' attr: 'b' } + shape_directory: '#0037fc' + shape_external: '#0037fc' + shape_externalarg: { fg: '#fa0074' attr: 'b' } + shape_filepath: '#0037fc' + shape_flag: { fg: '#3282ff' attr: 'b' } + shape_float: { fg: '#1b3cff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0037fc' attr: 'b' } + shape_int: { fg: '#1b3cff' attr: 'b' } + shape_internalcall: { fg: '#0037fc' attr: 'b' } + shape_list: { fg: '#0037fc' attr: 'b' } + shape_literal: '#3282ff' + shape_match_pattern: '#fa0074' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ae9fc' + shape_operator: '#7f0a1f' + shape_or: { fg: '#1b3cff' attr: 'b' } + shape_pipe: { fg: '#1b3cff' attr: 'b' } + shape_range: { fg: '#7f0a1f' attr: 'b' } + shape_record: { fg: '#0037fc' attr: 'b' } + shape_redirection: { fg: '#1b3cff' attr: 'b' } + shape_signature: { fg: '#fa0074' attr: 'b' } + shape_string: '#fa0074' + shape_string_interpolation: { fg: '#0037fc' attr: 'b' } + shape_table: { fg: '#3282ff' attr: 'b' } + shape_variable: '#1b3cff' + + background: '#222330' + foreground: '#cef3ff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/amora.nu b/themes/nu-themes/amora.nu index f9931fb..061a1d2 100644 --- a/themes/nu-themes/amora.nu +++ b/themes/nu-themes/amora.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dedbeb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a2baa8" attr: "b" } - empty: "#9985d1" - bool: {|| if $in { "#c4d1f5" } else { "light_gray" } } - int: "#dedbeb" - filesize: {|e| - if $e == 0b { - "#dedbeb" - } else if $e < 1mb { - "#aabae7" - } else {{ fg: "#9985d1" }} - } - duration: "#dedbeb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ed3f7f" attr: "b" } - } else if $in < 6hr { - "#ed3f7f" - } else if $in < 1day { - "#eacac0" - } else if $in < 3day { - "#a2baa8" - } else if $in < 1wk { - { fg: "#a2baa8" attr: "b" } - } else if $in < 6wk { - "#aabae7" - } else if $in < 52wk { - "#9985d1" - } else { "dark_gray" } - } - range: "#dedbeb" - float: "#dedbeb" - string: "#dedbeb" - nothing: "#dedbeb" - binary: "#dedbeb" - cellpath: "#dedbeb" - row_index: { fg: "#a2baa8" attr: "b" } - record: "#dedbeb" - list: "#dedbeb" - block: "#dedbeb" - hints: "dark_gray" - search_result: { fg: "#ed3f7f" bg: "#dedbeb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e68ac1" attr: "b" } - shape_binary: { fg: "#e68ac1" attr: "b" } - shape_block: { fg: "#9985d1" attr: "b" } - shape_bool: "#c4d1f5" - shape_custom: "#a2baa8" - shape_datetime: { fg: "#aabae7" attr: "b" } - shape_directory: "#aabae7" - shape_external: "#aabae7" - shape_externalarg: { fg: "#a2baa8" attr: "b" } - shape_filepath: "#aabae7" - shape_flag: { fg: "#9985d1" attr: "b" } - shape_float: { fg: "#e68ac1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aabae7" attr: "b" } - shape_int: { fg: "#e68ac1" attr: "b" } - shape_internalcall: { fg: "#aabae7" attr: "b" } - shape_list: { fg: "#aabae7" attr: "b" } - shape_literal: "#9985d1" - shape_match_pattern: "#a2baa8" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c4d1f5" - shape_operator: "#eacac0" - shape_or: { fg: "#e68ac1" attr: "b" } - shape_pipe: { fg: "#e68ac1" attr: "b" } - shape_range: { fg: "#eacac0" attr: "b" } - shape_record: { fg: "#aabae7" attr: "b" } - shape_redirection: { fg: "#e68ac1" attr: "b" } - shape_signature: { fg: "#a2baa8" attr: "b" } - shape_string: "#a2baa8" - shape_string_interpolation: { fg: "#aabae7" attr: "b" } - shape_table: { fg: "#9985d1" attr: "b" } - shape_variable: "#e68ac1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a2331" - foreground: "#dedbeb" - cursor: "#dedbeb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dedbeb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a2baa8' attr: 'b' } + empty: '#9985d1' + bool: {|| if $in { '#c4d1f5' } else { 'light_gray' } } + int: '#dedbeb' + filesize: {|e| + if $e == 0b { + '#dedbeb' + } else if $e < 1mb { + '#aabae7' + } else {{ fg: '#9985d1' }} + } + duration: '#dedbeb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ed3f7f' attr: 'b' } + } else if $in < 6hr { + '#ed3f7f' + } else if $in < 1day { + '#eacac0' + } else if $in < 3day { + '#a2baa8' + } else if $in < 1wk { + { fg: '#a2baa8' attr: 'b' } + } else if $in < 6wk { + '#aabae7' + } else if $in < 52wk { + '#9985d1' + } else { 'dark_gray' } + } + range: '#dedbeb' + float: '#dedbeb' + string: '#dedbeb' + nothing: '#dedbeb' + binary: '#dedbeb' + cellpath: '#dedbeb' + row_index: { fg: '#a2baa8' attr: 'b' } + record: '#dedbeb' + list: '#dedbeb' + block: '#dedbeb' + hints: 'dark_gray' + search_result: { fg: '#ed3f7f' bg: '#dedbeb' } + + shape_and: { fg: '#e68ac1' attr: 'b' } + shape_binary: { fg: '#e68ac1' attr: 'b' } + shape_block: { fg: '#9985d1' attr: 'b' } + shape_bool: '#c4d1f5' + shape_custom: '#a2baa8' + shape_datetime: { fg: '#aabae7' attr: 'b' } + shape_directory: '#aabae7' + shape_external: '#aabae7' + shape_externalarg: { fg: '#a2baa8' attr: 'b' } + shape_filepath: '#aabae7' + shape_flag: { fg: '#9985d1' attr: 'b' } + shape_float: { fg: '#e68ac1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aabae7' attr: 'b' } + shape_int: { fg: '#e68ac1' attr: 'b' } + shape_internalcall: { fg: '#aabae7' attr: 'b' } + shape_list: { fg: '#aabae7' attr: 'b' } + shape_literal: '#9985d1' + shape_match_pattern: '#a2baa8' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c4d1f5' + shape_operator: '#eacac0' + shape_or: { fg: '#e68ac1' attr: 'b' } + shape_pipe: { fg: '#e68ac1' attr: 'b' } + shape_range: { fg: '#eacac0' attr: 'b' } + shape_record: { fg: '#aabae7' attr: 'b' } + shape_redirection: { fg: '#e68ac1' attr: 'b' } + shape_signature: { fg: '#a2baa8' attr: 'b' } + shape_string: '#a2baa8' + shape_string_interpolation: { fg: '#aabae7' attr: 'b' } + shape_table: { fg: '#9985d1' attr: 'b' } + shape_variable: '#e68ac1' + + background: '#2a2331' + foreground: '#dedbeb' + cursor: '#dedbeb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/apathy.nu b/themes/nu-themes/apathy.nu index cd0833c..5db747e 100644 --- a/themes/nu-themes/apathy.nu +++ b/themes/nu-themes/apathy.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#81b5ac" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#883e96" attr: "b" } - empty: "#96883e" - bool: {|| if $in { "#963e4c" } else { "light_gray" } } - int: "#81b5ac" - filesize: {|e| - if $e == 0b { - "#81b5ac" - } else if $e < 1mb { - "#963e4c" - } else {{ fg: "#96883e" }} - } - duration: "#81b5ac" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#3e9688" attr: "b" } - } else if $in < 6hr { - "#3e9688" - } else if $in < 1day { - "#3e4c96" - } else if $in < 3day { - "#883e96" - } else if $in < 1wk { - { fg: "#883e96" attr: "b" } - } else if $in < 6wk { - "#963e4c" - } else if $in < 52wk { - "#96883e" - } else { "dark_gray" } - } - range: "#81b5ac" - float: "#81b5ac" - string: "#81b5ac" - nothing: "#81b5ac" - binary: "#81b5ac" - cellpath: "#81b5ac" - row_index: { fg: "#883e96" attr: "b" } - record: "#81b5ac" - list: "#81b5ac" - block: "#81b5ac" - hints: "dark_gray" - search_result: { fg: "#3e9688" bg: "#81b5ac" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#4c963e" attr: "b" } - shape_binary: { fg: "#4c963e" attr: "b" } - shape_block: { fg: "#96883e" attr: "b" } - shape_bool: "#963e4c" - shape_custom: "#883e96" - shape_datetime: { fg: "#963e4c" attr: "b" } - shape_directory: "#963e4c" - shape_external: "#963e4c" - shape_externalarg: { fg: "#883e96" attr: "b" } - shape_filepath: "#963e4c" - shape_flag: { fg: "#96883e" attr: "b" } - shape_float: { fg: "#4c963e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#963e4c" attr: "b" } - shape_int: { fg: "#4c963e" attr: "b" } - shape_internalcall: { fg: "#963e4c" attr: "b" } - shape_list: { fg: "#963e4c" attr: "b" } - shape_literal: "#96883e" - shape_match_pattern: "#883e96" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#963e4c" - shape_operator: "#3e4c96" - shape_or: { fg: "#4c963e" attr: "b" } - shape_pipe: { fg: "#4c963e" attr: "b" } - shape_range: { fg: "#3e4c96" attr: "b" } - shape_record: { fg: "#963e4c" attr: "b" } - shape_redirection: { fg: "#4c963e" attr: "b" } - shape_signature: { fg: "#883e96" attr: "b" } - shape_string: "#883e96" - shape_string_interpolation: { fg: "#963e4c" attr: "b" } - shape_table: { fg: "#96883e" attr: "b" } - shape_variable: "#4c963e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#031a16" - foreground: "#81b5ac" - cursor: "#81b5ac" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#81b5ac' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#883e96' attr: 'b' } + empty: '#96883e' + bool: {|| if $in { '#963e4c' } else { 'light_gray' } } + int: '#81b5ac' + filesize: {|e| + if $e == 0b { + '#81b5ac' + } else if $e < 1mb { + '#963e4c' + } else {{ fg: '#96883e' }} + } + duration: '#81b5ac' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#3e9688' attr: 'b' } + } else if $in < 6hr { + '#3e9688' + } else if $in < 1day { + '#3e4c96' + } else if $in < 3day { + '#883e96' + } else if $in < 1wk { + { fg: '#883e96' attr: 'b' } + } else if $in < 6wk { + '#963e4c' + } else if $in < 52wk { + '#96883e' + } else { 'dark_gray' } + } + range: '#81b5ac' + float: '#81b5ac' + string: '#81b5ac' + nothing: '#81b5ac' + binary: '#81b5ac' + cellpath: '#81b5ac' + row_index: { fg: '#883e96' attr: 'b' } + record: '#81b5ac' + list: '#81b5ac' + block: '#81b5ac' + hints: 'dark_gray' + search_result: { fg: '#3e9688' bg: '#81b5ac' } + + shape_and: { fg: '#4c963e' attr: 'b' } + shape_binary: { fg: '#4c963e' attr: 'b' } + shape_block: { fg: '#96883e' attr: 'b' } + shape_bool: '#963e4c' + shape_custom: '#883e96' + shape_datetime: { fg: '#963e4c' attr: 'b' } + shape_directory: '#963e4c' + shape_external: '#963e4c' + shape_externalarg: { fg: '#883e96' attr: 'b' } + shape_filepath: '#963e4c' + shape_flag: { fg: '#96883e' attr: 'b' } + shape_float: { fg: '#4c963e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#963e4c' attr: 'b' } + shape_int: { fg: '#4c963e' attr: 'b' } + shape_internalcall: { fg: '#963e4c' attr: 'b' } + shape_list: { fg: '#963e4c' attr: 'b' } + shape_literal: '#96883e' + shape_match_pattern: '#883e96' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#963e4c' + shape_operator: '#3e4c96' + shape_or: { fg: '#4c963e' attr: 'b' } + shape_pipe: { fg: '#4c963e' attr: 'b' } + shape_range: { fg: '#3e4c96' attr: 'b' } + shape_record: { fg: '#963e4c' attr: 'b' } + shape_redirection: { fg: '#4c963e' attr: 'b' } + shape_signature: { fg: '#883e96' attr: 'b' } + shape_string: '#883e96' + shape_string_interpolation: { fg: '#963e4c' attr: 'b' } + shape_table: { fg: '#96883e' attr: 'b' } + shape_variable: '#4c963e' + + background: '#031a16' + foreground: '#81b5ac' + cursor: '#81b5ac' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/apprentice.nu b/themes/nu-themes/apprentice.nu index 6216d5d..9af338e 100644 --- a/themes/nu-themes/apprentice.nu +++ b/themes/nu-themes/apprentice.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bcbcbc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87af87" attr: "b" } - empty: "#ffffaf" - bool: {|| if $in { "#5f875f" } else { "light_gray" } } - int: "#bcbcbc" - filesize: {|e| - if $e == 0b { - "#bcbcbc" - } else if $e < 1mb { - "#5f875f" - } else {{ fg: "#ffffaf" }} - } - duration: "#bcbcbc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#5f8787" - } else if $in < 3day { - "#87af87" - } else if $in < 1wk { - { fg: "#87af87" attr: "b" } - } else if $in < 6wk { - "#5f875f" - } else if $in < 52wk { - "#ffffaf" - } else { "dark_gray" } - } - range: "#bcbcbc" - float: "#bcbcbc" - string: "#bcbcbc" - nothing: "#bcbcbc" - binary: "#bcbcbc" - cellpath: "#bcbcbc" - row_index: { fg: "#87af87" attr: "b" } - record: "#bcbcbc" - list: "#bcbcbc" - block: "#bcbcbc" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#bcbcbc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#87afd7" attr: "b" } - shape_binary: { fg: "#87afd7" attr: "b" } - shape_block: { fg: "#ffffaf" attr: "b" } - shape_bool: "#5f875f" - shape_custom: "#87af87" - shape_datetime: { fg: "#5f875f" attr: "b" } - shape_directory: "#5f875f" - shape_external: "#5f875f" - shape_externalarg: { fg: "#87af87" attr: "b" } - shape_filepath: "#5f875f" - shape_flag: { fg: "#ffffaf" attr: "b" } - shape_float: { fg: "#87afd7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5f875f" attr: "b" } - shape_int: { fg: "#87afd7" attr: "b" } - shape_internalcall: { fg: "#5f875f" attr: "b" } - shape_list: { fg: "#5f875f" attr: "b" } - shape_literal: "#ffffaf" - shape_match_pattern: "#87af87" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5f875f" - shape_operator: "#5f8787" - shape_or: { fg: "#87afd7" attr: "b" } - shape_pipe: { fg: "#87afd7" attr: "b" } - shape_range: { fg: "#5f8787" attr: "b" } - shape_record: { fg: "#5f875f" attr: "b" } - shape_redirection: { fg: "#87afd7" attr: "b" } - shape_signature: { fg: "#87af87" attr: "b" } - shape_string: "#87af87" - shape_string_interpolation: { fg: "#5f875f" attr: "b" } - shape_table: { fg: "#ffffaf" attr: "b" } - shape_variable: "#87afd7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262626" - foreground: "#bcbcbc" - cursor: "#bcbcbc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bcbcbc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87af87' attr: 'b' } + empty: '#ffffaf' + bool: {|| if $in { '#5f875f' } else { 'light_gray' } } + int: '#bcbcbc' + filesize: {|e| + if $e == 0b { + '#bcbcbc' + } else if $e < 1mb { + '#5f875f' + } else {{ fg: '#ffffaf' }} + } + duration: '#bcbcbc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#5f8787' + } else if $in < 3day { + '#87af87' + } else if $in < 1wk { + { fg: '#87af87' attr: 'b' } + } else if $in < 6wk { + '#5f875f' + } else if $in < 52wk { + '#ffffaf' + } else { 'dark_gray' } + } + range: '#bcbcbc' + float: '#bcbcbc' + string: '#bcbcbc' + nothing: '#bcbcbc' + binary: '#bcbcbc' + cellpath: '#bcbcbc' + row_index: { fg: '#87af87' attr: 'b' } + record: '#bcbcbc' + list: '#bcbcbc' + block: '#bcbcbc' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#bcbcbc' } + + shape_and: { fg: '#87afd7' attr: 'b' } + shape_binary: { fg: '#87afd7' attr: 'b' } + shape_block: { fg: '#ffffaf' attr: 'b' } + shape_bool: '#5f875f' + shape_custom: '#87af87' + shape_datetime: { fg: '#5f875f' attr: 'b' } + shape_directory: '#5f875f' + shape_external: '#5f875f' + shape_externalarg: { fg: '#87af87' attr: 'b' } + shape_filepath: '#5f875f' + shape_flag: { fg: '#ffffaf' attr: 'b' } + shape_float: { fg: '#87afd7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5f875f' attr: 'b' } + shape_int: { fg: '#87afd7' attr: 'b' } + shape_internalcall: { fg: '#5f875f' attr: 'b' } + shape_list: { fg: '#5f875f' attr: 'b' } + shape_literal: '#ffffaf' + shape_match_pattern: '#87af87' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5f875f' + shape_operator: '#5f8787' + shape_or: { fg: '#87afd7' attr: 'b' } + shape_pipe: { fg: '#87afd7' attr: 'b' } + shape_range: { fg: '#5f8787' attr: 'b' } + shape_record: { fg: '#5f875f' attr: 'b' } + shape_redirection: { fg: '#87afd7' attr: 'b' } + shape_signature: { fg: '#87af87' attr: 'b' } + shape_string: '#87af87' + shape_string_interpolation: { fg: '#5f875f' attr: 'b' } + shape_table: { fg: '#ffffaf' attr: 'b' } + shape_variable: '#87afd7' + + background: '#262626' + foreground: '#bcbcbc' + cursor: '#bcbcbc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/argonaut.nu b/themes/nu-themes/argonaut.nu index 8cabcfa..e449340 100644 --- a/themes/nu-themes/argonaut.nu +++ b/themes/nu-themes/argonaut.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8ce10b" attr: "b" } - empty: "#008df8" - bool: {|| if $in { "#67fff0" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#00d8eb" - } else {{ fg: "#008df8" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff000f" attr: "b" } - } else if $in < 6hr { - "#ff000f" - } else if $in < 1day { - "#ffb900" - } else if $in < 3day { - "#8ce10b" - } else if $in < 1wk { - { fg: "#8ce10b" attr: "b" } - } else if $in < 6wk { - "#00d8eb" - } else if $in < 52wk { - "#008df8" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#8ce10b" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#ff000f" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6d43a6" attr: "b" } - shape_binary: { fg: "#6d43a6" attr: "b" } - shape_block: { fg: "#008df8" attr: "b" } - shape_bool: "#67fff0" - shape_custom: "#8ce10b" - shape_datetime: { fg: "#00d8eb" attr: "b" } - shape_directory: "#00d8eb" - shape_external: "#00d8eb" - shape_externalarg: { fg: "#8ce10b" attr: "b" } - shape_filepath: "#00d8eb" - shape_flag: { fg: "#008df8" attr: "b" } - shape_float: { fg: "#6d43a6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00d8eb" attr: "b" } - shape_int: { fg: "#6d43a6" attr: "b" } - shape_internalcall: { fg: "#00d8eb" attr: "b" } - shape_list: { fg: "#00d8eb" attr: "b" } - shape_literal: "#008df8" - shape_match_pattern: "#8ce10b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#67fff0" - shape_operator: "#ffb900" - shape_or: { fg: "#6d43a6" attr: "b" } - shape_pipe: { fg: "#6d43a6" attr: "b" } - shape_range: { fg: "#ffb900" attr: "b" } - shape_record: { fg: "#00d8eb" attr: "b" } - shape_redirection: { fg: "#6d43a6" attr: "b" } - shape_signature: { fg: "#8ce10b" attr: "b" } - shape_string: "#8ce10b" - shape_string_interpolation: { fg: "#00d8eb" attr: "b" } - shape_table: { fg: "#008df8" attr: "b" } - shape_variable: "#6d43a6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0e1019" - foreground: "#fffaf4" - cursor: "#fffaf4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8ce10b' attr: 'b' } + empty: '#008df8' + bool: {|| if $in { '#67fff0' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#00d8eb' + } else {{ fg: '#008df8' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff000f' attr: 'b' } + } else if $in < 6hr { + '#ff000f' + } else if $in < 1day { + '#ffb900' + } else if $in < 3day { + '#8ce10b' + } else if $in < 1wk { + { fg: '#8ce10b' attr: 'b' } + } else if $in < 6wk { + '#00d8eb' + } else if $in < 52wk { + '#008df8' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#8ce10b' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#ff000f' bg: '#ffffff' } + + shape_and: { fg: '#6d43a6' attr: 'b' } + shape_binary: { fg: '#6d43a6' attr: 'b' } + shape_block: { fg: '#008df8' attr: 'b' } + shape_bool: '#67fff0' + shape_custom: '#8ce10b' + shape_datetime: { fg: '#00d8eb' attr: 'b' } + shape_directory: '#00d8eb' + shape_external: '#00d8eb' + shape_externalarg: { fg: '#8ce10b' attr: 'b' } + shape_filepath: '#00d8eb' + shape_flag: { fg: '#008df8' attr: 'b' } + shape_float: { fg: '#6d43a6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00d8eb' attr: 'b' } + shape_int: { fg: '#6d43a6' attr: 'b' } + shape_internalcall: { fg: '#00d8eb' attr: 'b' } + shape_list: { fg: '#00d8eb' attr: 'b' } + shape_literal: '#008df8' + shape_match_pattern: '#8ce10b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#67fff0' + shape_operator: '#ffb900' + shape_or: { fg: '#6d43a6' attr: 'b' } + shape_pipe: { fg: '#6d43a6' attr: 'b' } + shape_range: { fg: '#ffb900' attr: 'b' } + shape_record: { fg: '#00d8eb' attr: 'b' } + shape_redirection: { fg: '#6d43a6' attr: 'b' } + shape_signature: { fg: '#8ce10b' attr: 'b' } + shape_string: '#8ce10b' + shape_string_interpolation: { fg: '#00d8eb' attr: 'b' } + shape_table: { fg: '#008df8' attr: 'b' } + shape_variable: '#6d43a6' + + background: '#0e1019' + foreground: '#fffaf4' + cursor: '#fffaf4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/arthur.nu b/themes/nu-themes/arthur.nu index 0ce196e..ea57bdf 100644 --- a/themes/nu-themes/arthur.nu +++ b/themes/nu-themes/arthur.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbaa99" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#86af80" attr: "b" } - empty: "#6495ed" - bool: {|| if $in { "#b0c4de" } else { "light_gray" } } - int: "#bbaa99" - filesize: {|e| - if $e == 0b { - "#bbaa99" - } else if $e < 1mb { - "#b0c4de" - } else {{ fg: "#6495ed" }} - } - duration: "#bbaa99" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cd5c5c" attr: "b" } - } else if $in < 6hr { - "#cd5c5c" - } else if $in < 1day { - "#e8ae5b" - } else if $in < 3day { - "#86af80" - } else if $in < 1wk { - { fg: "#86af80" attr: "b" } - } else if $in < 6wk { - "#b0c4de" - } else if $in < 52wk { - "#6495ed" - } else { "dark_gray" } - } - range: "#bbaa99" - float: "#bbaa99" - string: "#bbaa99" - nothing: "#bbaa99" - binary: "#bbaa99" - cellpath: "#bbaa99" - row_index: { fg: "#86af80" attr: "b" } - record: "#bbaa99" - list: "#bbaa99" - block: "#bbaa99" - hints: "dark_gray" - search_result: { fg: "#cd5c5c" bg: "#bbaa99" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#deb887" attr: "b" } - shape_binary: { fg: "#deb887" attr: "b" } - shape_block: { fg: "#6495ed" attr: "b" } - shape_bool: "#b0c4de" - shape_custom: "#86af80" - shape_datetime: { fg: "#b0c4de" attr: "b" } - shape_directory: "#b0c4de" - shape_external: "#b0c4de" - shape_externalarg: { fg: "#86af80" attr: "b" } - shape_filepath: "#b0c4de" - shape_flag: { fg: "#6495ed" attr: "b" } - shape_float: { fg: "#deb887" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b0c4de" attr: "b" } - shape_int: { fg: "#deb887" attr: "b" } - shape_internalcall: { fg: "#b0c4de" attr: "b" } - shape_list: { fg: "#b0c4de" attr: "b" } - shape_literal: "#6495ed" - shape_match_pattern: "#86af80" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b0c4de" - shape_operator: "#e8ae5b" - shape_or: { fg: "#deb887" attr: "b" } - shape_pipe: { fg: "#deb887" attr: "b" } - shape_range: { fg: "#e8ae5b" attr: "b" } - shape_record: { fg: "#b0c4de" attr: "b" } - shape_redirection: { fg: "#deb887" attr: "b" } - shape_signature: { fg: "#86af80" attr: "b" } - shape_string: "#86af80" - shape_string_interpolation: { fg: "#b0c4de" attr: "b" } - shape_table: { fg: "#6495ed" attr: "b" } - shape_variable: "#deb887" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1c1c" - foreground: "#ddeedd" - cursor: "#ddeedd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbaa99' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#86af80' attr: 'b' } + empty: '#6495ed' + bool: {|| if $in { '#b0c4de' } else { 'light_gray' } } + int: '#bbaa99' + filesize: {|e| + if $e == 0b { + '#bbaa99' + } else if $e < 1mb { + '#b0c4de' + } else {{ fg: '#6495ed' }} + } + duration: '#bbaa99' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cd5c5c' attr: 'b' } + } else if $in < 6hr { + '#cd5c5c' + } else if $in < 1day { + '#e8ae5b' + } else if $in < 3day { + '#86af80' + } else if $in < 1wk { + { fg: '#86af80' attr: 'b' } + } else if $in < 6wk { + '#b0c4de' + } else if $in < 52wk { + '#6495ed' + } else { 'dark_gray' } + } + range: '#bbaa99' + float: '#bbaa99' + string: '#bbaa99' + nothing: '#bbaa99' + binary: '#bbaa99' + cellpath: '#bbaa99' + row_index: { fg: '#86af80' attr: 'b' } + record: '#bbaa99' + list: '#bbaa99' + block: '#bbaa99' + hints: 'dark_gray' + search_result: { fg: '#cd5c5c' bg: '#bbaa99' } + + shape_and: { fg: '#deb887' attr: 'b' } + shape_binary: { fg: '#deb887' attr: 'b' } + shape_block: { fg: '#6495ed' attr: 'b' } + shape_bool: '#b0c4de' + shape_custom: '#86af80' + shape_datetime: { fg: '#b0c4de' attr: 'b' } + shape_directory: '#b0c4de' + shape_external: '#b0c4de' + shape_externalarg: { fg: '#86af80' attr: 'b' } + shape_filepath: '#b0c4de' + shape_flag: { fg: '#6495ed' attr: 'b' } + shape_float: { fg: '#deb887' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b0c4de' attr: 'b' } + shape_int: { fg: '#deb887' attr: 'b' } + shape_internalcall: { fg: '#b0c4de' attr: 'b' } + shape_list: { fg: '#b0c4de' attr: 'b' } + shape_literal: '#6495ed' + shape_match_pattern: '#86af80' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b0c4de' + shape_operator: '#e8ae5b' + shape_or: { fg: '#deb887' attr: 'b' } + shape_pipe: { fg: '#deb887' attr: 'b' } + shape_range: { fg: '#e8ae5b' attr: 'b' } + shape_record: { fg: '#b0c4de' attr: 'b' } + shape_redirection: { fg: '#deb887' attr: 'b' } + shape_signature: { fg: '#86af80' attr: 'b' } + shape_string: '#86af80' + shape_string_interpolation: { fg: '#b0c4de' attr: 'b' } + shape_table: { fg: '#6495ed' attr: 'b' } + shape_variable: '#deb887' + + background: '#1c1c1c' + foreground: '#ddeedd' + cursor: '#ddeedd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ashes.nu b/themes/nu-themes/ashes.nu index 916994a..565e537 100644 --- a/themes/nu-themes/ashes.nu +++ b/themes/nu-themes/ashes.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c7ccd1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#95c7ae" attr: "b" } - empty: "#ae95c7" - bool: {|| if $in { "#95aec7" } else { "light_gray" } } - int: "#c7ccd1" - filesize: {|e| - if $e == 0b { - "#c7ccd1" - } else if $e < 1mb { - "#95aec7" - } else {{ fg: "#ae95c7" }} - } - duration: "#c7ccd1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c7ae95" attr: "b" } - } else if $in < 6hr { - "#c7ae95" - } else if $in < 1day { - "#aec795" - } else if $in < 3day { - "#95c7ae" - } else if $in < 1wk { - { fg: "#95c7ae" attr: "b" } - } else if $in < 6wk { - "#95aec7" - } else if $in < 52wk { - "#ae95c7" - } else { "dark_gray" } - } - range: "#c7ccd1" - float: "#c7ccd1" - string: "#c7ccd1" - nothing: "#c7ccd1" - binary: "#c7ccd1" - cellpath: "#c7ccd1" - row_index: { fg: "#95c7ae" attr: "b" } - record: "#c7ccd1" - list: "#c7ccd1" - block: "#c7ccd1" - hints: "dark_gray" - search_result: { fg: "#c7ae95" bg: "#c7ccd1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c795ae" attr: "b" } - shape_binary: { fg: "#c795ae" attr: "b" } - shape_block: { fg: "#ae95c7" attr: "b" } - shape_bool: "#95aec7" - shape_custom: "#95c7ae" - shape_datetime: { fg: "#95aec7" attr: "b" } - shape_directory: "#95aec7" - shape_external: "#95aec7" - shape_externalarg: { fg: "#95c7ae" attr: "b" } - shape_filepath: "#95aec7" - shape_flag: { fg: "#ae95c7" attr: "b" } - shape_float: { fg: "#c795ae" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#95aec7" attr: "b" } - shape_int: { fg: "#c795ae" attr: "b" } - shape_internalcall: { fg: "#95aec7" attr: "b" } - shape_list: { fg: "#95aec7" attr: "b" } - shape_literal: "#ae95c7" - shape_match_pattern: "#95c7ae" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#95aec7" - shape_operator: "#aec795" - shape_or: { fg: "#c795ae" attr: "b" } - shape_pipe: { fg: "#c795ae" attr: "b" } - shape_range: { fg: "#aec795" attr: "b" } - shape_record: { fg: "#95aec7" attr: "b" } - shape_redirection: { fg: "#c795ae" attr: "b" } - shape_signature: { fg: "#95c7ae" attr: "b" } - shape_string: "#95c7ae" - shape_string_interpolation: { fg: "#95aec7" attr: "b" } - shape_table: { fg: "#ae95c7" attr: "b" } - shape_variable: "#c795ae" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c2023" - foreground: "#c7ccd1" - cursor: "#c7ccd1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c7ccd1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#95c7ae' attr: 'b' } + empty: '#ae95c7' + bool: {|| if $in { '#95aec7' } else { 'light_gray' } } + int: '#c7ccd1' + filesize: {|e| + if $e == 0b { + '#c7ccd1' + } else if $e < 1mb { + '#95aec7' + } else {{ fg: '#ae95c7' }} + } + duration: '#c7ccd1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c7ae95' attr: 'b' } + } else if $in < 6hr { + '#c7ae95' + } else if $in < 1day { + '#aec795' + } else if $in < 3day { + '#95c7ae' + } else if $in < 1wk { + { fg: '#95c7ae' attr: 'b' } + } else if $in < 6wk { + '#95aec7' + } else if $in < 52wk { + '#ae95c7' + } else { 'dark_gray' } + } + range: '#c7ccd1' + float: '#c7ccd1' + string: '#c7ccd1' + nothing: '#c7ccd1' + binary: '#c7ccd1' + cellpath: '#c7ccd1' + row_index: { fg: '#95c7ae' attr: 'b' } + record: '#c7ccd1' + list: '#c7ccd1' + block: '#c7ccd1' + hints: 'dark_gray' + search_result: { fg: '#c7ae95' bg: '#c7ccd1' } + + shape_and: { fg: '#c795ae' attr: 'b' } + shape_binary: { fg: '#c795ae' attr: 'b' } + shape_block: { fg: '#ae95c7' attr: 'b' } + shape_bool: '#95aec7' + shape_custom: '#95c7ae' + shape_datetime: { fg: '#95aec7' attr: 'b' } + shape_directory: '#95aec7' + shape_external: '#95aec7' + shape_externalarg: { fg: '#95c7ae' attr: 'b' } + shape_filepath: '#95aec7' + shape_flag: { fg: '#ae95c7' attr: 'b' } + shape_float: { fg: '#c795ae' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#95aec7' attr: 'b' } + shape_int: { fg: '#c795ae' attr: 'b' } + shape_internalcall: { fg: '#95aec7' attr: 'b' } + shape_list: { fg: '#95aec7' attr: 'b' } + shape_literal: '#ae95c7' + shape_match_pattern: '#95c7ae' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#95aec7' + shape_operator: '#aec795' + shape_or: { fg: '#c795ae' attr: 'b' } + shape_pipe: { fg: '#c795ae' attr: 'b' } + shape_range: { fg: '#aec795' attr: 'b' } + shape_record: { fg: '#95aec7' attr: 'b' } + shape_redirection: { fg: '#c795ae' attr: 'b' } + shape_signature: { fg: '#95c7ae' attr: 'b' } + shape_string: '#95c7ae' + shape_string_interpolation: { fg: '#95aec7' attr: 'b' } + shape_table: { fg: '#ae95c7' attr: 'b' } + shape_variable: '#c795ae' + + background: '#1c2023' + foreground: '#c7ccd1' + cursor: '#c7ccd1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-cave-light.nu b/themes/nu-themes/atelier-cave-light.nu index 82e964a..620b07a 100644 --- a/themes/nu-themes/atelier-cave-light.nu +++ b/themes/nu-themes/atelier-cave-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#585260" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2a9292" attr: "b" } - empty: "#576ddb" - bool: {|| if $in { "#398bc6" } else { "light_gray" } } - int: "#585260" - filesize: {|e| - if $e == 0b { - "#585260" - } else if $e < 1mb { - "#398bc6" - } else {{ fg: "#576ddb" }} - } - duration: "#585260" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be4678" attr: "b" } - } else if $in < 6hr { - "#be4678" - } else if $in < 1day { - "#a06e3b" - } else if $in < 3day { - "#2a9292" - } else if $in < 1wk { - { fg: "#2a9292" attr: "b" } - } else if $in < 6wk { - "#398bc6" - } else if $in < 52wk { - "#576ddb" - } else { "dark_gray" } - } - range: "#585260" - float: "#585260" - string: "#585260" - nothing: "#585260" - binary: "#585260" - cellpath: "#585260" - row_index: { fg: "#2a9292" attr: "b" } - record: "#585260" - list: "#585260" - block: "#585260" - hints: "dark_gray" - search_result: { fg: "#be4678" bg: "#585260" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#955ae7" attr: "b" } - shape_binary: { fg: "#955ae7" attr: "b" } - shape_block: { fg: "#576ddb" attr: "b" } - shape_bool: "#398bc6" - shape_custom: "#2a9292" - shape_datetime: { fg: "#398bc6" attr: "b" } - shape_directory: "#398bc6" - shape_external: "#398bc6" - shape_externalarg: { fg: "#2a9292" attr: "b" } - shape_filepath: "#398bc6" - shape_flag: { fg: "#576ddb" attr: "b" } - shape_float: { fg: "#955ae7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#398bc6" attr: "b" } - shape_int: { fg: "#955ae7" attr: "b" } - shape_internalcall: { fg: "#398bc6" attr: "b" } - shape_list: { fg: "#398bc6" attr: "b" } - shape_literal: "#576ddb" - shape_match_pattern: "#2a9292" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#398bc6" - shape_operator: "#a06e3b" - shape_or: { fg: "#955ae7" attr: "b" } - shape_pipe: { fg: "#955ae7" attr: "b" } - shape_range: { fg: "#a06e3b" attr: "b" } - shape_record: { fg: "#398bc6" attr: "b" } - shape_redirection: { fg: "#955ae7" attr: "b" } - shape_signature: { fg: "#2a9292" attr: "b" } - shape_string: "#2a9292" - shape_string_interpolation: { fg: "#398bc6" attr: "b" } - shape_table: { fg: "#576ddb" attr: "b" } - shape_variable: "#955ae7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#efecf4" - foreground: "#585260" - cursor: "#585260" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#585260' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2a9292' attr: 'b' } + empty: '#576ddb' + bool: {|| if $in { '#398bc6' } else { 'light_gray' } } + int: '#585260' + filesize: {|e| + if $e == 0b { + '#585260' + } else if $e < 1mb { + '#398bc6' + } else {{ fg: '#576ddb' }} + } + duration: '#585260' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be4678' attr: 'b' } + } else if $in < 6hr { + '#be4678' + } else if $in < 1day { + '#a06e3b' + } else if $in < 3day { + '#2a9292' + } else if $in < 1wk { + { fg: '#2a9292' attr: 'b' } + } else if $in < 6wk { + '#398bc6' + } else if $in < 52wk { + '#576ddb' + } else { 'dark_gray' } + } + range: '#585260' + float: '#585260' + string: '#585260' + nothing: '#585260' + binary: '#585260' + cellpath: '#585260' + row_index: { fg: '#2a9292' attr: 'b' } + record: '#585260' + list: '#585260' + block: '#585260' + hints: 'dark_gray' + search_result: { fg: '#be4678' bg: '#585260' } + + shape_and: { fg: '#955ae7' attr: 'b' } + shape_binary: { fg: '#955ae7' attr: 'b' } + shape_block: { fg: '#576ddb' attr: 'b' } + shape_bool: '#398bc6' + shape_custom: '#2a9292' + shape_datetime: { fg: '#398bc6' attr: 'b' } + shape_directory: '#398bc6' + shape_external: '#398bc6' + shape_externalarg: { fg: '#2a9292' attr: 'b' } + shape_filepath: '#398bc6' + shape_flag: { fg: '#576ddb' attr: 'b' } + shape_float: { fg: '#955ae7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#398bc6' attr: 'b' } + shape_int: { fg: '#955ae7' attr: 'b' } + shape_internalcall: { fg: '#398bc6' attr: 'b' } + shape_list: { fg: '#398bc6' attr: 'b' } + shape_literal: '#576ddb' + shape_match_pattern: '#2a9292' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#398bc6' + shape_operator: '#a06e3b' + shape_or: { fg: '#955ae7' attr: 'b' } + shape_pipe: { fg: '#955ae7' attr: 'b' } + shape_range: { fg: '#a06e3b' attr: 'b' } + shape_record: { fg: '#398bc6' attr: 'b' } + shape_redirection: { fg: '#955ae7' attr: 'b' } + shape_signature: { fg: '#2a9292' attr: 'b' } + shape_string: '#2a9292' + shape_string_interpolation: { fg: '#398bc6' attr: 'b' } + shape_table: { fg: '#576ddb' attr: 'b' } + shape_variable: '#955ae7' + + background: '#efecf4' + foreground: '#585260' + cursor: '#585260' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-cave.nu b/themes/nu-themes/atelier-cave.nu index 3f00225..47bd6d7 100644 --- a/themes/nu-themes/atelier-cave.nu +++ b/themes/nu-themes/atelier-cave.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8b8792" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2a9292" attr: "b" } - empty: "#576ddb" - bool: {|| if $in { "#398bc6" } else { "light_gray" } } - int: "#8b8792" - filesize: {|e| - if $e == 0b { - "#8b8792" - } else if $e < 1mb { - "#398bc6" - } else {{ fg: "#576ddb" }} - } - duration: "#8b8792" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be4678" attr: "b" } - } else if $in < 6hr { - "#be4678" - } else if $in < 1day { - "#a06e3b" - } else if $in < 3day { - "#2a9292" - } else if $in < 1wk { - { fg: "#2a9292" attr: "b" } - } else if $in < 6wk { - "#398bc6" - } else if $in < 52wk { - "#576ddb" - } else { "dark_gray" } - } - range: "#8b8792" - float: "#8b8792" - string: "#8b8792" - nothing: "#8b8792" - binary: "#8b8792" - cellpath: "#8b8792" - row_index: { fg: "#2a9292" attr: "b" } - record: "#8b8792" - list: "#8b8792" - block: "#8b8792" - hints: "dark_gray" - search_result: { fg: "#be4678" bg: "#8b8792" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#955ae7" attr: "b" } - shape_binary: { fg: "#955ae7" attr: "b" } - shape_block: { fg: "#576ddb" attr: "b" } - shape_bool: "#398bc6" - shape_custom: "#2a9292" - shape_datetime: { fg: "#398bc6" attr: "b" } - shape_directory: "#398bc6" - shape_external: "#398bc6" - shape_externalarg: { fg: "#2a9292" attr: "b" } - shape_filepath: "#398bc6" - shape_flag: { fg: "#576ddb" attr: "b" } - shape_float: { fg: "#955ae7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#398bc6" attr: "b" } - shape_int: { fg: "#955ae7" attr: "b" } - shape_internalcall: { fg: "#398bc6" attr: "b" } - shape_list: { fg: "#398bc6" attr: "b" } - shape_literal: "#576ddb" - shape_match_pattern: "#2a9292" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#398bc6" - shape_operator: "#a06e3b" - shape_or: { fg: "#955ae7" attr: "b" } - shape_pipe: { fg: "#955ae7" attr: "b" } - shape_range: { fg: "#a06e3b" attr: "b" } - shape_record: { fg: "#398bc6" attr: "b" } - shape_redirection: { fg: "#955ae7" attr: "b" } - shape_signature: { fg: "#2a9292" attr: "b" } - shape_string: "#2a9292" - shape_string_interpolation: { fg: "#398bc6" attr: "b" } - shape_table: { fg: "#576ddb" attr: "b" } - shape_variable: "#955ae7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#19171c" - foreground: "#8b8792" - cursor: "#8b8792" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8b8792' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2a9292' attr: 'b' } + empty: '#576ddb' + bool: {|| if $in { '#398bc6' } else { 'light_gray' } } + int: '#8b8792' + filesize: {|e| + if $e == 0b { + '#8b8792' + } else if $e < 1mb { + '#398bc6' + } else {{ fg: '#576ddb' }} + } + duration: '#8b8792' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be4678' attr: 'b' } + } else if $in < 6hr { + '#be4678' + } else if $in < 1day { + '#a06e3b' + } else if $in < 3day { + '#2a9292' + } else if $in < 1wk { + { fg: '#2a9292' attr: 'b' } + } else if $in < 6wk { + '#398bc6' + } else if $in < 52wk { + '#576ddb' + } else { 'dark_gray' } + } + range: '#8b8792' + float: '#8b8792' + string: '#8b8792' + nothing: '#8b8792' + binary: '#8b8792' + cellpath: '#8b8792' + row_index: { fg: '#2a9292' attr: 'b' } + record: '#8b8792' + list: '#8b8792' + block: '#8b8792' + hints: 'dark_gray' + search_result: { fg: '#be4678' bg: '#8b8792' } + + shape_and: { fg: '#955ae7' attr: 'b' } + shape_binary: { fg: '#955ae7' attr: 'b' } + shape_block: { fg: '#576ddb' attr: 'b' } + shape_bool: '#398bc6' + shape_custom: '#2a9292' + shape_datetime: { fg: '#398bc6' attr: 'b' } + shape_directory: '#398bc6' + shape_external: '#398bc6' + shape_externalarg: { fg: '#2a9292' attr: 'b' } + shape_filepath: '#398bc6' + shape_flag: { fg: '#576ddb' attr: 'b' } + shape_float: { fg: '#955ae7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#398bc6' attr: 'b' } + shape_int: { fg: '#955ae7' attr: 'b' } + shape_internalcall: { fg: '#398bc6' attr: 'b' } + shape_list: { fg: '#398bc6' attr: 'b' } + shape_literal: '#576ddb' + shape_match_pattern: '#2a9292' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#398bc6' + shape_operator: '#a06e3b' + shape_or: { fg: '#955ae7' attr: 'b' } + shape_pipe: { fg: '#955ae7' attr: 'b' } + shape_range: { fg: '#a06e3b' attr: 'b' } + shape_record: { fg: '#398bc6' attr: 'b' } + shape_redirection: { fg: '#955ae7' attr: 'b' } + shape_signature: { fg: '#2a9292' attr: 'b' } + shape_string: '#2a9292' + shape_string_interpolation: { fg: '#398bc6' attr: 'b' } + shape_table: { fg: '#576ddb' attr: 'b' } + shape_variable: '#955ae7' + + background: '#19171c' + foreground: '#8b8792' + cursor: '#8b8792' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-dune-light.nu b/themes/nu-themes/atelier-dune-light.nu index 5d7dd9a..848494b 100644 --- a/themes/nu-themes/atelier-dune-light.nu +++ b/themes/nu-themes/atelier-dune-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6e6b5e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#60ac39" attr: "b" } - empty: "#6684e1" - bool: {|| if $in { "#1fad83" } else { "light_gray" } } - int: "#6e6b5e" - filesize: {|e| - if $e == 0b { - "#6e6b5e" - } else if $e < 1mb { - "#1fad83" - } else {{ fg: "#6684e1" }} - } - duration: "#6e6b5e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d73737" attr: "b" } - } else if $in < 6hr { - "#d73737" - } else if $in < 1day { - "#ae9513" - } else if $in < 3day { - "#60ac39" - } else if $in < 1wk { - { fg: "#60ac39" attr: "b" } - } else if $in < 6wk { - "#1fad83" - } else if $in < 52wk { - "#6684e1" - } else { "dark_gray" } - } - range: "#6e6b5e" - float: "#6e6b5e" - string: "#6e6b5e" - nothing: "#6e6b5e" - binary: "#6e6b5e" - cellpath: "#6e6b5e" - row_index: { fg: "#60ac39" attr: "b" } - record: "#6e6b5e" - list: "#6e6b5e" - block: "#6e6b5e" - hints: "dark_gray" - search_result: { fg: "#d73737" bg: "#6e6b5e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b854d4" attr: "b" } - shape_binary: { fg: "#b854d4" attr: "b" } - shape_block: { fg: "#6684e1" attr: "b" } - shape_bool: "#1fad83" - shape_custom: "#60ac39" - shape_datetime: { fg: "#1fad83" attr: "b" } - shape_directory: "#1fad83" - shape_external: "#1fad83" - shape_externalarg: { fg: "#60ac39" attr: "b" } - shape_filepath: "#1fad83" - shape_flag: { fg: "#6684e1" attr: "b" } - shape_float: { fg: "#b854d4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1fad83" attr: "b" } - shape_int: { fg: "#b854d4" attr: "b" } - shape_internalcall: { fg: "#1fad83" attr: "b" } - shape_list: { fg: "#1fad83" attr: "b" } - shape_literal: "#6684e1" - shape_match_pattern: "#60ac39" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1fad83" - shape_operator: "#ae9513" - shape_or: { fg: "#b854d4" attr: "b" } - shape_pipe: { fg: "#b854d4" attr: "b" } - shape_range: { fg: "#ae9513" attr: "b" } - shape_record: { fg: "#1fad83" attr: "b" } - shape_redirection: { fg: "#b854d4" attr: "b" } - shape_signature: { fg: "#60ac39" attr: "b" } - shape_string: "#60ac39" - shape_string_interpolation: { fg: "#1fad83" attr: "b" } - shape_table: { fg: "#6684e1" attr: "b" } - shape_variable: "#b854d4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fefbec" - foreground: "#6e6b5e" - cursor: "#6e6b5e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6e6b5e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#60ac39' attr: 'b' } + empty: '#6684e1' + bool: {|| if $in { '#1fad83' } else { 'light_gray' } } + int: '#6e6b5e' + filesize: {|e| + if $e == 0b { + '#6e6b5e' + } else if $e < 1mb { + '#1fad83' + } else {{ fg: '#6684e1' }} + } + duration: '#6e6b5e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d73737' attr: 'b' } + } else if $in < 6hr { + '#d73737' + } else if $in < 1day { + '#ae9513' + } else if $in < 3day { + '#60ac39' + } else if $in < 1wk { + { fg: '#60ac39' attr: 'b' } + } else if $in < 6wk { + '#1fad83' + } else if $in < 52wk { + '#6684e1' + } else { 'dark_gray' } + } + range: '#6e6b5e' + float: '#6e6b5e' + string: '#6e6b5e' + nothing: '#6e6b5e' + binary: '#6e6b5e' + cellpath: '#6e6b5e' + row_index: { fg: '#60ac39' attr: 'b' } + record: '#6e6b5e' + list: '#6e6b5e' + block: '#6e6b5e' + hints: 'dark_gray' + search_result: { fg: '#d73737' bg: '#6e6b5e' } + + shape_and: { fg: '#b854d4' attr: 'b' } + shape_binary: { fg: '#b854d4' attr: 'b' } + shape_block: { fg: '#6684e1' attr: 'b' } + shape_bool: '#1fad83' + shape_custom: '#60ac39' + shape_datetime: { fg: '#1fad83' attr: 'b' } + shape_directory: '#1fad83' + shape_external: '#1fad83' + shape_externalarg: { fg: '#60ac39' attr: 'b' } + shape_filepath: '#1fad83' + shape_flag: { fg: '#6684e1' attr: 'b' } + shape_float: { fg: '#b854d4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1fad83' attr: 'b' } + shape_int: { fg: '#b854d4' attr: 'b' } + shape_internalcall: { fg: '#1fad83' attr: 'b' } + shape_list: { fg: '#1fad83' attr: 'b' } + shape_literal: '#6684e1' + shape_match_pattern: '#60ac39' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1fad83' + shape_operator: '#ae9513' + shape_or: { fg: '#b854d4' attr: 'b' } + shape_pipe: { fg: '#b854d4' attr: 'b' } + shape_range: { fg: '#ae9513' attr: 'b' } + shape_record: { fg: '#1fad83' attr: 'b' } + shape_redirection: { fg: '#b854d4' attr: 'b' } + shape_signature: { fg: '#60ac39' attr: 'b' } + shape_string: '#60ac39' + shape_string_interpolation: { fg: '#1fad83' attr: 'b' } + shape_table: { fg: '#6684e1' attr: 'b' } + shape_variable: '#b854d4' + + background: '#fefbec' + foreground: '#6e6b5e' + cursor: '#6e6b5e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-dune.nu b/themes/nu-themes/atelier-dune.nu index a501a7c..18a46d2 100644 --- a/themes/nu-themes/atelier-dune.nu +++ b/themes/nu-themes/atelier-dune.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a6a28c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#60ac39" attr: "b" } - empty: "#6684e1" - bool: {|| if $in { "#1fad83" } else { "light_gray" } } - int: "#a6a28c" - filesize: {|e| - if $e == 0b { - "#a6a28c" - } else if $e < 1mb { - "#1fad83" - } else {{ fg: "#6684e1" }} - } - duration: "#a6a28c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d73737" attr: "b" } - } else if $in < 6hr { - "#d73737" - } else if $in < 1day { - "#ae9513" - } else if $in < 3day { - "#60ac39" - } else if $in < 1wk { - { fg: "#60ac39" attr: "b" } - } else if $in < 6wk { - "#1fad83" - } else if $in < 52wk { - "#6684e1" - } else { "dark_gray" } - } - range: "#a6a28c" - float: "#a6a28c" - string: "#a6a28c" - nothing: "#a6a28c" - binary: "#a6a28c" - cellpath: "#a6a28c" - row_index: { fg: "#60ac39" attr: "b" } - record: "#a6a28c" - list: "#a6a28c" - block: "#a6a28c" - hints: "dark_gray" - search_result: { fg: "#d73737" bg: "#a6a28c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b854d4" attr: "b" } - shape_binary: { fg: "#b854d4" attr: "b" } - shape_block: { fg: "#6684e1" attr: "b" } - shape_bool: "#1fad83" - shape_custom: "#60ac39" - shape_datetime: { fg: "#1fad83" attr: "b" } - shape_directory: "#1fad83" - shape_external: "#1fad83" - shape_externalarg: { fg: "#60ac39" attr: "b" } - shape_filepath: "#1fad83" - shape_flag: { fg: "#6684e1" attr: "b" } - shape_float: { fg: "#b854d4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1fad83" attr: "b" } - shape_int: { fg: "#b854d4" attr: "b" } - shape_internalcall: { fg: "#1fad83" attr: "b" } - shape_list: { fg: "#1fad83" attr: "b" } - shape_literal: "#6684e1" - shape_match_pattern: "#60ac39" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1fad83" - shape_operator: "#ae9513" - shape_or: { fg: "#b854d4" attr: "b" } - shape_pipe: { fg: "#b854d4" attr: "b" } - shape_range: { fg: "#ae9513" attr: "b" } - shape_record: { fg: "#1fad83" attr: "b" } - shape_redirection: { fg: "#b854d4" attr: "b" } - shape_signature: { fg: "#60ac39" attr: "b" } - shape_string: "#60ac39" - shape_string_interpolation: { fg: "#1fad83" attr: "b" } - shape_table: { fg: "#6684e1" attr: "b" } - shape_variable: "#b854d4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#20201d" - foreground: "#a6a28c" - cursor: "#a6a28c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a6a28c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#60ac39' attr: 'b' } + empty: '#6684e1' + bool: {|| if $in { '#1fad83' } else { 'light_gray' } } + int: '#a6a28c' + filesize: {|e| + if $e == 0b { + '#a6a28c' + } else if $e < 1mb { + '#1fad83' + } else {{ fg: '#6684e1' }} + } + duration: '#a6a28c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d73737' attr: 'b' } + } else if $in < 6hr { + '#d73737' + } else if $in < 1day { + '#ae9513' + } else if $in < 3day { + '#60ac39' + } else if $in < 1wk { + { fg: '#60ac39' attr: 'b' } + } else if $in < 6wk { + '#1fad83' + } else if $in < 52wk { + '#6684e1' + } else { 'dark_gray' } + } + range: '#a6a28c' + float: '#a6a28c' + string: '#a6a28c' + nothing: '#a6a28c' + binary: '#a6a28c' + cellpath: '#a6a28c' + row_index: { fg: '#60ac39' attr: 'b' } + record: '#a6a28c' + list: '#a6a28c' + block: '#a6a28c' + hints: 'dark_gray' + search_result: { fg: '#d73737' bg: '#a6a28c' } + + shape_and: { fg: '#b854d4' attr: 'b' } + shape_binary: { fg: '#b854d4' attr: 'b' } + shape_block: { fg: '#6684e1' attr: 'b' } + shape_bool: '#1fad83' + shape_custom: '#60ac39' + shape_datetime: { fg: '#1fad83' attr: 'b' } + shape_directory: '#1fad83' + shape_external: '#1fad83' + shape_externalarg: { fg: '#60ac39' attr: 'b' } + shape_filepath: '#1fad83' + shape_flag: { fg: '#6684e1' attr: 'b' } + shape_float: { fg: '#b854d4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1fad83' attr: 'b' } + shape_int: { fg: '#b854d4' attr: 'b' } + shape_internalcall: { fg: '#1fad83' attr: 'b' } + shape_list: { fg: '#1fad83' attr: 'b' } + shape_literal: '#6684e1' + shape_match_pattern: '#60ac39' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1fad83' + shape_operator: '#ae9513' + shape_or: { fg: '#b854d4' attr: 'b' } + shape_pipe: { fg: '#b854d4' attr: 'b' } + shape_range: { fg: '#ae9513' attr: 'b' } + shape_record: { fg: '#1fad83' attr: 'b' } + shape_redirection: { fg: '#b854d4' attr: 'b' } + shape_signature: { fg: '#60ac39' attr: 'b' } + shape_string: '#60ac39' + shape_string_interpolation: { fg: '#1fad83' attr: 'b' } + shape_table: { fg: '#6684e1' attr: 'b' } + shape_variable: '#b854d4' + + background: '#20201d' + foreground: '#a6a28c' + cursor: '#a6a28c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-estuary-light.nu b/themes/nu-themes/atelier-estuary-light.nu index 84d2842..421064f 100644 --- a/themes/nu-themes/atelier-estuary-light.nu +++ b/themes/nu-themes/atelier-estuary-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5f5e4e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7d9726" attr: "b" } - empty: "#36a166" - bool: {|| if $in { "#5b9d48" } else { "light_gray" } } - int: "#5f5e4e" - filesize: {|e| - if $e == 0b { - "#5f5e4e" - } else if $e < 1mb { - "#5b9d48" - } else {{ fg: "#36a166" }} - } - duration: "#5f5e4e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ba6236" attr: "b" } - } else if $in < 6hr { - "#ba6236" - } else if $in < 1day { - "#a5980d" - } else if $in < 3day { - "#7d9726" - } else if $in < 1wk { - { fg: "#7d9726" attr: "b" } - } else if $in < 6wk { - "#5b9d48" - } else if $in < 52wk { - "#36a166" - } else { "dark_gray" } - } - range: "#5f5e4e" - float: "#5f5e4e" - string: "#5f5e4e" - nothing: "#5f5e4e" - binary: "#5f5e4e" - cellpath: "#5f5e4e" - row_index: { fg: "#7d9726" attr: "b" } - record: "#5f5e4e" - list: "#5f5e4e" - block: "#5f5e4e" - hints: "dark_gray" - search_result: { fg: "#ba6236" bg: "#5f5e4e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#5f9182" attr: "b" } - shape_binary: { fg: "#5f9182" attr: "b" } - shape_block: { fg: "#36a166" attr: "b" } - shape_bool: "#5b9d48" - shape_custom: "#7d9726" - shape_datetime: { fg: "#5b9d48" attr: "b" } - shape_directory: "#5b9d48" - shape_external: "#5b9d48" - shape_externalarg: { fg: "#7d9726" attr: "b" } - shape_filepath: "#5b9d48" - shape_flag: { fg: "#36a166" attr: "b" } - shape_float: { fg: "#5f9182" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5b9d48" attr: "b" } - shape_int: { fg: "#5f9182" attr: "b" } - shape_internalcall: { fg: "#5b9d48" attr: "b" } - shape_list: { fg: "#5b9d48" attr: "b" } - shape_literal: "#36a166" - shape_match_pattern: "#7d9726" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5b9d48" - shape_operator: "#a5980d" - shape_or: { fg: "#5f9182" attr: "b" } - shape_pipe: { fg: "#5f9182" attr: "b" } - shape_range: { fg: "#a5980d" attr: "b" } - shape_record: { fg: "#5b9d48" attr: "b" } - shape_redirection: { fg: "#5f9182" attr: "b" } - shape_signature: { fg: "#7d9726" attr: "b" } - shape_string: "#7d9726" - shape_string_interpolation: { fg: "#5b9d48" attr: "b" } - shape_table: { fg: "#36a166" attr: "b" } - shape_variable: "#5f9182" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f4f3ec" - foreground: "#5f5e4e" - cursor: "#5f5e4e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5f5e4e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7d9726' attr: 'b' } + empty: '#36a166' + bool: {|| if $in { '#5b9d48' } else { 'light_gray' } } + int: '#5f5e4e' + filesize: {|e| + if $e == 0b { + '#5f5e4e' + } else if $e < 1mb { + '#5b9d48' + } else {{ fg: '#36a166' }} + } + duration: '#5f5e4e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ba6236' attr: 'b' } + } else if $in < 6hr { + '#ba6236' + } else if $in < 1day { + '#a5980d' + } else if $in < 3day { + '#7d9726' + } else if $in < 1wk { + { fg: '#7d9726' attr: 'b' } + } else if $in < 6wk { + '#5b9d48' + } else if $in < 52wk { + '#36a166' + } else { 'dark_gray' } + } + range: '#5f5e4e' + float: '#5f5e4e' + string: '#5f5e4e' + nothing: '#5f5e4e' + binary: '#5f5e4e' + cellpath: '#5f5e4e' + row_index: { fg: '#7d9726' attr: 'b' } + record: '#5f5e4e' + list: '#5f5e4e' + block: '#5f5e4e' + hints: 'dark_gray' + search_result: { fg: '#ba6236' bg: '#5f5e4e' } + + shape_and: { fg: '#5f9182' attr: 'b' } + shape_binary: { fg: '#5f9182' attr: 'b' } + shape_block: { fg: '#36a166' attr: 'b' } + shape_bool: '#5b9d48' + shape_custom: '#7d9726' + shape_datetime: { fg: '#5b9d48' attr: 'b' } + shape_directory: '#5b9d48' + shape_external: '#5b9d48' + shape_externalarg: { fg: '#7d9726' attr: 'b' } + shape_filepath: '#5b9d48' + shape_flag: { fg: '#36a166' attr: 'b' } + shape_float: { fg: '#5f9182' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5b9d48' attr: 'b' } + shape_int: { fg: '#5f9182' attr: 'b' } + shape_internalcall: { fg: '#5b9d48' attr: 'b' } + shape_list: { fg: '#5b9d48' attr: 'b' } + shape_literal: '#36a166' + shape_match_pattern: '#7d9726' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5b9d48' + shape_operator: '#a5980d' + shape_or: { fg: '#5f9182' attr: 'b' } + shape_pipe: { fg: '#5f9182' attr: 'b' } + shape_range: { fg: '#a5980d' attr: 'b' } + shape_record: { fg: '#5b9d48' attr: 'b' } + shape_redirection: { fg: '#5f9182' attr: 'b' } + shape_signature: { fg: '#7d9726' attr: 'b' } + shape_string: '#7d9726' + shape_string_interpolation: { fg: '#5b9d48' attr: 'b' } + shape_table: { fg: '#36a166' attr: 'b' } + shape_variable: '#5f9182' + + background: '#f4f3ec' + foreground: '#5f5e4e' + cursor: '#5f5e4e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-estuary.nu b/themes/nu-themes/atelier-estuary.nu index e7c8c4c..e52e217 100644 --- a/themes/nu-themes/atelier-estuary.nu +++ b/themes/nu-themes/atelier-estuary.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#929181" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7d9726" attr: "b" } - empty: "#36a166" - bool: {|| if $in { "#5b9d48" } else { "light_gray" } } - int: "#929181" - filesize: {|e| - if $e == 0b { - "#929181" - } else if $e < 1mb { - "#5b9d48" - } else {{ fg: "#36a166" }} - } - duration: "#929181" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ba6236" attr: "b" } - } else if $in < 6hr { - "#ba6236" - } else if $in < 1day { - "#a5980d" - } else if $in < 3day { - "#7d9726" - } else if $in < 1wk { - { fg: "#7d9726" attr: "b" } - } else if $in < 6wk { - "#5b9d48" - } else if $in < 52wk { - "#36a166" - } else { "dark_gray" } - } - range: "#929181" - float: "#929181" - string: "#929181" - nothing: "#929181" - binary: "#929181" - cellpath: "#929181" - row_index: { fg: "#7d9726" attr: "b" } - record: "#929181" - list: "#929181" - block: "#929181" - hints: "dark_gray" - search_result: { fg: "#ba6236" bg: "#929181" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#5f9182" attr: "b" } - shape_binary: { fg: "#5f9182" attr: "b" } - shape_block: { fg: "#36a166" attr: "b" } - shape_bool: "#5b9d48" - shape_custom: "#7d9726" - shape_datetime: { fg: "#5b9d48" attr: "b" } - shape_directory: "#5b9d48" - shape_external: "#5b9d48" - shape_externalarg: { fg: "#7d9726" attr: "b" } - shape_filepath: "#5b9d48" - shape_flag: { fg: "#36a166" attr: "b" } - shape_float: { fg: "#5f9182" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5b9d48" attr: "b" } - shape_int: { fg: "#5f9182" attr: "b" } - shape_internalcall: { fg: "#5b9d48" attr: "b" } - shape_list: { fg: "#5b9d48" attr: "b" } - shape_literal: "#36a166" - shape_match_pattern: "#7d9726" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5b9d48" - shape_operator: "#a5980d" - shape_or: { fg: "#5f9182" attr: "b" } - shape_pipe: { fg: "#5f9182" attr: "b" } - shape_range: { fg: "#a5980d" attr: "b" } - shape_record: { fg: "#5b9d48" attr: "b" } - shape_redirection: { fg: "#5f9182" attr: "b" } - shape_signature: { fg: "#7d9726" attr: "b" } - shape_string: "#7d9726" - shape_string_interpolation: { fg: "#5b9d48" attr: "b" } - shape_table: { fg: "#36a166" attr: "b" } - shape_variable: "#5f9182" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#22221b" - foreground: "#929181" - cursor: "#929181" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#929181' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7d9726' attr: 'b' } + empty: '#36a166' + bool: {|| if $in { '#5b9d48' } else { 'light_gray' } } + int: '#929181' + filesize: {|e| + if $e == 0b { + '#929181' + } else if $e < 1mb { + '#5b9d48' + } else {{ fg: '#36a166' }} + } + duration: '#929181' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ba6236' attr: 'b' } + } else if $in < 6hr { + '#ba6236' + } else if $in < 1day { + '#a5980d' + } else if $in < 3day { + '#7d9726' + } else if $in < 1wk { + { fg: '#7d9726' attr: 'b' } + } else if $in < 6wk { + '#5b9d48' + } else if $in < 52wk { + '#36a166' + } else { 'dark_gray' } + } + range: '#929181' + float: '#929181' + string: '#929181' + nothing: '#929181' + binary: '#929181' + cellpath: '#929181' + row_index: { fg: '#7d9726' attr: 'b' } + record: '#929181' + list: '#929181' + block: '#929181' + hints: 'dark_gray' + search_result: { fg: '#ba6236' bg: '#929181' } + + shape_and: { fg: '#5f9182' attr: 'b' } + shape_binary: { fg: '#5f9182' attr: 'b' } + shape_block: { fg: '#36a166' attr: 'b' } + shape_bool: '#5b9d48' + shape_custom: '#7d9726' + shape_datetime: { fg: '#5b9d48' attr: 'b' } + shape_directory: '#5b9d48' + shape_external: '#5b9d48' + shape_externalarg: { fg: '#7d9726' attr: 'b' } + shape_filepath: '#5b9d48' + shape_flag: { fg: '#36a166' attr: 'b' } + shape_float: { fg: '#5f9182' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5b9d48' attr: 'b' } + shape_int: { fg: '#5f9182' attr: 'b' } + shape_internalcall: { fg: '#5b9d48' attr: 'b' } + shape_list: { fg: '#5b9d48' attr: 'b' } + shape_literal: '#36a166' + shape_match_pattern: '#7d9726' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5b9d48' + shape_operator: '#a5980d' + shape_or: { fg: '#5f9182' attr: 'b' } + shape_pipe: { fg: '#5f9182' attr: 'b' } + shape_range: { fg: '#a5980d' attr: 'b' } + shape_record: { fg: '#5b9d48' attr: 'b' } + shape_redirection: { fg: '#5f9182' attr: 'b' } + shape_signature: { fg: '#7d9726' attr: 'b' } + shape_string: '#7d9726' + shape_string_interpolation: { fg: '#5b9d48' attr: 'b' } + shape_table: { fg: '#36a166' attr: 'b' } + shape_variable: '#5f9182' + + background: '#22221b' + foreground: '#929181' + cursor: '#929181' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-forest-light.nu b/themes/nu-themes/atelier-forest-light.nu index 4eb1d9b..7b16452 100644 --- a/themes/nu-themes/atelier-forest-light.nu +++ b/themes/nu-themes/atelier-forest-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#68615e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7b9726" attr: "b" } - empty: "#407ee7" - bool: {|| if $in { "#3d97b8" } else { "light_gray" } } - int: "#68615e" - filesize: {|e| - if $e == 0b { - "#68615e" - } else if $e < 1mb { - "#3d97b8" - } else {{ fg: "#407ee7" }} - } - duration: "#68615e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f22c40" attr: "b" } - } else if $in < 6hr { - "#f22c40" - } else if $in < 1day { - "#c38418" - } else if $in < 3day { - "#7b9726" - } else if $in < 1wk { - { fg: "#7b9726" attr: "b" } - } else if $in < 6wk { - "#3d97b8" - } else if $in < 52wk { - "#407ee7" - } else { "dark_gray" } - } - range: "#68615e" - float: "#68615e" - string: "#68615e" - nothing: "#68615e" - binary: "#68615e" - cellpath: "#68615e" - row_index: { fg: "#7b9726" attr: "b" } - record: "#68615e" - list: "#68615e" - block: "#68615e" - hints: "dark_gray" - search_result: { fg: "#f22c40" bg: "#68615e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6666ea" attr: "b" } - shape_binary: { fg: "#6666ea" attr: "b" } - shape_block: { fg: "#407ee7" attr: "b" } - shape_bool: "#3d97b8" - shape_custom: "#7b9726" - shape_datetime: { fg: "#3d97b8" attr: "b" } - shape_directory: "#3d97b8" - shape_external: "#3d97b8" - shape_externalarg: { fg: "#7b9726" attr: "b" } - shape_filepath: "#3d97b8" - shape_flag: { fg: "#407ee7" attr: "b" } - shape_float: { fg: "#6666ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3d97b8" attr: "b" } - shape_int: { fg: "#6666ea" attr: "b" } - shape_internalcall: { fg: "#3d97b8" attr: "b" } - shape_list: { fg: "#3d97b8" attr: "b" } - shape_literal: "#407ee7" - shape_match_pattern: "#7b9726" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3d97b8" - shape_operator: "#c38418" - shape_or: { fg: "#6666ea" attr: "b" } - shape_pipe: { fg: "#6666ea" attr: "b" } - shape_range: { fg: "#c38418" attr: "b" } - shape_record: { fg: "#3d97b8" attr: "b" } - shape_redirection: { fg: "#6666ea" attr: "b" } - shape_signature: { fg: "#7b9726" attr: "b" } - shape_string: "#7b9726" - shape_string_interpolation: { fg: "#3d97b8" attr: "b" } - shape_table: { fg: "#407ee7" attr: "b" } - shape_variable: "#6666ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f1efee" - foreground: "#68615e" - cursor: "#68615e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#68615e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7b9726' attr: 'b' } + empty: '#407ee7' + bool: {|| if $in { '#3d97b8' } else { 'light_gray' } } + int: '#68615e' + filesize: {|e| + if $e == 0b { + '#68615e' + } else if $e < 1mb { + '#3d97b8' + } else {{ fg: '#407ee7' }} + } + duration: '#68615e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f22c40' attr: 'b' } + } else if $in < 6hr { + '#f22c40' + } else if $in < 1day { + '#c38418' + } else if $in < 3day { + '#7b9726' + } else if $in < 1wk { + { fg: '#7b9726' attr: 'b' } + } else if $in < 6wk { + '#3d97b8' + } else if $in < 52wk { + '#407ee7' + } else { 'dark_gray' } + } + range: '#68615e' + float: '#68615e' + string: '#68615e' + nothing: '#68615e' + binary: '#68615e' + cellpath: '#68615e' + row_index: { fg: '#7b9726' attr: 'b' } + record: '#68615e' + list: '#68615e' + block: '#68615e' + hints: 'dark_gray' + search_result: { fg: '#f22c40' bg: '#68615e' } + + shape_and: { fg: '#6666ea' attr: 'b' } + shape_binary: { fg: '#6666ea' attr: 'b' } + shape_block: { fg: '#407ee7' attr: 'b' } + shape_bool: '#3d97b8' + shape_custom: '#7b9726' + shape_datetime: { fg: '#3d97b8' attr: 'b' } + shape_directory: '#3d97b8' + shape_external: '#3d97b8' + shape_externalarg: { fg: '#7b9726' attr: 'b' } + shape_filepath: '#3d97b8' + shape_flag: { fg: '#407ee7' attr: 'b' } + shape_float: { fg: '#6666ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3d97b8' attr: 'b' } + shape_int: { fg: '#6666ea' attr: 'b' } + shape_internalcall: { fg: '#3d97b8' attr: 'b' } + shape_list: { fg: '#3d97b8' attr: 'b' } + shape_literal: '#407ee7' + shape_match_pattern: '#7b9726' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3d97b8' + shape_operator: '#c38418' + shape_or: { fg: '#6666ea' attr: 'b' } + shape_pipe: { fg: '#6666ea' attr: 'b' } + shape_range: { fg: '#c38418' attr: 'b' } + shape_record: { fg: '#3d97b8' attr: 'b' } + shape_redirection: { fg: '#6666ea' attr: 'b' } + shape_signature: { fg: '#7b9726' attr: 'b' } + shape_string: '#7b9726' + shape_string_interpolation: { fg: '#3d97b8' attr: 'b' } + shape_table: { fg: '#407ee7' attr: 'b' } + shape_variable: '#6666ea' + + background: '#f1efee' + foreground: '#68615e' + cursor: '#68615e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-forest.nu b/themes/nu-themes/atelier-forest.nu index f6057b4..3c378a8 100644 --- a/themes/nu-themes/atelier-forest.nu +++ b/themes/nu-themes/atelier-forest.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a8a19f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7b9726" attr: "b" } - empty: "#407ee7" - bool: {|| if $in { "#3d97b8" } else { "light_gray" } } - int: "#a8a19f" - filesize: {|e| - if $e == 0b { - "#a8a19f" - } else if $e < 1mb { - "#3d97b8" - } else {{ fg: "#407ee7" }} - } - duration: "#a8a19f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f22c40" attr: "b" } - } else if $in < 6hr { - "#f22c40" - } else if $in < 1day { - "#c38418" - } else if $in < 3day { - "#7b9726" - } else if $in < 1wk { - { fg: "#7b9726" attr: "b" } - } else if $in < 6wk { - "#3d97b8" - } else if $in < 52wk { - "#407ee7" - } else { "dark_gray" } - } - range: "#a8a19f" - float: "#a8a19f" - string: "#a8a19f" - nothing: "#a8a19f" - binary: "#a8a19f" - cellpath: "#a8a19f" - row_index: { fg: "#7b9726" attr: "b" } - record: "#a8a19f" - list: "#a8a19f" - block: "#a8a19f" - hints: "dark_gray" - search_result: { fg: "#f22c40" bg: "#a8a19f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6666ea" attr: "b" } - shape_binary: { fg: "#6666ea" attr: "b" } - shape_block: { fg: "#407ee7" attr: "b" } - shape_bool: "#3d97b8" - shape_custom: "#7b9726" - shape_datetime: { fg: "#3d97b8" attr: "b" } - shape_directory: "#3d97b8" - shape_external: "#3d97b8" - shape_externalarg: { fg: "#7b9726" attr: "b" } - shape_filepath: "#3d97b8" - shape_flag: { fg: "#407ee7" attr: "b" } - shape_float: { fg: "#6666ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3d97b8" attr: "b" } - shape_int: { fg: "#6666ea" attr: "b" } - shape_internalcall: { fg: "#3d97b8" attr: "b" } - shape_list: { fg: "#3d97b8" attr: "b" } - shape_literal: "#407ee7" - shape_match_pattern: "#7b9726" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3d97b8" - shape_operator: "#c38418" - shape_or: { fg: "#6666ea" attr: "b" } - shape_pipe: { fg: "#6666ea" attr: "b" } - shape_range: { fg: "#c38418" attr: "b" } - shape_record: { fg: "#3d97b8" attr: "b" } - shape_redirection: { fg: "#6666ea" attr: "b" } - shape_signature: { fg: "#7b9726" attr: "b" } - shape_string: "#7b9726" - shape_string_interpolation: { fg: "#3d97b8" attr: "b" } - shape_table: { fg: "#407ee7" attr: "b" } - shape_variable: "#6666ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1918" - foreground: "#a8a19f" - cursor: "#a8a19f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a8a19f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7b9726' attr: 'b' } + empty: '#407ee7' + bool: {|| if $in { '#3d97b8' } else { 'light_gray' } } + int: '#a8a19f' + filesize: {|e| + if $e == 0b { + '#a8a19f' + } else if $e < 1mb { + '#3d97b8' + } else {{ fg: '#407ee7' }} + } + duration: '#a8a19f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f22c40' attr: 'b' } + } else if $in < 6hr { + '#f22c40' + } else if $in < 1day { + '#c38418' + } else if $in < 3day { + '#7b9726' + } else if $in < 1wk { + { fg: '#7b9726' attr: 'b' } + } else if $in < 6wk { + '#3d97b8' + } else if $in < 52wk { + '#407ee7' + } else { 'dark_gray' } + } + range: '#a8a19f' + float: '#a8a19f' + string: '#a8a19f' + nothing: '#a8a19f' + binary: '#a8a19f' + cellpath: '#a8a19f' + row_index: { fg: '#7b9726' attr: 'b' } + record: '#a8a19f' + list: '#a8a19f' + block: '#a8a19f' + hints: 'dark_gray' + search_result: { fg: '#f22c40' bg: '#a8a19f' } + + shape_and: { fg: '#6666ea' attr: 'b' } + shape_binary: { fg: '#6666ea' attr: 'b' } + shape_block: { fg: '#407ee7' attr: 'b' } + shape_bool: '#3d97b8' + shape_custom: '#7b9726' + shape_datetime: { fg: '#3d97b8' attr: 'b' } + shape_directory: '#3d97b8' + shape_external: '#3d97b8' + shape_externalarg: { fg: '#7b9726' attr: 'b' } + shape_filepath: '#3d97b8' + shape_flag: { fg: '#407ee7' attr: 'b' } + shape_float: { fg: '#6666ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3d97b8' attr: 'b' } + shape_int: { fg: '#6666ea' attr: 'b' } + shape_internalcall: { fg: '#3d97b8' attr: 'b' } + shape_list: { fg: '#3d97b8' attr: 'b' } + shape_literal: '#407ee7' + shape_match_pattern: '#7b9726' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3d97b8' + shape_operator: '#c38418' + shape_or: { fg: '#6666ea' attr: 'b' } + shape_pipe: { fg: '#6666ea' attr: 'b' } + shape_range: { fg: '#c38418' attr: 'b' } + shape_record: { fg: '#3d97b8' attr: 'b' } + shape_redirection: { fg: '#6666ea' attr: 'b' } + shape_signature: { fg: '#7b9726' attr: 'b' } + shape_string: '#7b9726' + shape_string_interpolation: { fg: '#3d97b8' attr: 'b' } + shape_table: { fg: '#407ee7' attr: 'b' } + shape_variable: '#6666ea' + + background: '#1b1918' + foreground: '#a8a19f' + cursor: '#a8a19f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-heath-light.nu b/themes/nu-themes/atelier-heath-light.nu index 423f244..9ef55c3 100644 --- a/themes/nu-themes/atelier-heath-light.nu +++ b/themes/nu-themes/atelier-heath-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#695d69" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#918b3b" attr: "b" } - empty: "#516aec" - bool: {|| if $in { "#159393" } else { "light_gray" } } - int: "#695d69" - filesize: {|e| - if $e == 0b { - "#695d69" - } else if $e < 1mb { - "#159393" - } else {{ fg: "#516aec" }} - } - duration: "#695d69" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca402b" attr: "b" } - } else if $in < 6hr { - "#ca402b" - } else if $in < 1day { - "#bb8a35" - } else if $in < 3day { - "#918b3b" - } else if $in < 1wk { - { fg: "#918b3b" attr: "b" } - } else if $in < 6wk { - "#159393" - } else if $in < 52wk { - "#516aec" - } else { "dark_gray" } - } - range: "#695d69" - float: "#695d69" - string: "#695d69" - nothing: "#695d69" - binary: "#695d69" - cellpath: "#695d69" - row_index: { fg: "#918b3b" attr: "b" } - record: "#695d69" - list: "#695d69" - block: "#695d69" - hints: "dark_gray" - search_result: { fg: "#ca402b" bg: "#695d69" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7b59c0" attr: "b" } - shape_binary: { fg: "#7b59c0" attr: "b" } - shape_block: { fg: "#516aec" attr: "b" } - shape_bool: "#159393" - shape_custom: "#918b3b" - shape_datetime: { fg: "#159393" attr: "b" } - shape_directory: "#159393" - shape_external: "#159393" - shape_externalarg: { fg: "#918b3b" attr: "b" } - shape_filepath: "#159393" - shape_flag: { fg: "#516aec" attr: "b" } - shape_float: { fg: "#7b59c0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#159393" attr: "b" } - shape_int: { fg: "#7b59c0" attr: "b" } - shape_internalcall: { fg: "#159393" attr: "b" } - shape_list: { fg: "#159393" attr: "b" } - shape_literal: "#516aec" - shape_match_pattern: "#918b3b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#159393" - shape_operator: "#bb8a35" - shape_or: { fg: "#7b59c0" attr: "b" } - shape_pipe: { fg: "#7b59c0" attr: "b" } - shape_range: { fg: "#bb8a35" attr: "b" } - shape_record: { fg: "#159393" attr: "b" } - shape_redirection: { fg: "#7b59c0" attr: "b" } - shape_signature: { fg: "#918b3b" attr: "b" } - shape_string: "#918b3b" - shape_string_interpolation: { fg: "#159393" attr: "b" } - shape_table: { fg: "#516aec" attr: "b" } - shape_variable: "#7b59c0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f7f3f7" - foreground: "#695d69" - cursor: "#695d69" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#695d69' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#918b3b' attr: 'b' } + empty: '#516aec' + bool: {|| if $in { '#159393' } else { 'light_gray' } } + int: '#695d69' + filesize: {|e| + if $e == 0b { + '#695d69' + } else if $e < 1mb { + '#159393' + } else {{ fg: '#516aec' }} + } + duration: '#695d69' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca402b' attr: 'b' } + } else if $in < 6hr { + '#ca402b' + } else if $in < 1day { + '#bb8a35' + } else if $in < 3day { + '#918b3b' + } else if $in < 1wk { + { fg: '#918b3b' attr: 'b' } + } else if $in < 6wk { + '#159393' + } else if $in < 52wk { + '#516aec' + } else { 'dark_gray' } + } + range: '#695d69' + float: '#695d69' + string: '#695d69' + nothing: '#695d69' + binary: '#695d69' + cellpath: '#695d69' + row_index: { fg: '#918b3b' attr: 'b' } + record: '#695d69' + list: '#695d69' + block: '#695d69' + hints: 'dark_gray' + search_result: { fg: '#ca402b' bg: '#695d69' } + + shape_and: { fg: '#7b59c0' attr: 'b' } + shape_binary: { fg: '#7b59c0' attr: 'b' } + shape_block: { fg: '#516aec' attr: 'b' } + shape_bool: '#159393' + shape_custom: '#918b3b' + shape_datetime: { fg: '#159393' attr: 'b' } + shape_directory: '#159393' + shape_external: '#159393' + shape_externalarg: { fg: '#918b3b' attr: 'b' } + shape_filepath: '#159393' + shape_flag: { fg: '#516aec' attr: 'b' } + shape_float: { fg: '#7b59c0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#159393' attr: 'b' } + shape_int: { fg: '#7b59c0' attr: 'b' } + shape_internalcall: { fg: '#159393' attr: 'b' } + shape_list: { fg: '#159393' attr: 'b' } + shape_literal: '#516aec' + shape_match_pattern: '#918b3b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#159393' + shape_operator: '#bb8a35' + shape_or: { fg: '#7b59c0' attr: 'b' } + shape_pipe: { fg: '#7b59c0' attr: 'b' } + shape_range: { fg: '#bb8a35' attr: 'b' } + shape_record: { fg: '#159393' attr: 'b' } + shape_redirection: { fg: '#7b59c0' attr: 'b' } + shape_signature: { fg: '#918b3b' attr: 'b' } + shape_string: '#918b3b' + shape_string_interpolation: { fg: '#159393' attr: 'b' } + shape_table: { fg: '#516aec' attr: 'b' } + shape_variable: '#7b59c0' + + background: '#f7f3f7' + foreground: '#695d69' + cursor: '#695d69' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-heath.nu b/themes/nu-themes/atelier-heath.nu index 8fb63f4..2115206 100644 --- a/themes/nu-themes/atelier-heath.nu +++ b/themes/nu-themes/atelier-heath.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ab9bab" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#918b3b" attr: "b" } - empty: "#516aec" - bool: {|| if $in { "#159393" } else { "light_gray" } } - int: "#ab9bab" - filesize: {|e| - if $e == 0b { - "#ab9bab" - } else if $e < 1mb { - "#159393" - } else {{ fg: "#516aec" }} - } - duration: "#ab9bab" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca402b" attr: "b" } - } else if $in < 6hr { - "#ca402b" - } else if $in < 1day { - "#bb8a35" - } else if $in < 3day { - "#918b3b" - } else if $in < 1wk { - { fg: "#918b3b" attr: "b" } - } else if $in < 6wk { - "#159393" - } else if $in < 52wk { - "#516aec" - } else { "dark_gray" } - } - range: "#ab9bab" - float: "#ab9bab" - string: "#ab9bab" - nothing: "#ab9bab" - binary: "#ab9bab" - cellpath: "#ab9bab" - row_index: { fg: "#918b3b" attr: "b" } - record: "#ab9bab" - list: "#ab9bab" - block: "#ab9bab" - hints: "dark_gray" - search_result: { fg: "#ca402b" bg: "#ab9bab" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7b59c0" attr: "b" } - shape_binary: { fg: "#7b59c0" attr: "b" } - shape_block: { fg: "#516aec" attr: "b" } - shape_bool: "#159393" - shape_custom: "#918b3b" - shape_datetime: { fg: "#159393" attr: "b" } - shape_directory: "#159393" - shape_external: "#159393" - shape_externalarg: { fg: "#918b3b" attr: "b" } - shape_filepath: "#159393" - shape_flag: { fg: "#516aec" attr: "b" } - shape_float: { fg: "#7b59c0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#159393" attr: "b" } - shape_int: { fg: "#7b59c0" attr: "b" } - shape_internalcall: { fg: "#159393" attr: "b" } - shape_list: { fg: "#159393" attr: "b" } - shape_literal: "#516aec" - shape_match_pattern: "#918b3b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#159393" - shape_operator: "#bb8a35" - shape_or: { fg: "#7b59c0" attr: "b" } - shape_pipe: { fg: "#7b59c0" attr: "b" } - shape_range: { fg: "#bb8a35" attr: "b" } - shape_record: { fg: "#159393" attr: "b" } - shape_redirection: { fg: "#7b59c0" attr: "b" } - shape_signature: { fg: "#918b3b" attr: "b" } - shape_string: "#918b3b" - shape_string_interpolation: { fg: "#159393" attr: "b" } - shape_table: { fg: "#516aec" attr: "b" } - shape_variable: "#7b59c0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b181b" - foreground: "#ab9bab" - cursor: "#ab9bab" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ab9bab' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#918b3b' attr: 'b' } + empty: '#516aec' + bool: {|| if $in { '#159393' } else { 'light_gray' } } + int: '#ab9bab' + filesize: {|e| + if $e == 0b { + '#ab9bab' + } else if $e < 1mb { + '#159393' + } else {{ fg: '#516aec' }} + } + duration: '#ab9bab' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca402b' attr: 'b' } + } else if $in < 6hr { + '#ca402b' + } else if $in < 1day { + '#bb8a35' + } else if $in < 3day { + '#918b3b' + } else if $in < 1wk { + { fg: '#918b3b' attr: 'b' } + } else if $in < 6wk { + '#159393' + } else if $in < 52wk { + '#516aec' + } else { 'dark_gray' } + } + range: '#ab9bab' + float: '#ab9bab' + string: '#ab9bab' + nothing: '#ab9bab' + binary: '#ab9bab' + cellpath: '#ab9bab' + row_index: { fg: '#918b3b' attr: 'b' } + record: '#ab9bab' + list: '#ab9bab' + block: '#ab9bab' + hints: 'dark_gray' + search_result: { fg: '#ca402b' bg: '#ab9bab' } + + shape_and: { fg: '#7b59c0' attr: 'b' } + shape_binary: { fg: '#7b59c0' attr: 'b' } + shape_block: { fg: '#516aec' attr: 'b' } + shape_bool: '#159393' + shape_custom: '#918b3b' + shape_datetime: { fg: '#159393' attr: 'b' } + shape_directory: '#159393' + shape_external: '#159393' + shape_externalarg: { fg: '#918b3b' attr: 'b' } + shape_filepath: '#159393' + shape_flag: { fg: '#516aec' attr: 'b' } + shape_float: { fg: '#7b59c0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#159393' attr: 'b' } + shape_int: { fg: '#7b59c0' attr: 'b' } + shape_internalcall: { fg: '#159393' attr: 'b' } + shape_list: { fg: '#159393' attr: 'b' } + shape_literal: '#516aec' + shape_match_pattern: '#918b3b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#159393' + shape_operator: '#bb8a35' + shape_or: { fg: '#7b59c0' attr: 'b' } + shape_pipe: { fg: '#7b59c0' attr: 'b' } + shape_range: { fg: '#bb8a35' attr: 'b' } + shape_record: { fg: '#159393' attr: 'b' } + shape_redirection: { fg: '#7b59c0' attr: 'b' } + shape_signature: { fg: '#918b3b' attr: 'b' } + shape_string: '#918b3b' + shape_string_interpolation: { fg: '#159393' attr: 'b' } + shape_table: { fg: '#516aec' attr: 'b' } + shape_variable: '#7b59c0' + + background: '#1b181b' + foreground: '#ab9bab' + cursor: '#ab9bab' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-lakeside-light.nu b/themes/nu-themes/atelier-lakeside-light.nu index 2d5b078..4ca2b16 100644 --- a/themes/nu-themes/atelier-lakeside-light.nu +++ b/themes/nu-themes/atelier-lakeside-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#516d7b" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#568c3b" attr: "b" } - empty: "#257fad" - bool: {|| if $in { "#2d8f6f" } else { "light_gray" } } - int: "#516d7b" - filesize: {|e| - if $e == 0b { - "#516d7b" - } else if $e < 1mb { - "#2d8f6f" - } else {{ fg: "#257fad" }} - } - duration: "#516d7b" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d22d72" attr: "b" } - } else if $in < 6hr { - "#d22d72" - } else if $in < 1day { - "#8a8a0f" - } else if $in < 3day { - "#568c3b" - } else if $in < 1wk { - { fg: "#568c3b" attr: "b" } - } else if $in < 6wk { - "#2d8f6f" - } else if $in < 52wk { - "#257fad" - } else { "dark_gray" } - } - range: "#516d7b" - float: "#516d7b" - string: "#516d7b" - nothing: "#516d7b" - binary: "#516d7b" - cellpath: "#516d7b" - row_index: { fg: "#568c3b" attr: "b" } - record: "#516d7b" - list: "#516d7b" - block: "#516d7b" - hints: "dark_gray" - search_result: { fg: "#d22d72" bg: "#516d7b" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6b6bb8" attr: "b" } - shape_binary: { fg: "#6b6bb8" attr: "b" } - shape_block: { fg: "#257fad" attr: "b" } - shape_bool: "#2d8f6f" - shape_custom: "#568c3b" - shape_datetime: { fg: "#2d8f6f" attr: "b" } - shape_directory: "#2d8f6f" - shape_external: "#2d8f6f" - shape_externalarg: { fg: "#568c3b" attr: "b" } - shape_filepath: "#2d8f6f" - shape_flag: { fg: "#257fad" attr: "b" } - shape_float: { fg: "#6b6bb8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2d8f6f" attr: "b" } - shape_int: { fg: "#6b6bb8" attr: "b" } - shape_internalcall: { fg: "#2d8f6f" attr: "b" } - shape_list: { fg: "#2d8f6f" attr: "b" } - shape_literal: "#257fad" - shape_match_pattern: "#568c3b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2d8f6f" - shape_operator: "#8a8a0f" - shape_or: { fg: "#6b6bb8" attr: "b" } - shape_pipe: { fg: "#6b6bb8" attr: "b" } - shape_range: { fg: "#8a8a0f" attr: "b" } - shape_record: { fg: "#2d8f6f" attr: "b" } - shape_redirection: { fg: "#6b6bb8" attr: "b" } - shape_signature: { fg: "#568c3b" attr: "b" } - shape_string: "#568c3b" - shape_string_interpolation: { fg: "#2d8f6f" attr: "b" } - shape_table: { fg: "#257fad" attr: "b" } - shape_variable: "#6b6bb8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ebf8ff" - foreground: "#516d7b" - cursor: "#516d7b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#516d7b' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#568c3b' attr: 'b' } + empty: '#257fad' + bool: {|| if $in { '#2d8f6f' } else { 'light_gray' } } + int: '#516d7b' + filesize: {|e| + if $e == 0b { + '#516d7b' + } else if $e < 1mb { + '#2d8f6f' + } else {{ fg: '#257fad' }} + } + duration: '#516d7b' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d22d72' attr: 'b' } + } else if $in < 6hr { + '#d22d72' + } else if $in < 1day { + '#8a8a0f' + } else if $in < 3day { + '#568c3b' + } else if $in < 1wk { + { fg: '#568c3b' attr: 'b' } + } else if $in < 6wk { + '#2d8f6f' + } else if $in < 52wk { + '#257fad' + } else { 'dark_gray' } + } + range: '#516d7b' + float: '#516d7b' + string: '#516d7b' + nothing: '#516d7b' + binary: '#516d7b' + cellpath: '#516d7b' + row_index: { fg: '#568c3b' attr: 'b' } + record: '#516d7b' + list: '#516d7b' + block: '#516d7b' + hints: 'dark_gray' + search_result: { fg: '#d22d72' bg: '#516d7b' } + + shape_and: { fg: '#6b6bb8' attr: 'b' } + shape_binary: { fg: '#6b6bb8' attr: 'b' } + shape_block: { fg: '#257fad' attr: 'b' } + shape_bool: '#2d8f6f' + shape_custom: '#568c3b' + shape_datetime: { fg: '#2d8f6f' attr: 'b' } + shape_directory: '#2d8f6f' + shape_external: '#2d8f6f' + shape_externalarg: { fg: '#568c3b' attr: 'b' } + shape_filepath: '#2d8f6f' + shape_flag: { fg: '#257fad' attr: 'b' } + shape_float: { fg: '#6b6bb8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2d8f6f' attr: 'b' } + shape_int: { fg: '#6b6bb8' attr: 'b' } + shape_internalcall: { fg: '#2d8f6f' attr: 'b' } + shape_list: { fg: '#2d8f6f' attr: 'b' } + shape_literal: '#257fad' + shape_match_pattern: '#568c3b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2d8f6f' + shape_operator: '#8a8a0f' + shape_or: { fg: '#6b6bb8' attr: 'b' } + shape_pipe: { fg: '#6b6bb8' attr: 'b' } + shape_range: { fg: '#8a8a0f' attr: 'b' } + shape_record: { fg: '#2d8f6f' attr: 'b' } + shape_redirection: { fg: '#6b6bb8' attr: 'b' } + shape_signature: { fg: '#568c3b' attr: 'b' } + shape_string: '#568c3b' + shape_string_interpolation: { fg: '#2d8f6f' attr: 'b' } + shape_table: { fg: '#257fad' attr: 'b' } + shape_variable: '#6b6bb8' + + background: '#ebf8ff' + foreground: '#516d7b' + cursor: '#516d7b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-lakeside.nu b/themes/nu-themes/atelier-lakeside.nu index 81e9775..2426ebe 100644 --- a/themes/nu-themes/atelier-lakeside.nu +++ b/themes/nu-themes/atelier-lakeside.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#7ea2b4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#568c3b" attr: "b" } - empty: "#257fad" - bool: {|| if $in { "#2d8f6f" } else { "light_gray" } } - int: "#7ea2b4" - filesize: {|e| - if $e == 0b { - "#7ea2b4" - } else if $e < 1mb { - "#2d8f6f" - } else {{ fg: "#257fad" }} - } - duration: "#7ea2b4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d22d72" attr: "b" } - } else if $in < 6hr { - "#d22d72" - } else if $in < 1day { - "#8a8a0f" - } else if $in < 3day { - "#568c3b" - } else if $in < 1wk { - { fg: "#568c3b" attr: "b" } - } else if $in < 6wk { - "#2d8f6f" - } else if $in < 52wk { - "#257fad" - } else { "dark_gray" } - } - range: "#7ea2b4" - float: "#7ea2b4" - string: "#7ea2b4" - nothing: "#7ea2b4" - binary: "#7ea2b4" - cellpath: "#7ea2b4" - row_index: { fg: "#568c3b" attr: "b" } - record: "#7ea2b4" - list: "#7ea2b4" - block: "#7ea2b4" - hints: "dark_gray" - search_result: { fg: "#d22d72" bg: "#7ea2b4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6b6bb8" attr: "b" } - shape_binary: { fg: "#6b6bb8" attr: "b" } - shape_block: { fg: "#257fad" attr: "b" } - shape_bool: "#2d8f6f" - shape_custom: "#568c3b" - shape_datetime: { fg: "#2d8f6f" attr: "b" } - shape_directory: "#2d8f6f" - shape_external: "#2d8f6f" - shape_externalarg: { fg: "#568c3b" attr: "b" } - shape_filepath: "#2d8f6f" - shape_flag: { fg: "#257fad" attr: "b" } - shape_float: { fg: "#6b6bb8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2d8f6f" attr: "b" } - shape_int: { fg: "#6b6bb8" attr: "b" } - shape_internalcall: { fg: "#2d8f6f" attr: "b" } - shape_list: { fg: "#2d8f6f" attr: "b" } - shape_literal: "#257fad" - shape_match_pattern: "#568c3b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2d8f6f" - shape_operator: "#8a8a0f" - shape_or: { fg: "#6b6bb8" attr: "b" } - shape_pipe: { fg: "#6b6bb8" attr: "b" } - shape_range: { fg: "#8a8a0f" attr: "b" } - shape_record: { fg: "#2d8f6f" attr: "b" } - shape_redirection: { fg: "#6b6bb8" attr: "b" } - shape_signature: { fg: "#568c3b" attr: "b" } - shape_string: "#568c3b" - shape_string_interpolation: { fg: "#2d8f6f" attr: "b" } - shape_table: { fg: "#257fad" attr: "b" } - shape_variable: "#6b6bb8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#161b1d" - foreground: "#7ea2b4" - cursor: "#7ea2b4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#7ea2b4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#568c3b' attr: 'b' } + empty: '#257fad' + bool: {|| if $in { '#2d8f6f' } else { 'light_gray' } } + int: '#7ea2b4' + filesize: {|e| + if $e == 0b { + '#7ea2b4' + } else if $e < 1mb { + '#2d8f6f' + } else {{ fg: '#257fad' }} + } + duration: '#7ea2b4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d22d72' attr: 'b' } + } else if $in < 6hr { + '#d22d72' + } else if $in < 1day { + '#8a8a0f' + } else if $in < 3day { + '#568c3b' + } else if $in < 1wk { + { fg: '#568c3b' attr: 'b' } + } else if $in < 6wk { + '#2d8f6f' + } else if $in < 52wk { + '#257fad' + } else { 'dark_gray' } + } + range: '#7ea2b4' + float: '#7ea2b4' + string: '#7ea2b4' + nothing: '#7ea2b4' + binary: '#7ea2b4' + cellpath: '#7ea2b4' + row_index: { fg: '#568c3b' attr: 'b' } + record: '#7ea2b4' + list: '#7ea2b4' + block: '#7ea2b4' + hints: 'dark_gray' + search_result: { fg: '#d22d72' bg: '#7ea2b4' } + + shape_and: { fg: '#6b6bb8' attr: 'b' } + shape_binary: { fg: '#6b6bb8' attr: 'b' } + shape_block: { fg: '#257fad' attr: 'b' } + shape_bool: '#2d8f6f' + shape_custom: '#568c3b' + shape_datetime: { fg: '#2d8f6f' attr: 'b' } + shape_directory: '#2d8f6f' + shape_external: '#2d8f6f' + shape_externalarg: { fg: '#568c3b' attr: 'b' } + shape_filepath: '#2d8f6f' + shape_flag: { fg: '#257fad' attr: 'b' } + shape_float: { fg: '#6b6bb8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2d8f6f' attr: 'b' } + shape_int: { fg: '#6b6bb8' attr: 'b' } + shape_internalcall: { fg: '#2d8f6f' attr: 'b' } + shape_list: { fg: '#2d8f6f' attr: 'b' } + shape_literal: '#257fad' + shape_match_pattern: '#568c3b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2d8f6f' + shape_operator: '#8a8a0f' + shape_or: { fg: '#6b6bb8' attr: 'b' } + shape_pipe: { fg: '#6b6bb8' attr: 'b' } + shape_range: { fg: '#8a8a0f' attr: 'b' } + shape_record: { fg: '#2d8f6f' attr: 'b' } + shape_redirection: { fg: '#6b6bb8' attr: 'b' } + shape_signature: { fg: '#568c3b' attr: 'b' } + shape_string: '#568c3b' + shape_string_interpolation: { fg: '#2d8f6f' attr: 'b' } + shape_table: { fg: '#257fad' attr: 'b' } + shape_variable: '#6b6bb8' + + background: '#161b1d' + foreground: '#7ea2b4' + cursor: '#7ea2b4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-plateau-light.nu b/themes/nu-themes/atelier-plateau-light.nu index b1619f3..594ba26 100644 --- a/themes/nu-themes/atelier-plateau-light.nu +++ b/themes/nu-themes/atelier-plateau-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#585050" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4b8b8b" attr: "b" } - empty: "#7272ca" - bool: {|| if $in { "#5485b6" } else { "light_gray" } } - int: "#585050" - filesize: {|e| - if $e == 0b { - "#585050" - } else if $e < 1mb { - "#5485b6" - } else {{ fg: "#7272ca" }} - } - duration: "#585050" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca4949" attr: "b" } - } else if $in < 6hr { - "#ca4949" - } else if $in < 1day { - "#a06e3b" - } else if $in < 3day { - "#4b8b8b" - } else if $in < 1wk { - { fg: "#4b8b8b" attr: "b" } - } else if $in < 6wk { - "#5485b6" - } else if $in < 52wk { - "#7272ca" - } else { "dark_gray" } - } - range: "#585050" - float: "#585050" - string: "#585050" - nothing: "#585050" - binary: "#585050" - cellpath: "#585050" - row_index: { fg: "#4b8b8b" attr: "b" } - record: "#585050" - list: "#585050" - block: "#585050" - hints: "dark_gray" - search_result: { fg: "#ca4949" bg: "#585050" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8464c4" attr: "b" } - shape_binary: { fg: "#8464c4" attr: "b" } - shape_block: { fg: "#7272ca" attr: "b" } - shape_bool: "#5485b6" - shape_custom: "#4b8b8b" - shape_datetime: { fg: "#5485b6" attr: "b" } - shape_directory: "#5485b6" - shape_external: "#5485b6" - shape_externalarg: { fg: "#4b8b8b" attr: "b" } - shape_filepath: "#5485b6" - shape_flag: { fg: "#7272ca" attr: "b" } - shape_float: { fg: "#8464c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5485b6" attr: "b" } - shape_int: { fg: "#8464c4" attr: "b" } - shape_internalcall: { fg: "#5485b6" attr: "b" } - shape_list: { fg: "#5485b6" attr: "b" } - shape_literal: "#7272ca" - shape_match_pattern: "#4b8b8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5485b6" - shape_operator: "#a06e3b" - shape_or: { fg: "#8464c4" attr: "b" } - shape_pipe: { fg: "#8464c4" attr: "b" } - shape_range: { fg: "#a06e3b" attr: "b" } - shape_record: { fg: "#5485b6" attr: "b" } - shape_redirection: { fg: "#8464c4" attr: "b" } - shape_signature: { fg: "#4b8b8b" attr: "b" } - shape_string: "#4b8b8b" - shape_string_interpolation: { fg: "#5485b6" attr: "b" } - shape_table: { fg: "#7272ca" attr: "b" } - shape_variable: "#8464c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f4ecec" - foreground: "#585050" - cursor: "#585050" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#585050' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4b8b8b' attr: 'b' } + empty: '#7272ca' + bool: {|| if $in { '#5485b6' } else { 'light_gray' } } + int: '#585050' + filesize: {|e| + if $e == 0b { + '#585050' + } else if $e < 1mb { + '#5485b6' + } else {{ fg: '#7272ca' }} + } + duration: '#585050' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca4949' attr: 'b' } + } else if $in < 6hr { + '#ca4949' + } else if $in < 1day { + '#a06e3b' + } else if $in < 3day { + '#4b8b8b' + } else if $in < 1wk { + { fg: '#4b8b8b' attr: 'b' } + } else if $in < 6wk { + '#5485b6' + } else if $in < 52wk { + '#7272ca' + } else { 'dark_gray' } + } + range: '#585050' + float: '#585050' + string: '#585050' + nothing: '#585050' + binary: '#585050' + cellpath: '#585050' + row_index: { fg: '#4b8b8b' attr: 'b' } + record: '#585050' + list: '#585050' + block: '#585050' + hints: 'dark_gray' + search_result: { fg: '#ca4949' bg: '#585050' } + + shape_and: { fg: '#8464c4' attr: 'b' } + shape_binary: { fg: '#8464c4' attr: 'b' } + shape_block: { fg: '#7272ca' attr: 'b' } + shape_bool: '#5485b6' + shape_custom: '#4b8b8b' + shape_datetime: { fg: '#5485b6' attr: 'b' } + shape_directory: '#5485b6' + shape_external: '#5485b6' + shape_externalarg: { fg: '#4b8b8b' attr: 'b' } + shape_filepath: '#5485b6' + shape_flag: { fg: '#7272ca' attr: 'b' } + shape_float: { fg: '#8464c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5485b6' attr: 'b' } + shape_int: { fg: '#8464c4' attr: 'b' } + shape_internalcall: { fg: '#5485b6' attr: 'b' } + shape_list: { fg: '#5485b6' attr: 'b' } + shape_literal: '#7272ca' + shape_match_pattern: '#4b8b8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5485b6' + shape_operator: '#a06e3b' + shape_or: { fg: '#8464c4' attr: 'b' } + shape_pipe: { fg: '#8464c4' attr: 'b' } + shape_range: { fg: '#a06e3b' attr: 'b' } + shape_record: { fg: '#5485b6' attr: 'b' } + shape_redirection: { fg: '#8464c4' attr: 'b' } + shape_signature: { fg: '#4b8b8b' attr: 'b' } + shape_string: '#4b8b8b' + shape_string_interpolation: { fg: '#5485b6' attr: 'b' } + shape_table: { fg: '#7272ca' attr: 'b' } + shape_variable: '#8464c4' + + background: '#f4ecec' + foreground: '#585050' + cursor: '#585050' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-plateau.nu b/themes/nu-themes/atelier-plateau.nu index bf2e2c1..9e7eb57 100644 --- a/themes/nu-themes/atelier-plateau.nu +++ b/themes/nu-themes/atelier-plateau.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8a8585" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4b8b8b" attr: "b" } - empty: "#7272ca" - bool: {|| if $in { "#5485b6" } else { "light_gray" } } - int: "#8a8585" - filesize: {|e| - if $e == 0b { - "#8a8585" - } else if $e < 1mb { - "#5485b6" - } else {{ fg: "#7272ca" }} - } - duration: "#8a8585" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca4949" attr: "b" } - } else if $in < 6hr { - "#ca4949" - } else if $in < 1day { - "#a06e3b" - } else if $in < 3day { - "#4b8b8b" - } else if $in < 1wk { - { fg: "#4b8b8b" attr: "b" } - } else if $in < 6wk { - "#5485b6" - } else if $in < 52wk { - "#7272ca" - } else { "dark_gray" } - } - range: "#8a8585" - float: "#8a8585" - string: "#8a8585" - nothing: "#8a8585" - binary: "#8a8585" - cellpath: "#8a8585" - row_index: { fg: "#4b8b8b" attr: "b" } - record: "#8a8585" - list: "#8a8585" - block: "#8a8585" - hints: "dark_gray" - search_result: { fg: "#ca4949" bg: "#8a8585" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8464c4" attr: "b" } - shape_binary: { fg: "#8464c4" attr: "b" } - shape_block: { fg: "#7272ca" attr: "b" } - shape_bool: "#5485b6" - shape_custom: "#4b8b8b" - shape_datetime: { fg: "#5485b6" attr: "b" } - shape_directory: "#5485b6" - shape_external: "#5485b6" - shape_externalarg: { fg: "#4b8b8b" attr: "b" } - shape_filepath: "#5485b6" - shape_flag: { fg: "#7272ca" attr: "b" } - shape_float: { fg: "#8464c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5485b6" attr: "b" } - shape_int: { fg: "#8464c4" attr: "b" } - shape_internalcall: { fg: "#5485b6" attr: "b" } - shape_list: { fg: "#5485b6" attr: "b" } - shape_literal: "#7272ca" - shape_match_pattern: "#4b8b8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5485b6" - shape_operator: "#a06e3b" - shape_or: { fg: "#8464c4" attr: "b" } - shape_pipe: { fg: "#8464c4" attr: "b" } - shape_range: { fg: "#a06e3b" attr: "b" } - shape_record: { fg: "#5485b6" attr: "b" } - shape_redirection: { fg: "#8464c4" attr: "b" } - shape_signature: { fg: "#4b8b8b" attr: "b" } - shape_string: "#4b8b8b" - shape_string_interpolation: { fg: "#5485b6" attr: "b" } - shape_table: { fg: "#7272ca" attr: "b" } - shape_variable: "#8464c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1818" - foreground: "#8a8585" - cursor: "#8a8585" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8a8585' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4b8b8b' attr: 'b' } + empty: '#7272ca' + bool: {|| if $in { '#5485b6' } else { 'light_gray' } } + int: '#8a8585' + filesize: {|e| + if $e == 0b { + '#8a8585' + } else if $e < 1mb { + '#5485b6' + } else {{ fg: '#7272ca' }} + } + duration: '#8a8585' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca4949' attr: 'b' } + } else if $in < 6hr { + '#ca4949' + } else if $in < 1day { + '#a06e3b' + } else if $in < 3day { + '#4b8b8b' + } else if $in < 1wk { + { fg: '#4b8b8b' attr: 'b' } + } else if $in < 6wk { + '#5485b6' + } else if $in < 52wk { + '#7272ca' + } else { 'dark_gray' } + } + range: '#8a8585' + float: '#8a8585' + string: '#8a8585' + nothing: '#8a8585' + binary: '#8a8585' + cellpath: '#8a8585' + row_index: { fg: '#4b8b8b' attr: 'b' } + record: '#8a8585' + list: '#8a8585' + block: '#8a8585' + hints: 'dark_gray' + search_result: { fg: '#ca4949' bg: '#8a8585' } + + shape_and: { fg: '#8464c4' attr: 'b' } + shape_binary: { fg: '#8464c4' attr: 'b' } + shape_block: { fg: '#7272ca' attr: 'b' } + shape_bool: '#5485b6' + shape_custom: '#4b8b8b' + shape_datetime: { fg: '#5485b6' attr: 'b' } + shape_directory: '#5485b6' + shape_external: '#5485b6' + shape_externalarg: { fg: '#4b8b8b' attr: 'b' } + shape_filepath: '#5485b6' + shape_flag: { fg: '#7272ca' attr: 'b' } + shape_float: { fg: '#8464c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5485b6' attr: 'b' } + shape_int: { fg: '#8464c4' attr: 'b' } + shape_internalcall: { fg: '#5485b6' attr: 'b' } + shape_list: { fg: '#5485b6' attr: 'b' } + shape_literal: '#7272ca' + shape_match_pattern: '#4b8b8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5485b6' + shape_operator: '#a06e3b' + shape_or: { fg: '#8464c4' attr: 'b' } + shape_pipe: { fg: '#8464c4' attr: 'b' } + shape_range: { fg: '#a06e3b' attr: 'b' } + shape_record: { fg: '#5485b6' attr: 'b' } + shape_redirection: { fg: '#8464c4' attr: 'b' } + shape_signature: { fg: '#4b8b8b' attr: 'b' } + shape_string: '#4b8b8b' + shape_string_interpolation: { fg: '#5485b6' attr: 'b' } + shape_table: { fg: '#7272ca' attr: 'b' } + shape_variable: '#8464c4' + + background: '#1b1818' + foreground: '#8a8585' + cursor: '#8a8585' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-savanna-light.nu b/themes/nu-themes/atelier-savanna-light.nu index d7d6082..17e0d39 100644 --- a/themes/nu-themes/atelier-savanna-light.nu +++ b/themes/nu-themes/atelier-savanna-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#526057" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#489963" attr: "b" } - empty: "#478c90" - bool: {|| if $in { "#1c9aa0" } else { "light_gray" } } - int: "#526057" - filesize: {|e| - if $e == 0b { - "#526057" - } else if $e < 1mb { - "#1c9aa0" - } else {{ fg: "#478c90" }} - } - duration: "#526057" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b16139" attr: "b" } - } else if $in < 6hr { - "#b16139" - } else if $in < 1day { - "#a07e3b" - } else if $in < 3day { - "#489963" - } else if $in < 1wk { - { fg: "#489963" attr: "b" } - } else if $in < 6wk { - "#1c9aa0" - } else if $in < 52wk { - "#478c90" - } else { "dark_gray" } - } - range: "#526057" - float: "#526057" - string: "#526057" - nothing: "#526057" - binary: "#526057" - cellpath: "#526057" - row_index: { fg: "#489963" attr: "b" } - record: "#526057" - list: "#526057" - block: "#526057" - hints: "dark_gray" - search_result: { fg: "#b16139" bg: "#526057" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#55859b" attr: "b" } - shape_binary: { fg: "#55859b" attr: "b" } - shape_block: { fg: "#478c90" attr: "b" } - shape_bool: "#1c9aa0" - shape_custom: "#489963" - shape_datetime: { fg: "#1c9aa0" attr: "b" } - shape_directory: "#1c9aa0" - shape_external: "#1c9aa0" - shape_externalarg: { fg: "#489963" attr: "b" } - shape_filepath: "#1c9aa0" - shape_flag: { fg: "#478c90" attr: "b" } - shape_float: { fg: "#55859b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1c9aa0" attr: "b" } - shape_int: { fg: "#55859b" attr: "b" } - shape_internalcall: { fg: "#1c9aa0" attr: "b" } - shape_list: { fg: "#1c9aa0" attr: "b" } - shape_literal: "#478c90" - shape_match_pattern: "#489963" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1c9aa0" - shape_operator: "#a07e3b" - shape_or: { fg: "#55859b" attr: "b" } - shape_pipe: { fg: "#55859b" attr: "b" } - shape_range: { fg: "#a07e3b" attr: "b" } - shape_record: { fg: "#1c9aa0" attr: "b" } - shape_redirection: { fg: "#55859b" attr: "b" } - shape_signature: { fg: "#489963" attr: "b" } - shape_string: "#489963" - shape_string_interpolation: { fg: "#1c9aa0" attr: "b" } - shape_table: { fg: "#478c90" attr: "b" } - shape_variable: "#55859b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ecf4ee" - foreground: "#526057" - cursor: "#526057" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#526057' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#489963' attr: 'b' } + empty: '#478c90' + bool: {|| if $in { '#1c9aa0' } else { 'light_gray' } } + int: '#526057' + filesize: {|e| + if $e == 0b { + '#526057' + } else if $e < 1mb { + '#1c9aa0' + } else {{ fg: '#478c90' }} + } + duration: '#526057' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b16139' attr: 'b' } + } else if $in < 6hr { + '#b16139' + } else if $in < 1day { + '#a07e3b' + } else if $in < 3day { + '#489963' + } else if $in < 1wk { + { fg: '#489963' attr: 'b' } + } else if $in < 6wk { + '#1c9aa0' + } else if $in < 52wk { + '#478c90' + } else { 'dark_gray' } + } + range: '#526057' + float: '#526057' + string: '#526057' + nothing: '#526057' + binary: '#526057' + cellpath: '#526057' + row_index: { fg: '#489963' attr: 'b' } + record: '#526057' + list: '#526057' + block: '#526057' + hints: 'dark_gray' + search_result: { fg: '#b16139' bg: '#526057' } + + shape_and: { fg: '#55859b' attr: 'b' } + shape_binary: { fg: '#55859b' attr: 'b' } + shape_block: { fg: '#478c90' attr: 'b' } + shape_bool: '#1c9aa0' + shape_custom: '#489963' + shape_datetime: { fg: '#1c9aa0' attr: 'b' } + shape_directory: '#1c9aa0' + shape_external: '#1c9aa0' + shape_externalarg: { fg: '#489963' attr: 'b' } + shape_filepath: '#1c9aa0' + shape_flag: { fg: '#478c90' attr: 'b' } + shape_float: { fg: '#55859b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1c9aa0' attr: 'b' } + shape_int: { fg: '#55859b' attr: 'b' } + shape_internalcall: { fg: '#1c9aa0' attr: 'b' } + shape_list: { fg: '#1c9aa0' attr: 'b' } + shape_literal: '#478c90' + shape_match_pattern: '#489963' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1c9aa0' + shape_operator: '#a07e3b' + shape_or: { fg: '#55859b' attr: 'b' } + shape_pipe: { fg: '#55859b' attr: 'b' } + shape_range: { fg: '#a07e3b' attr: 'b' } + shape_record: { fg: '#1c9aa0' attr: 'b' } + shape_redirection: { fg: '#55859b' attr: 'b' } + shape_signature: { fg: '#489963' attr: 'b' } + shape_string: '#489963' + shape_string_interpolation: { fg: '#1c9aa0' attr: 'b' } + shape_table: { fg: '#478c90' attr: 'b' } + shape_variable: '#55859b' + + background: '#ecf4ee' + foreground: '#526057' + cursor: '#526057' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-savanna.nu b/themes/nu-themes/atelier-savanna.nu index 459053a..5c71107 100644 --- a/themes/nu-themes/atelier-savanna.nu +++ b/themes/nu-themes/atelier-savanna.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#87928a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#489963" attr: "b" } - empty: "#478c90" - bool: {|| if $in { "#1c9aa0" } else { "light_gray" } } - int: "#87928a" - filesize: {|e| - if $e == 0b { - "#87928a" - } else if $e < 1mb { - "#1c9aa0" - } else {{ fg: "#478c90" }} - } - duration: "#87928a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b16139" attr: "b" } - } else if $in < 6hr { - "#b16139" - } else if $in < 1day { - "#a07e3b" - } else if $in < 3day { - "#489963" - } else if $in < 1wk { - { fg: "#489963" attr: "b" } - } else if $in < 6wk { - "#1c9aa0" - } else if $in < 52wk { - "#478c90" - } else { "dark_gray" } - } - range: "#87928a" - float: "#87928a" - string: "#87928a" - nothing: "#87928a" - binary: "#87928a" - cellpath: "#87928a" - row_index: { fg: "#489963" attr: "b" } - record: "#87928a" - list: "#87928a" - block: "#87928a" - hints: "dark_gray" - search_result: { fg: "#b16139" bg: "#87928a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#55859b" attr: "b" } - shape_binary: { fg: "#55859b" attr: "b" } - shape_block: { fg: "#478c90" attr: "b" } - shape_bool: "#1c9aa0" - shape_custom: "#489963" - shape_datetime: { fg: "#1c9aa0" attr: "b" } - shape_directory: "#1c9aa0" - shape_external: "#1c9aa0" - shape_externalarg: { fg: "#489963" attr: "b" } - shape_filepath: "#1c9aa0" - shape_flag: { fg: "#478c90" attr: "b" } - shape_float: { fg: "#55859b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1c9aa0" attr: "b" } - shape_int: { fg: "#55859b" attr: "b" } - shape_internalcall: { fg: "#1c9aa0" attr: "b" } - shape_list: { fg: "#1c9aa0" attr: "b" } - shape_literal: "#478c90" - shape_match_pattern: "#489963" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1c9aa0" - shape_operator: "#a07e3b" - shape_or: { fg: "#55859b" attr: "b" } - shape_pipe: { fg: "#55859b" attr: "b" } - shape_range: { fg: "#a07e3b" attr: "b" } - shape_record: { fg: "#1c9aa0" attr: "b" } - shape_redirection: { fg: "#55859b" attr: "b" } - shape_signature: { fg: "#489963" attr: "b" } - shape_string: "#489963" - shape_string_interpolation: { fg: "#1c9aa0" attr: "b" } - shape_table: { fg: "#478c90" attr: "b" } - shape_variable: "#55859b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#171c19" - foreground: "#87928a" - cursor: "#87928a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#87928a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#489963' attr: 'b' } + empty: '#478c90' + bool: {|| if $in { '#1c9aa0' } else { 'light_gray' } } + int: '#87928a' + filesize: {|e| + if $e == 0b { + '#87928a' + } else if $e < 1mb { + '#1c9aa0' + } else {{ fg: '#478c90' }} + } + duration: '#87928a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b16139' attr: 'b' } + } else if $in < 6hr { + '#b16139' + } else if $in < 1day { + '#a07e3b' + } else if $in < 3day { + '#489963' + } else if $in < 1wk { + { fg: '#489963' attr: 'b' } + } else if $in < 6wk { + '#1c9aa0' + } else if $in < 52wk { + '#478c90' + } else { 'dark_gray' } + } + range: '#87928a' + float: '#87928a' + string: '#87928a' + nothing: '#87928a' + binary: '#87928a' + cellpath: '#87928a' + row_index: { fg: '#489963' attr: 'b' } + record: '#87928a' + list: '#87928a' + block: '#87928a' + hints: 'dark_gray' + search_result: { fg: '#b16139' bg: '#87928a' } + + shape_and: { fg: '#55859b' attr: 'b' } + shape_binary: { fg: '#55859b' attr: 'b' } + shape_block: { fg: '#478c90' attr: 'b' } + shape_bool: '#1c9aa0' + shape_custom: '#489963' + shape_datetime: { fg: '#1c9aa0' attr: 'b' } + shape_directory: '#1c9aa0' + shape_external: '#1c9aa0' + shape_externalarg: { fg: '#489963' attr: 'b' } + shape_filepath: '#1c9aa0' + shape_flag: { fg: '#478c90' attr: 'b' } + shape_float: { fg: '#55859b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1c9aa0' attr: 'b' } + shape_int: { fg: '#55859b' attr: 'b' } + shape_internalcall: { fg: '#1c9aa0' attr: 'b' } + shape_list: { fg: '#1c9aa0' attr: 'b' } + shape_literal: '#478c90' + shape_match_pattern: '#489963' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1c9aa0' + shape_operator: '#a07e3b' + shape_or: { fg: '#55859b' attr: 'b' } + shape_pipe: { fg: '#55859b' attr: 'b' } + shape_range: { fg: '#a07e3b' attr: 'b' } + shape_record: { fg: '#1c9aa0' attr: 'b' } + shape_redirection: { fg: '#55859b' attr: 'b' } + shape_signature: { fg: '#489963' attr: 'b' } + shape_string: '#489963' + shape_string_interpolation: { fg: '#1c9aa0' attr: 'b' } + shape_table: { fg: '#478c90' attr: 'b' } + shape_variable: '#55859b' + + background: '#171c19' + foreground: '#87928a' + cursor: '#87928a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-seaside-light.nu b/themes/nu-themes/atelier-seaside-light.nu index a4aaa7a..9493d3f 100644 --- a/themes/nu-themes/atelier-seaside-light.nu +++ b/themes/nu-themes/atelier-seaside-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5e6e5e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#29a329" attr: "b" } - empty: "#3d62f5" - bool: {|| if $in { "#1999b3" } else { "light_gray" } } - int: "#5e6e5e" - filesize: {|e| - if $e == 0b { - "#5e6e5e" - } else if $e < 1mb { - "#1999b3" - } else {{ fg: "#3d62f5" }} - } - duration: "#5e6e5e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e6193c" attr: "b" } - } else if $in < 6hr { - "#e6193c" - } else if $in < 1day { - "#98981b" - } else if $in < 3day { - "#29a329" - } else if $in < 1wk { - { fg: "#29a329" attr: "b" } - } else if $in < 6wk { - "#1999b3" - } else if $in < 52wk { - "#3d62f5" - } else { "dark_gray" } - } - range: "#5e6e5e" - float: "#5e6e5e" - string: "#5e6e5e" - nothing: "#5e6e5e" - binary: "#5e6e5e" - cellpath: "#5e6e5e" - row_index: { fg: "#29a329" attr: "b" } - record: "#5e6e5e" - list: "#5e6e5e" - block: "#5e6e5e" - hints: "dark_gray" - search_result: { fg: "#e6193c" bg: "#5e6e5e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ad2bee" attr: "b" } - shape_binary: { fg: "#ad2bee" attr: "b" } - shape_block: { fg: "#3d62f5" attr: "b" } - shape_bool: "#1999b3" - shape_custom: "#29a329" - shape_datetime: { fg: "#1999b3" attr: "b" } - shape_directory: "#1999b3" - shape_external: "#1999b3" - shape_externalarg: { fg: "#29a329" attr: "b" } - shape_filepath: "#1999b3" - shape_flag: { fg: "#3d62f5" attr: "b" } - shape_float: { fg: "#ad2bee" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1999b3" attr: "b" } - shape_int: { fg: "#ad2bee" attr: "b" } - shape_internalcall: { fg: "#1999b3" attr: "b" } - shape_list: { fg: "#1999b3" attr: "b" } - shape_literal: "#3d62f5" - shape_match_pattern: "#29a329" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1999b3" - shape_operator: "#98981b" - shape_or: { fg: "#ad2bee" attr: "b" } - shape_pipe: { fg: "#ad2bee" attr: "b" } - shape_range: { fg: "#98981b" attr: "b" } - shape_record: { fg: "#1999b3" attr: "b" } - shape_redirection: { fg: "#ad2bee" attr: "b" } - shape_signature: { fg: "#29a329" attr: "b" } - shape_string: "#29a329" - shape_string_interpolation: { fg: "#1999b3" attr: "b" } - shape_table: { fg: "#3d62f5" attr: "b" } - shape_variable: "#ad2bee" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f4fbf4" - foreground: "#5e6e5e" - cursor: "#5e6e5e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5e6e5e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#29a329' attr: 'b' } + empty: '#3d62f5' + bool: {|| if $in { '#1999b3' } else { 'light_gray' } } + int: '#5e6e5e' + filesize: {|e| + if $e == 0b { + '#5e6e5e' + } else if $e < 1mb { + '#1999b3' + } else {{ fg: '#3d62f5' }} + } + duration: '#5e6e5e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e6193c' attr: 'b' } + } else if $in < 6hr { + '#e6193c' + } else if $in < 1day { + '#98981b' + } else if $in < 3day { + '#29a329' + } else if $in < 1wk { + { fg: '#29a329' attr: 'b' } + } else if $in < 6wk { + '#1999b3' + } else if $in < 52wk { + '#3d62f5' + } else { 'dark_gray' } + } + range: '#5e6e5e' + float: '#5e6e5e' + string: '#5e6e5e' + nothing: '#5e6e5e' + binary: '#5e6e5e' + cellpath: '#5e6e5e' + row_index: { fg: '#29a329' attr: 'b' } + record: '#5e6e5e' + list: '#5e6e5e' + block: '#5e6e5e' + hints: 'dark_gray' + search_result: { fg: '#e6193c' bg: '#5e6e5e' } + + shape_and: { fg: '#ad2bee' attr: 'b' } + shape_binary: { fg: '#ad2bee' attr: 'b' } + shape_block: { fg: '#3d62f5' attr: 'b' } + shape_bool: '#1999b3' + shape_custom: '#29a329' + shape_datetime: { fg: '#1999b3' attr: 'b' } + shape_directory: '#1999b3' + shape_external: '#1999b3' + shape_externalarg: { fg: '#29a329' attr: 'b' } + shape_filepath: '#1999b3' + shape_flag: { fg: '#3d62f5' attr: 'b' } + shape_float: { fg: '#ad2bee' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1999b3' attr: 'b' } + shape_int: { fg: '#ad2bee' attr: 'b' } + shape_internalcall: { fg: '#1999b3' attr: 'b' } + shape_list: { fg: '#1999b3' attr: 'b' } + shape_literal: '#3d62f5' + shape_match_pattern: '#29a329' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1999b3' + shape_operator: '#98981b' + shape_or: { fg: '#ad2bee' attr: 'b' } + shape_pipe: { fg: '#ad2bee' attr: 'b' } + shape_range: { fg: '#98981b' attr: 'b' } + shape_record: { fg: '#1999b3' attr: 'b' } + shape_redirection: { fg: '#ad2bee' attr: 'b' } + shape_signature: { fg: '#29a329' attr: 'b' } + shape_string: '#29a329' + shape_string_interpolation: { fg: '#1999b3' attr: 'b' } + shape_table: { fg: '#3d62f5' attr: 'b' } + shape_variable: '#ad2bee' + + background: '#f4fbf4' + foreground: '#5e6e5e' + cursor: '#5e6e5e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-seaside.nu b/themes/nu-themes/atelier-seaside.nu index 4f7b583..df0832c 100644 --- a/themes/nu-themes/atelier-seaside.nu +++ b/themes/nu-themes/atelier-seaside.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8ca68c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#29a329" attr: "b" } - empty: "#3d62f5" - bool: {|| if $in { "#1999b3" } else { "light_gray" } } - int: "#8ca68c" - filesize: {|e| - if $e == 0b { - "#8ca68c" - } else if $e < 1mb { - "#1999b3" - } else {{ fg: "#3d62f5" }} - } - duration: "#8ca68c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e6193c" attr: "b" } - } else if $in < 6hr { - "#e6193c" - } else if $in < 1day { - "#98981b" - } else if $in < 3day { - "#29a329" - } else if $in < 1wk { - { fg: "#29a329" attr: "b" } - } else if $in < 6wk { - "#1999b3" - } else if $in < 52wk { - "#3d62f5" - } else { "dark_gray" } - } - range: "#8ca68c" - float: "#8ca68c" - string: "#8ca68c" - nothing: "#8ca68c" - binary: "#8ca68c" - cellpath: "#8ca68c" - row_index: { fg: "#29a329" attr: "b" } - record: "#8ca68c" - list: "#8ca68c" - block: "#8ca68c" - hints: "dark_gray" - search_result: { fg: "#e6193c" bg: "#8ca68c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ad2bee" attr: "b" } - shape_binary: { fg: "#ad2bee" attr: "b" } - shape_block: { fg: "#3d62f5" attr: "b" } - shape_bool: "#1999b3" - shape_custom: "#29a329" - shape_datetime: { fg: "#1999b3" attr: "b" } - shape_directory: "#1999b3" - shape_external: "#1999b3" - shape_externalarg: { fg: "#29a329" attr: "b" } - shape_filepath: "#1999b3" - shape_flag: { fg: "#3d62f5" attr: "b" } - shape_float: { fg: "#ad2bee" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1999b3" attr: "b" } - shape_int: { fg: "#ad2bee" attr: "b" } - shape_internalcall: { fg: "#1999b3" attr: "b" } - shape_list: { fg: "#1999b3" attr: "b" } - shape_literal: "#3d62f5" - shape_match_pattern: "#29a329" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1999b3" - shape_operator: "#98981b" - shape_or: { fg: "#ad2bee" attr: "b" } - shape_pipe: { fg: "#ad2bee" attr: "b" } - shape_range: { fg: "#98981b" attr: "b" } - shape_record: { fg: "#1999b3" attr: "b" } - shape_redirection: { fg: "#ad2bee" attr: "b" } - shape_signature: { fg: "#29a329" attr: "b" } - shape_string: "#29a329" - shape_string_interpolation: { fg: "#1999b3" attr: "b" } - shape_table: { fg: "#3d62f5" attr: "b" } - shape_variable: "#ad2bee" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#131513" - foreground: "#8ca68c" - cursor: "#8ca68c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8ca68c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#29a329' attr: 'b' } + empty: '#3d62f5' + bool: {|| if $in { '#1999b3' } else { 'light_gray' } } + int: '#8ca68c' + filesize: {|e| + if $e == 0b { + '#8ca68c' + } else if $e < 1mb { + '#1999b3' + } else {{ fg: '#3d62f5' }} + } + duration: '#8ca68c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e6193c' attr: 'b' } + } else if $in < 6hr { + '#e6193c' + } else if $in < 1day { + '#98981b' + } else if $in < 3day { + '#29a329' + } else if $in < 1wk { + { fg: '#29a329' attr: 'b' } + } else if $in < 6wk { + '#1999b3' + } else if $in < 52wk { + '#3d62f5' + } else { 'dark_gray' } + } + range: '#8ca68c' + float: '#8ca68c' + string: '#8ca68c' + nothing: '#8ca68c' + binary: '#8ca68c' + cellpath: '#8ca68c' + row_index: { fg: '#29a329' attr: 'b' } + record: '#8ca68c' + list: '#8ca68c' + block: '#8ca68c' + hints: 'dark_gray' + search_result: { fg: '#e6193c' bg: '#8ca68c' } + + shape_and: { fg: '#ad2bee' attr: 'b' } + shape_binary: { fg: '#ad2bee' attr: 'b' } + shape_block: { fg: '#3d62f5' attr: 'b' } + shape_bool: '#1999b3' + shape_custom: '#29a329' + shape_datetime: { fg: '#1999b3' attr: 'b' } + shape_directory: '#1999b3' + shape_external: '#1999b3' + shape_externalarg: { fg: '#29a329' attr: 'b' } + shape_filepath: '#1999b3' + shape_flag: { fg: '#3d62f5' attr: 'b' } + shape_float: { fg: '#ad2bee' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1999b3' attr: 'b' } + shape_int: { fg: '#ad2bee' attr: 'b' } + shape_internalcall: { fg: '#1999b3' attr: 'b' } + shape_list: { fg: '#1999b3' attr: 'b' } + shape_literal: '#3d62f5' + shape_match_pattern: '#29a329' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1999b3' + shape_operator: '#98981b' + shape_or: { fg: '#ad2bee' attr: 'b' } + shape_pipe: { fg: '#ad2bee' attr: 'b' } + shape_range: { fg: '#98981b' attr: 'b' } + shape_record: { fg: '#1999b3' attr: 'b' } + shape_redirection: { fg: '#ad2bee' attr: 'b' } + shape_signature: { fg: '#29a329' attr: 'b' } + shape_string: '#29a329' + shape_string_interpolation: { fg: '#1999b3' attr: 'b' } + shape_table: { fg: '#3d62f5' attr: 'b' } + shape_variable: '#ad2bee' + + background: '#131513' + foreground: '#8ca68c' + cursor: '#8ca68c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-sulphurpool-light.nu b/themes/nu-themes/atelier-sulphurpool-light.nu index 8c4ba75..a0f6fbb 100644 --- a/themes/nu-themes/atelier-sulphurpool-light.nu +++ b/themes/nu-themes/atelier-sulphurpool-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5e6687" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ac9739" attr: "b" } - empty: "#3d8fd1" - bool: {|| if $in { "#22a2c9" } else { "light_gray" } } - int: "#5e6687" - filesize: {|e| - if $e == 0b { - "#5e6687" - } else if $e < 1mb { - "#22a2c9" - } else {{ fg: "#3d8fd1" }} - } - duration: "#5e6687" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c94922" attr: "b" } - } else if $in < 6hr { - "#c94922" - } else if $in < 1day { - "#c08b30" - } else if $in < 3day { - "#ac9739" - } else if $in < 1wk { - { fg: "#ac9739" attr: "b" } - } else if $in < 6wk { - "#22a2c9" - } else if $in < 52wk { - "#3d8fd1" - } else { "dark_gray" } - } - range: "#5e6687" - float: "#5e6687" - string: "#5e6687" - nothing: "#5e6687" - binary: "#5e6687" - cellpath: "#5e6687" - row_index: { fg: "#ac9739" attr: "b" } - record: "#5e6687" - list: "#5e6687" - block: "#5e6687" - hints: "dark_gray" - search_result: { fg: "#c94922" bg: "#5e6687" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6679cc" attr: "b" } - shape_binary: { fg: "#6679cc" attr: "b" } - shape_block: { fg: "#3d8fd1" attr: "b" } - shape_bool: "#22a2c9" - shape_custom: "#ac9739" - shape_datetime: { fg: "#22a2c9" attr: "b" } - shape_directory: "#22a2c9" - shape_external: "#22a2c9" - shape_externalarg: { fg: "#ac9739" attr: "b" } - shape_filepath: "#22a2c9" - shape_flag: { fg: "#3d8fd1" attr: "b" } - shape_float: { fg: "#6679cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#22a2c9" attr: "b" } - shape_int: { fg: "#6679cc" attr: "b" } - shape_internalcall: { fg: "#22a2c9" attr: "b" } - shape_list: { fg: "#22a2c9" attr: "b" } - shape_literal: "#3d8fd1" - shape_match_pattern: "#ac9739" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#22a2c9" - shape_operator: "#c08b30" - shape_or: { fg: "#6679cc" attr: "b" } - shape_pipe: { fg: "#6679cc" attr: "b" } - shape_range: { fg: "#c08b30" attr: "b" } - shape_record: { fg: "#22a2c9" attr: "b" } - shape_redirection: { fg: "#6679cc" attr: "b" } - shape_signature: { fg: "#ac9739" attr: "b" } - shape_string: "#ac9739" - shape_string_interpolation: { fg: "#22a2c9" attr: "b" } - shape_table: { fg: "#3d8fd1" attr: "b" } - shape_variable: "#6679cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f5f7ff" - foreground: "#5e6687" - cursor: "#5e6687" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5e6687' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ac9739' attr: 'b' } + empty: '#3d8fd1' + bool: {|| if $in { '#22a2c9' } else { 'light_gray' } } + int: '#5e6687' + filesize: {|e| + if $e == 0b { + '#5e6687' + } else if $e < 1mb { + '#22a2c9' + } else {{ fg: '#3d8fd1' }} + } + duration: '#5e6687' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c94922' attr: 'b' } + } else if $in < 6hr { + '#c94922' + } else if $in < 1day { + '#c08b30' + } else if $in < 3day { + '#ac9739' + } else if $in < 1wk { + { fg: '#ac9739' attr: 'b' } + } else if $in < 6wk { + '#22a2c9' + } else if $in < 52wk { + '#3d8fd1' + } else { 'dark_gray' } + } + range: '#5e6687' + float: '#5e6687' + string: '#5e6687' + nothing: '#5e6687' + binary: '#5e6687' + cellpath: '#5e6687' + row_index: { fg: '#ac9739' attr: 'b' } + record: '#5e6687' + list: '#5e6687' + block: '#5e6687' + hints: 'dark_gray' + search_result: { fg: '#c94922' bg: '#5e6687' } + + shape_and: { fg: '#6679cc' attr: 'b' } + shape_binary: { fg: '#6679cc' attr: 'b' } + shape_block: { fg: '#3d8fd1' attr: 'b' } + shape_bool: '#22a2c9' + shape_custom: '#ac9739' + shape_datetime: { fg: '#22a2c9' attr: 'b' } + shape_directory: '#22a2c9' + shape_external: '#22a2c9' + shape_externalarg: { fg: '#ac9739' attr: 'b' } + shape_filepath: '#22a2c9' + shape_flag: { fg: '#3d8fd1' attr: 'b' } + shape_float: { fg: '#6679cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#22a2c9' attr: 'b' } + shape_int: { fg: '#6679cc' attr: 'b' } + shape_internalcall: { fg: '#22a2c9' attr: 'b' } + shape_list: { fg: '#22a2c9' attr: 'b' } + shape_literal: '#3d8fd1' + shape_match_pattern: '#ac9739' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#22a2c9' + shape_operator: '#c08b30' + shape_or: { fg: '#6679cc' attr: 'b' } + shape_pipe: { fg: '#6679cc' attr: 'b' } + shape_range: { fg: '#c08b30' attr: 'b' } + shape_record: { fg: '#22a2c9' attr: 'b' } + shape_redirection: { fg: '#6679cc' attr: 'b' } + shape_signature: { fg: '#ac9739' attr: 'b' } + shape_string: '#ac9739' + shape_string_interpolation: { fg: '#22a2c9' attr: 'b' } + shape_table: { fg: '#3d8fd1' attr: 'b' } + shape_variable: '#6679cc' + + background: '#f5f7ff' + foreground: '#5e6687' + cursor: '#5e6687' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atelier-sulphurpool.nu b/themes/nu-themes/atelier-sulphurpool.nu index 355aa81..54f7f54 100644 --- a/themes/nu-themes/atelier-sulphurpool.nu +++ b/themes/nu-themes/atelier-sulphurpool.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#979db4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ac9739" attr: "b" } - empty: "#3d8fd1" - bool: {|| if $in { "#22a2c9" } else { "light_gray" } } - int: "#979db4" - filesize: {|e| - if $e == 0b { - "#979db4" - } else if $e < 1mb { - "#22a2c9" - } else {{ fg: "#3d8fd1" }} - } - duration: "#979db4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c94922" attr: "b" } - } else if $in < 6hr { - "#c94922" - } else if $in < 1day { - "#c08b30" - } else if $in < 3day { - "#ac9739" - } else if $in < 1wk { - { fg: "#ac9739" attr: "b" } - } else if $in < 6wk { - "#22a2c9" - } else if $in < 52wk { - "#3d8fd1" - } else { "dark_gray" } - } - range: "#979db4" - float: "#979db4" - string: "#979db4" - nothing: "#979db4" - binary: "#979db4" - cellpath: "#979db4" - row_index: { fg: "#ac9739" attr: "b" } - record: "#979db4" - list: "#979db4" - block: "#979db4" - hints: "dark_gray" - search_result: { fg: "#c94922" bg: "#979db4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6679cc" attr: "b" } - shape_binary: { fg: "#6679cc" attr: "b" } - shape_block: { fg: "#3d8fd1" attr: "b" } - shape_bool: "#22a2c9" - shape_custom: "#ac9739" - shape_datetime: { fg: "#22a2c9" attr: "b" } - shape_directory: "#22a2c9" - shape_external: "#22a2c9" - shape_externalarg: { fg: "#ac9739" attr: "b" } - shape_filepath: "#22a2c9" - shape_flag: { fg: "#3d8fd1" attr: "b" } - shape_float: { fg: "#6679cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#22a2c9" attr: "b" } - shape_int: { fg: "#6679cc" attr: "b" } - shape_internalcall: { fg: "#22a2c9" attr: "b" } - shape_list: { fg: "#22a2c9" attr: "b" } - shape_literal: "#3d8fd1" - shape_match_pattern: "#ac9739" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#22a2c9" - shape_operator: "#c08b30" - shape_or: { fg: "#6679cc" attr: "b" } - shape_pipe: { fg: "#6679cc" attr: "b" } - shape_range: { fg: "#c08b30" attr: "b" } - shape_record: { fg: "#22a2c9" attr: "b" } - shape_redirection: { fg: "#6679cc" attr: "b" } - shape_signature: { fg: "#ac9739" attr: "b" } - shape_string: "#ac9739" - shape_string_interpolation: { fg: "#22a2c9" attr: "b" } - shape_table: { fg: "#3d8fd1" attr: "b" } - shape_variable: "#6679cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#202746" - foreground: "#979db4" - cursor: "#979db4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#979db4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ac9739' attr: 'b' } + empty: '#3d8fd1' + bool: {|| if $in { '#22a2c9' } else { 'light_gray' } } + int: '#979db4' + filesize: {|e| + if $e == 0b { + '#979db4' + } else if $e < 1mb { + '#22a2c9' + } else {{ fg: '#3d8fd1' }} + } + duration: '#979db4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c94922' attr: 'b' } + } else if $in < 6hr { + '#c94922' + } else if $in < 1day { + '#c08b30' + } else if $in < 3day { + '#ac9739' + } else if $in < 1wk { + { fg: '#ac9739' attr: 'b' } + } else if $in < 6wk { + '#22a2c9' + } else if $in < 52wk { + '#3d8fd1' + } else { 'dark_gray' } + } + range: '#979db4' + float: '#979db4' + string: '#979db4' + nothing: '#979db4' + binary: '#979db4' + cellpath: '#979db4' + row_index: { fg: '#ac9739' attr: 'b' } + record: '#979db4' + list: '#979db4' + block: '#979db4' + hints: 'dark_gray' + search_result: { fg: '#c94922' bg: '#979db4' } + + shape_and: { fg: '#6679cc' attr: 'b' } + shape_binary: { fg: '#6679cc' attr: 'b' } + shape_block: { fg: '#3d8fd1' attr: 'b' } + shape_bool: '#22a2c9' + shape_custom: '#ac9739' + shape_datetime: { fg: '#22a2c9' attr: 'b' } + shape_directory: '#22a2c9' + shape_external: '#22a2c9' + shape_externalarg: { fg: '#ac9739' attr: 'b' } + shape_filepath: '#22a2c9' + shape_flag: { fg: '#3d8fd1' attr: 'b' } + shape_float: { fg: '#6679cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#22a2c9' attr: 'b' } + shape_int: { fg: '#6679cc' attr: 'b' } + shape_internalcall: { fg: '#22a2c9' attr: 'b' } + shape_list: { fg: '#22a2c9' attr: 'b' } + shape_literal: '#3d8fd1' + shape_match_pattern: '#ac9739' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#22a2c9' + shape_operator: '#c08b30' + shape_or: { fg: '#6679cc' attr: 'b' } + shape_pipe: { fg: '#6679cc' attr: 'b' } + shape_range: { fg: '#c08b30' attr: 'b' } + shape_record: { fg: '#22a2c9' attr: 'b' } + shape_redirection: { fg: '#6679cc' attr: 'b' } + shape_signature: { fg: '#ac9739' attr: 'b' } + shape_string: '#ac9739' + shape_string_interpolation: { fg: '#22a2c9' attr: 'b' } + shape_table: { fg: '#3d8fd1' attr: 'b' } + shape_variable: '#6679cc' + + background: '#202746' + foreground: '#979db4' + cursor: '#979db4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atlas.nu b/themes/nu-themes/atlas.nu index a726873..4617242 100644 --- a/themes/nu-themes/atlas.nu +++ b/themes/nu-themes/atlas.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a1a19a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7fc06e" attr: "b" } - empty: "#5dd7b9" - bool: {|| if $in { "#14747e" } else { "light_gray" } } - int: "#a1a19a" - filesize: {|e| - if $e == 0b { - "#a1a19a" - } else if $e < 1mb { - "#14747e" - } else {{ fg: "#5dd7b9" }} - } - duration: "#a1a19a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff5a67" attr: "b" } - } else if $in < 6hr { - "#ff5a67" - } else if $in < 1day { - "#ffcc1b" - } else if $in < 3day { - "#7fc06e" - } else if $in < 1wk { - { fg: "#7fc06e" attr: "b" } - } else if $in < 6wk { - "#14747e" - } else if $in < 52wk { - "#5dd7b9" - } else { "dark_gray" } - } - range: "#a1a19a" - float: "#a1a19a" - string: "#a1a19a" - nothing: "#a1a19a" - binary: "#a1a19a" - cellpath: "#a1a19a" - row_index: { fg: "#7fc06e" attr: "b" } - record: "#a1a19a" - list: "#a1a19a" - block: "#a1a19a" - hints: "dark_gray" - search_result: { fg: "#ff5a67" bg: "#a1a19a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9a70a4" attr: "b" } - shape_binary: { fg: "#9a70a4" attr: "b" } - shape_block: { fg: "#5dd7b9" attr: "b" } - shape_bool: "#14747e" - shape_custom: "#7fc06e" - shape_datetime: { fg: "#14747e" attr: "b" } - shape_directory: "#14747e" - shape_external: "#14747e" - shape_externalarg: { fg: "#7fc06e" attr: "b" } - shape_filepath: "#14747e" - shape_flag: { fg: "#5dd7b9" attr: "b" } - shape_float: { fg: "#9a70a4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#14747e" attr: "b" } - shape_int: { fg: "#9a70a4" attr: "b" } - shape_internalcall: { fg: "#14747e" attr: "b" } - shape_list: { fg: "#14747e" attr: "b" } - shape_literal: "#5dd7b9" - shape_match_pattern: "#7fc06e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#14747e" - shape_operator: "#ffcc1b" - shape_or: { fg: "#9a70a4" attr: "b" } - shape_pipe: { fg: "#9a70a4" attr: "b" } - shape_range: { fg: "#ffcc1b" attr: "b" } - shape_record: { fg: "#14747e" attr: "b" } - shape_redirection: { fg: "#9a70a4" attr: "b" } - shape_signature: { fg: "#7fc06e" attr: "b" } - shape_string: "#7fc06e" - shape_string_interpolation: { fg: "#14747e" attr: "b" } - shape_table: { fg: "#5dd7b9" attr: "b" } - shape_variable: "#9a70a4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#002635" - foreground: "#a1a19a" - cursor: "#a1a19a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a1a19a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7fc06e' attr: 'b' } + empty: '#5dd7b9' + bool: {|| if $in { '#14747e' } else { 'light_gray' } } + int: '#a1a19a' + filesize: {|e| + if $e == 0b { + '#a1a19a' + } else if $e < 1mb { + '#14747e' + } else {{ fg: '#5dd7b9' }} + } + duration: '#a1a19a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff5a67' attr: 'b' } + } else if $in < 6hr { + '#ff5a67' + } else if $in < 1day { + '#ffcc1b' + } else if $in < 3day { + '#7fc06e' + } else if $in < 1wk { + { fg: '#7fc06e' attr: 'b' } + } else if $in < 6wk { + '#14747e' + } else if $in < 52wk { + '#5dd7b9' + } else { 'dark_gray' } + } + range: '#a1a19a' + float: '#a1a19a' + string: '#a1a19a' + nothing: '#a1a19a' + binary: '#a1a19a' + cellpath: '#a1a19a' + row_index: { fg: '#7fc06e' attr: 'b' } + record: '#a1a19a' + list: '#a1a19a' + block: '#a1a19a' + hints: 'dark_gray' + search_result: { fg: '#ff5a67' bg: '#a1a19a' } + + shape_and: { fg: '#9a70a4' attr: 'b' } + shape_binary: { fg: '#9a70a4' attr: 'b' } + shape_block: { fg: '#5dd7b9' attr: 'b' } + shape_bool: '#14747e' + shape_custom: '#7fc06e' + shape_datetime: { fg: '#14747e' attr: 'b' } + shape_directory: '#14747e' + shape_external: '#14747e' + shape_externalarg: { fg: '#7fc06e' attr: 'b' } + shape_filepath: '#14747e' + shape_flag: { fg: '#5dd7b9' attr: 'b' } + shape_float: { fg: '#9a70a4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#14747e' attr: 'b' } + shape_int: { fg: '#9a70a4' attr: 'b' } + shape_internalcall: { fg: '#14747e' attr: 'b' } + shape_list: { fg: '#14747e' attr: 'b' } + shape_literal: '#5dd7b9' + shape_match_pattern: '#7fc06e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#14747e' + shape_operator: '#ffcc1b' + shape_or: { fg: '#9a70a4' attr: 'b' } + shape_pipe: { fg: '#9a70a4' attr: 'b' } + shape_range: { fg: '#ffcc1b' attr: 'b' } + shape_record: { fg: '#14747e' attr: 'b' } + shape_redirection: { fg: '#9a70a4' attr: 'b' } + shape_signature: { fg: '#7fc06e' attr: 'b' } + shape_string: '#7fc06e' + shape_string_interpolation: { fg: '#14747e' attr: 'b' } + shape_table: { fg: '#5dd7b9' attr: 'b' } + shape_variable: '#9a70a4' + + background: '#002635' + foreground: '#a1a19a' + cursor: '#a1a19a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atom-one-light.nu b/themes/nu-themes/atom-one-light.nu index e75f2b8..e8a6cb9 100644 --- a/themes/nu-themes/atom-one-light.nu +++ b/themes/nu-themes/atom-one-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3e953a" attr: "b" } - empty: "#2f5af3" - bool: {|| if $in { "#3e953a" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#3e953a" - } else {{ fg: "#2f5af3" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#de3d35" attr: "b" } - } else if $in < 6hr { - "#de3d35" - } else if $in < 1day { - "#d2b67b" - } else if $in < 3day { - "#3e953a" - } else if $in < 1wk { - { fg: "#3e953a" attr: "b" } - } else if $in < 6wk { - "#3e953a" - } else if $in < 52wk { - "#2f5af3" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#3e953a" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#de3d35" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#950095" attr: "b" } - shape_binary: { fg: "#950095" attr: "b" } - shape_block: { fg: "#2f5af3" attr: "b" } - shape_bool: "#3e953a" - shape_custom: "#3e953a" - shape_datetime: { fg: "#3e953a" attr: "b" } - shape_directory: "#3e953a" - shape_external: "#3e953a" - shape_externalarg: { fg: "#3e953a" attr: "b" } - shape_filepath: "#3e953a" - shape_flag: { fg: "#2f5af3" attr: "b" } - shape_float: { fg: "#950095" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3e953a" attr: "b" } - shape_int: { fg: "#950095" attr: "b" } - shape_internalcall: { fg: "#3e953a" attr: "b" } - shape_list: { fg: "#3e953a" attr: "b" } - shape_literal: "#2f5af3" - shape_match_pattern: "#3e953a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3e953a" - shape_operator: "#d2b67b" - shape_or: { fg: "#950095" attr: "b" } - shape_pipe: { fg: "#950095" attr: "b" } - shape_range: { fg: "#d2b67b" attr: "b" } - shape_record: { fg: "#3e953a" attr: "b" } - shape_redirection: { fg: "#950095" attr: "b" } - shape_signature: { fg: "#3e953a" attr: "b" } - shape_string: "#3e953a" - shape_string_interpolation: { fg: "#3e953a" attr: "b" } - shape_table: { fg: "#2f5af3" attr: "b" } - shape_variable: "#950095" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f8f8" - foreground: "#2a2b33" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3e953a' attr: 'b' } + empty: '#2f5af3' + bool: {|| if $in { '#3e953a' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#3e953a' + } else {{ fg: '#2f5af3' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#de3d35' attr: 'b' } + } else if $in < 6hr { + '#de3d35' + } else if $in < 1day { + '#d2b67b' + } else if $in < 3day { + '#3e953a' + } else if $in < 1wk { + { fg: '#3e953a' attr: 'b' } + } else if $in < 6wk { + '#3e953a' + } else if $in < 52wk { + '#2f5af3' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#3e953a' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#de3d35' bg: '#bbbbbb' } + + shape_and: { fg: '#950095' attr: 'b' } + shape_binary: { fg: '#950095' attr: 'b' } + shape_block: { fg: '#2f5af3' attr: 'b' } + shape_bool: '#3e953a' + shape_custom: '#3e953a' + shape_datetime: { fg: '#3e953a' attr: 'b' } + shape_directory: '#3e953a' + shape_external: '#3e953a' + shape_externalarg: { fg: '#3e953a' attr: 'b' } + shape_filepath: '#3e953a' + shape_flag: { fg: '#2f5af3' attr: 'b' } + shape_float: { fg: '#950095' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3e953a' attr: 'b' } + shape_int: { fg: '#950095' attr: 'b' } + shape_internalcall: { fg: '#3e953a' attr: 'b' } + shape_list: { fg: '#3e953a' attr: 'b' } + shape_literal: '#2f5af3' + shape_match_pattern: '#3e953a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3e953a' + shape_operator: '#d2b67b' + shape_or: { fg: '#950095' attr: 'b' } + shape_pipe: { fg: '#950095' attr: 'b' } + shape_range: { fg: '#d2b67b' attr: 'b' } + shape_record: { fg: '#3e953a' attr: 'b' } + shape_redirection: { fg: '#950095' attr: 'b' } + shape_signature: { fg: '#3e953a' attr: 'b' } + shape_string: '#3e953a' + shape_string_interpolation: { fg: '#3e953a' attr: 'b' } + shape_table: { fg: '#2f5af3' attr: 'b' } + shape_variable: '#950095' + + background: '#f8f8f8' + foreground: '#2a2b33' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/atom.nu b/themes/nu-themes/atom.nu index 975386c..29b2b5b 100644 --- a/themes/nu-themes/atom.nu +++ b/themes/nu-themes/atom.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0e0e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87c38a" attr: "b" } - empty: "#85befd" - bool: {|| if $in { "#85befd" } else { "light_gray" } } - int: "#e0e0e0" - filesize: {|e| - if $e == 0b { - "#e0e0e0" - } else if $e < 1mb { - "#85befd" - } else {{ fg: "#85befd" }} - } - duration: "#e0e0e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fd5ff1" attr: "b" } - } else if $in < 6hr { - "#fd5ff1" - } else if $in < 1day { - "#ffd7b1" - } else if $in < 3day { - "#87c38a" - } else if $in < 1wk { - { fg: "#87c38a" attr: "b" } - } else if $in < 6wk { - "#85befd" - } else if $in < 52wk { - "#85befd" - } else { "dark_gray" } - } - range: "#e0e0e0" - float: "#e0e0e0" - string: "#e0e0e0" - nothing: "#e0e0e0" - binary: "#e0e0e0" - cellpath: "#e0e0e0" - row_index: { fg: "#87c38a" attr: "b" } - record: "#e0e0e0" - list: "#e0e0e0" - block: "#e0e0e0" - hints: "dark_gray" - search_result: { fg: "#fd5ff1" bg: "#e0e0e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b9b6fc" attr: "b" } - shape_binary: { fg: "#b9b6fc" attr: "b" } - shape_block: { fg: "#85befd" attr: "b" } - shape_bool: "#85befd" - shape_custom: "#87c38a" - shape_datetime: { fg: "#85befd" attr: "b" } - shape_directory: "#85befd" - shape_external: "#85befd" - shape_externalarg: { fg: "#87c38a" attr: "b" } - shape_filepath: "#85befd" - shape_flag: { fg: "#85befd" attr: "b" } - shape_float: { fg: "#b9b6fc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#85befd" attr: "b" } - shape_int: { fg: "#b9b6fc" attr: "b" } - shape_internalcall: { fg: "#85befd" attr: "b" } - shape_list: { fg: "#85befd" attr: "b" } - shape_literal: "#85befd" - shape_match_pattern: "#87c38a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#85befd" - shape_operator: "#ffd7b1" - shape_or: { fg: "#b9b6fc" attr: "b" } - shape_pipe: { fg: "#b9b6fc" attr: "b" } - shape_range: { fg: "#ffd7b1" attr: "b" } - shape_record: { fg: "#85befd" attr: "b" } - shape_redirection: { fg: "#b9b6fc" attr: "b" } - shape_signature: { fg: "#87c38a" attr: "b" } - shape_string: "#87c38a" - shape_string_interpolation: { fg: "#85befd" attr: "b" } - shape_table: { fg: "#85befd" attr: "b" } - shape_variable: "#b9b6fc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#161719" - foreground: "#c5c8c6" - cursor: "#c5c8c6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0e0e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87c38a' attr: 'b' } + empty: '#85befd' + bool: {|| if $in { '#85befd' } else { 'light_gray' } } + int: '#e0e0e0' + filesize: {|e| + if $e == 0b { + '#e0e0e0' + } else if $e < 1mb { + '#85befd' + } else {{ fg: '#85befd' }} + } + duration: '#e0e0e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fd5ff1' attr: 'b' } + } else if $in < 6hr { + '#fd5ff1' + } else if $in < 1day { + '#ffd7b1' + } else if $in < 3day { + '#87c38a' + } else if $in < 1wk { + { fg: '#87c38a' attr: 'b' } + } else if $in < 6wk { + '#85befd' + } else if $in < 52wk { + '#85befd' + } else { 'dark_gray' } + } + range: '#e0e0e0' + float: '#e0e0e0' + string: '#e0e0e0' + nothing: '#e0e0e0' + binary: '#e0e0e0' + cellpath: '#e0e0e0' + row_index: { fg: '#87c38a' attr: 'b' } + record: '#e0e0e0' + list: '#e0e0e0' + block: '#e0e0e0' + hints: 'dark_gray' + search_result: { fg: '#fd5ff1' bg: '#e0e0e0' } + + shape_and: { fg: '#b9b6fc' attr: 'b' } + shape_binary: { fg: '#b9b6fc' attr: 'b' } + shape_block: { fg: '#85befd' attr: 'b' } + shape_bool: '#85befd' + shape_custom: '#87c38a' + shape_datetime: { fg: '#85befd' attr: 'b' } + shape_directory: '#85befd' + shape_external: '#85befd' + shape_externalarg: { fg: '#87c38a' attr: 'b' } + shape_filepath: '#85befd' + shape_flag: { fg: '#85befd' attr: 'b' } + shape_float: { fg: '#b9b6fc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#85befd' attr: 'b' } + shape_int: { fg: '#b9b6fc' attr: 'b' } + shape_internalcall: { fg: '#85befd' attr: 'b' } + shape_list: { fg: '#85befd' attr: 'b' } + shape_literal: '#85befd' + shape_match_pattern: '#87c38a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#85befd' + shape_operator: '#ffd7b1' + shape_or: { fg: '#b9b6fc' attr: 'b' } + shape_pipe: { fg: '#b9b6fc' attr: 'b' } + shape_range: { fg: '#ffd7b1' attr: 'b' } + shape_record: { fg: '#85befd' attr: 'b' } + shape_redirection: { fg: '#b9b6fc' attr: 'b' } + shape_signature: { fg: '#87c38a' attr: 'b' } + shape_string: '#87c38a' + shape_string_interpolation: { fg: '#85befd' attr: 'b' } + shape_table: { fg: '#85befd' attr: 'b' } + shape_variable: '#b9b6fc' + + background: '#161719' + foreground: '#c5c8c6' + cursor: '#c5c8c6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ayu-light.nu b/themes/nu-themes/ayu-light.nu index 6b7566f..696d6e6 100644 --- a/themes/nu-themes/ayu-light.nu +++ b/themes/nu-themes/ayu-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#86b200" attr: "b" } - empty: "#41a6d9" - bool: {|| if $in { "#7ff0cb" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#4cbe99" - } else {{ fg: "#41a6d9" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3333" attr: "b" } - } else if $in < 6hr { - "#ff3333" - } else if $in < 1day { - "#f19618" - } else if $in < 3day { - "#86b200" - } else if $in < 1wk { - { fg: "#86b200" attr: "b" } - } else if $in < 6wk { - "#4cbe99" - } else if $in < 52wk { - "#41a6d9" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#86b200" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#ff3333" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f07078" attr: "b" } - shape_binary: { fg: "#f07078" attr: "b" } - shape_block: { fg: "#41a6d9" attr: "b" } - shape_bool: "#7ff0cb" - shape_custom: "#86b200" - shape_datetime: { fg: "#4cbe99" attr: "b" } - shape_directory: "#4cbe99" - shape_external: "#4cbe99" - shape_externalarg: { fg: "#86b200" attr: "b" } - shape_filepath: "#4cbe99" - shape_flag: { fg: "#41a6d9" attr: "b" } - shape_float: { fg: "#f07078" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4cbe99" attr: "b" } - shape_int: { fg: "#f07078" attr: "b" } - shape_internalcall: { fg: "#4cbe99" attr: "b" } - shape_list: { fg: "#4cbe99" attr: "b" } - shape_literal: "#41a6d9" - shape_match_pattern: "#86b200" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7ff0cb" - shape_operator: "#f19618" - shape_or: { fg: "#f07078" attr: "b" } - shape_pipe: { fg: "#f07078" attr: "b" } - shape_range: { fg: "#f19618" attr: "b" } - shape_record: { fg: "#4cbe99" attr: "b" } - shape_redirection: { fg: "#f07078" attr: "b" } - shape_signature: { fg: "#86b200" attr: "b" } - shape_string: "#86b200" - shape_string_interpolation: { fg: "#4cbe99" attr: "b" } - shape_table: { fg: "#41a6d9" attr: "b" } - shape_variable: "#f07078" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fafafa" - foreground: "#5b6673" - cursor: "#ff6900" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#86b200' attr: 'b' } + empty: '#41a6d9' + bool: {|| if $in { '#7ff0cb' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#4cbe99' + } else {{ fg: '#41a6d9' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3333' attr: 'b' } + } else if $in < 6hr { + '#ff3333' + } else if $in < 1day { + '#f19618' + } else if $in < 3day { + '#86b200' + } else if $in < 1wk { + { fg: '#86b200' attr: 'b' } + } else if $in < 6wk { + '#4cbe99' + } else if $in < 52wk { + '#41a6d9' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#86b200' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#ff3333' bg: '#ffffff' } + + shape_and: { fg: '#f07078' attr: 'b' } + shape_binary: { fg: '#f07078' attr: 'b' } + shape_block: { fg: '#41a6d9' attr: 'b' } + shape_bool: '#7ff0cb' + shape_custom: '#86b200' + shape_datetime: { fg: '#4cbe99' attr: 'b' } + shape_directory: '#4cbe99' + shape_external: '#4cbe99' + shape_externalarg: { fg: '#86b200' attr: 'b' } + shape_filepath: '#4cbe99' + shape_flag: { fg: '#41a6d9' attr: 'b' } + shape_float: { fg: '#f07078' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4cbe99' attr: 'b' } + shape_int: { fg: '#f07078' attr: 'b' } + shape_internalcall: { fg: '#4cbe99' attr: 'b' } + shape_list: { fg: '#4cbe99' attr: 'b' } + shape_literal: '#41a6d9' + shape_match_pattern: '#86b200' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7ff0cb' + shape_operator: '#f19618' + shape_or: { fg: '#f07078' attr: 'b' } + shape_pipe: { fg: '#f07078' attr: 'b' } + shape_range: { fg: '#f19618' attr: 'b' } + shape_record: { fg: '#4cbe99' attr: 'b' } + shape_redirection: { fg: '#f07078' attr: 'b' } + shape_signature: { fg: '#86b200' attr: 'b' } + shape_string: '#86b200' + shape_string_interpolation: { fg: '#4cbe99' attr: 'b' } + shape_table: { fg: '#41a6d9' attr: 'b' } + shape_variable: '#f07078' + + background: '#fafafa' + foreground: '#5b6673' + cursor: '#ff6900' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ayu-mirage-simple-cursor.nu b/themes/nu-themes/ayu-mirage-simple-cursor.nu index 44dfbdc..57e2640 100644 --- a/themes/nu-themes/ayu-mirage-simple-cursor.nu +++ b/themes/nu-themes/ayu-mirage-simple-cursor.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c7c7c7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a6cc70" attr: "b" } - empty: "#6dcbfa" - bool: {|| if $in { "#95e6cb" } else { "light_gray" } } - int: "#c7c7c7" - filesize: {|e| - if $e == 0b { - "#c7c7c7" - } else if $e < 1mb { - "#90e1c6" - } else {{ fg: "#6dcbfa" }} - } - duration: "#c7c7c7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ed8274" attr: "b" } - } else if $in < 6hr { - "#ed8274" - } else if $in < 1day { - "#fad07b" - } else if $in < 3day { - "#a6cc70" - } else if $in < 1wk { - { fg: "#a6cc70" attr: "b" } - } else if $in < 6wk { - "#90e1c6" - } else if $in < 52wk { - "#6dcbfa" - } else { "dark_gray" } - } - range: "#c7c7c7" - float: "#c7c7c7" - string: "#c7c7c7" - nothing: "#c7c7c7" - binary: "#c7c7c7" - cellpath: "#c7c7c7" - row_index: { fg: "#a6cc70" attr: "b" } - record: "#c7c7c7" - list: "#c7c7c7" - block: "#c7c7c7" - hints: "dark_gray" - search_result: { fg: "#ed8274" bg: "#c7c7c7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cfbafa" attr: "b" } - shape_binary: { fg: "#cfbafa" attr: "b" } - shape_block: { fg: "#6dcbfa" attr: "b" } - shape_bool: "#95e6cb" - shape_custom: "#a6cc70" - shape_datetime: { fg: "#90e1c6" attr: "b" } - shape_directory: "#90e1c6" - shape_external: "#90e1c6" - shape_externalarg: { fg: "#a6cc70" attr: "b" } - shape_filepath: "#90e1c6" - shape_flag: { fg: "#6dcbfa" attr: "b" } - shape_float: { fg: "#cfbafa" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#90e1c6" attr: "b" } - shape_int: { fg: "#cfbafa" attr: "b" } - shape_internalcall: { fg: "#90e1c6" attr: "b" } - shape_list: { fg: "#90e1c6" attr: "b" } - shape_literal: "#6dcbfa" - shape_match_pattern: "#a6cc70" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#95e6cb" - shape_operator: "#fad07b" - shape_or: { fg: "#cfbafa" attr: "b" } - shape_pipe: { fg: "#cfbafa" attr: "b" } - shape_range: { fg: "#fad07b" attr: "b" } - shape_record: { fg: "#90e1c6" attr: "b" } - shape_redirection: { fg: "#cfbafa" attr: "b" } - shape_signature: { fg: "#a6cc70" attr: "b" } - shape_string: "#a6cc70" - shape_string_interpolation: { fg: "#90e1c6" attr: "b" } - shape_table: { fg: "#6dcbfa" attr: "b" } - shape_variable: "#cfbafa" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#212733" - foreground: "#d9d7ce" - cursor: "#d9d7ce" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c7c7c7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a6cc70' attr: 'b' } + empty: '#6dcbfa' + bool: {|| if $in { '#95e6cb' } else { 'light_gray' } } + int: '#c7c7c7' + filesize: {|e| + if $e == 0b { + '#c7c7c7' + } else if $e < 1mb { + '#90e1c6' + } else {{ fg: '#6dcbfa' }} + } + duration: '#c7c7c7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ed8274' attr: 'b' } + } else if $in < 6hr { + '#ed8274' + } else if $in < 1day { + '#fad07b' + } else if $in < 3day { + '#a6cc70' + } else if $in < 1wk { + { fg: '#a6cc70' attr: 'b' } + } else if $in < 6wk { + '#90e1c6' + } else if $in < 52wk { + '#6dcbfa' + } else { 'dark_gray' } + } + range: '#c7c7c7' + float: '#c7c7c7' + string: '#c7c7c7' + nothing: '#c7c7c7' + binary: '#c7c7c7' + cellpath: '#c7c7c7' + row_index: { fg: '#a6cc70' attr: 'b' } + record: '#c7c7c7' + list: '#c7c7c7' + block: '#c7c7c7' + hints: 'dark_gray' + search_result: { fg: '#ed8274' bg: '#c7c7c7' } + + shape_and: { fg: '#cfbafa' attr: 'b' } + shape_binary: { fg: '#cfbafa' attr: 'b' } + shape_block: { fg: '#6dcbfa' attr: 'b' } + shape_bool: '#95e6cb' + shape_custom: '#a6cc70' + shape_datetime: { fg: '#90e1c6' attr: 'b' } + shape_directory: '#90e1c6' + shape_external: '#90e1c6' + shape_externalarg: { fg: '#a6cc70' attr: 'b' } + shape_filepath: '#90e1c6' + shape_flag: { fg: '#6dcbfa' attr: 'b' } + shape_float: { fg: '#cfbafa' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#90e1c6' attr: 'b' } + shape_int: { fg: '#cfbafa' attr: 'b' } + shape_internalcall: { fg: '#90e1c6' attr: 'b' } + shape_list: { fg: '#90e1c6' attr: 'b' } + shape_literal: '#6dcbfa' + shape_match_pattern: '#a6cc70' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#95e6cb' + shape_operator: '#fad07b' + shape_or: { fg: '#cfbafa' attr: 'b' } + shape_pipe: { fg: '#cfbafa' attr: 'b' } + shape_range: { fg: '#fad07b' attr: 'b' } + shape_record: { fg: '#90e1c6' attr: 'b' } + shape_redirection: { fg: '#cfbafa' attr: 'b' } + shape_signature: { fg: '#a6cc70' attr: 'b' } + shape_string: '#a6cc70' + shape_string_interpolation: { fg: '#90e1c6' attr: 'b' } + shape_table: { fg: '#6dcbfa' attr: 'b' } + shape_variable: '#cfbafa' + + background: '#212733' + foreground: '#d9d7ce' + cursor: '#d9d7ce' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ayu-mirage.nu b/themes/nu-themes/ayu-mirage.nu index bc4ee51..df1927c 100644 --- a/themes/nu-themes/ayu-mirage.nu +++ b/themes/nu-themes/ayu-mirage.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c7c7c7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a6cc70" attr: "b" } - empty: "#6dcbfa" - bool: {|| if $in { "#95e6cb" } else { "light_gray" } } - int: "#c7c7c7" - filesize: {|e| - if $e == 0b { - "#c7c7c7" - } else if $e < 1mb { - "#90e1c6" - } else {{ fg: "#6dcbfa" }} - } - duration: "#c7c7c7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ed8274" attr: "b" } - } else if $in < 6hr { - "#ed8274" - } else if $in < 1day { - "#fad07b" - } else if $in < 3day { - "#a6cc70" - } else if $in < 1wk { - { fg: "#a6cc70" attr: "b" } - } else if $in < 6wk { - "#90e1c6" - } else if $in < 52wk { - "#6dcbfa" - } else { "dark_gray" } - } - range: "#c7c7c7" - float: "#c7c7c7" - string: "#c7c7c7" - nothing: "#c7c7c7" - binary: "#c7c7c7" - cellpath: "#c7c7c7" - row_index: { fg: "#a6cc70" attr: "b" } - record: "#c7c7c7" - list: "#c7c7c7" - block: "#c7c7c7" - hints: "dark_gray" - search_result: { fg: "#ed8274" bg: "#c7c7c7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cfbafa" attr: "b" } - shape_binary: { fg: "#cfbafa" attr: "b" } - shape_block: { fg: "#6dcbfa" attr: "b" } - shape_bool: "#95e6cb" - shape_custom: "#a6cc70" - shape_datetime: { fg: "#90e1c6" attr: "b" } - shape_directory: "#90e1c6" - shape_external: "#90e1c6" - shape_externalarg: { fg: "#a6cc70" attr: "b" } - shape_filepath: "#90e1c6" - shape_flag: { fg: "#6dcbfa" attr: "b" } - shape_float: { fg: "#cfbafa" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#90e1c6" attr: "b" } - shape_int: { fg: "#cfbafa" attr: "b" } - shape_internalcall: { fg: "#90e1c6" attr: "b" } - shape_list: { fg: "#90e1c6" attr: "b" } - shape_literal: "#6dcbfa" - shape_match_pattern: "#a6cc70" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#95e6cb" - shape_operator: "#fad07b" - shape_or: { fg: "#cfbafa" attr: "b" } - shape_pipe: { fg: "#cfbafa" attr: "b" } - shape_range: { fg: "#fad07b" attr: "b" } - shape_record: { fg: "#90e1c6" attr: "b" } - shape_redirection: { fg: "#cfbafa" attr: "b" } - shape_signature: { fg: "#a6cc70" attr: "b" } - shape_string: "#a6cc70" - shape_string_interpolation: { fg: "#90e1c6" attr: "b" } - shape_table: { fg: "#6dcbfa" attr: "b" } - shape_variable: "#cfbafa" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#212733" - foreground: "#d9d7ce" - cursor: "#ffcc66" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c7c7c7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a6cc70' attr: 'b' } + empty: '#6dcbfa' + bool: {|| if $in { '#95e6cb' } else { 'light_gray' } } + int: '#c7c7c7' + filesize: {|e| + if $e == 0b { + '#c7c7c7' + } else if $e < 1mb { + '#90e1c6' + } else {{ fg: '#6dcbfa' }} + } + duration: '#c7c7c7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ed8274' attr: 'b' } + } else if $in < 6hr { + '#ed8274' + } else if $in < 1day { + '#fad07b' + } else if $in < 3day { + '#a6cc70' + } else if $in < 1wk { + { fg: '#a6cc70' attr: 'b' } + } else if $in < 6wk { + '#90e1c6' + } else if $in < 52wk { + '#6dcbfa' + } else { 'dark_gray' } + } + range: '#c7c7c7' + float: '#c7c7c7' + string: '#c7c7c7' + nothing: '#c7c7c7' + binary: '#c7c7c7' + cellpath: '#c7c7c7' + row_index: { fg: '#a6cc70' attr: 'b' } + record: '#c7c7c7' + list: '#c7c7c7' + block: '#c7c7c7' + hints: 'dark_gray' + search_result: { fg: '#ed8274' bg: '#c7c7c7' } + + shape_and: { fg: '#cfbafa' attr: 'b' } + shape_binary: { fg: '#cfbafa' attr: 'b' } + shape_block: { fg: '#6dcbfa' attr: 'b' } + shape_bool: '#95e6cb' + shape_custom: '#a6cc70' + shape_datetime: { fg: '#90e1c6' attr: 'b' } + shape_directory: '#90e1c6' + shape_external: '#90e1c6' + shape_externalarg: { fg: '#a6cc70' attr: 'b' } + shape_filepath: '#90e1c6' + shape_flag: { fg: '#6dcbfa' attr: 'b' } + shape_float: { fg: '#cfbafa' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#90e1c6' attr: 'b' } + shape_int: { fg: '#cfbafa' attr: 'b' } + shape_internalcall: { fg: '#90e1c6' attr: 'b' } + shape_list: { fg: '#90e1c6' attr: 'b' } + shape_literal: '#6dcbfa' + shape_match_pattern: '#a6cc70' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#95e6cb' + shape_operator: '#fad07b' + shape_or: { fg: '#cfbafa' attr: 'b' } + shape_pipe: { fg: '#cfbafa' attr: 'b' } + shape_range: { fg: '#fad07b' attr: 'b' } + shape_record: { fg: '#90e1c6' attr: 'b' } + shape_redirection: { fg: '#cfbafa' attr: 'b' } + shape_signature: { fg: '#a6cc70' attr: 'b' } + shape_string: '#a6cc70' + shape_string_interpolation: { fg: '#90e1c6' attr: 'b' } + shape_table: { fg: '#6dcbfa' attr: 'b' } + shape_variable: '#cfbafa' + + background: '#212733' + foreground: '#d9d7ce' + cursor: '#ffcc66' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ayu.nu b/themes/nu-themes/ayu.nu index 1059a3d..f7ce41e 100644 --- a/themes/nu-themes/ayu.nu +++ b/themes/nu-themes/ayu.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8cc52" attr: "b" } - empty: "#36a3d9" - bool: {|| if $in { "#c7fffc" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#95e5cb" - } else {{ fg: "#36a3d9" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3333" attr: "b" } - } else if $in < 6hr { - "#ff3333" - } else if $in < 1day { - "#e6c446" - } else if $in < 3day { - "#b8cc52" - } else if $in < 1wk { - { fg: "#b8cc52" attr: "b" } - } else if $in < 6wk { - "#95e5cb" - } else if $in < 52wk { - "#36a3d9" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#b8cc52" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#ff3333" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f07078" attr: "b" } - shape_binary: { fg: "#f07078" attr: "b" } - shape_block: { fg: "#36a3d9" attr: "b" } - shape_bool: "#c7fffc" - shape_custom: "#b8cc52" - shape_datetime: { fg: "#95e5cb" attr: "b" } - shape_directory: "#95e5cb" - shape_external: "#95e5cb" - shape_externalarg: { fg: "#b8cc52" attr: "b" } - shape_filepath: "#95e5cb" - shape_flag: { fg: "#36a3d9" attr: "b" } - shape_float: { fg: "#f07078" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#95e5cb" attr: "b" } - shape_int: { fg: "#f07078" attr: "b" } - shape_internalcall: { fg: "#95e5cb" attr: "b" } - shape_list: { fg: "#95e5cb" attr: "b" } - shape_literal: "#36a3d9" - shape_match_pattern: "#b8cc52" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c7fffc" - shape_operator: "#e6c446" - shape_or: { fg: "#f07078" attr: "b" } - shape_pipe: { fg: "#f07078" attr: "b" } - shape_range: { fg: "#e6c446" attr: "b" } - shape_record: { fg: "#95e5cb" attr: "b" } - shape_redirection: { fg: "#f07078" attr: "b" } - shape_signature: { fg: "#b8cc52" attr: "b" } - shape_string: "#b8cc52" - shape_string_interpolation: { fg: "#95e5cb" attr: "b" } - shape_table: { fg: "#36a3d9" attr: "b" } - shape_variable: "#f07078" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0e1419" - foreground: "#e5e1cf" - cursor: "#f19618" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8cc52' attr: 'b' } + empty: '#36a3d9' + bool: {|| if $in { '#c7fffc' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#95e5cb' + } else {{ fg: '#36a3d9' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3333' attr: 'b' } + } else if $in < 6hr { + '#ff3333' + } else if $in < 1day { + '#e6c446' + } else if $in < 3day { + '#b8cc52' + } else if $in < 1wk { + { fg: '#b8cc52' attr: 'b' } + } else if $in < 6wk { + '#95e5cb' + } else if $in < 52wk { + '#36a3d9' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#b8cc52' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#ff3333' bg: '#ffffff' } + + shape_and: { fg: '#f07078' attr: 'b' } + shape_binary: { fg: '#f07078' attr: 'b' } + shape_block: { fg: '#36a3d9' attr: 'b' } + shape_bool: '#c7fffc' + shape_custom: '#b8cc52' + shape_datetime: { fg: '#95e5cb' attr: 'b' } + shape_directory: '#95e5cb' + shape_external: '#95e5cb' + shape_externalarg: { fg: '#b8cc52' attr: 'b' } + shape_filepath: '#95e5cb' + shape_flag: { fg: '#36a3d9' attr: 'b' } + shape_float: { fg: '#f07078' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#95e5cb' attr: 'b' } + shape_int: { fg: '#f07078' attr: 'b' } + shape_internalcall: { fg: '#95e5cb' attr: 'b' } + shape_list: { fg: '#95e5cb' attr: 'b' } + shape_literal: '#36a3d9' + shape_match_pattern: '#b8cc52' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c7fffc' + shape_operator: '#e6c446' + shape_or: { fg: '#f07078' attr: 'b' } + shape_pipe: { fg: '#f07078' attr: 'b' } + shape_range: { fg: '#e6c446' attr: 'b' } + shape_record: { fg: '#95e5cb' attr: 'b' } + shape_redirection: { fg: '#f07078' attr: 'b' } + shape_signature: { fg: '#b8cc52' attr: 'b' } + shape_string: '#b8cc52' + shape_string_interpolation: { fg: '#95e5cb' attr: 'b' } + shape_table: { fg: '#36a3d9' attr: 'b' } + shape_variable: '#f07078' + + background: '#0e1419' + foreground: '#e5e1cf' + cursor: '#f19618' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/azu.nu b/themes/nu-themes/azu.nu index 38a531a..16867e7 100644 --- a/themes/nu-themes/azu.nu +++ b/themes/nu-themes/azu.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e6e6e6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#74ac6d" attr: "b" } - empty: "#6d74ac" - bool: {|| if $in { "#b8d6d3" } else { "light_gray" } } - int: "#e6e6e6" - filesize: {|e| - if $e == 0b { - "#e6e6e6" - } else if $e < 1mb { - "#6daca4" - } else {{ fg: "#6d74ac" }} - } - duration: "#e6e6e6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ac6d74" attr: "b" } - } else if $in < 6hr { - "#ac6d74" - } else if $in < 1day { - "#aca46d" - } else if $in < 3day { - "#74ac6d" - } else if $in < 1wk { - { fg: "#74ac6d" attr: "b" } - } else if $in < 6wk { - "#6daca4" - } else if $in < 52wk { - "#6d74ac" - } else { "dark_gray" } - } - range: "#e6e6e6" - float: "#e6e6e6" - string: "#e6e6e6" - nothing: "#e6e6e6" - binary: "#e6e6e6" - cellpath: "#e6e6e6" - row_index: { fg: "#74ac6d" attr: "b" } - record: "#e6e6e6" - list: "#e6e6e6" - block: "#e6e6e6" - hints: "dark_gray" - search_result: { fg: "#ac6d74" bg: "#e6e6e6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a46dac" attr: "b" } - shape_binary: { fg: "#a46dac" attr: "b" } - shape_block: { fg: "#6d74ac" attr: "b" } - shape_bool: "#b8d6d3" - shape_custom: "#74ac6d" - shape_datetime: { fg: "#6daca4" attr: "b" } - shape_directory: "#6daca4" - shape_external: "#6daca4" - shape_externalarg: { fg: "#74ac6d" attr: "b" } - shape_filepath: "#6daca4" - shape_flag: { fg: "#6d74ac" attr: "b" } - shape_float: { fg: "#a46dac" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6daca4" attr: "b" } - shape_int: { fg: "#a46dac" attr: "b" } - shape_internalcall: { fg: "#6daca4" attr: "b" } - shape_list: { fg: "#6daca4" attr: "b" } - shape_literal: "#6d74ac" - shape_match_pattern: "#74ac6d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b8d6d3" - shape_operator: "#aca46d" - shape_or: { fg: "#a46dac" attr: "b" } - shape_pipe: { fg: "#a46dac" attr: "b" } - shape_range: { fg: "#aca46d" attr: "b" } - shape_record: { fg: "#6daca4" attr: "b" } - shape_redirection: { fg: "#a46dac" attr: "b" } - shape_signature: { fg: "#74ac6d" attr: "b" } - shape_string: "#74ac6d" - shape_string_interpolation: { fg: "#6daca4" attr: "b" } - shape_table: { fg: "#6d74ac" attr: "b" } - shape_variable: "#a46dac" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#09111a" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e6e6e6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#74ac6d' attr: 'b' } + empty: '#6d74ac' + bool: {|| if $in { '#b8d6d3' } else { 'light_gray' } } + int: '#e6e6e6' + filesize: {|e| + if $e == 0b { + '#e6e6e6' + } else if $e < 1mb { + '#6daca4' + } else {{ fg: '#6d74ac' }} + } + duration: '#e6e6e6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ac6d74' attr: 'b' } + } else if $in < 6hr { + '#ac6d74' + } else if $in < 1day { + '#aca46d' + } else if $in < 3day { + '#74ac6d' + } else if $in < 1wk { + { fg: '#74ac6d' attr: 'b' } + } else if $in < 6wk { + '#6daca4' + } else if $in < 52wk { + '#6d74ac' + } else { 'dark_gray' } + } + range: '#e6e6e6' + float: '#e6e6e6' + string: '#e6e6e6' + nothing: '#e6e6e6' + binary: '#e6e6e6' + cellpath: '#e6e6e6' + row_index: { fg: '#74ac6d' attr: 'b' } + record: '#e6e6e6' + list: '#e6e6e6' + block: '#e6e6e6' + hints: 'dark_gray' + search_result: { fg: '#ac6d74' bg: '#e6e6e6' } + + shape_and: { fg: '#a46dac' attr: 'b' } + shape_binary: { fg: '#a46dac' attr: 'b' } + shape_block: { fg: '#6d74ac' attr: 'b' } + shape_bool: '#b8d6d3' + shape_custom: '#74ac6d' + shape_datetime: { fg: '#6daca4' attr: 'b' } + shape_directory: '#6daca4' + shape_external: '#6daca4' + shape_externalarg: { fg: '#74ac6d' attr: 'b' } + shape_filepath: '#6daca4' + shape_flag: { fg: '#6d74ac' attr: 'b' } + shape_float: { fg: '#a46dac' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6daca4' attr: 'b' } + shape_int: { fg: '#a46dac' attr: 'b' } + shape_internalcall: { fg: '#6daca4' attr: 'b' } + shape_list: { fg: '#6daca4' attr: 'b' } + shape_literal: '#6d74ac' + shape_match_pattern: '#74ac6d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b8d6d3' + shape_operator: '#aca46d' + shape_or: { fg: '#a46dac' attr: 'b' } + shape_pipe: { fg: '#a46dac' attr: 'b' } + shape_range: { fg: '#aca46d' attr: 'b' } + shape_record: { fg: '#6daca4' attr: 'b' } + shape_redirection: { fg: '#a46dac' attr: 'b' } + shape_signature: { fg: '#74ac6d' attr: 'b' } + shape_string: '#74ac6d' + shape_string_interpolation: { fg: '#6daca4' attr: 'b' } + shape_table: { fg: '#6d74ac' attr: 'b' } + shape_variable: '#a46dac' + + background: '#09111a' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/batman.nu b/themes/nu-themes/batman.nu index f880a42..3fd99b6 100644 --- a/themes/nu-themes/batman.nu +++ b/themes/nu-themes/batman.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c5c5be" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c8be46" attr: "b" } - empty: "#737074" - bool: {|| if $in { "#a2a2a5" } else { "light_gray" } } - int: "#c5c5be" - filesize: {|e| - if $e == 0b { - "#c5c5be" - } else if $e < 1mb { - "#615f5e" - } else {{ fg: "#737074" }} - } - duration: "#c5c5be" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e6db43" attr: "b" } - } else if $in < 6hr { - "#e6db43" - } else if $in < 1day { - "#f3fd21" - } else if $in < 3day { - "#c8be46" - } else if $in < 1wk { - { fg: "#c8be46" attr: "b" } - } else if $in < 6wk { - "#615f5e" - } else if $in < 52wk { - "#737074" - } else { "dark_gray" } - } - range: "#c5c5be" - float: "#c5c5be" - string: "#c5c5be" - nothing: "#c5c5be" - binary: "#c5c5be" - cellpath: "#c5c5be" - row_index: { fg: "#c8be46" attr: "b" } - record: "#c5c5be" - list: "#c5c5be" - block: "#c5c5be" - hints: "dark_gray" - search_result: { fg: "#e6db43" bg: "#c5c5be" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#737271" attr: "b" } - shape_binary: { fg: "#737271" attr: "b" } - shape_block: { fg: "#737074" attr: "b" } - shape_bool: "#a2a2a5" - shape_custom: "#c8be46" - shape_datetime: { fg: "#615f5e" attr: "b" } - shape_directory: "#615f5e" - shape_external: "#615f5e" - shape_externalarg: { fg: "#c8be46" attr: "b" } - shape_filepath: "#615f5e" - shape_flag: { fg: "#737074" attr: "b" } - shape_float: { fg: "#737271" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#615f5e" attr: "b" } - shape_int: { fg: "#737271" attr: "b" } - shape_internalcall: { fg: "#615f5e" attr: "b" } - shape_list: { fg: "#615f5e" attr: "b" } - shape_literal: "#737074" - shape_match_pattern: "#c8be46" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a2a2a5" - shape_operator: "#f3fd21" - shape_or: { fg: "#737271" attr: "b" } - shape_pipe: { fg: "#737271" attr: "b" } - shape_range: { fg: "#f3fd21" attr: "b" } - shape_record: { fg: "#615f5e" attr: "b" } - shape_redirection: { fg: "#737271" attr: "b" } - shape_signature: { fg: "#c8be46" attr: "b" } - shape_string: "#c8be46" - shape_string_interpolation: { fg: "#615f5e" attr: "b" } - shape_table: { fg: "#737074" attr: "b" } - shape_variable: "#737271" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1d1e" - foreground: "#6e6e6e" - cursor: "#fcee0b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c5c5be' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c8be46' attr: 'b' } + empty: '#737074' + bool: {|| if $in { '#a2a2a5' } else { 'light_gray' } } + int: '#c5c5be' + filesize: {|e| + if $e == 0b { + '#c5c5be' + } else if $e < 1mb { + '#615f5e' + } else {{ fg: '#737074' }} + } + duration: '#c5c5be' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e6db43' attr: 'b' } + } else if $in < 6hr { + '#e6db43' + } else if $in < 1day { + '#f3fd21' + } else if $in < 3day { + '#c8be46' + } else if $in < 1wk { + { fg: '#c8be46' attr: 'b' } + } else if $in < 6wk { + '#615f5e' + } else if $in < 52wk { + '#737074' + } else { 'dark_gray' } + } + range: '#c5c5be' + float: '#c5c5be' + string: '#c5c5be' + nothing: '#c5c5be' + binary: '#c5c5be' + cellpath: '#c5c5be' + row_index: { fg: '#c8be46' attr: 'b' } + record: '#c5c5be' + list: '#c5c5be' + block: '#c5c5be' + hints: 'dark_gray' + search_result: { fg: '#e6db43' bg: '#c5c5be' } + + shape_and: { fg: '#737271' attr: 'b' } + shape_binary: { fg: '#737271' attr: 'b' } + shape_block: { fg: '#737074' attr: 'b' } + shape_bool: '#a2a2a5' + shape_custom: '#c8be46' + shape_datetime: { fg: '#615f5e' attr: 'b' } + shape_directory: '#615f5e' + shape_external: '#615f5e' + shape_externalarg: { fg: '#c8be46' attr: 'b' } + shape_filepath: '#615f5e' + shape_flag: { fg: '#737074' attr: 'b' } + shape_float: { fg: '#737271' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#615f5e' attr: 'b' } + shape_int: { fg: '#737271' attr: 'b' } + shape_internalcall: { fg: '#615f5e' attr: 'b' } + shape_list: { fg: '#615f5e' attr: 'b' } + shape_literal: '#737074' + shape_match_pattern: '#c8be46' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a2a2a5' + shape_operator: '#f3fd21' + shape_or: { fg: '#737271' attr: 'b' } + shape_pipe: { fg: '#737271' attr: 'b' } + shape_range: { fg: '#f3fd21' attr: 'b' } + shape_record: { fg: '#615f5e' attr: 'b' } + shape_redirection: { fg: '#737271' attr: 'b' } + shape_signature: { fg: '#c8be46' attr: 'b' } + shape_string: '#c8be46' + shape_string_interpolation: { fg: '#615f5e' attr: 'b' } + shape_table: { fg: '#737074' attr: 'b' } + shape_variable: '#737271' + + background: '#1b1d1e' + foreground: '#6e6e6e' + cursor: '#fcee0b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/belafonte-day.nu b/themes/nu-themes/belafonte-day.nu index d7c71a1..6515a4d 100644 --- a/themes/nu-themes/belafonte-day.nu +++ b/themes/nu-themes/belafonte-day.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#968c83" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#858162" attr: "b" } - empty: "#426a79" - bool: {|| if $in { "#989a9c" } else { "light_gray" } } - int: "#968c83" - filesize: {|e| - if $e == 0b { - "#968c83" - } else if $e < 1mb { - "#989a9c" - } else {{ fg: "#426a79" }} - } - duration: "#968c83" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be100e" attr: "b" } - } else if $in < 6hr { - "#be100e" - } else if $in < 1day { - "#eaa549" - } else if $in < 3day { - "#858162" - } else if $in < 1wk { - { fg: "#858162" attr: "b" } - } else if $in < 6wk { - "#989a9c" - } else if $in < 52wk { - "#426a79" - } else { "dark_gray" } - } - range: "#968c83" - float: "#968c83" - string: "#968c83" - nothing: "#968c83" - binary: "#968c83" - cellpath: "#968c83" - row_index: { fg: "#858162" attr: "b" } - record: "#968c83" - list: "#968c83" - block: "#968c83" - hints: "dark_gray" - search_result: { fg: "#be100e" bg: "#968c83" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#97522c" attr: "b" } - shape_binary: { fg: "#97522c" attr: "b" } - shape_block: { fg: "#426a79" attr: "b" } - shape_bool: "#989a9c" - shape_custom: "#858162" - shape_datetime: { fg: "#989a9c" attr: "b" } - shape_directory: "#989a9c" - shape_external: "#989a9c" - shape_externalarg: { fg: "#858162" attr: "b" } - shape_filepath: "#989a9c" - shape_flag: { fg: "#426a79" attr: "b" } - shape_float: { fg: "#97522c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#989a9c" attr: "b" } - shape_int: { fg: "#97522c" attr: "b" } - shape_internalcall: { fg: "#989a9c" attr: "b" } - shape_list: { fg: "#989a9c" attr: "b" } - shape_literal: "#426a79" - shape_match_pattern: "#858162" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#989a9c" - shape_operator: "#eaa549" - shape_or: { fg: "#97522c" attr: "b" } - shape_pipe: { fg: "#97522c" attr: "b" } - shape_range: { fg: "#eaa549" attr: "b" } - shape_record: { fg: "#989a9c" attr: "b" } - shape_redirection: { fg: "#97522c" attr: "b" } - shape_signature: { fg: "#858162" attr: "b" } - shape_string: "#858162" - shape_string_interpolation: { fg: "#989a9c" attr: "b" } - shape_table: { fg: "#426a79" attr: "b" } - shape_variable: "#97522c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#d5ccba" - foreground: "#45373c" - cursor: "#45373c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#968c83' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#858162' attr: 'b' } + empty: '#426a79' + bool: {|| if $in { '#989a9c' } else { 'light_gray' } } + int: '#968c83' + filesize: {|e| + if $e == 0b { + '#968c83' + } else if $e < 1mb { + '#989a9c' + } else {{ fg: '#426a79' }} + } + duration: '#968c83' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be100e' attr: 'b' } + } else if $in < 6hr { + '#be100e' + } else if $in < 1day { + '#eaa549' + } else if $in < 3day { + '#858162' + } else if $in < 1wk { + { fg: '#858162' attr: 'b' } + } else if $in < 6wk { + '#989a9c' + } else if $in < 52wk { + '#426a79' + } else { 'dark_gray' } + } + range: '#968c83' + float: '#968c83' + string: '#968c83' + nothing: '#968c83' + binary: '#968c83' + cellpath: '#968c83' + row_index: { fg: '#858162' attr: 'b' } + record: '#968c83' + list: '#968c83' + block: '#968c83' + hints: 'dark_gray' + search_result: { fg: '#be100e' bg: '#968c83' } + + shape_and: { fg: '#97522c' attr: 'b' } + shape_binary: { fg: '#97522c' attr: 'b' } + shape_block: { fg: '#426a79' attr: 'b' } + shape_bool: '#989a9c' + shape_custom: '#858162' + shape_datetime: { fg: '#989a9c' attr: 'b' } + shape_directory: '#989a9c' + shape_external: '#989a9c' + shape_externalarg: { fg: '#858162' attr: 'b' } + shape_filepath: '#989a9c' + shape_flag: { fg: '#426a79' attr: 'b' } + shape_float: { fg: '#97522c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#989a9c' attr: 'b' } + shape_int: { fg: '#97522c' attr: 'b' } + shape_internalcall: { fg: '#989a9c' attr: 'b' } + shape_list: { fg: '#989a9c' attr: 'b' } + shape_literal: '#426a79' + shape_match_pattern: '#858162' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#989a9c' + shape_operator: '#eaa549' + shape_or: { fg: '#97522c' attr: 'b' } + shape_pipe: { fg: '#97522c' attr: 'b' } + shape_range: { fg: '#eaa549' attr: 'b' } + shape_record: { fg: '#989a9c' attr: 'b' } + shape_redirection: { fg: '#97522c' attr: 'b' } + shape_signature: { fg: '#858162' attr: 'b' } + shape_string: '#858162' + shape_string_interpolation: { fg: '#989a9c' attr: 'b' } + shape_table: { fg: '#426a79' attr: 'b' } + shape_variable: '#97522c' + + background: '#d5ccba' + foreground: '#45373c' + cursor: '#45373c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/belafonte-night.nu b/themes/nu-themes/belafonte-night.nu index 4976057..8e9ed54 100644 --- a/themes/nu-themes/belafonte-night.nu +++ b/themes/nu-themes/belafonte-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#968c83" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#858162" attr: "b" } - empty: "#426a79" - bool: {|| if $in { "#989a9c" } else { "light_gray" } } - int: "#968c83" - filesize: {|e| - if $e == 0b { - "#968c83" - } else if $e < 1mb { - "#989a9c" - } else {{ fg: "#426a79" }} - } - duration: "#968c83" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be100e" attr: "b" } - } else if $in < 6hr { - "#be100e" - } else if $in < 1day { - "#eaa549" - } else if $in < 3day { - "#858162" - } else if $in < 1wk { - { fg: "#858162" attr: "b" } - } else if $in < 6wk { - "#989a9c" - } else if $in < 52wk { - "#426a79" - } else { "dark_gray" } - } - range: "#968c83" - float: "#968c83" - string: "#968c83" - nothing: "#968c83" - binary: "#968c83" - cellpath: "#968c83" - row_index: { fg: "#858162" attr: "b" } - record: "#968c83" - list: "#968c83" - block: "#968c83" - hints: "dark_gray" - search_result: { fg: "#be100e" bg: "#968c83" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#97522c" attr: "b" } - shape_binary: { fg: "#97522c" attr: "b" } - shape_block: { fg: "#426a79" attr: "b" } - shape_bool: "#989a9c" - shape_custom: "#858162" - shape_datetime: { fg: "#989a9c" attr: "b" } - shape_directory: "#989a9c" - shape_external: "#989a9c" - shape_externalarg: { fg: "#858162" attr: "b" } - shape_filepath: "#989a9c" - shape_flag: { fg: "#426a79" attr: "b" } - shape_float: { fg: "#97522c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#989a9c" attr: "b" } - shape_int: { fg: "#97522c" attr: "b" } - shape_internalcall: { fg: "#989a9c" attr: "b" } - shape_list: { fg: "#989a9c" attr: "b" } - shape_literal: "#426a79" - shape_match_pattern: "#858162" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#989a9c" - shape_operator: "#eaa549" - shape_or: { fg: "#97522c" attr: "b" } - shape_pipe: { fg: "#97522c" attr: "b" } - shape_range: { fg: "#eaa549" attr: "b" } - shape_record: { fg: "#989a9c" attr: "b" } - shape_redirection: { fg: "#97522c" attr: "b" } - shape_signature: { fg: "#858162" attr: "b" } - shape_string: "#858162" - shape_string_interpolation: { fg: "#989a9c" attr: "b" } - shape_table: { fg: "#426a79" attr: "b" } - shape_variable: "#97522c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#20111b" - foreground: "#968c83" - cursor: "#968c83" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#968c83' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#858162' attr: 'b' } + empty: '#426a79' + bool: {|| if $in { '#989a9c' } else { 'light_gray' } } + int: '#968c83' + filesize: {|e| + if $e == 0b { + '#968c83' + } else if $e < 1mb { + '#989a9c' + } else {{ fg: '#426a79' }} + } + duration: '#968c83' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be100e' attr: 'b' } + } else if $in < 6hr { + '#be100e' + } else if $in < 1day { + '#eaa549' + } else if $in < 3day { + '#858162' + } else if $in < 1wk { + { fg: '#858162' attr: 'b' } + } else if $in < 6wk { + '#989a9c' + } else if $in < 52wk { + '#426a79' + } else { 'dark_gray' } + } + range: '#968c83' + float: '#968c83' + string: '#968c83' + nothing: '#968c83' + binary: '#968c83' + cellpath: '#968c83' + row_index: { fg: '#858162' attr: 'b' } + record: '#968c83' + list: '#968c83' + block: '#968c83' + hints: 'dark_gray' + search_result: { fg: '#be100e' bg: '#968c83' } + + shape_and: { fg: '#97522c' attr: 'b' } + shape_binary: { fg: '#97522c' attr: 'b' } + shape_block: { fg: '#426a79' attr: 'b' } + shape_bool: '#989a9c' + shape_custom: '#858162' + shape_datetime: { fg: '#989a9c' attr: 'b' } + shape_directory: '#989a9c' + shape_external: '#989a9c' + shape_externalarg: { fg: '#858162' attr: 'b' } + shape_filepath: '#989a9c' + shape_flag: { fg: '#426a79' attr: 'b' } + shape_float: { fg: '#97522c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#989a9c' attr: 'b' } + shape_int: { fg: '#97522c' attr: 'b' } + shape_internalcall: { fg: '#989a9c' attr: 'b' } + shape_list: { fg: '#989a9c' attr: 'b' } + shape_literal: '#426a79' + shape_match_pattern: '#858162' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#989a9c' + shape_operator: '#eaa549' + shape_or: { fg: '#97522c' attr: 'b' } + shape_pipe: { fg: '#97522c' attr: 'b' } + shape_range: { fg: '#eaa549' attr: 'b' } + shape_record: { fg: '#989a9c' attr: 'b' } + shape_redirection: { fg: '#97522c' attr: 'b' } + shape_signature: { fg: '#858162' attr: 'b' } + shape_string: '#858162' + shape_string_interpolation: { fg: '#989a9c' attr: 'b' } + shape_table: { fg: '#426a79' attr: 'b' } + shape_variable: '#97522c' + + background: '#20111b' + foreground: '#968c83' + cursor: '#968c83' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/bespin.nu b/themes/nu-themes/bespin.nu index be2f6f0..b11d4a0 100644 --- a/themes/nu-themes/bespin.nu +++ b/themes/nu-themes/bespin.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8a8986" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#54be0d" attr: "b" } - empty: "#5ea6ea" - bool: {|| if $in { "#afc4db" } else { "light_gray" } } - int: "#8a8986" - filesize: {|e| - if $e == 0b { - "#8a8986" - } else if $e < 1mb { - "#afc4db" - } else {{ fg: "#5ea6ea" }} - } - duration: "#8a8986" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf6a4c" attr: "b" } - } else if $in < 6hr { - "#cf6a4c" - } else if $in < 1day { - "#f9ee98" - } else if $in < 3day { - "#54be0d" - } else if $in < 1wk { - { fg: "#54be0d" attr: "b" } - } else if $in < 6wk { - "#afc4db" - } else if $in < 52wk { - "#5ea6ea" - } else { "dark_gray" } - } - range: "#8a8986" - float: "#8a8986" - string: "#8a8986" - nothing: "#8a8986" - binary: "#8a8986" - cellpath: "#8a8986" - row_index: { fg: "#54be0d" attr: "b" } - record: "#8a8986" - list: "#8a8986" - block: "#8a8986" - hints: "dark_gray" - search_result: { fg: "#cf6a4c" bg: "#8a8986" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9b859d" attr: "b" } - shape_binary: { fg: "#9b859d" attr: "b" } - shape_block: { fg: "#5ea6ea" attr: "b" } - shape_bool: "#afc4db" - shape_custom: "#54be0d" - shape_datetime: { fg: "#afc4db" attr: "b" } - shape_directory: "#afc4db" - shape_external: "#afc4db" - shape_externalarg: { fg: "#54be0d" attr: "b" } - shape_filepath: "#afc4db" - shape_flag: { fg: "#5ea6ea" attr: "b" } - shape_float: { fg: "#9b859d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#afc4db" attr: "b" } - shape_int: { fg: "#9b859d" attr: "b" } - shape_internalcall: { fg: "#afc4db" attr: "b" } - shape_list: { fg: "#afc4db" attr: "b" } - shape_literal: "#5ea6ea" - shape_match_pattern: "#54be0d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#afc4db" - shape_operator: "#f9ee98" - shape_or: { fg: "#9b859d" attr: "b" } - shape_pipe: { fg: "#9b859d" attr: "b" } - shape_range: { fg: "#f9ee98" attr: "b" } - shape_record: { fg: "#afc4db" attr: "b" } - shape_redirection: { fg: "#9b859d" attr: "b" } - shape_signature: { fg: "#54be0d" attr: "b" } - shape_string: "#54be0d" - shape_string_interpolation: { fg: "#afc4db" attr: "b" } - shape_table: { fg: "#5ea6ea" attr: "b" } - shape_variable: "#9b859d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#28211c" - foreground: "#8a8986" - cursor: "#8a8986" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8a8986' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#54be0d' attr: 'b' } + empty: '#5ea6ea' + bool: {|| if $in { '#afc4db' } else { 'light_gray' } } + int: '#8a8986' + filesize: {|e| + if $e == 0b { + '#8a8986' + } else if $e < 1mb { + '#afc4db' + } else {{ fg: '#5ea6ea' }} + } + duration: '#8a8986' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf6a4c' attr: 'b' } + } else if $in < 6hr { + '#cf6a4c' + } else if $in < 1day { + '#f9ee98' + } else if $in < 3day { + '#54be0d' + } else if $in < 1wk { + { fg: '#54be0d' attr: 'b' } + } else if $in < 6wk { + '#afc4db' + } else if $in < 52wk { + '#5ea6ea' + } else { 'dark_gray' } + } + range: '#8a8986' + float: '#8a8986' + string: '#8a8986' + nothing: '#8a8986' + binary: '#8a8986' + cellpath: '#8a8986' + row_index: { fg: '#54be0d' attr: 'b' } + record: '#8a8986' + list: '#8a8986' + block: '#8a8986' + hints: 'dark_gray' + search_result: { fg: '#cf6a4c' bg: '#8a8986' } + + shape_and: { fg: '#9b859d' attr: 'b' } + shape_binary: { fg: '#9b859d' attr: 'b' } + shape_block: { fg: '#5ea6ea' attr: 'b' } + shape_bool: '#afc4db' + shape_custom: '#54be0d' + shape_datetime: { fg: '#afc4db' attr: 'b' } + shape_directory: '#afc4db' + shape_external: '#afc4db' + shape_externalarg: { fg: '#54be0d' attr: 'b' } + shape_filepath: '#afc4db' + shape_flag: { fg: '#5ea6ea' attr: 'b' } + shape_float: { fg: '#9b859d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#afc4db' attr: 'b' } + shape_int: { fg: '#9b859d' attr: 'b' } + shape_internalcall: { fg: '#afc4db' attr: 'b' } + shape_list: { fg: '#afc4db' attr: 'b' } + shape_literal: '#5ea6ea' + shape_match_pattern: '#54be0d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#afc4db' + shape_operator: '#f9ee98' + shape_or: { fg: '#9b859d' attr: 'b' } + shape_pipe: { fg: '#9b859d' attr: 'b' } + shape_range: { fg: '#f9ee98' attr: 'b' } + shape_record: { fg: '#afc4db' attr: 'b' } + shape_redirection: { fg: '#9b859d' attr: 'b' } + shape_signature: { fg: '#54be0d' attr: 'b' } + shape_string: '#54be0d' + shape_string_interpolation: { fg: '#afc4db' attr: 'b' } + shape_table: { fg: '#5ea6ea' attr: 'b' } + shape_variable: '#9b859d' + + background: '#28211c' + foreground: '#8a8986' + cursor: '#8a8986' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/bim.nu b/themes/nu-themes/bim.nu index 8569937..4c20bd3 100644 --- a/themes/nu-themes/bim.nu +++ b/themes/nu-themes/bim.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#918988" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a9ee55" attr: "b" } - empty: "#5ea2ec" - bool: {|| if $in { "#81eeb2" } else { "light_gray" } } - int: "#918988" - filesize: {|e| - if $e == 0b { - "#918988" - } else if $e < 1mb { - "#5eeea0" - } else {{ fg: "#5ea2ec" }} - } - duration: "#918988" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f557a0" attr: "b" } - } else if $in < 6hr { - "#f557a0" - } else if $in < 1day { - "#f5a255" - } else if $in < 3day { - "#a9ee55" - } else if $in < 1wk { - { fg: "#a9ee55" attr: "b" } - } else if $in < 6wk { - "#5eeea0" - } else if $in < 52wk { - "#5ea2ec" - } else { "dark_gray" } - } - range: "#918988" - float: "#918988" - string: "#918988" - nothing: "#918988" - binary: "#918988" - cellpath: "#918988" - row_index: { fg: "#a9ee55" attr: "b" } - record: "#918988" - list: "#918988" - block: "#918988" - hints: "dark_gray" - search_result: { fg: "#f557a0" bg: "#918988" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a957ec" attr: "b" } - shape_binary: { fg: "#a957ec" attr: "b" } - shape_block: { fg: "#5ea2ec" attr: "b" } - shape_bool: "#81eeb2" - shape_custom: "#a9ee55" - shape_datetime: { fg: "#5eeea0" attr: "b" } - shape_directory: "#5eeea0" - shape_external: "#5eeea0" - shape_externalarg: { fg: "#a9ee55" attr: "b" } - shape_filepath: "#5eeea0" - shape_flag: { fg: "#5ea2ec" attr: "b" } - shape_float: { fg: "#a957ec" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5eeea0" attr: "b" } - shape_int: { fg: "#a957ec" attr: "b" } - shape_internalcall: { fg: "#5eeea0" attr: "b" } - shape_list: { fg: "#5eeea0" attr: "b" } - shape_literal: "#5ea2ec" - shape_match_pattern: "#a9ee55" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#81eeb2" - shape_operator: "#f5a255" - shape_or: { fg: "#a957ec" attr: "b" } - shape_pipe: { fg: "#a957ec" attr: "b" } - shape_range: { fg: "#f5a255" attr: "b" } - shape_record: { fg: "#5eeea0" attr: "b" } - shape_redirection: { fg: "#a957ec" attr: "b" } - shape_signature: { fg: "#a9ee55" attr: "b" } - shape_string: "#a9ee55" - shape_string_interpolation: { fg: "#5eeea0" attr: "b" } - shape_table: { fg: "#5ea2ec" attr: "b" } - shape_variable: "#a957ec" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#012849" - foreground: "#a9bed8" - cursor: "#a9bed8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#918988' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a9ee55' attr: 'b' } + empty: '#5ea2ec' + bool: {|| if $in { '#81eeb2' } else { 'light_gray' } } + int: '#918988' + filesize: {|e| + if $e == 0b { + '#918988' + } else if $e < 1mb { + '#5eeea0' + } else {{ fg: '#5ea2ec' }} + } + duration: '#918988' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f557a0' attr: 'b' } + } else if $in < 6hr { + '#f557a0' + } else if $in < 1day { + '#f5a255' + } else if $in < 3day { + '#a9ee55' + } else if $in < 1wk { + { fg: '#a9ee55' attr: 'b' } + } else if $in < 6wk { + '#5eeea0' + } else if $in < 52wk { + '#5ea2ec' + } else { 'dark_gray' } + } + range: '#918988' + float: '#918988' + string: '#918988' + nothing: '#918988' + binary: '#918988' + cellpath: '#918988' + row_index: { fg: '#a9ee55' attr: 'b' } + record: '#918988' + list: '#918988' + block: '#918988' + hints: 'dark_gray' + search_result: { fg: '#f557a0' bg: '#918988' } + + shape_and: { fg: '#a957ec' attr: 'b' } + shape_binary: { fg: '#a957ec' attr: 'b' } + shape_block: { fg: '#5ea2ec' attr: 'b' } + shape_bool: '#81eeb2' + shape_custom: '#a9ee55' + shape_datetime: { fg: '#5eeea0' attr: 'b' } + shape_directory: '#5eeea0' + shape_external: '#5eeea0' + shape_externalarg: { fg: '#a9ee55' attr: 'b' } + shape_filepath: '#5eeea0' + shape_flag: { fg: '#5ea2ec' attr: 'b' } + shape_float: { fg: '#a957ec' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5eeea0' attr: 'b' } + shape_int: { fg: '#a957ec' attr: 'b' } + shape_internalcall: { fg: '#5eeea0' attr: 'b' } + shape_list: { fg: '#5eeea0' attr: 'b' } + shape_literal: '#5ea2ec' + shape_match_pattern: '#a9ee55' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#81eeb2' + shape_operator: '#f5a255' + shape_or: { fg: '#a957ec' attr: 'b' } + shape_pipe: { fg: '#a957ec' attr: 'b' } + shape_range: { fg: '#f5a255' attr: 'b' } + shape_record: { fg: '#5eeea0' attr: 'b' } + shape_redirection: { fg: '#a957ec' attr: 'b' } + shape_signature: { fg: '#a9ee55' attr: 'b' } + shape_string: '#a9ee55' + shape_string_interpolation: { fg: '#5eeea0' attr: 'b' } + shape_table: { fg: '#5ea2ec' attr: 'b' } + shape_variable: '#a957ec' + + background: '#012849' + foreground: '#a9bed8' + cursor: '#a9bed8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/birds-of-paradise.nu b/themes/nu-themes/birds-of-paradise.nu index 6c0570f..4da1c90 100644 --- a/themes/nu-themes/birds-of-paradise.nu +++ b/themes/nu-themes/birds-of-paradise.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0dbb7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ba18a" attr: "b" } - empty: "#5a86ad" - bool: {|| if $in { "#93cfd7" } else { "light_gray" } } - int: "#e0dbb7" - filesize: {|e| - if $e == 0b { - "#e0dbb7" - } else if $e < 1mb { - "#74a6ad" - } else {{ fg: "#5a86ad" }} - } - duration: "#e0dbb7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be2d26" attr: "b" } - } else if $in < 6hr { - "#be2d26" - } else if $in < 1day { - "#e99d2a" - } else if $in < 3day { - "#6ba18a" - } else if $in < 1wk { - { fg: "#6ba18a" attr: "b" } - } else if $in < 6wk { - "#74a6ad" - } else if $in < 52wk { - "#5a86ad" - } else { "dark_gray" } - } - range: "#e0dbb7" - float: "#e0dbb7" - string: "#e0dbb7" - nothing: "#e0dbb7" - binary: "#e0dbb7" - cellpath: "#e0dbb7" - row_index: { fg: "#6ba18a" attr: "b" } - record: "#e0dbb7" - list: "#e0dbb7" - block: "#e0dbb7" - hints: "dark_gray" - search_result: { fg: "#be2d26" bg: "#e0dbb7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ac80a6" attr: "b" } - shape_binary: { fg: "#ac80a6" attr: "b" } - shape_block: { fg: "#5a86ad" attr: "b" } - shape_bool: "#93cfd7" - shape_custom: "#6ba18a" - shape_datetime: { fg: "#74a6ad" attr: "b" } - shape_directory: "#74a6ad" - shape_external: "#74a6ad" - shape_externalarg: { fg: "#6ba18a" attr: "b" } - shape_filepath: "#74a6ad" - shape_flag: { fg: "#5a86ad" attr: "b" } - shape_float: { fg: "#ac80a6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#74a6ad" attr: "b" } - shape_int: { fg: "#ac80a6" attr: "b" } - shape_internalcall: { fg: "#74a6ad" attr: "b" } - shape_list: { fg: "#74a6ad" attr: "b" } - shape_literal: "#5a86ad" - shape_match_pattern: "#6ba18a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#93cfd7" - shape_operator: "#e99d2a" - shape_or: { fg: "#ac80a6" attr: "b" } - shape_pipe: { fg: "#ac80a6" attr: "b" } - shape_range: { fg: "#e99d2a" attr: "b" } - shape_record: { fg: "#74a6ad" attr: "b" } - shape_redirection: { fg: "#ac80a6" attr: "b" } - shape_signature: { fg: "#6ba18a" attr: "b" } - shape_string: "#6ba18a" - shape_string_interpolation: { fg: "#74a6ad" attr: "b" } - shape_table: { fg: "#5a86ad" attr: "b" } - shape_variable: "#ac80a6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a1f1d" - foreground: "#e0dbb7" - cursor: "#e0dbb7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0dbb7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ba18a' attr: 'b' } + empty: '#5a86ad' + bool: {|| if $in { '#93cfd7' } else { 'light_gray' } } + int: '#e0dbb7' + filesize: {|e| + if $e == 0b { + '#e0dbb7' + } else if $e < 1mb { + '#74a6ad' + } else {{ fg: '#5a86ad' }} + } + duration: '#e0dbb7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be2d26' attr: 'b' } + } else if $in < 6hr { + '#be2d26' + } else if $in < 1day { + '#e99d2a' + } else if $in < 3day { + '#6ba18a' + } else if $in < 1wk { + { fg: '#6ba18a' attr: 'b' } + } else if $in < 6wk { + '#74a6ad' + } else if $in < 52wk { + '#5a86ad' + } else { 'dark_gray' } + } + range: '#e0dbb7' + float: '#e0dbb7' + string: '#e0dbb7' + nothing: '#e0dbb7' + binary: '#e0dbb7' + cellpath: '#e0dbb7' + row_index: { fg: '#6ba18a' attr: 'b' } + record: '#e0dbb7' + list: '#e0dbb7' + block: '#e0dbb7' + hints: 'dark_gray' + search_result: { fg: '#be2d26' bg: '#e0dbb7' } + + shape_and: { fg: '#ac80a6' attr: 'b' } + shape_binary: { fg: '#ac80a6' attr: 'b' } + shape_block: { fg: '#5a86ad' attr: 'b' } + shape_bool: '#93cfd7' + shape_custom: '#6ba18a' + shape_datetime: { fg: '#74a6ad' attr: 'b' } + shape_directory: '#74a6ad' + shape_external: '#74a6ad' + shape_externalarg: { fg: '#6ba18a' attr: 'b' } + shape_filepath: '#74a6ad' + shape_flag: { fg: '#5a86ad' attr: 'b' } + shape_float: { fg: '#ac80a6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#74a6ad' attr: 'b' } + shape_int: { fg: '#ac80a6' attr: 'b' } + shape_internalcall: { fg: '#74a6ad' attr: 'b' } + shape_list: { fg: '#74a6ad' attr: 'b' } + shape_literal: '#5a86ad' + shape_match_pattern: '#6ba18a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#93cfd7' + shape_operator: '#e99d2a' + shape_or: { fg: '#ac80a6' attr: 'b' } + shape_pipe: { fg: '#ac80a6' attr: 'b' } + shape_range: { fg: '#e99d2a' attr: 'b' } + shape_record: { fg: '#74a6ad' attr: 'b' } + shape_redirection: { fg: '#ac80a6' attr: 'b' } + shape_signature: { fg: '#6ba18a' attr: 'b' } + shape_string: '#6ba18a' + shape_string_interpolation: { fg: '#74a6ad' attr: 'b' } + shape_table: { fg: '#5a86ad' attr: 'b' } + shape_variable: '#ac80a6' + + background: '#2a1f1d' + foreground: '#e0dbb7' + cursor: '#e0dbb7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-bathory.nu b/themes/nu-themes/black-metal-bathory.nu index 7362d4d..1db86af 100644 --- a/themes/nu-themes/black-metal-bathory.nu +++ b/themes/nu-themes/black-metal-bathory.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#fbcb97" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#e78a53" - } else if $in < 3day { - "#fbcb97" - } else if $in < 1wk { - { fg: "#fbcb97" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#fbcb97" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#fbcb97" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#fbcb97" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#fbcb97" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#e78a53" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#e78a53" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#fbcb97" attr: "b" } - shape_string: "#fbcb97" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#fbcb97' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#e78a53' + } else if $in < 3day { + '#fbcb97' + } else if $in < 1wk { + { fg: '#fbcb97' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#fbcb97' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#fbcb97' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#fbcb97' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#fbcb97' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#e78a53' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#e78a53' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#fbcb97' attr: 'b' } + shape_string: '#fbcb97' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-burzum.nu b/themes/nu-themes/black-metal-burzum.nu index 60fa349..951f78f 100644 --- a/themes/nu-themes/black-metal-burzum.nu +++ b/themes/nu-themes/black-metal-burzum.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ddeecc" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#99bbaa" - } else if $in < 3day { - "#ddeecc" - } else if $in < 1wk { - { fg: "#ddeecc" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#ddeecc" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#ddeecc" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#ddeecc" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#ddeecc" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#99bbaa" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#99bbaa" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#ddeecc" attr: "b" } - shape_string: "#ddeecc" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ddeecc' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#99bbaa' + } else if $in < 3day { + '#ddeecc' + } else if $in < 1wk { + { fg: '#ddeecc' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#ddeecc' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#ddeecc' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#ddeecc' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#ddeecc' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#99bbaa' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#99bbaa' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#ddeecc' attr: 'b' } + shape_string: '#ddeecc' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-dark-funeral.nu b/themes/nu-themes/black-metal-dark-funeral.nu index 9d86832..2d934a9 100644 --- a/themes/nu-themes/black-metal-dark-funeral.nu +++ b/themes/nu-themes/black-metal-dark-funeral.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#d0dfee" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#5f81a5" - } else if $in < 3day { - "#d0dfee" - } else if $in < 1wk { - { fg: "#d0dfee" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#d0dfee" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#d0dfee" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#d0dfee" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#d0dfee" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#5f81a5" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#5f81a5" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#d0dfee" attr: "b" } - shape_string: "#d0dfee" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#d0dfee' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#5f81a5' + } else if $in < 3day { + '#d0dfee' + } else if $in < 1wk { + { fg: '#d0dfee' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#d0dfee' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#d0dfee' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#d0dfee' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#d0dfee' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#5f81a5' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#5f81a5' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#d0dfee' attr: 'b' } + shape_string: '#d0dfee' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-gorgoroth.nu b/themes/nu-themes/black-metal-gorgoroth.nu index f40b5fa..65ead61 100644 --- a/themes/nu-themes/black-metal-gorgoroth.nu +++ b/themes/nu-themes/black-metal-gorgoroth.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9b8d7f" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#8c7f70" - } else if $in < 3day { - "#9b8d7f" - } else if $in < 1wk { - { fg: "#9b8d7f" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#9b8d7f" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#9b8d7f" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#9b8d7f" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#9b8d7f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#8c7f70" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#8c7f70" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#9b8d7f" attr: "b" } - shape_string: "#9b8d7f" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9b8d7f' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#8c7f70' + } else if $in < 3day { + '#9b8d7f' + } else if $in < 1wk { + { fg: '#9b8d7f' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#9b8d7f' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#9b8d7f' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#9b8d7f' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#9b8d7f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#8c7f70' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#8c7f70' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#9b8d7f' attr: 'b' } + shape_string: '#9b8d7f' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-immortal.nu b/themes/nu-themes/black-metal-immortal.nu index 8627e36..fcedb79 100644 --- a/themes/nu-themes/black-metal-immortal.nu +++ b/themes/nu-themes/black-metal-immortal.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7799bb" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#556677" - } else if $in < 3day { - "#7799bb" - } else if $in < 1wk { - { fg: "#7799bb" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#7799bb" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#7799bb" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#7799bb" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#7799bb" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#556677" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#556677" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#7799bb" attr: "b" } - shape_string: "#7799bb" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7799bb' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#556677' + } else if $in < 3day { + '#7799bb' + } else if $in < 1wk { + { fg: '#7799bb' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#7799bb' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#7799bb' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#7799bb' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#7799bb' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#556677' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#556677' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#7799bb' attr: 'b' } + shape_string: '#7799bb' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-khold.nu b/themes/nu-themes/black-metal-khold.nu index cb24963..c08e142 100644 --- a/themes/nu-themes/black-metal-khold.nu +++ b/themes/nu-themes/black-metal-khold.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#eceee3" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#974b46" - } else if $in < 3day { - "#eceee3" - } else if $in < 1wk { - { fg: "#eceee3" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#eceee3" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#eceee3" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#eceee3" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#eceee3" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#974b46" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#974b46" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#eceee3" attr: "b" } - shape_string: "#eceee3" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#eceee3' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#974b46' + } else if $in < 3day { + '#eceee3' + } else if $in < 1wk { + { fg: '#eceee3' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#eceee3' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#eceee3' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#eceee3' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#eceee3' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#974b46' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#974b46' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#eceee3' attr: 'b' } + shape_string: '#eceee3' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-marduk.nu b/themes/nu-themes/black-metal-marduk.nu index 22304d0..0abf6eb 100644 --- a/themes/nu-themes/black-metal-marduk.nu +++ b/themes/nu-themes/black-metal-marduk.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a5aaa7" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#626b67" - } else if $in < 3day { - "#a5aaa7" - } else if $in < 1wk { - { fg: "#a5aaa7" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#a5aaa7" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#a5aaa7" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#a5aaa7" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#a5aaa7" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#626b67" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#626b67" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#a5aaa7" attr: "b" } - shape_string: "#a5aaa7" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a5aaa7' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#626b67' + } else if $in < 3day { + '#a5aaa7' + } else if $in < 1wk { + { fg: '#a5aaa7' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#a5aaa7' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#a5aaa7' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#a5aaa7' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#a5aaa7' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#626b67' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#626b67' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#a5aaa7' attr: 'b' } + shape_string: '#a5aaa7' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-mayhem.nu b/themes/nu-themes/black-metal-mayhem.nu index cb2d376..48ae46d 100644 --- a/themes/nu-themes/black-metal-mayhem.nu +++ b/themes/nu-themes/black-metal-mayhem.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#f3ecd4" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#eecc6c" - } else if $in < 3day { - "#f3ecd4" - } else if $in < 1wk { - { fg: "#f3ecd4" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#f3ecd4" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#f3ecd4" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#f3ecd4" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#f3ecd4" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#eecc6c" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#eecc6c" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#f3ecd4" attr: "b" } - shape_string: "#f3ecd4" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#f3ecd4' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#eecc6c' + } else if $in < 3day { + '#f3ecd4' + } else if $in < 1wk { + { fg: '#f3ecd4' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#f3ecd4' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#f3ecd4' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#f3ecd4' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#f3ecd4' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#eecc6c' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#eecc6c' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#f3ecd4' attr: 'b' } + shape_string: '#f3ecd4' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-nile.nu b/themes/nu-themes/black-metal-nile.nu index 9948487..f75f749 100644 --- a/themes/nu-themes/black-metal-nile.nu +++ b/themes/nu-themes/black-metal-nile.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#aa9988" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#777755" - } else if $in < 3day { - "#aa9988" - } else if $in < 1wk { - { fg: "#aa9988" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#aa9988" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#aa9988" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#aa9988" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#aa9988" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#777755" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#777755" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#aa9988" attr: "b" } - shape_string: "#aa9988" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#aa9988' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#777755' + } else if $in < 3day { + '#aa9988' + } else if $in < 1wk { + { fg: '#aa9988' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#aa9988' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#aa9988' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#aa9988' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#aa9988' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#777755' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#777755' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#aa9988' attr: 'b' } + shape_string: '#aa9988' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal-venom.nu b/themes/nu-themes/black-metal-venom.nu index cb650c3..603eee4 100644 --- a/themes/nu-themes/black-metal-venom.nu +++ b/themes/nu-themes/black-metal-venom.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#f8f7f2" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#79241f" - } else if $in < 3day { - "#f8f7f2" - } else if $in < 1wk { - { fg: "#f8f7f2" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#f8f7f2" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#f8f7f2" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#f8f7f2" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#f8f7f2" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#79241f" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#79241f" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#f8f7f2" attr: "b" } - shape_string: "#f8f7f2" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#f8f7f2' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#79241f' + } else if $in < 3day { + '#f8f7f2' + } else if $in < 1wk { + { fg: '#f8f7f2' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#f8f7f2' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#f8f7f2' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#f8f7f2' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#f8f7f2' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#79241f' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#79241f' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#f8f7f2' attr: 'b' } + shape_string: '#f8f7f2' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/black-metal.nu b/themes/nu-themes/black-metal.nu index 326b1cf..7aa096e 100644 --- a/themes/nu-themes/black-metal.nu +++ b/themes/nu-themes/black-metal.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c1c1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#dd9999" attr: "b" } - empty: "#888888" - bool: {|| if $in { "#aaaaaa" } else { "light_gray" } } - int: "#c1c1c1" - filesize: {|e| - if $e == 0b { - "#c1c1c1" - } else if $e < 1mb { - "#aaaaaa" - } else {{ fg: "#888888" }} - } - duration: "#c1c1c1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f8787" attr: "b" } - } else if $in < 6hr { - "#5f8787" - } else if $in < 1day { - "#a06666" - } else if $in < 3day { - "#dd9999" - } else if $in < 1wk { - { fg: "#dd9999" attr: "b" } - } else if $in < 6wk { - "#aaaaaa" - } else if $in < 52wk { - "#888888" - } else { "dark_gray" } - } - range: "#c1c1c1" - float: "#c1c1c1" - string: "#c1c1c1" - nothing: "#c1c1c1" - binary: "#c1c1c1" - cellpath: "#c1c1c1" - row_index: { fg: "#dd9999" attr: "b" } - record: "#c1c1c1" - list: "#c1c1c1" - block: "#c1c1c1" - hints: "dark_gray" - search_result: { fg: "#5f8787" bg: "#c1c1c1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#999999" attr: "b" } - shape_binary: { fg: "#999999" attr: "b" } - shape_block: { fg: "#888888" attr: "b" } - shape_bool: "#aaaaaa" - shape_custom: "#dd9999" - shape_datetime: { fg: "#aaaaaa" attr: "b" } - shape_directory: "#aaaaaa" - shape_external: "#aaaaaa" - shape_externalarg: { fg: "#dd9999" attr: "b" } - shape_filepath: "#aaaaaa" - shape_flag: { fg: "#888888" attr: "b" } - shape_float: { fg: "#999999" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaaaaa" attr: "b" } - shape_int: { fg: "#999999" attr: "b" } - shape_internalcall: { fg: "#aaaaaa" attr: "b" } - shape_list: { fg: "#aaaaaa" attr: "b" } - shape_literal: "#888888" - shape_match_pattern: "#dd9999" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aaaaaa" - shape_operator: "#a06666" - shape_or: { fg: "#999999" attr: "b" } - shape_pipe: { fg: "#999999" attr: "b" } - shape_range: { fg: "#a06666" attr: "b" } - shape_record: { fg: "#aaaaaa" attr: "b" } - shape_redirection: { fg: "#999999" attr: "b" } - shape_signature: { fg: "#dd9999" attr: "b" } - shape_string: "#dd9999" - shape_string_interpolation: { fg: "#aaaaaa" attr: "b" } - shape_table: { fg: "#888888" attr: "b" } - shape_variable: "#999999" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c1c1c1" - cursor: "#c1c1c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c1c1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#dd9999' attr: 'b' } + empty: '#888888' + bool: {|| if $in { '#aaaaaa' } else { 'light_gray' } } + int: '#c1c1c1' + filesize: {|e| + if $e == 0b { + '#c1c1c1' + } else if $e < 1mb { + '#aaaaaa' + } else {{ fg: '#888888' }} + } + duration: '#c1c1c1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f8787' attr: 'b' } + } else if $in < 6hr { + '#5f8787' + } else if $in < 1day { + '#a06666' + } else if $in < 3day { + '#dd9999' + } else if $in < 1wk { + { fg: '#dd9999' attr: 'b' } + } else if $in < 6wk { + '#aaaaaa' + } else if $in < 52wk { + '#888888' + } else { 'dark_gray' } + } + range: '#c1c1c1' + float: '#c1c1c1' + string: '#c1c1c1' + nothing: '#c1c1c1' + binary: '#c1c1c1' + cellpath: '#c1c1c1' + row_index: { fg: '#dd9999' attr: 'b' } + record: '#c1c1c1' + list: '#c1c1c1' + block: '#c1c1c1' + hints: 'dark_gray' + search_result: { fg: '#5f8787' bg: '#c1c1c1' } + + shape_and: { fg: '#999999' attr: 'b' } + shape_binary: { fg: '#999999' attr: 'b' } + shape_block: { fg: '#888888' attr: 'b' } + shape_bool: '#aaaaaa' + shape_custom: '#dd9999' + shape_datetime: { fg: '#aaaaaa' attr: 'b' } + shape_directory: '#aaaaaa' + shape_external: '#aaaaaa' + shape_externalarg: { fg: '#dd9999' attr: 'b' } + shape_filepath: '#aaaaaa' + shape_flag: { fg: '#888888' attr: 'b' } + shape_float: { fg: '#999999' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaaaaa' attr: 'b' } + shape_int: { fg: '#999999' attr: 'b' } + shape_internalcall: { fg: '#aaaaaa' attr: 'b' } + shape_list: { fg: '#aaaaaa' attr: 'b' } + shape_literal: '#888888' + shape_match_pattern: '#dd9999' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aaaaaa' + shape_operator: '#a06666' + shape_or: { fg: '#999999' attr: 'b' } + shape_pipe: { fg: '#999999' attr: 'b' } + shape_range: { fg: '#a06666' attr: 'b' } + shape_record: { fg: '#aaaaaa' attr: 'b' } + shape_redirection: { fg: '#999999' attr: 'b' } + shape_signature: { fg: '#dd9999' attr: 'b' } + shape_string: '#dd9999' + shape_string_interpolation: { fg: '#aaaaaa' attr: 'b' } + shape_table: { fg: '#888888' attr: 'b' } + shape_variable: '#999999' + + background: '#000000' + foreground: '#c1c1c1' + cursor: '#c1c1c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/blazer.nu b/themes/nu-themes/blazer.nu index 58fb4fa..260bde7 100644 --- a/themes/nu-themes/blazer.nu +++ b/themes/nu-themes/blazer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d9d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7ab87a" attr: "b" } - empty: "#7a7ab8" - bool: {|| if $in { "#bddbdb" } else { "light_gray" } } - int: "#d9d9d9" - filesize: {|e| - if $e == 0b { - "#d9d9d9" - } else if $e < 1mb { - "#7ab8b8" - } else {{ fg: "#7a7ab8" }} - } - duration: "#d9d9d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b87a7a" attr: "b" } - } else if $in < 6hr { - "#b87a7a" - } else if $in < 1day { - "#b8b87a" - } else if $in < 3day { - "#7ab87a" - } else if $in < 1wk { - { fg: "#7ab87a" attr: "b" } - } else if $in < 6wk { - "#7ab8b8" - } else if $in < 52wk { - "#7a7ab8" - } else { "dark_gray" } - } - range: "#d9d9d9" - float: "#d9d9d9" - string: "#d9d9d9" - nothing: "#d9d9d9" - binary: "#d9d9d9" - cellpath: "#d9d9d9" - row_index: { fg: "#7ab87a" attr: "b" } - record: "#d9d9d9" - list: "#d9d9d9" - block: "#d9d9d9" - hints: "dark_gray" - search_result: { fg: "#b87a7a" bg: "#d9d9d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b87ab8" attr: "b" } - shape_binary: { fg: "#b87ab8" attr: "b" } - shape_block: { fg: "#7a7ab8" attr: "b" } - shape_bool: "#bddbdb" - shape_custom: "#7ab87a" - shape_datetime: { fg: "#7ab8b8" attr: "b" } - shape_directory: "#7ab8b8" - shape_external: "#7ab8b8" - shape_externalarg: { fg: "#7ab87a" attr: "b" } - shape_filepath: "#7ab8b8" - shape_flag: { fg: "#7a7ab8" attr: "b" } - shape_float: { fg: "#b87ab8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7ab8b8" attr: "b" } - shape_int: { fg: "#b87ab8" attr: "b" } - shape_internalcall: { fg: "#7ab8b8" attr: "b" } - shape_list: { fg: "#7ab8b8" attr: "b" } - shape_literal: "#7a7ab8" - shape_match_pattern: "#7ab87a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#bddbdb" - shape_operator: "#b8b87a" - shape_or: { fg: "#b87ab8" attr: "b" } - shape_pipe: { fg: "#b87ab8" attr: "b" } - shape_range: { fg: "#b8b87a" attr: "b" } - shape_record: { fg: "#7ab8b8" attr: "b" } - shape_redirection: { fg: "#b87ab8" attr: "b" } - shape_signature: { fg: "#7ab87a" attr: "b" } - shape_string: "#7ab87a" - shape_string_interpolation: { fg: "#7ab8b8" attr: "b" } - shape_table: { fg: "#7a7ab8" attr: "b" } - shape_variable: "#b87ab8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0d1926" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d9d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7ab87a' attr: 'b' } + empty: '#7a7ab8' + bool: {|| if $in { '#bddbdb' } else { 'light_gray' } } + int: '#d9d9d9' + filesize: {|e| + if $e == 0b { + '#d9d9d9' + } else if $e < 1mb { + '#7ab8b8' + } else {{ fg: '#7a7ab8' }} + } + duration: '#d9d9d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b87a7a' attr: 'b' } + } else if $in < 6hr { + '#b87a7a' + } else if $in < 1day { + '#b8b87a' + } else if $in < 3day { + '#7ab87a' + } else if $in < 1wk { + { fg: '#7ab87a' attr: 'b' } + } else if $in < 6wk { + '#7ab8b8' + } else if $in < 52wk { + '#7a7ab8' + } else { 'dark_gray' } + } + range: '#d9d9d9' + float: '#d9d9d9' + string: '#d9d9d9' + nothing: '#d9d9d9' + binary: '#d9d9d9' + cellpath: '#d9d9d9' + row_index: { fg: '#7ab87a' attr: 'b' } + record: '#d9d9d9' + list: '#d9d9d9' + block: '#d9d9d9' + hints: 'dark_gray' + search_result: { fg: '#b87a7a' bg: '#d9d9d9' } + + shape_and: { fg: '#b87ab8' attr: 'b' } + shape_binary: { fg: '#b87ab8' attr: 'b' } + shape_block: { fg: '#7a7ab8' attr: 'b' } + shape_bool: '#bddbdb' + shape_custom: '#7ab87a' + shape_datetime: { fg: '#7ab8b8' attr: 'b' } + shape_directory: '#7ab8b8' + shape_external: '#7ab8b8' + shape_externalarg: { fg: '#7ab87a' attr: 'b' } + shape_filepath: '#7ab8b8' + shape_flag: { fg: '#7a7ab8' attr: 'b' } + shape_float: { fg: '#b87ab8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7ab8b8' attr: 'b' } + shape_int: { fg: '#b87ab8' attr: 'b' } + shape_internalcall: { fg: '#7ab8b8' attr: 'b' } + shape_list: { fg: '#7ab8b8' attr: 'b' } + shape_literal: '#7a7ab8' + shape_match_pattern: '#7ab87a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#bddbdb' + shape_operator: '#b8b87a' + shape_or: { fg: '#b87ab8' attr: 'b' } + shape_pipe: { fg: '#b87ab8' attr: 'b' } + shape_range: { fg: '#b8b87a' attr: 'b' } + shape_record: { fg: '#7ab8b8' attr: 'b' } + shape_redirection: { fg: '#b87ab8' attr: 'b' } + shape_signature: { fg: '#7ab87a' attr: 'b' } + shape_string: '#7ab87a' + shape_string_interpolation: { fg: '#7ab8b8' attr: 'b' } + shape_table: { fg: '#7a7ab8' attr: 'b' } + shape_variable: '#b87ab8' + + background: '#0d1926' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/borland.nu b/themes/nu-themes/borland.nu index 317fb75..e9b9769 100644 --- a/themes/nu-themes/borland.nu +++ b/themes/nu-themes/borland.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeeeee" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a8ff60" attr: "b" } - empty: "#96cbfe" - bool: {|| if $in { "#dfdffe" } else { "light_gray" } } - int: "#eeeeee" - filesize: {|e| - if $e == 0b { - "#eeeeee" - } else if $e < 1mb { - "#c6c5fe" - } else {{ fg: "#96cbfe" }} - } - duration: "#eeeeee" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff6c60" attr: "b" } - } else if $in < 6hr { - "#ff6c60" - } else if $in < 1day { - "#ffffb6" - } else if $in < 3day { - "#a8ff60" - } else if $in < 1wk { - { fg: "#a8ff60" attr: "b" } - } else if $in < 6wk { - "#c6c5fe" - } else if $in < 52wk { - "#96cbfe" - } else { "dark_gray" } - } - range: "#eeeeee" - float: "#eeeeee" - string: "#eeeeee" - nothing: "#eeeeee" - binary: "#eeeeee" - cellpath: "#eeeeee" - row_index: { fg: "#a8ff60" attr: "b" } - record: "#eeeeee" - list: "#eeeeee" - block: "#eeeeee" - hints: "dark_gray" - search_result: { fg: "#ff6c60" bg: "#eeeeee" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff73fd" attr: "b" } - shape_binary: { fg: "#ff73fd" attr: "b" } - shape_block: { fg: "#96cbfe" attr: "b" } - shape_bool: "#dfdffe" - shape_custom: "#a8ff60" - shape_datetime: { fg: "#c6c5fe" attr: "b" } - shape_directory: "#c6c5fe" - shape_external: "#c6c5fe" - shape_externalarg: { fg: "#a8ff60" attr: "b" } - shape_filepath: "#c6c5fe" - shape_flag: { fg: "#96cbfe" attr: "b" } - shape_float: { fg: "#ff73fd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c6c5fe" attr: "b" } - shape_int: { fg: "#ff73fd" attr: "b" } - shape_internalcall: { fg: "#c6c5fe" attr: "b" } - shape_list: { fg: "#c6c5fe" attr: "b" } - shape_literal: "#96cbfe" - shape_match_pattern: "#a8ff60" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#dfdffe" - shape_operator: "#ffffb6" - shape_or: { fg: "#ff73fd" attr: "b" } - shape_pipe: { fg: "#ff73fd" attr: "b" } - shape_range: { fg: "#ffffb6" attr: "b" } - shape_record: { fg: "#c6c5fe" attr: "b" } - shape_redirection: { fg: "#ff73fd" attr: "b" } - shape_signature: { fg: "#a8ff60" attr: "b" } - shape_string: "#a8ff60" - shape_string_interpolation: { fg: "#c6c5fe" attr: "b" } - shape_table: { fg: "#96cbfe" attr: "b" } - shape_variable: "#ff73fd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0000a4" - foreground: "#ffff4e" - cursor: "#ffff4e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeeeee' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a8ff60' attr: 'b' } + empty: '#96cbfe' + bool: {|| if $in { '#dfdffe' } else { 'light_gray' } } + int: '#eeeeee' + filesize: {|e| + if $e == 0b { + '#eeeeee' + } else if $e < 1mb { + '#c6c5fe' + } else {{ fg: '#96cbfe' }} + } + duration: '#eeeeee' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff6c60' attr: 'b' } + } else if $in < 6hr { + '#ff6c60' + } else if $in < 1day { + '#ffffb6' + } else if $in < 3day { + '#a8ff60' + } else if $in < 1wk { + { fg: '#a8ff60' attr: 'b' } + } else if $in < 6wk { + '#c6c5fe' + } else if $in < 52wk { + '#96cbfe' + } else { 'dark_gray' } + } + range: '#eeeeee' + float: '#eeeeee' + string: '#eeeeee' + nothing: '#eeeeee' + binary: '#eeeeee' + cellpath: '#eeeeee' + row_index: { fg: '#a8ff60' attr: 'b' } + record: '#eeeeee' + list: '#eeeeee' + block: '#eeeeee' + hints: 'dark_gray' + search_result: { fg: '#ff6c60' bg: '#eeeeee' } + + shape_and: { fg: '#ff73fd' attr: 'b' } + shape_binary: { fg: '#ff73fd' attr: 'b' } + shape_block: { fg: '#96cbfe' attr: 'b' } + shape_bool: '#dfdffe' + shape_custom: '#a8ff60' + shape_datetime: { fg: '#c6c5fe' attr: 'b' } + shape_directory: '#c6c5fe' + shape_external: '#c6c5fe' + shape_externalarg: { fg: '#a8ff60' attr: 'b' } + shape_filepath: '#c6c5fe' + shape_flag: { fg: '#96cbfe' attr: 'b' } + shape_float: { fg: '#ff73fd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c6c5fe' attr: 'b' } + shape_int: { fg: '#ff73fd' attr: 'b' } + shape_internalcall: { fg: '#c6c5fe' attr: 'b' } + shape_list: { fg: '#c6c5fe' attr: 'b' } + shape_literal: '#96cbfe' + shape_match_pattern: '#a8ff60' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#dfdffe' + shape_operator: '#ffffb6' + shape_or: { fg: '#ff73fd' attr: 'b' } + shape_pipe: { fg: '#ff73fd' attr: 'b' } + shape_range: { fg: '#ffffb6' attr: 'b' } + shape_record: { fg: '#c6c5fe' attr: 'b' } + shape_redirection: { fg: '#ff73fd' attr: 'b' } + shape_signature: { fg: '#a8ff60' attr: 'b' } + shape_string: '#a8ff60' + shape_string_interpolation: { fg: '#c6c5fe' attr: 'b' } + shape_table: { fg: '#96cbfe' attr: 'b' } + shape_variable: '#ff73fd' + + background: '#0000a4' + foreground: '#ffff4e' + cursor: '#ffff4e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/brewer.nu b/themes/nu-themes/brewer.nu index cbae0a6..1fdd41e 100644 --- a/themes/nu-themes/brewer.nu +++ b/themes/nu-themes/brewer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b7b8b9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#31a354" attr: "b" } - empty: "#3182bd" - bool: {|| if $in { "#80b1d3" } else { "light_gray" } } - int: "#b7b8b9" - filesize: {|e| - if $e == 0b { - "#b7b8b9" - } else if $e < 1mb { - "#80b1d3" - } else {{ fg: "#3182bd" }} - } - duration: "#b7b8b9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e31a1c" attr: "b" } - } else if $in < 6hr { - "#e31a1c" - } else if $in < 1day { - "#dca060" - } else if $in < 3day { - "#31a354" - } else if $in < 1wk { - { fg: "#31a354" attr: "b" } - } else if $in < 6wk { - "#80b1d3" - } else if $in < 52wk { - "#3182bd" - } else { "dark_gray" } - } - range: "#b7b8b9" - float: "#b7b8b9" - string: "#b7b8b9" - nothing: "#b7b8b9" - binary: "#b7b8b9" - cellpath: "#b7b8b9" - row_index: { fg: "#31a354" attr: "b" } - record: "#b7b8b9" - list: "#b7b8b9" - block: "#b7b8b9" - hints: "dark_gray" - search_result: { fg: "#e31a1c" bg: "#b7b8b9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#756bb1" attr: "b" } - shape_binary: { fg: "#756bb1" attr: "b" } - shape_block: { fg: "#3182bd" attr: "b" } - shape_bool: "#80b1d3" - shape_custom: "#31a354" - shape_datetime: { fg: "#80b1d3" attr: "b" } - shape_directory: "#80b1d3" - shape_external: "#80b1d3" - shape_externalarg: { fg: "#31a354" attr: "b" } - shape_filepath: "#80b1d3" - shape_flag: { fg: "#3182bd" attr: "b" } - shape_float: { fg: "#756bb1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#80b1d3" attr: "b" } - shape_int: { fg: "#756bb1" attr: "b" } - shape_internalcall: { fg: "#80b1d3" attr: "b" } - shape_list: { fg: "#80b1d3" attr: "b" } - shape_literal: "#3182bd" - shape_match_pattern: "#31a354" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#80b1d3" - shape_operator: "#dca060" - shape_or: { fg: "#756bb1" attr: "b" } - shape_pipe: { fg: "#756bb1" attr: "b" } - shape_range: { fg: "#dca060" attr: "b" } - shape_record: { fg: "#80b1d3" attr: "b" } - shape_redirection: { fg: "#756bb1" attr: "b" } - shape_signature: { fg: "#31a354" attr: "b" } - shape_string: "#31a354" - shape_string_interpolation: { fg: "#80b1d3" attr: "b" } - shape_table: { fg: "#3182bd" attr: "b" } - shape_variable: "#756bb1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0c0d0e" - foreground: "#b7b8b9" - cursor: "#b7b8b9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b7b8b9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#31a354' attr: 'b' } + empty: '#3182bd' + bool: {|| if $in { '#80b1d3' } else { 'light_gray' } } + int: '#b7b8b9' + filesize: {|e| + if $e == 0b { + '#b7b8b9' + } else if $e < 1mb { + '#80b1d3' + } else {{ fg: '#3182bd' }} + } + duration: '#b7b8b9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e31a1c' attr: 'b' } + } else if $in < 6hr { + '#e31a1c' + } else if $in < 1day { + '#dca060' + } else if $in < 3day { + '#31a354' + } else if $in < 1wk { + { fg: '#31a354' attr: 'b' } + } else if $in < 6wk { + '#80b1d3' + } else if $in < 52wk { + '#3182bd' + } else { 'dark_gray' } + } + range: '#b7b8b9' + float: '#b7b8b9' + string: '#b7b8b9' + nothing: '#b7b8b9' + binary: '#b7b8b9' + cellpath: '#b7b8b9' + row_index: { fg: '#31a354' attr: 'b' } + record: '#b7b8b9' + list: '#b7b8b9' + block: '#b7b8b9' + hints: 'dark_gray' + search_result: { fg: '#e31a1c' bg: '#b7b8b9' } + + shape_and: { fg: '#756bb1' attr: 'b' } + shape_binary: { fg: '#756bb1' attr: 'b' } + shape_block: { fg: '#3182bd' attr: 'b' } + shape_bool: '#80b1d3' + shape_custom: '#31a354' + shape_datetime: { fg: '#80b1d3' attr: 'b' } + shape_directory: '#80b1d3' + shape_external: '#80b1d3' + shape_externalarg: { fg: '#31a354' attr: 'b' } + shape_filepath: '#80b1d3' + shape_flag: { fg: '#3182bd' attr: 'b' } + shape_float: { fg: '#756bb1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#80b1d3' attr: 'b' } + shape_int: { fg: '#756bb1' attr: 'b' } + shape_internalcall: { fg: '#80b1d3' attr: 'b' } + shape_list: { fg: '#80b1d3' attr: 'b' } + shape_literal: '#3182bd' + shape_match_pattern: '#31a354' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#80b1d3' + shape_operator: '#dca060' + shape_or: { fg: '#756bb1' attr: 'b' } + shape_pipe: { fg: '#756bb1' attr: 'b' } + shape_range: { fg: '#dca060' attr: 'b' } + shape_record: { fg: '#80b1d3' attr: 'b' } + shape_redirection: { fg: '#756bb1' attr: 'b' } + shape_signature: { fg: '#31a354' attr: 'b' } + shape_string: '#31a354' + shape_string_interpolation: { fg: '#80b1d3' attr: 'b' } + shape_table: { fg: '#3182bd' attr: 'b' } + shape_variable: '#756bb1' + + background: '#0c0d0e' + foreground: '#b7b8b9' + cursor: '#b7b8b9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/bright-lights.nu b/themes/nu-themes/bright-lights.nu index f1523b7..43b2ced 100644 --- a/themes/nu-themes/bright-lights.nu +++ b/themes/nu-themes/bright-lights.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c8d6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b6e875" attr: "b" } - empty: "#75d3ff" - bool: {|| if $in { "#6cbeb5" } else { "light_gray" } } - int: "#c1c8d6" - filesize: {|e| - if $e == 0b { - "#c1c8d6" - } else if $e < 1mb { - "#6cbeb5" - } else {{ fg: "#75d3ff" }} - } - duration: "#c1c8d6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff355b" attr: "b" } - } else if $in < 6hr { - "#ff355b" - } else if $in < 1day { - "#ffc150" - } else if $in < 3day { - "#b6e875" - } else if $in < 1wk { - { fg: "#b6e875" attr: "b" } - } else if $in < 6wk { - "#6cbeb5" - } else if $in < 52wk { - "#75d3ff" - } else { "dark_gray" } - } - range: "#c1c8d6" - float: "#c1c8d6" - string: "#c1c8d6" - nothing: "#c1c8d6" - binary: "#c1c8d6" - cellpath: "#c1c8d6" - row_index: { fg: "#b6e875" attr: "b" } - record: "#c1c8d6" - list: "#c1c8d6" - block: "#c1c8d6" - hints: "dark_gray" - search_result: { fg: "#ff355b" bg: "#c1c8d6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b975e6" attr: "b" } - shape_binary: { fg: "#b975e6" attr: "b" } - shape_block: { fg: "#75d3ff" attr: "b" } - shape_bool: "#6cbeb5" - shape_custom: "#b6e875" - shape_datetime: { fg: "#6cbeb5" attr: "b" } - shape_directory: "#6cbeb5" - shape_external: "#6cbeb5" - shape_externalarg: { fg: "#b6e875" attr: "b" } - shape_filepath: "#6cbeb5" - shape_flag: { fg: "#75d3ff" attr: "b" } - shape_float: { fg: "#b975e6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6cbeb5" attr: "b" } - shape_int: { fg: "#b975e6" attr: "b" } - shape_internalcall: { fg: "#6cbeb5" attr: "b" } - shape_list: { fg: "#6cbeb5" attr: "b" } - shape_literal: "#75d3ff" - shape_match_pattern: "#b6e875" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6cbeb5" - shape_operator: "#ffc150" - shape_or: { fg: "#b975e6" attr: "b" } - shape_pipe: { fg: "#b975e6" attr: "b" } - shape_range: { fg: "#ffc150" attr: "b" } - shape_record: { fg: "#6cbeb5" attr: "b" } - shape_redirection: { fg: "#b975e6" attr: "b" } - shape_signature: { fg: "#b6e875" attr: "b" } - shape_string: "#b6e875" - shape_string_interpolation: { fg: "#6cbeb5" attr: "b" } - shape_table: { fg: "#75d3ff" attr: "b" } - shape_variable: "#b975e6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191919" - foreground: "#b2c8d6" - cursor: "#f34a00" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c8d6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b6e875' attr: 'b' } + empty: '#75d3ff' + bool: {|| if $in { '#6cbeb5' } else { 'light_gray' } } + int: '#c1c8d6' + filesize: {|e| + if $e == 0b { + '#c1c8d6' + } else if $e < 1mb { + '#6cbeb5' + } else {{ fg: '#75d3ff' }} + } + duration: '#c1c8d6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff355b' attr: 'b' } + } else if $in < 6hr { + '#ff355b' + } else if $in < 1day { + '#ffc150' + } else if $in < 3day { + '#b6e875' + } else if $in < 1wk { + { fg: '#b6e875' attr: 'b' } + } else if $in < 6wk { + '#6cbeb5' + } else if $in < 52wk { + '#75d3ff' + } else { 'dark_gray' } + } + range: '#c1c8d6' + float: '#c1c8d6' + string: '#c1c8d6' + nothing: '#c1c8d6' + binary: '#c1c8d6' + cellpath: '#c1c8d6' + row_index: { fg: '#b6e875' attr: 'b' } + record: '#c1c8d6' + list: '#c1c8d6' + block: '#c1c8d6' + hints: 'dark_gray' + search_result: { fg: '#ff355b' bg: '#c1c8d6' } + + shape_and: { fg: '#b975e6' attr: 'b' } + shape_binary: { fg: '#b975e6' attr: 'b' } + shape_block: { fg: '#75d3ff' attr: 'b' } + shape_bool: '#6cbeb5' + shape_custom: '#b6e875' + shape_datetime: { fg: '#6cbeb5' attr: 'b' } + shape_directory: '#6cbeb5' + shape_external: '#6cbeb5' + shape_externalarg: { fg: '#b6e875' attr: 'b' } + shape_filepath: '#6cbeb5' + shape_flag: { fg: '#75d3ff' attr: 'b' } + shape_float: { fg: '#b975e6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6cbeb5' attr: 'b' } + shape_int: { fg: '#b975e6' attr: 'b' } + shape_internalcall: { fg: '#6cbeb5' attr: 'b' } + shape_list: { fg: '#6cbeb5' attr: 'b' } + shape_literal: '#75d3ff' + shape_match_pattern: '#b6e875' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6cbeb5' + shape_operator: '#ffc150' + shape_or: { fg: '#b975e6' attr: 'b' } + shape_pipe: { fg: '#b975e6' attr: 'b' } + shape_range: { fg: '#ffc150' attr: 'b' } + shape_record: { fg: '#6cbeb5' attr: 'b' } + shape_redirection: { fg: '#b975e6' attr: 'b' } + shape_signature: { fg: '#b6e875' attr: 'b' } + shape_string: '#b6e875' + shape_string_interpolation: { fg: '#6cbeb5' attr: 'b' } + shape_table: { fg: '#75d3ff' attr: 'b' } + shape_variable: '#b975e6' + + background: '#191919' + foreground: '#b2c8d6' + cursor: '#f34a00' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/bright.nu b/themes/nu-themes/bright.nu index 3f214ec..7175e33 100644 --- a/themes/nu-themes/bright.nu +++ b/themes/nu-themes/bright.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0e0e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1c659" attr: "b" } - empty: "#6fb3d2" - bool: {|| if $in { "#76c7b7" } else { "light_gray" } } - int: "#e0e0e0" - filesize: {|e| - if $e == 0b { - "#e0e0e0" - } else if $e < 1mb { - "#76c7b7" - } else {{ fg: "#6fb3d2" }} - } - duration: "#e0e0e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb0120" attr: "b" } - } else if $in < 6hr { - "#fb0120" - } else if $in < 1day { - "#fda331" - } else if $in < 3day { - "#a1c659" - } else if $in < 1wk { - { fg: "#a1c659" attr: "b" } - } else if $in < 6wk { - "#76c7b7" - } else if $in < 52wk { - "#6fb3d2" - } else { "dark_gray" } - } - range: "#e0e0e0" - float: "#e0e0e0" - string: "#e0e0e0" - nothing: "#e0e0e0" - binary: "#e0e0e0" - cellpath: "#e0e0e0" - row_index: { fg: "#a1c659" attr: "b" } - record: "#e0e0e0" - list: "#e0e0e0" - block: "#e0e0e0" - hints: "dark_gray" - search_result: { fg: "#fb0120" bg: "#e0e0e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d381c3" attr: "b" } - shape_binary: { fg: "#d381c3" attr: "b" } - shape_block: { fg: "#6fb3d2" attr: "b" } - shape_bool: "#76c7b7" - shape_custom: "#a1c659" - shape_datetime: { fg: "#76c7b7" attr: "b" } - shape_directory: "#76c7b7" - shape_external: "#76c7b7" - shape_externalarg: { fg: "#a1c659" attr: "b" } - shape_filepath: "#76c7b7" - shape_flag: { fg: "#6fb3d2" attr: "b" } - shape_float: { fg: "#d381c3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#76c7b7" attr: "b" } - shape_int: { fg: "#d381c3" attr: "b" } - shape_internalcall: { fg: "#76c7b7" attr: "b" } - shape_list: { fg: "#76c7b7" attr: "b" } - shape_literal: "#6fb3d2" - shape_match_pattern: "#a1c659" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#76c7b7" - shape_operator: "#fda331" - shape_or: { fg: "#d381c3" attr: "b" } - shape_pipe: { fg: "#d381c3" attr: "b" } - shape_range: { fg: "#fda331" attr: "b" } - shape_record: { fg: "#76c7b7" attr: "b" } - shape_redirection: { fg: "#d381c3" attr: "b" } - shape_signature: { fg: "#a1c659" attr: "b" } - shape_string: "#a1c659" - shape_string_interpolation: { fg: "#76c7b7" attr: "b" } - shape_table: { fg: "#6fb3d2" attr: "b" } - shape_variable: "#d381c3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#e0e0e0" - cursor: "#e0e0e0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0e0e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1c659' attr: 'b' } + empty: '#6fb3d2' + bool: {|| if $in { '#76c7b7' } else { 'light_gray' } } + int: '#e0e0e0' + filesize: {|e| + if $e == 0b { + '#e0e0e0' + } else if $e < 1mb { + '#76c7b7' + } else {{ fg: '#6fb3d2' }} + } + duration: '#e0e0e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb0120' attr: 'b' } + } else if $in < 6hr { + '#fb0120' + } else if $in < 1day { + '#fda331' + } else if $in < 3day { + '#a1c659' + } else if $in < 1wk { + { fg: '#a1c659' attr: 'b' } + } else if $in < 6wk { + '#76c7b7' + } else if $in < 52wk { + '#6fb3d2' + } else { 'dark_gray' } + } + range: '#e0e0e0' + float: '#e0e0e0' + string: '#e0e0e0' + nothing: '#e0e0e0' + binary: '#e0e0e0' + cellpath: '#e0e0e0' + row_index: { fg: '#a1c659' attr: 'b' } + record: '#e0e0e0' + list: '#e0e0e0' + block: '#e0e0e0' + hints: 'dark_gray' + search_result: { fg: '#fb0120' bg: '#e0e0e0' } + + shape_and: { fg: '#d381c3' attr: 'b' } + shape_binary: { fg: '#d381c3' attr: 'b' } + shape_block: { fg: '#6fb3d2' attr: 'b' } + shape_bool: '#76c7b7' + shape_custom: '#a1c659' + shape_datetime: { fg: '#76c7b7' attr: 'b' } + shape_directory: '#76c7b7' + shape_external: '#76c7b7' + shape_externalarg: { fg: '#a1c659' attr: 'b' } + shape_filepath: '#76c7b7' + shape_flag: { fg: '#6fb3d2' attr: 'b' } + shape_float: { fg: '#d381c3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#76c7b7' attr: 'b' } + shape_int: { fg: '#d381c3' attr: 'b' } + shape_internalcall: { fg: '#76c7b7' attr: 'b' } + shape_list: { fg: '#76c7b7' attr: 'b' } + shape_literal: '#6fb3d2' + shape_match_pattern: '#a1c659' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#76c7b7' + shape_operator: '#fda331' + shape_or: { fg: '#d381c3' attr: 'b' } + shape_pipe: { fg: '#d381c3' attr: 'b' } + shape_range: { fg: '#fda331' attr: 'b' } + shape_record: { fg: '#76c7b7' attr: 'b' } + shape_redirection: { fg: '#d381c3' attr: 'b' } + shape_signature: { fg: '#a1c659' attr: 'b' } + shape_string: '#a1c659' + shape_string_interpolation: { fg: '#76c7b7' attr: 'b' } + shape_table: { fg: '#6fb3d2' attr: 'b' } + shape_variable: '#d381c3' + + background: '#000000' + foreground: '#e0e0e0' + cursor: '#e0e0e0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/broadcast.nu b/themes/nu-themes/broadcast.nu index 971f9c0..c93c4e3 100644 --- a/themes/nu-themes/broadcast.nu +++ b/themes/nu-themes/broadcast.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#519f50" attr: "b" } - empty: "#6d9cbe" - bool: {|| if $in { "#a0cef0" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#6e9cbe" - } else {{ fg: "#6d9cbe" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#da4939" attr: "b" } - } else if $in < 6hr { - "#da4939" - } else if $in < 1day { - "#ffd24a" - } else if $in < 3day { - "#519f50" - } else if $in < 1wk { - { fg: "#519f50" attr: "b" } - } else if $in < 6wk { - "#6e9cbe" - } else if $in < 52wk { - "#6d9cbe" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#519f50" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#da4939" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d0d0ff" attr: "b" } - shape_binary: { fg: "#d0d0ff" attr: "b" } - shape_block: { fg: "#6d9cbe" attr: "b" } - shape_bool: "#a0cef0" - shape_custom: "#519f50" - shape_datetime: { fg: "#6e9cbe" attr: "b" } - shape_directory: "#6e9cbe" - shape_external: "#6e9cbe" - shape_externalarg: { fg: "#519f50" attr: "b" } - shape_filepath: "#6e9cbe" - shape_flag: { fg: "#6d9cbe" attr: "b" } - shape_float: { fg: "#d0d0ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6e9cbe" attr: "b" } - shape_int: { fg: "#d0d0ff" attr: "b" } - shape_internalcall: { fg: "#6e9cbe" attr: "b" } - shape_list: { fg: "#6e9cbe" attr: "b" } - shape_literal: "#6d9cbe" - shape_match_pattern: "#519f50" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a0cef0" - shape_operator: "#ffd24a" - shape_or: { fg: "#d0d0ff" attr: "b" } - shape_pipe: { fg: "#d0d0ff" attr: "b" } - shape_range: { fg: "#ffd24a" attr: "b" } - shape_record: { fg: "#6e9cbe" attr: "b" } - shape_redirection: { fg: "#d0d0ff" attr: "b" } - shape_signature: { fg: "#519f50" attr: "b" } - shape_string: "#519f50" - shape_string_interpolation: { fg: "#6e9cbe" attr: "b" } - shape_table: { fg: "#6d9cbe" attr: "b" } - shape_variable: "#d0d0ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b2b2b" - foreground: "#e6e1dc" - cursor: "#e6e1dc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#519f50' attr: 'b' } + empty: '#6d9cbe' + bool: {|| if $in { '#a0cef0' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#6e9cbe' + } else {{ fg: '#6d9cbe' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#da4939' attr: 'b' } + } else if $in < 6hr { + '#da4939' + } else if $in < 1day { + '#ffd24a' + } else if $in < 3day { + '#519f50' + } else if $in < 1wk { + { fg: '#519f50' attr: 'b' } + } else if $in < 6wk { + '#6e9cbe' + } else if $in < 52wk { + '#6d9cbe' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#519f50' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#da4939' bg: '#ffffff' } + + shape_and: { fg: '#d0d0ff' attr: 'b' } + shape_binary: { fg: '#d0d0ff' attr: 'b' } + shape_block: { fg: '#6d9cbe' attr: 'b' } + shape_bool: '#a0cef0' + shape_custom: '#519f50' + shape_datetime: { fg: '#6e9cbe' attr: 'b' } + shape_directory: '#6e9cbe' + shape_external: '#6e9cbe' + shape_externalarg: { fg: '#519f50' attr: 'b' } + shape_filepath: '#6e9cbe' + shape_flag: { fg: '#6d9cbe' attr: 'b' } + shape_float: { fg: '#d0d0ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6e9cbe' attr: 'b' } + shape_int: { fg: '#d0d0ff' attr: 'b' } + shape_internalcall: { fg: '#6e9cbe' attr: 'b' } + shape_list: { fg: '#6e9cbe' attr: 'b' } + shape_literal: '#6d9cbe' + shape_match_pattern: '#519f50' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a0cef0' + shape_operator: '#ffd24a' + shape_or: { fg: '#d0d0ff' attr: 'b' } + shape_pipe: { fg: '#d0d0ff' attr: 'b' } + shape_range: { fg: '#ffd24a' attr: 'b' } + shape_record: { fg: '#6e9cbe' attr: 'b' } + shape_redirection: { fg: '#d0d0ff' attr: 'b' } + shape_signature: { fg: '#519f50' attr: 'b' } + shape_string: '#519f50' + shape_string_interpolation: { fg: '#6e9cbe' attr: 'b' } + shape_table: { fg: '#6d9cbe' attr: 'b' } + shape_variable: '#d0d0ff' + + background: '#2b2b2b' + foreground: '#e6e1dc' + cursor: '#e6e1dc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/brogrammer.nu b/themes/nu-themes/brogrammer.nu index b6be096..6e0fdc8 100644 --- a/themes/nu-themes/brogrammer.nu +++ b/themes/nu-themes/brogrammer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#4e5ab7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#f3bd09" attr: "b" } - empty: "#5350b9" - bool: {|| if $in { "#1081d6" } else { "light_gray" } } - int: "#4e5ab7" - filesize: {|e| - if $e == 0b { - "#4e5ab7" - } else if $e < 1mb { - "#1081d6" - } else {{ fg: "#5350b9" }} - } - duration: "#4e5ab7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d6dbe5" attr: "b" } - } else if $in < 6hr { - "#d6dbe5" - } else if $in < 1day { - "#1dd361" - } else if $in < 3day { - "#f3bd09" - } else if $in < 1wk { - { fg: "#f3bd09" attr: "b" } - } else if $in < 6wk { - "#1081d6" - } else if $in < 52wk { - "#5350b9" - } else { "dark_gray" } - } - range: "#4e5ab7" - float: "#4e5ab7" - string: "#4e5ab7" - nothing: "#4e5ab7" - binary: "#4e5ab7" - cellpath: "#4e5ab7" - row_index: { fg: "#f3bd09" attr: "b" } - record: "#4e5ab7" - list: "#4e5ab7" - block: "#4e5ab7" - hints: "dark_gray" - search_result: { fg: "#d6dbe5" bg: "#4e5ab7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#0f7ddb" attr: "b" } - shape_binary: { fg: "#0f7ddb" attr: "b" } - shape_block: { fg: "#5350b9" attr: "b" } - shape_bool: "#1081d6" - shape_custom: "#f3bd09" - shape_datetime: { fg: "#1081d6" attr: "b" } - shape_directory: "#1081d6" - shape_external: "#1081d6" - shape_externalarg: { fg: "#f3bd09" attr: "b" } - shape_filepath: "#1081d6" - shape_flag: { fg: "#5350b9" attr: "b" } - shape_float: { fg: "#0f7ddb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1081d6" attr: "b" } - shape_int: { fg: "#0f7ddb" attr: "b" } - shape_internalcall: { fg: "#1081d6" attr: "b" } - shape_list: { fg: "#1081d6" attr: "b" } - shape_literal: "#5350b9" - shape_match_pattern: "#f3bd09" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1081d6" - shape_operator: "#1dd361" - shape_or: { fg: "#0f7ddb" attr: "b" } - shape_pipe: { fg: "#0f7ddb" attr: "b" } - shape_range: { fg: "#1dd361" attr: "b" } - shape_record: { fg: "#1081d6" attr: "b" } - shape_redirection: { fg: "#0f7ddb" attr: "b" } - shape_signature: { fg: "#f3bd09" attr: "b" } - shape_string: "#f3bd09" - shape_string_interpolation: { fg: "#1081d6" attr: "b" } - shape_table: { fg: "#5350b9" attr: "b" } - shape_variable: "#0f7ddb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1f1f" - foreground: "#4e5ab7" - cursor: "#4e5ab7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#4e5ab7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#f3bd09' attr: 'b' } + empty: '#5350b9' + bool: {|| if $in { '#1081d6' } else { 'light_gray' } } + int: '#4e5ab7' + filesize: {|e| + if $e == 0b { + '#4e5ab7' + } else if $e < 1mb { + '#1081d6' + } else {{ fg: '#5350b9' }} + } + duration: '#4e5ab7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d6dbe5' attr: 'b' } + } else if $in < 6hr { + '#d6dbe5' + } else if $in < 1day { + '#1dd361' + } else if $in < 3day { + '#f3bd09' + } else if $in < 1wk { + { fg: '#f3bd09' attr: 'b' } + } else if $in < 6wk { + '#1081d6' + } else if $in < 52wk { + '#5350b9' + } else { 'dark_gray' } + } + range: '#4e5ab7' + float: '#4e5ab7' + string: '#4e5ab7' + nothing: '#4e5ab7' + binary: '#4e5ab7' + cellpath: '#4e5ab7' + row_index: { fg: '#f3bd09' attr: 'b' } + record: '#4e5ab7' + list: '#4e5ab7' + block: '#4e5ab7' + hints: 'dark_gray' + search_result: { fg: '#d6dbe5' bg: '#4e5ab7' } + + shape_and: { fg: '#0f7ddb' attr: 'b' } + shape_binary: { fg: '#0f7ddb' attr: 'b' } + shape_block: { fg: '#5350b9' attr: 'b' } + shape_bool: '#1081d6' + shape_custom: '#f3bd09' + shape_datetime: { fg: '#1081d6' attr: 'b' } + shape_directory: '#1081d6' + shape_external: '#1081d6' + shape_externalarg: { fg: '#f3bd09' attr: 'b' } + shape_filepath: '#1081d6' + shape_flag: { fg: '#5350b9' attr: 'b' } + shape_float: { fg: '#0f7ddb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1081d6' attr: 'b' } + shape_int: { fg: '#0f7ddb' attr: 'b' } + shape_internalcall: { fg: '#1081d6' attr: 'b' } + shape_list: { fg: '#1081d6' attr: 'b' } + shape_literal: '#5350b9' + shape_match_pattern: '#f3bd09' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1081d6' + shape_operator: '#1dd361' + shape_or: { fg: '#0f7ddb' attr: 'b' } + shape_pipe: { fg: '#0f7ddb' attr: 'b' } + shape_range: { fg: '#1dd361' attr: 'b' } + shape_record: { fg: '#1081d6' attr: 'b' } + shape_redirection: { fg: '#0f7ddb' attr: 'b' } + shape_signature: { fg: '#f3bd09' attr: 'b' } + shape_string: '#f3bd09' + shape_string_interpolation: { fg: '#1081d6' attr: 'b' } + shape_table: { fg: '#5350b9' attr: 'b' } + shape_variable: '#0f7ddb' + + background: '#1f1f1f' + foreground: '#4e5ab7' + cursor: '#4e5ab7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/brushtrees-dark.nu b/themes/nu-themes/brushtrees-dark.nu index be83c84..fc64cb3 100644 --- a/themes/nu-themes/brushtrees-dark.nu +++ b/themes/nu-themes/brushtrees-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b0c5c8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87b386" attr: "b" } - empty: "#868cb3" - bool: {|| if $in { "#86b3b3" } else { "light_gray" } } - int: "#b0c5c8" - filesize: {|e| - if $e == 0b { - "#b0c5c8" - } else if $e < 1mb { - "#86b3b3" - } else {{ fg: "#868cb3" }} - } - duration: "#b0c5c8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b38686" attr: "b" } - } else if $in < 6hr { - "#b38686" - } else if $in < 1day { - "#aab386" - } else if $in < 3day { - "#87b386" - } else if $in < 1wk { - { fg: "#87b386" attr: "b" } - } else if $in < 6wk { - "#86b3b3" - } else if $in < 52wk { - "#868cb3" - } else { "dark_gray" } - } - range: "#b0c5c8" - float: "#b0c5c8" - string: "#b0c5c8" - nothing: "#b0c5c8" - binary: "#b0c5c8" - cellpath: "#b0c5c8" - row_index: { fg: "#87b386" attr: "b" } - record: "#b0c5c8" - list: "#b0c5c8" - block: "#b0c5c8" - hints: "dark_gray" - search_result: { fg: "#b38686" bg: "#b0c5c8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b386b2" attr: "b" } - shape_binary: { fg: "#b386b2" attr: "b" } - shape_block: { fg: "#868cb3" attr: "b" } - shape_bool: "#86b3b3" - shape_custom: "#87b386" - shape_datetime: { fg: "#86b3b3" attr: "b" } - shape_directory: "#86b3b3" - shape_external: "#86b3b3" - shape_externalarg: { fg: "#87b386" attr: "b" } - shape_filepath: "#86b3b3" - shape_flag: { fg: "#868cb3" attr: "b" } - shape_float: { fg: "#b386b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#86b3b3" attr: "b" } - shape_int: { fg: "#b386b2" attr: "b" } - shape_internalcall: { fg: "#86b3b3" attr: "b" } - shape_list: { fg: "#86b3b3" attr: "b" } - shape_literal: "#868cb3" - shape_match_pattern: "#87b386" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86b3b3" - shape_operator: "#aab386" - shape_or: { fg: "#b386b2" attr: "b" } - shape_pipe: { fg: "#b386b2" attr: "b" } - shape_range: { fg: "#aab386" attr: "b" } - shape_record: { fg: "#86b3b3" attr: "b" } - shape_redirection: { fg: "#b386b2" attr: "b" } - shape_signature: { fg: "#87b386" attr: "b" } - shape_string: "#87b386" - shape_string_interpolation: { fg: "#86b3b3" attr: "b" } - shape_table: { fg: "#868cb3" attr: "b" } - shape_variable: "#b386b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#485867" - foreground: "#b0c5c8" - cursor: "#b0c5c8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b0c5c8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87b386' attr: 'b' } + empty: '#868cb3' + bool: {|| if $in { '#86b3b3' } else { 'light_gray' } } + int: '#b0c5c8' + filesize: {|e| + if $e == 0b { + '#b0c5c8' + } else if $e < 1mb { + '#86b3b3' + } else {{ fg: '#868cb3' }} + } + duration: '#b0c5c8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b38686' attr: 'b' } + } else if $in < 6hr { + '#b38686' + } else if $in < 1day { + '#aab386' + } else if $in < 3day { + '#87b386' + } else if $in < 1wk { + { fg: '#87b386' attr: 'b' } + } else if $in < 6wk { + '#86b3b3' + } else if $in < 52wk { + '#868cb3' + } else { 'dark_gray' } + } + range: '#b0c5c8' + float: '#b0c5c8' + string: '#b0c5c8' + nothing: '#b0c5c8' + binary: '#b0c5c8' + cellpath: '#b0c5c8' + row_index: { fg: '#87b386' attr: 'b' } + record: '#b0c5c8' + list: '#b0c5c8' + block: '#b0c5c8' + hints: 'dark_gray' + search_result: { fg: '#b38686' bg: '#b0c5c8' } + + shape_and: { fg: '#b386b2' attr: 'b' } + shape_binary: { fg: '#b386b2' attr: 'b' } + shape_block: { fg: '#868cb3' attr: 'b' } + shape_bool: '#86b3b3' + shape_custom: '#87b386' + shape_datetime: { fg: '#86b3b3' attr: 'b' } + shape_directory: '#86b3b3' + shape_external: '#86b3b3' + shape_externalarg: { fg: '#87b386' attr: 'b' } + shape_filepath: '#86b3b3' + shape_flag: { fg: '#868cb3' attr: 'b' } + shape_float: { fg: '#b386b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#86b3b3' attr: 'b' } + shape_int: { fg: '#b386b2' attr: 'b' } + shape_internalcall: { fg: '#86b3b3' attr: 'b' } + shape_list: { fg: '#86b3b3' attr: 'b' } + shape_literal: '#868cb3' + shape_match_pattern: '#87b386' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#86b3b3' + shape_operator: '#aab386' + shape_or: { fg: '#b386b2' attr: 'b' } + shape_pipe: { fg: '#b386b2' attr: 'b' } + shape_range: { fg: '#aab386' attr: 'b' } + shape_record: { fg: '#86b3b3' attr: 'b' } + shape_redirection: { fg: '#b386b2' attr: 'b' } + shape_signature: { fg: '#87b386' attr: 'b' } + shape_string: '#87b386' + shape_string_interpolation: { fg: '#86b3b3' attr: 'b' } + shape_table: { fg: '#868cb3' attr: 'b' } + shape_variable: '#b386b2' + + background: '#485867' + foreground: '#b0c5c8' + cursor: '#b0c5c8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/brushtrees.nu b/themes/nu-themes/brushtrees.nu index 92a8edb..d5227df 100644 --- a/themes/nu-themes/brushtrees.nu +++ b/themes/nu-themes/brushtrees.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6d828e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87b386" attr: "b" } - empty: "#868cb3" - bool: {|| if $in { "#86b3b3" } else { "light_gray" } } - int: "#6d828e" - filesize: {|e| - if $e == 0b { - "#6d828e" - } else if $e < 1mb { - "#86b3b3" - } else {{ fg: "#868cb3" }} - } - duration: "#6d828e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b38686" attr: "b" } - } else if $in < 6hr { - "#b38686" - } else if $in < 1day { - "#aab386" - } else if $in < 3day { - "#87b386" - } else if $in < 1wk { - { fg: "#87b386" attr: "b" } - } else if $in < 6wk { - "#86b3b3" - } else if $in < 52wk { - "#868cb3" - } else { "dark_gray" } - } - range: "#6d828e" - float: "#6d828e" - string: "#6d828e" - nothing: "#6d828e" - binary: "#6d828e" - cellpath: "#6d828e" - row_index: { fg: "#87b386" attr: "b" } - record: "#6d828e" - list: "#6d828e" - block: "#6d828e" - hints: "dark_gray" - search_result: { fg: "#b38686" bg: "#6d828e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b386b2" attr: "b" } - shape_binary: { fg: "#b386b2" attr: "b" } - shape_block: { fg: "#868cb3" attr: "b" } - shape_bool: "#86b3b3" - shape_custom: "#87b386" - shape_datetime: { fg: "#86b3b3" attr: "b" } - shape_directory: "#86b3b3" - shape_external: "#86b3b3" - shape_externalarg: { fg: "#87b386" attr: "b" } - shape_filepath: "#86b3b3" - shape_flag: { fg: "#868cb3" attr: "b" } - shape_float: { fg: "#b386b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#86b3b3" attr: "b" } - shape_int: { fg: "#b386b2" attr: "b" } - shape_internalcall: { fg: "#86b3b3" attr: "b" } - shape_list: { fg: "#86b3b3" attr: "b" } - shape_literal: "#868cb3" - shape_match_pattern: "#87b386" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86b3b3" - shape_operator: "#aab386" - shape_or: { fg: "#b386b2" attr: "b" } - shape_pipe: { fg: "#b386b2" attr: "b" } - shape_range: { fg: "#aab386" attr: "b" } - shape_record: { fg: "#86b3b3" attr: "b" } - shape_redirection: { fg: "#b386b2" attr: "b" } - shape_signature: { fg: "#87b386" attr: "b" } - shape_string: "#87b386" - shape_string_interpolation: { fg: "#86b3b3" attr: "b" } - shape_table: { fg: "#868cb3" attr: "b" } - shape_variable: "#b386b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#e3efef" - foreground: "#6d828e" - cursor: "#6d828e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6d828e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87b386' attr: 'b' } + empty: '#868cb3' + bool: {|| if $in { '#86b3b3' } else { 'light_gray' } } + int: '#6d828e' + filesize: {|e| + if $e == 0b { + '#6d828e' + } else if $e < 1mb { + '#86b3b3' + } else {{ fg: '#868cb3' }} + } + duration: '#6d828e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b38686' attr: 'b' } + } else if $in < 6hr { + '#b38686' + } else if $in < 1day { + '#aab386' + } else if $in < 3day { + '#87b386' + } else if $in < 1wk { + { fg: '#87b386' attr: 'b' } + } else if $in < 6wk { + '#86b3b3' + } else if $in < 52wk { + '#868cb3' + } else { 'dark_gray' } + } + range: '#6d828e' + float: '#6d828e' + string: '#6d828e' + nothing: '#6d828e' + binary: '#6d828e' + cellpath: '#6d828e' + row_index: { fg: '#87b386' attr: 'b' } + record: '#6d828e' + list: '#6d828e' + block: '#6d828e' + hints: 'dark_gray' + search_result: { fg: '#b38686' bg: '#6d828e' } + + shape_and: { fg: '#b386b2' attr: 'b' } + shape_binary: { fg: '#b386b2' attr: 'b' } + shape_block: { fg: '#868cb3' attr: 'b' } + shape_bool: '#86b3b3' + shape_custom: '#87b386' + shape_datetime: { fg: '#86b3b3' attr: 'b' } + shape_directory: '#86b3b3' + shape_external: '#86b3b3' + shape_externalarg: { fg: '#87b386' attr: 'b' } + shape_filepath: '#86b3b3' + shape_flag: { fg: '#868cb3' attr: 'b' } + shape_float: { fg: '#b386b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#86b3b3' attr: 'b' } + shape_int: { fg: '#b386b2' attr: 'b' } + shape_internalcall: { fg: '#86b3b3' attr: 'b' } + shape_list: { fg: '#86b3b3' attr: 'b' } + shape_literal: '#868cb3' + shape_match_pattern: '#87b386' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#86b3b3' + shape_operator: '#aab386' + shape_or: { fg: '#b386b2' attr: 'b' } + shape_pipe: { fg: '#b386b2' attr: 'b' } + shape_range: { fg: '#aab386' attr: 'b' } + shape_record: { fg: '#86b3b3' attr: 'b' } + shape_redirection: { fg: '#b386b2' attr: 'b' } + shape_signature: { fg: '#87b386' attr: 'b' } + shape_string: '#87b386' + shape_string_interpolation: { fg: '#86b3b3' attr: 'b' } + shape_table: { fg: '#868cb3' attr: 'b' } + shape_variable: '#b386b2' + + background: '#e3efef' + foreground: '#6d828e' + cursor: '#6d828e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/c64.nu b/themes/nu-themes/c64.nu index 785f0de..e67ab8d 100644 --- a/themes/nu-themes/c64.nu +++ b/themes/nu-themes/c64.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#55a049" attr: "b" } - empty: "#40318d" - bool: {|| if $in { "#67b6bd" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#67b6bd" - } else {{ fg: "#40318d" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#883932" attr: "b" } - } else if $in < 6hr { - "#883932" - } else if $in < 1day { - "#bfce72" - } else if $in < 3day { - "#55a049" - } else if $in < 1wk { - { fg: "#55a049" attr: "b" } - } else if $in < 6wk { - "#67b6bd" - } else if $in < 52wk { - "#40318d" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#55a049" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#883932" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8b3f96" attr: "b" } - shape_binary: { fg: "#8b3f96" attr: "b" } - shape_block: { fg: "#40318d" attr: "b" } - shape_bool: "#67b6bd" - shape_custom: "#55a049" - shape_datetime: { fg: "#67b6bd" attr: "b" } - shape_directory: "#67b6bd" - shape_external: "#67b6bd" - shape_externalarg: { fg: "#55a049" attr: "b" } - shape_filepath: "#67b6bd" - shape_flag: { fg: "#40318d" attr: "b" } - shape_float: { fg: "#8b3f96" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#67b6bd" attr: "b" } - shape_int: { fg: "#8b3f96" attr: "b" } - shape_internalcall: { fg: "#67b6bd" attr: "b" } - shape_list: { fg: "#67b6bd" attr: "b" } - shape_literal: "#40318d" - shape_match_pattern: "#55a049" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#67b6bd" - shape_operator: "#bfce72" - shape_or: { fg: "#8b3f96" attr: "b" } - shape_pipe: { fg: "#8b3f96" attr: "b" } - shape_range: { fg: "#bfce72" attr: "b" } - shape_record: { fg: "#67b6bd" attr: "b" } - shape_redirection: { fg: "#8b3f96" attr: "b" } - shape_signature: { fg: "#55a049" attr: "b" } - shape_string: "#55a049" - shape_string_interpolation: { fg: "#67b6bd" attr: "b" } - shape_table: { fg: "#40318d" attr: "b" } - shape_variable: "#8b3f96" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#40318d" - foreground: "#7869c4" - cursor: "#7869c4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#55a049' attr: 'b' } + empty: '#40318d' + bool: {|| if $in { '#67b6bd' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#67b6bd' + } else {{ fg: '#40318d' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#883932' attr: 'b' } + } else if $in < 6hr { + '#883932' + } else if $in < 1day { + '#bfce72' + } else if $in < 3day { + '#55a049' + } else if $in < 1wk { + { fg: '#55a049' attr: 'b' } + } else if $in < 6wk { + '#67b6bd' + } else if $in < 52wk { + '#40318d' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#55a049' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#883932' bg: '#ffffff' } + + shape_and: { fg: '#8b3f96' attr: 'b' } + shape_binary: { fg: '#8b3f96' attr: 'b' } + shape_block: { fg: '#40318d' attr: 'b' } + shape_bool: '#67b6bd' + shape_custom: '#55a049' + shape_datetime: { fg: '#67b6bd' attr: 'b' } + shape_directory: '#67b6bd' + shape_external: '#67b6bd' + shape_externalarg: { fg: '#55a049' attr: 'b' } + shape_filepath: '#67b6bd' + shape_flag: { fg: '#40318d' attr: 'b' } + shape_float: { fg: '#8b3f96' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#67b6bd' attr: 'b' } + shape_int: { fg: '#8b3f96' attr: 'b' } + shape_internalcall: { fg: '#67b6bd' attr: 'b' } + shape_list: { fg: '#67b6bd' attr: 'b' } + shape_literal: '#40318d' + shape_match_pattern: '#55a049' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#67b6bd' + shape_operator: '#bfce72' + shape_or: { fg: '#8b3f96' attr: 'b' } + shape_pipe: { fg: '#8b3f96' attr: 'b' } + shape_range: { fg: '#bfce72' attr: 'b' } + shape_record: { fg: '#67b6bd' attr: 'b' } + shape_redirection: { fg: '#8b3f96' attr: 'b' } + shape_signature: { fg: '#55a049' attr: 'b' } + shape_string: '#55a049' + shape_string_interpolation: { fg: '#67b6bd' attr: 'b' } + shape_table: { fg: '#40318d' attr: 'b' } + shape_variable: '#8b3f96' + + background: '#40318d' + foreground: '#7869c4' + cursor: '#7869c4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/cai.nu b/themes/nu-themes/cai.nu index 1077acb..5251b7f 100644 --- a/themes/nu-themes/cai.nu +++ b/themes/nu-themes/cai.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#808080" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4dca27" attr: "b" } - empty: "#274dca" - bool: {|| if $in { "#8de9d4" } else { "light_gray" } } - int: "#808080" - filesize: {|e| - if $e == 0b { - "#808080" - } else if $e < 1mb { - "#27caa4" - } else {{ fg: "#274dca" }} - } - duration: "#808080" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca274d" attr: "b" } - } else if $in < 6hr { - "#ca274d" - } else if $in < 1day { - "#caa427" - } else if $in < 3day { - "#4dca27" - } else if $in < 1wk { - { fg: "#4dca27" attr: "b" } - } else if $in < 6wk { - "#27caa4" - } else if $in < 52wk { - "#274dca" - } else { "dark_gray" } - } - range: "#808080" - float: "#808080" - string: "#808080" - nothing: "#808080" - binary: "#808080" - cellpath: "#808080" - row_index: { fg: "#4dca27" attr: "b" } - record: "#808080" - list: "#808080" - block: "#808080" - hints: "dark_gray" - search_result: { fg: "#ca274d" bg: "#808080" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a427ca" attr: "b" } - shape_binary: { fg: "#a427ca" attr: "b" } - shape_block: { fg: "#274dca" attr: "b" } - shape_bool: "#8de9d4" - shape_custom: "#4dca27" - shape_datetime: { fg: "#27caa4" attr: "b" } - shape_directory: "#27caa4" - shape_external: "#27caa4" - shape_externalarg: { fg: "#4dca27" attr: "b" } - shape_filepath: "#27caa4" - shape_flag: { fg: "#274dca" attr: "b" } - shape_float: { fg: "#a427ca" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#27caa4" attr: "b" } - shape_int: { fg: "#a427ca" attr: "b" } - shape_internalcall: { fg: "#27caa4" attr: "b" } - shape_list: { fg: "#27caa4" attr: "b" } - shape_literal: "#274dca" - shape_match_pattern: "#4dca27" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8de9d4" - shape_operator: "#caa427" - shape_or: { fg: "#a427ca" attr: "b" } - shape_pipe: { fg: "#a427ca" attr: "b" } - shape_range: { fg: "#caa427" attr: "b" } - shape_record: { fg: "#27caa4" attr: "b" } - shape_redirection: { fg: "#a427ca" attr: "b" } - shape_signature: { fg: "#4dca27" attr: "b" } - shape_string: "#4dca27" - shape_string_interpolation: { fg: "#27caa4" attr: "b" } - shape_table: { fg: "#274dca" attr: "b" } - shape_variable: "#a427ca" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#09111a" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#808080' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4dca27' attr: 'b' } + empty: '#274dca' + bool: {|| if $in { '#8de9d4' } else { 'light_gray' } } + int: '#808080' + filesize: {|e| + if $e == 0b { + '#808080' + } else if $e < 1mb { + '#27caa4' + } else {{ fg: '#274dca' }} + } + duration: '#808080' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca274d' attr: 'b' } + } else if $in < 6hr { + '#ca274d' + } else if $in < 1day { + '#caa427' + } else if $in < 3day { + '#4dca27' + } else if $in < 1wk { + { fg: '#4dca27' attr: 'b' } + } else if $in < 6wk { + '#27caa4' + } else if $in < 52wk { + '#274dca' + } else { 'dark_gray' } + } + range: '#808080' + float: '#808080' + string: '#808080' + nothing: '#808080' + binary: '#808080' + cellpath: '#808080' + row_index: { fg: '#4dca27' attr: 'b' } + record: '#808080' + list: '#808080' + block: '#808080' + hints: 'dark_gray' + search_result: { fg: '#ca274d' bg: '#808080' } + + shape_and: { fg: '#a427ca' attr: 'b' } + shape_binary: { fg: '#a427ca' attr: 'b' } + shape_block: { fg: '#274dca' attr: 'b' } + shape_bool: '#8de9d4' + shape_custom: '#4dca27' + shape_datetime: { fg: '#27caa4' attr: 'b' } + shape_directory: '#27caa4' + shape_external: '#27caa4' + shape_externalarg: { fg: '#4dca27' attr: 'b' } + shape_filepath: '#27caa4' + shape_flag: { fg: '#274dca' attr: 'b' } + shape_float: { fg: '#a427ca' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#27caa4' attr: 'b' } + shape_int: { fg: '#a427ca' attr: 'b' } + shape_internalcall: { fg: '#27caa4' attr: 'b' } + shape_list: { fg: '#27caa4' attr: 'b' } + shape_literal: '#274dca' + shape_match_pattern: '#4dca27' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8de9d4' + shape_operator: '#caa427' + shape_or: { fg: '#a427ca' attr: 'b' } + shape_pipe: { fg: '#a427ca' attr: 'b' } + shape_range: { fg: '#caa427' attr: 'b' } + shape_record: { fg: '#27caa4' attr: 'b' } + shape_redirection: { fg: '#a427ca' attr: 'b' } + shape_signature: { fg: '#4dca27' attr: 'b' } + shape_string: '#4dca27' + shape_string_interpolation: { fg: '#27caa4' attr: 'b' } + shape_table: { fg: '#274dca' attr: 'b' } + shape_variable: '#a427ca' + + background: '#09111a' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/catppuccin-latte.nu b/themes/nu-themes/catppuccin-latte.nu deleted file mode 100644 index 0723a4f..0000000 --- a/themes/nu-themes/catppuccin-latte.nu +++ /dev/null @@ -1,114 +0,0 @@ -const color_palette = { - rosewater: "#dc8a78" - flamingo: "#dd7878" - pink: "#ea76cb" - mauve: "#8839ef" - red: "#d20f39" - maroon: "#e64553" - peach: "#fe640b" - yellow: "#df8e1d" - green: "#40a02b" - teal: "#179299" - sky: "#04a5e5" - sapphire: "#209fb5" - blue: "#1e66f5" - lavender: "#7287fd" - text: "#4c4f69" - subtext1: "#5c5f77" - subtext0: "#6c6f85" - overlay2: "#7c7f93" - overlay1: "#8c8fa1" - overlay0: "#9ca0b0" - surface2: "#acb0be" - surface1: "#bcc0cc" - surface0: "#ccd0da" - crust: "#dce0e8" - mantle: "#e6e9ef" - base: "#eff1f5" - -} - -export def main [] { return { - separator: $color_palette.overlay0 - leading_trailing_space_bg: { attr: "n" } - header: { fg: $color_palette.blue attr: "b" } - empty: $color_palette.lavender - bool: $color_palette.lavender - int: $color_palette.peach - duration: $color_palette.text - filesize: {|e| - if $e < 1mb { - $color_palette.green - } else if $e < 100mb { - $color_palette.yellow - } else if $e < 500mb { - $color_palette.peach - } else if $e < 800mb { - $color_palette.maroon - } else if $e > 800mb { - $color_palette.red - } - } - date: {|| (date now) - $in | - if $in < 1hr { - $color_palette.green - } else if $in < 1day { - $color_palette.yellow - } else if $in < 3day { - $color_palette.peach - } else if $in < 1wk { - $color_palette.maroon - } else if $in > 1wk { - $color_palette.red - } - } - range: $color_palette.text - float: $color_palette.text - string: $color_palette.text - nothing: $color_palette.text - binary: $color_palette.text - cellpath: $color_palette.text - row_index: { fg: $color_palette.mauve attr: "b" } - record: $color_palette.text - list: $color_palette.text - block: $color_palette.text - hints: $color_palette.overlay1 - search_result: { fg: $color_palette.red bg: $color_palette.text } - - shape_and: { fg: $color_palette.pink attr: "b" } - shape_binary: { fg: $color_palette.pink attr: "b" } - shape_block: { fg: $color_palette.blue attr: "b" } - shape_bool: $color_palette.teal - shape_custom: $color_palette.green - shape_datetime: { fg: $color_palette.teal attr: "b" } - shape_directory: $color_palette.teal - shape_external: $color_palette.teal - shape_externalarg: { fg: $color_palette.green attr: "b" } - shape_filepath: $color_palette.teal - shape_flag: { fg: $color_palette.blue attr: "b" } - shape_float: { fg: $color_palette.pink attr: "b" } - shape_garbage: { fg: $color_palette.text bg: $color_palette.red attr: "b" } - shape_globpattern: { fg: $color_palette.teal attr: "b" } - shape_int: { fg: $color_palette.pink attr: "b" } - shape_internalcall: { fg: $color_palette.teal attr: "b" } - shape_list: { fg: $color_palette.teal attr: "b" } - shape_literal: $color_palette.blue - shape_match_pattern: $color_palette.green - shape_matching_brackets: { attr: "u" } - shape_nothing: $color_palette.teal - shape_operator: $color_palette.peach - shape_or: { fg: $color_palette.pink attr: "b" } - shape_pipe: { fg: $color_palette.pink attr: "b" } - shape_range: { fg: $color_palette.peach attr: "b" } - shape_record: { fg: $color_palette.teal attr: "b" } - shape_redirection: { fg: $color_palette.pink attr: "b" } - shape_signature: { fg: $color_palette.green attr: "b" } - shape_string: $color_palette.green - shape_string_interpolation: { fg: $color_palette.teal attr: "b" } - shape_table: { fg: $color_palette.blue attr: "b" } - shape_variable: $color_palette.pink - - background: $color_palette.base - foreground: $color_palette.text - cursor: $color_palette.blue -}} diff --git a/themes/nu-themes/catppuccin-mocha.nu b/themes/nu-themes/catppuccin-mocha.nu deleted file mode 100644 index df72587..0000000 --- a/themes/nu-themes/catppuccin-mocha.nu +++ /dev/null @@ -1,113 +0,0 @@ -const color_palette = { - rosewater: "#f5e0dc" - flamingo: "#f2cdcd" - pink: "#f5c2e7" - mauve: "#cba6f7" - red: "#f38ba8" - maroon: "#eba0ac" - peach: "#fab387" - yellow: "#f9e2af" - green: "#a6e3a1" - teal: "#94e2d5" - sky: "#89dceb" - sapphire: "#74c7ec" - blue: "#89b4fa" - lavender: "#b4befe" - text: "#cdd6f4" - subtext1: "#bac2de" - subtext0: "#a6adc8" - overlay2: "#9399b2" - overlay1: "#7f849c" - overlay0: "#6c7086" - surface2: "#585b70" - surface1: "#45475a" - surface0: "#313244" - base: "#1e1e2e" - mantle: "#181825" - crust: "#11111b" -} - -export def main [] { return { - separator: $color_palette.overlay0 - leading_trailing_space_bg: { attr: "n" } - header: { fg: $color_palette.blue attr: "b" } - empty: $color_palette.lavender - bool: $color_palette.lavender - int: $color_palette.peach - duration: $color_palette.text - filesize: {|e| - if $e < 1mb { - $color_palette.green - } else if $e < 100mb { - $color_palette.yellow - } else if $e < 500mb { - $color_palette.peach - } else if $e < 800mb { - $color_palette.maroon - } else if $e > 800mb { - $color_palette.red - } - } - date: {|| (date now) - $in | - if $in < 1hr { - $color_palette.green - } else if $in < 1day { - $color_palette.yellow - } else if $in < 3day { - $color_palette.peach - } else if $in < 1wk { - $color_palette.maroon - } else if $in > 1wk { - $color_palette.red - } - } - range: $color_palette.text - float: $color_palette.text - string: $color_palette.text - nothing: $color_palette.text - binary: $color_palette.text - cellpath: $color_palette.text - row_index: { fg: $color_palette.mauve attr: "b" } - record: $color_palette.text - list: $color_palette.text - block: $color_palette.text - hints: $color_palette.overlay1 - search_result: { fg: $color_palette.red bg: $color_palette.text } - - shape_and: { fg: $color_palette.pink attr: "b" } - shape_binary: { fg: $color_palette.pink attr: "b" } - shape_block: { fg: $color_palette.blue attr: "b" } - shape_bool: $color_palette.teal - shape_custom: $color_palette.green - shape_datetime: { fg: $color_palette.teal attr: "b" } - shape_directory: $color_palette.teal - shape_external: $color_palette.teal - shape_externalarg: { fg: $color_palette.green attr: "b" } - shape_filepath: $color_palette.teal - shape_flag: { fg: $color_palette.blue attr: "b" } - shape_float: { fg: $color_palette.pink attr: "b" } - shape_garbage: { fg: $color_palette.text bg: $color_palette.red attr: "b" } - shape_globpattern: { fg: $color_palette.teal attr: "b" } - shape_int: { fg: $color_palette.pink attr: "b" } - shape_internalcall: { fg: $color_palette.teal attr: "b" } - shape_list: { fg: $color_palette.teal attr: "b" } - shape_literal: $color_palette.blue - shape_match_pattern: $color_palette.green - shape_matching_brackets: { attr: "u" } - shape_nothing: $color_palette.teal - shape_operator: $color_palette.peach - shape_or: { fg: $color_palette.pink attr: "b" } - shape_pipe: { fg: $color_palette.pink attr: "b" } - shape_range: { fg: $color_palette.peach attr: "b" } - shape_record: { fg: $color_palette.teal attr: "b" } - shape_redirection: { fg: $color_palette.pink attr: "b" } - shape_signature: { fg: $color_palette.green attr: "b" } - shape_string: $color_palette.green - shape_string_interpolation: { fg: $color_palette.teal attr: "b" } - shape_table: { fg: $color_palette.blue attr: "b" } - shape_variable: $color_palette.pink - - background: $color_palette.base - foreground: $color_palette.text - cursor: $color_palette.blue -}} diff --git a/themes/nu-themes/chalk.nu b/themes/nu-themes/chalk.nu index dcaa451..7e4414b 100644 --- a/themes/nu-themes/chalk.nu +++ b/themes/nu-themes/chalk.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#acc267" attr: "b" } - empty: "#6fc2ef" - bool: {|| if $in { "#12cfc0" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#12cfc0" - } else {{ fg: "#6fc2ef" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb9fb1" attr: "b" } - } else if $in < 6hr { - "#fb9fb1" - } else if $in < 1day { - "#ddb26f" - } else if $in < 3day { - "#acc267" - } else if $in < 1wk { - { fg: "#acc267" attr: "b" } - } else if $in < 6wk { - "#12cfc0" - } else if $in < 52wk { - "#6fc2ef" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#acc267" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#fb9fb1" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e1a3ee" attr: "b" } - shape_binary: { fg: "#e1a3ee" attr: "b" } - shape_block: { fg: "#6fc2ef" attr: "b" } - shape_bool: "#12cfc0" - shape_custom: "#acc267" - shape_datetime: { fg: "#12cfc0" attr: "b" } - shape_directory: "#12cfc0" - shape_external: "#12cfc0" - shape_externalarg: { fg: "#acc267" attr: "b" } - shape_filepath: "#12cfc0" - shape_flag: { fg: "#6fc2ef" attr: "b" } - shape_float: { fg: "#e1a3ee" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#12cfc0" attr: "b" } - shape_int: { fg: "#e1a3ee" attr: "b" } - shape_internalcall: { fg: "#12cfc0" attr: "b" } - shape_list: { fg: "#12cfc0" attr: "b" } - shape_literal: "#6fc2ef" - shape_match_pattern: "#acc267" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#12cfc0" - shape_operator: "#ddb26f" - shape_or: { fg: "#e1a3ee" attr: "b" } - shape_pipe: { fg: "#e1a3ee" attr: "b" } - shape_range: { fg: "#ddb26f" attr: "b" } - shape_record: { fg: "#12cfc0" attr: "b" } - shape_redirection: { fg: "#e1a3ee" attr: "b" } - shape_signature: { fg: "#acc267" attr: "b" } - shape_string: "#acc267" - shape_string_interpolation: { fg: "#12cfc0" attr: "b" } - shape_table: { fg: "#6fc2ef" attr: "b" } - shape_variable: "#e1a3ee" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#151515" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#acc267' attr: 'b' } + empty: '#6fc2ef' + bool: {|| if $in { '#12cfc0' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#12cfc0' + } else {{ fg: '#6fc2ef' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb9fb1' attr: 'b' } + } else if $in < 6hr { + '#fb9fb1' + } else if $in < 1day { + '#ddb26f' + } else if $in < 3day { + '#acc267' + } else if $in < 1wk { + { fg: '#acc267' attr: 'b' } + } else if $in < 6wk { + '#12cfc0' + } else if $in < 52wk { + '#6fc2ef' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#acc267' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#fb9fb1' bg: '#d0d0d0' } + + shape_and: { fg: '#e1a3ee' attr: 'b' } + shape_binary: { fg: '#e1a3ee' attr: 'b' } + shape_block: { fg: '#6fc2ef' attr: 'b' } + shape_bool: '#12cfc0' + shape_custom: '#acc267' + shape_datetime: { fg: '#12cfc0' attr: 'b' } + shape_directory: '#12cfc0' + shape_external: '#12cfc0' + shape_externalarg: { fg: '#acc267' attr: 'b' } + shape_filepath: '#12cfc0' + shape_flag: { fg: '#6fc2ef' attr: 'b' } + shape_float: { fg: '#e1a3ee' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#12cfc0' attr: 'b' } + shape_int: { fg: '#e1a3ee' attr: 'b' } + shape_internalcall: { fg: '#12cfc0' attr: 'b' } + shape_list: { fg: '#12cfc0' attr: 'b' } + shape_literal: '#6fc2ef' + shape_match_pattern: '#acc267' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#12cfc0' + shape_operator: '#ddb26f' + shape_or: { fg: '#e1a3ee' attr: 'b' } + shape_pipe: { fg: '#e1a3ee' attr: 'b' } + shape_range: { fg: '#ddb26f' attr: 'b' } + shape_record: { fg: '#12cfc0' attr: 'b' } + shape_redirection: { fg: '#e1a3ee' attr: 'b' } + shape_signature: { fg: '#acc267' attr: 'b' } + shape_string: '#acc267' + shape_string_interpolation: { fg: '#12cfc0' attr: 'b' } + shape_table: { fg: '#6fc2ef' attr: 'b' } + shape_variable: '#e1a3ee' + + background: '#151515' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/chalkboard.nu b/themes/nu-themes/chalkboard.nu index 3aa80b2..73fcc2c 100644 --- a/themes/nu-themes/chalkboard.nu +++ b/themes/nu-themes/chalkboard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d9d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#72c373" attr: "b" } - empty: "#7372c3" - bool: {|| if $in { "#aadadb" } else { "light_gray" } } - int: "#d9d9d9" - filesize: {|e| - if $e == 0b { - "#d9d9d9" - } else if $e < 1mb { - "#72c2c3" - } else {{ fg: "#7372c3" }} - } - duration: "#d9d9d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c37372" attr: "b" } - } else if $in < 6hr { - "#c37372" - } else if $in < 1day { - "#c2c372" - } else if $in < 3day { - "#72c373" - } else if $in < 1wk { - { fg: "#72c373" attr: "b" } - } else if $in < 6wk { - "#72c2c3" - } else if $in < 52wk { - "#7372c3" - } else { "dark_gray" } - } - range: "#d9d9d9" - float: "#d9d9d9" - string: "#d9d9d9" - nothing: "#d9d9d9" - binary: "#d9d9d9" - cellpath: "#d9d9d9" - row_index: { fg: "#72c373" attr: "b" } - record: "#d9d9d9" - list: "#d9d9d9" - block: "#d9d9d9" - hints: "dark_gray" - search_result: { fg: "#c37372" bg: "#d9d9d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c372c2" attr: "b" } - shape_binary: { fg: "#c372c2" attr: "b" } - shape_block: { fg: "#7372c3" attr: "b" } - shape_bool: "#aadadb" - shape_custom: "#72c373" - shape_datetime: { fg: "#72c2c3" attr: "b" } - shape_directory: "#72c2c3" - shape_external: "#72c2c3" - shape_externalarg: { fg: "#72c373" attr: "b" } - shape_filepath: "#72c2c3" - shape_flag: { fg: "#7372c3" attr: "b" } - shape_float: { fg: "#c372c2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#72c2c3" attr: "b" } - shape_int: { fg: "#c372c2" attr: "b" } - shape_internalcall: { fg: "#72c2c3" attr: "b" } - shape_list: { fg: "#72c2c3" attr: "b" } - shape_literal: "#7372c3" - shape_match_pattern: "#72c373" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#aadadb" - shape_operator: "#c2c372" - shape_or: { fg: "#c372c2" attr: "b" } - shape_pipe: { fg: "#c372c2" attr: "b" } - shape_range: { fg: "#c2c372" attr: "b" } - shape_record: { fg: "#72c2c3" attr: "b" } - shape_redirection: { fg: "#c372c2" attr: "b" } - shape_signature: { fg: "#72c373" attr: "b" } - shape_string: "#72c373" - shape_string_interpolation: { fg: "#72c2c3" attr: "b" } - shape_table: { fg: "#7372c3" attr: "b" } - shape_variable: "#c372c2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#29262f" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d9d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#72c373' attr: 'b' } + empty: '#7372c3' + bool: {|| if $in { '#aadadb' } else { 'light_gray' } } + int: '#d9d9d9' + filesize: {|e| + if $e == 0b { + '#d9d9d9' + } else if $e < 1mb { + '#72c2c3' + } else {{ fg: '#7372c3' }} + } + duration: '#d9d9d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c37372' attr: 'b' } + } else if $in < 6hr { + '#c37372' + } else if $in < 1day { + '#c2c372' + } else if $in < 3day { + '#72c373' + } else if $in < 1wk { + { fg: '#72c373' attr: 'b' } + } else if $in < 6wk { + '#72c2c3' + } else if $in < 52wk { + '#7372c3' + } else { 'dark_gray' } + } + range: '#d9d9d9' + float: '#d9d9d9' + string: '#d9d9d9' + nothing: '#d9d9d9' + binary: '#d9d9d9' + cellpath: '#d9d9d9' + row_index: { fg: '#72c373' attr: 'b' } + record: '#d9d9d9' + list: '#d9d9d9' + block: '#d9d9d9' + hints: 'dark_gray' + search_result: { fg: '#c37372' bg: '#d9d9d9' } + + shape_and: { fg: '#c372c2' attr: 'b' } + shape_binary: { fg: '#c372c2' attr: 'b' } + shape_block: { fg: '#7372c3' attr: 'b' } + shape_bool: '#aadadb' + shape_custom: '#72c373' + shape_datetime: { fg: '#72c2c3' attr: 'b' } + shape_directory: '#72c2c3' + shape_external: '#72c2c3' + shape_externalarg: { fg: '#72c373' attr: 'b' } + shape_filepath: '#72c2c3' + shape_flag: { fg: '#7372c3' attr: 'b' } + shape_float: { fg: '#c372c2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#72c2c3' attr: 'b' } + shape_int: { fg: '#c372c2' attr: 'b' } + shape_internalcall: { fg: '#72c2c3' attr: 'b' } + shape_list: { fg: '#72c2c3' attr: 'b' } + shape_literal: '#7372c3' + shape_match_pattern: '#72c373' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#aadadb' + shape_operator: '#c2c372' + shape_or: { fg: '#c372c2' attr: 'b' } + shape_pipe: { fg: '#c372c2' attr: 'b' } + shape_range: { fg: '#c2c372' attr: 'b' } + shape_record: { fg: '#72c2c3' attr: 'b' } + shape_redirection: { fg: '#c372c2' attr: 'b' } + shape_signature: { fg: '#72c373' attr: 'b' } + shape_string: '#72c373' + shape_string_interpolation: { fg: '#72c2c3' attr: 'b' } + shape_table: { fg: '#7372c3' attr: 'b' } + shape_variable: '#c372c2' + + background: '#29262f' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/challenger-deep.nu b/themes/nu-themes/challenger-deep.nu index c53f962..4a35611 100644 --- a/themes/nu-themes/challenger-deep.nu +++ b/themes/nu-themes/challenger-deep.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbe3e7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#95ffa4" attr: "b" } - empty: "#91ddff" - bool: {|| if $in { "#63f2f1" } else { "light_gray" } } - int: "#cbe3e7" - filesize: {|e| - if $e == 0b { - "#cbe3e7" - } else if $e < 1mb { - "#aaffe4" - } else {{ fg: "#91ddff" }} - } - duration: "#cbe3e7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff8080" attr: "b" } - } else if $in < 6hr { - "#ff8080" - } else if $in < 1day { - "#ffe9aa" - } else if $in < 3day { - "#95ffa4" - } else if $in < 1wk { - { fg: "#95ffa4" attr: "b" } - } else if $in < 6wk { - "#aaffe4" - } else if $in < 52wk { - "#91ddff" - } else { "dark_gray" } - } - range: "#cbe3e7" - float: "#cbe3e7" - string: "#cbe3e7" - nothing: "#cbe3e7" - binary: "#cbe3e7" - cellpath: "#cbe3e7" - row_index: { fg: "#95ffa4" attr: "b" } - record: "#cbe3e7" - list: "#cbe3e7" - block: "#cbe3e7" - hints: "dark_gray" - search_result: { fg: "#ff8080" bg: "#cbe3e7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c991e1" attr: "b" } - shape_binary: { fg: "#c991e1" attr: "b" } - shape_block: { fg: "#91ddff" attr: "b" } - shape_bool: "#63f2f1" - shape_custom: "#95ffa4" - shape_datetime: { fg: "#aaffe4" attr: "b" } - shape_directory: "#aaffe4" - shape_external: "#aaffe4" - shape_externalarg: { fg: "#95ffa4" attr: "b" } - shape_filepath: "#aaffe4" - shape_flag: { fg: "#91ddff" attr: "b" } - shape_float: { fg: "#c991e1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#aaffe4" attr: "b" } - shape_int: { fg: "#c991e1" attr: "b" } - shape_internalcall: { fg: "#aaffe4" attr: "b" } - shape_list: { fg: "#aaffe4" attr: "b" } - shape_literal: "#91ddff" - shape_match_pattern: "#95ffa4" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#63f2f1" - shape_operator: "#ffe9aa" - shape_or: { fg: "#c991e1" attr: "b" } - shape_pipe: { fg: "#c991e1" attr: "b" } - shape_range: { fg: "#ffe9aa" attr: "b" } - shape_record: { fg: "#aaffe4" attr: "b" } - shape_redirection: { fg: "#c991e1" attr: "b" } - shape_signature: { fg: "#95ffa4" attr: "b" } - shape_string: "#95ffa4" - shape_string_interpolation: { fg: "#aaffe4" attr: "b" } - shape_table: { fg: "#91ddff" attr: "b" } - shape_variable: "#c991e1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e1c31" - foreground: "#cbe3e7" - cursor: "#cbe3e7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbe3e7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#95ffa4' attr: 'b' } + empty: '#91ddff' + bool: {|| if $in { '#63f2f1' } else { 'light_gray' } } + int: '#cbe3e7' + filesize: {|e| + if $e == 0b { + '#cbe3e7' + } else if $e < 1mb { + '#aaffe4' + } else {{ fg: '#91ddff' }} + } + duration: '#cbe3e7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff8080' attr: 'b' } + } else if $in < 6hr { + '#ff8080' + } else if $in < 1day { + '#ffe9aa' + } else if $in < 3day { + '#95ffa4' + } else if $in < 1wk { + { fg: '#95ffa4' attr: 'b' } + } else if $in < 6wk { + '#aaffe4' + } else if $in < 52wk { + '#91ddff' + } else { 'dark_gray' } + } + range: '#cbe3e7' + float: '#cbe3e7' + string: '#cbe3e7' + nothing: '#cbe3e7' + binary: '#cbe3e7' + cellpath: '#cbe3e7' + row_index: { fg: '#95ffa4' attr: 'b' } + record: '#cbe3e7' + list: '#cbe3e7' + block: '#cbe3e7' + hints: 'dark_gray' + search_result: { fg: '#ff8080' bg: '#cbe3e7' } + + shape_and: { fg: '#c991e1' attr: 'b' } + shape_binary: { fg: '#c991e1' attr: 'b' } + shape_block: { fg: '#91ddff' attr: 'b' } + shape_bool: '#63f2f1' + shape_custom: '#95ffa4' + shape_datetime: { fg: '#aaffe4' attr: 'b' } + shape_directory: '#aaffe4' + shape_external: '#aaffe4' + shape_externalarg: { fg: '#95ffa4' attr: 'b' } + shape_filepath: '#aaffe4' + shape_flag: { fg: '#91ddff' attr: 'b' } + shape_float: { fg: '#c991e1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#aaffe4' attr: 'b' } + shape_int: { fg: '#c991e1' attr: 'b' } + shape_internalcall: { fg: '#aaffe4' attr: 'b' } + shape_list: { fg: '#aaffe4' attr: 'b' } + shape_literal: '#91ddff' + shape_match_pattern: '#95ffa4' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#63f2f1' + shape_operator: '#ffe9aa' + shape_or: { fg: '#c991e1' attr: 'b' } + shape_pipe: { fg: '#c991e1' attr: 'b' } + shape_range: { fg: '#ffe9aa' attr: 'b' } + shape_record: { fg: '#aaffe4' attr: 'b' } + shape_redirection: { fg: '#c991e1' attr: 'b' } + shape_signature: { fg: '#95ffa4' attr: 'b' } + shape_string: '#95ffa4' + shape_string_interpolation: { fg: '#aaffe4' attr: 'b' } + shape_table: { fg: '#91ddff' attr: 'b' } + shape_variable: '#c991e1' + + background: '#1e1c31' + foreground: '#cbe3e7' + cursor: '#cbe3e7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ciapre.nu b/themes/nu-themes/ciapre.nu index 003aa8e..5a55bfc 100644 --- a/themes/nu-themes/ciapre.nu +++ b/themes/nu-themes/ciapre.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#aea47f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#48513b" attr: "b" } - empty: "#576d8c" - bool: {|| if $in { "#f3dbb2" } else { "light_gray" } } - int: "#aea47f" - filesize: {|e| - if $e == 0b { - "#aea47f" - } else if $e < 1mb { - "#5c4f4b" - } else {{ fg: "#576d8c" }} - } - duration: "#aea47f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#810009" attr: "b" } - } else if $in < 6hr { - "#810009" - } else if $in < 1day { - "#cc8b3f" - } else if $in < 3day { - "#48513b" - } else if $in < 1wk { - { fg: "#48513b" attr: "b" } - } else if $in < 6wk { - "#5c4f4b" - } else if $in < 52wk { - "#576d8c" - } else { "dark_gray" } - } - range: "#aea47f" - float: "#aea47f" - string: "#aea47f" - nothing: "#aea47f" - binary: "#aea47f" - cellpath: "#aea47f" - row_index: { fg: "#48513b" attr: "b" } - record: "#aea47f" - list: "#aea47f" - block: "#aea47f" - hints: "dark_gray" - search_result: { fg: "#810009" bg: "#aea47f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#724d7c" attr: "b" } - shape_binary: { fg: "#724d7c" attr: "b" } - shape_block: { fg: "#576d8c" attr: "b" } - shape_bool: "#f3dbb2" - shape_custom: "#48513b" - shape_datetime: { fg: "#5c4f4b" attr: "b" } - shape_directory: "#5c4f4b" - shape_external: "#5c4f4b" - shape_externalarg: { fg: "#48513b" attr: "b" } - shape_filepath: "#5c4f4b" - shape_flag: { fg: "#576d8c" attr: "b" } - shape_float: { fg: "#724d7c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5c4f4b" attr: "b" } - shape_int: { fg: "#724d7c" attr: "b" } - shape_internalcall: { fg: "#5c4f4b" attr: "b" } - shape_list: { fg: "#5c4f4b" attr: "b" } - shape_literal: "#576d8c" - shape_match_pattern: "#48513b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#f3dbb2" - shape_operator: "#cc8b3f" - shape_or: { fg: "#724d7c" attr: "b" } - shape_pipe: { fg: "#724d7c" attr: "b" } - shape_range: { fg: "#cc8b3f" attr: "b" } - shape_record: { fg: "#5c4f4b" attr: "b" } - shape_redirection: { fg: "#724d7c" attr: "b" } - shape_signature: { fg: "#48513b" attr: "b" } - shape_string: "#48513b" - shape_string_interpolation: { fg: "#5c4f4b" attr: "b" } - shape_table: { fg: "#576d8c" attr: "b" } - shape_variable: "#724d7c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191c27" - foreground: "#aea47a" - cursor: "#aea47a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#aea47f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#48513b' attr: 'b' } + empty: '#576d8c' + bool: {|| if $in { '#f3dbb2' } else { 'light_gray' } } + int: '#aea47f' + filesize: {|e| + if $e == 0b { + '#aea47f' + } else if $e < 1mb { + '#5c4f4b' + } else {{ fg: '#576d8c' }} + } + duration: '#aea47f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#810009' attr: 'b' } + } else if $in < 6hr { + '#810009' + } else if $in < 1day { + '#cc8b3f' + } else if $in < 3day { + '#48513b' + } else if $in < 1wk { + { fg: '#48513b' attr: 'b' } + } else if $in < 6wk { + '#5c4f4b' + } else if $in < 52wk { + '#576d8c' + } else { 'dark_gray' } + } + range: '#aea47f' + float: '#aea47f' + string: '#aea47f' + nothing: '#aea47f' + binary: '#aea47f' + cellpath: '#aea47f' + row_index: { fg: '#48513b' attr: 'b' } + record: '#aea47f' + list: '#aea47f' + block: '#aea47f' + hints: 'dark_gray' + search_result: { fg: '#810009' bg: '#aea47f' } + + shape_and: { fg: '#724d7c' attr: 'b' } + shape_binary: { fg: '#724d7c' attr: 'b' } + shape_block: { fg: '#576d8c' attr: 'b' } + shape_bool: '#f3dbb2' + shape_custom: '#48513b' + shape_datetime: { fg: '#5c4f4b' attr: 'b' } + shape_directory: '#5c4f4b' + shape_external: '#5c4f4b' + shape_externalarg: { fg: '#48513b' attr: 'b' } + shape_filepath: '#5c4f4b' + shape_flag: { fg: '#576d8c' attr: 'b' } + shape_float: { fg: '#724d7c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5c4f4b' attr: 'b' } + shape_int: { fg: '#724d7c' attr: 'b' } + shape_internalcall: { fg: '#5c4f4b' attr: 'b' } + shape_list: { fg: '#5c4f4b' attr: 'b' } + shape_literal: '#576d8c' + shape_match_pattern: '#48513b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#f3dbb2' + shape_operator: '#cc8b3f' + shape_or: { fg: '#724d7c' attr: 'b' } + shape_pipe: { fg: '#724d7c' attr: 'b' } + shape_range: { fg: '#cc8b3f' attr: 'b' } + shape_record: { fg: '#5c4f4b' attr: 'b' } + shape_redirection: { fg: '#724d7c' attr: 'b' } + shape_signature: { fg: '#48513b' attr: 'b' } + shape_string: '#48513b' + shape_string_interpolation: { fg: '#5c4f4b' attr: 'b' } + shape_table: { fg: '#576d8c' attr: 'b' } + shape_variable: '#724d7c' + + background: '#191c27' + foreground: '#aea47a' + cursor: '#aea47a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/circus.nu b/themes/nu-themes/circus.nu index 66c59f2..07f5043 100644 --- a/themes/nu-themes/circus.nu +++ b/themes/nu-themes/circus.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a7a7a7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#84b97c" attr: "b" } - empty: "#639ee4" - bool: {|| if $in { "#4bb1a7" } else { "light_gray" } } - int: "#a7a7a7" - filesize: {|e| - if $e == 0b { - "#a7a7a7" - } else if $e < 1mb { - "#4bb1a7" - } else {{ fg: "#639ee4" }} - } - duration: "#a7a7a7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dc657d" attr: "b" } - } else if $in < 6hr { - "#dc657d" - } else if $in < 1day { - "#c3ba63" - } else if $in < 3day { - "#84b97c" - } else if $in < 1wk { - { fg: "#84b97c" attr: "b" } - } else if $in < 6wk { - "#4bb1a7" - } else if $in < 52wk { - "#639ee4" - } else { "dark_gray" } - } - range: "#a7a7a7" - float: "#a7a7a7" - string: "#a7a7a7" - nothing: "#a7a7a7" - binary: "#a7a7a7" - cellpath: "#a7a7a7" - row_index: { fg: "#84b97c" attr: "b" } - record: "#a7a7a7" - list: "#a7a7a7" - block: "#a7a7a7" - hints: "dark_gray" - search_result: { fg: "#dc657d" bg: "#a7a7a7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b888e2" attr: "b" } - shape_binary: { fg: "#b888e2" attr: "b" } - shape_block: { fg: "#639ee4" attr: "b" } - shape_bool: "#4bb1a7" - shape_custom: "#84b97c" - shape_datetime: { fg: "#4bb1a7" attr: "b" } - shape_directory: "#4bb1a7" - shape_external: "#4bb1a7" - shape_externalarg: { fg: "#84b97c" attr: "b" } - shape_filepath: "#4bb1a7" - shape_flag: { fg: "#639ee4" attr: "b" } - shape_float: { fg: "#b888e2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4bb1a7" attr: "b" } - shape_int: { fg: "#b888e2" attr: "b" } - shape_internalcall: { fg: "#4bb1a7" attr: "b" } - shape_list: { fg: "#4bb1a7" attr: "b" } - shape_literal: "#639ee4" - shape_match_pattern: "#84b97c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4bb1a7" - shape_operator: "#c3ba63" - shape_or: { fg: "#b888e2" attr: "b" } - shape_pipe: { fg: "#b888e2" attr: "b" } - shape_range: { fg: "#c3ba63" attr: "b" } - shape_record: { fg: "#4bb1a7" attr: "b" } - shape_redirection: { fg: "#b888e2" attr: "b" } - shape_signature: { fg: "#84b97c" attr: "b" } - shape_string: "#84b97c" - shape_string_interpolation: { fg: "#4bb1a7" attr: "b" } - shape_table: { fg: "#639ee4" attr: "b" } - shape_variable: "#b888e2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191919" - foreground: "#a7a7a7" - cursor: "#a7a7a7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a7a7a7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#84b97c' attr: 'b' } + empty: '#639ee4' + bool: {|| if $in { '#4bb1a7' } else { 'light_gray' } } + int: '#a7a7a7' + filesize: {|e| + if $e == 0b { + '#a7a7a7' + } else if $e < 1mb { + '#4bb1a7' + } else {{ fg: '#639ee4' }} + } + duration: '#a7a7a7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dc657d' attr: 'b' } + } else if $in < 6hr { + '#dc657d' + } else if $in < 1day { + '#c3ba63' + } else if $in < 3day { + '#84b97c' + } else if $in < 1wk { + { fg: '#84b97c' attr: 'b' } + } else if $in < 6wk { + '#4bb1a7' + } else if $in < 52wk { + '#639ee4' + } else { 'dark_gray' } + } + range: '#a7a7a7' + float: '#a7a7a7' + string: '#a7a7a7' + nothing: '#a7a7a7' + binary: '#a7a7a7' + cellpath: '#a7a7a7' + row_index: { fg: '#84b97c' attr: 'b' } + record: '#a7a7a7' + list: '#a7a7a7' + block: '#a7a7a7' + hints: 'dark_gray' + search_result: { fg: '#dc657d' bg: '#a7a7a7' } + + shape_and: { fg: '#b888e2' attr: 'b' } + shape_binary: { fg: '#b888e2' attr: 'b' } + shape_block: { fg: '#639ee4' attr: 'b' } + shape_bool: '#4bb1a7' + shape_custom: '#84b97c' + shape_datetime: { fg: '#4bb1a7' attr: 'b' } + shape_directory: '#4bb1a7' + shape_external: '#4bb1a7' + shape_externalarg: { fg: '#84b97c' attr: 'b' } + shape_filepath: '#4bb1a7' + shape_flag: { fg: '#639ee4' attr: 'b' } + shape_float: { fg: '#b888e2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4bb1a7' attr: 'b' } + shape_int: { fg: '#b888e2' attr: 'b' } + shape_internalcall: { fg: '#4bb1a7' attr: 'b' } + shape_list: { fg: '#4bb1a7' attr: 'b' } + shape_literal: '#639ee4' + shape_match_pattern: '#84b97c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4bb1a7' + shape_operator: '#c3ba63' + shape_or: { fg: '#b888e2' attr: 'b' } + shape_pipe: { fg: '#b888e2' attr: 'b' } + shape_range: { fg: '#c3ba63' attr: 'b' } + shape_record: { fg: '#4bb1a7' attr: 'b' } + shape_redirection: { fg: '#b888e2' attr: 'b' } + shape_signature: { fg: '#84b97c' attr: 'b' } + shape_string: '#84b97c' + shape_string_interpolation: { fg: '#4bb1a7' attr: 'b' } + shape_table: { fg: '#639ee4' attr: 'b' } + shape_variable: '#b888e2' + + background: '#191919' + foreground: '#a7a7a7' + cursor: '#a7a7a7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/classic-dark.nu b/themes/nu-themes/classic-dark.nu index 5fe18c3..431b893 100644 --- a/themes/nu-themes/classic-dark.nu +++ b/themes/nu-themes/classic-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#90a959" attr: "b" } - empty: "#6a9fb5" - bool: {|| if $in { "#75b5aa" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#75b5aa" - } else {{ fg: "#6a9fb5" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ac4142" attr: "b" } - } else if $in < 6hr { - "#ac4142" - } else if $in < 1day { - "#f4bf75" - } else if $in < 3day { - "#90a959" - } else if $in < 1wk { - { fg: "#90a959" attr: "b" } - } else if $in < 6wk { - "#75b5aa" - } else if $in < 52wk { - "#6a9fb5" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#90a959" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#ac4142" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#aa759f" attr: "b" } - shape_binary: { fg: "#aa759f" attr: "b" } - shape_block: { fg: "#6a9fb5" attr: "b" } - shape_bool: "#75b5aa" - shape_custom: "#90a959" - shape_datetime: { fg: "#75b5aa" attr: "b" } - shape_directory: "#75b5aa" - shape_external: "#75b5aa" - shape_externalarg: { fg: "#90a959" attr: "b" } - shape_filepath: "#75b5aa" - shape_flag: { fg: "#6a9fb5" attr: "b" } - shape_float: { fg: "#aa759f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#75b5aa" attr: "b" } - shape_int: { fg: "#aa759f" attr: "b" } - shape_internalcall: { fg: "#75b5aa" attr: "b" } - shape_list: { fg: "#75b5aa" attr: "b" } - shape_literal: "#6a9fb5" - shape_match_pattern: "#90a959" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#75b5aa" - shape_operator: "#f4bf75" - shape_or: { fg: "#aa759f" attr: "b" } - shape_pipe: { fg: "#aa759f" attr: "b" } - shape_range: { fg: "#f4bf75" attr: "b" } - shape_record: { fg: "#75b5aa" attr: "b" } - shape_redirection: { fg: "#aa759f" attr: "b" } - shape_signature: { fg: "#90a959" attr: "b" } - shape_string: "#90a959" - shape_string_interpolation: { fg: "#75b5aa" attr: "b" } - shape_table: { fg: "#6a9fb5" attr: "b" } - shape_variable: "#aa759f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#151515" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#90a959' attr: 'b' } + empty: '#6a9fb5' + bool: {|| if $in { '#75b5aa' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#75b5aa' + } else {{ fg: '#6a9fb5' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ac4142' attr: 'b' } + } else if $in < 6hr { + '#ac4142' + } else if $in < 1day { + '#f4bf75' + } else if $in < 3day { + '#90a959' + } else if $in < 1wk { + { fg: '#90a959' attr: 'b' } + } else if $in < 6wk { + '#75b5aa' + } else if $in < 52wk { + '#6a9fb5' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#90a959' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#ac4142' bg: '#d0d0d0' } + + shape_and: { fg: '#aa759f' attr: 'b' } + shape_binary: { fg: '#aa759f' attr: 'b' } + shape_block: { fg: '#6a9fb5' attr: 'b' } + shape_bool: '#75b5aa' + shape_custom: '#90a959' + shape_datetime: { fg: '#75b5aa' attr: 'b' } + shape_directory: '#75b5aa' + shape_external: '#75b5aa' + shape_externalarg: { fg: '#90a959' attr: 'b' } + shape_filepath: '#75b5aa' + shape_flag: { fg: '#6a9fb5' attr: 'b' } + shape_float: { fg: '#aa759f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#75b5aa' attr: 'b' } + shape_int: { fg: '#aa759f' attr: 'b' } + shape_internalcall: { fg: '#75b5aa' attr: 'b' } + shape_list: { fg: '#75b5aa' attr: 'b' } + shape_literal: '#6a9fb5' + shape_match_pattern: '#90a959' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#75b5aa' + shape_operator: '#f4bf75' + shape_or: { fg: '#aa759f' attr: 'b' } + shape_pipe: { fg: '#aa759f' attr: 'b' } + shape_range: { fg: '#f4bf75' attr: 'b' } + shape_record: { fg: '#75b5aa' attr: 'b' } + shape_redirection: { fg: '#aa759f' attr: 'b' } + shape_signature: { fg: '#90a959' attr: 'b' } + shape_string: '#90a959' + shape_string_interpolation: { fg: '#75b5aa' attr: 'b' } + shape_table: { fg: '#6a9fb5' attr: 'b' } + shape_variable: '#aa759f' + + background: '#151515' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/classic-light.nu b/themes/nu-themes/classic-light.nu index 4de53c9..dc2d133 100644 --- a/themes/nu-themes/classic-light.nu +++ b/themes/nu-themes/classic-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#303030" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#90a959" attr: "b" } - empty: "#6a9fb5" - bool: {|| if $in { "#75b5aa" } else { "light_gray" } } - int: "#303030" - filesize: {|e| - if $e == 0b { - "#303030" - } else if $e < 1mb { - "#75b5aa" - } else {{ fg: "#6a9fb5" }} - } - duration: "#303030" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ac4142" attr: "b" } - } else if $in < 6hr { - "#ac4142" - } else if $in < 1day { - "#f4bf75" - } else if $in < 3day { - "#90a959" - } else if $in < 1wk { - { fg: "#90a959" attr: "b" } - } else if $in < 6wk { - "#75b5aa" - } else if $in < 52wk { - "#6a9fb5" - } else { "dark_gray" } - } - range: "#303030" - float: "#303030" - string: "#303030" - nothing: "#303030" - binary: "#303030" - cellpath: "#303030" - row_index: { fg: "#90a959" attr: "b" } - record: "#303030" - list: "#303030" - block: "#303030" - hints: "dark_gray" - search_result: { fg: "#ac4142" bg: "#303030" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#aa759f" attr: "b" } - shape_binary: { fg: "#aa759f" attr: "b" } - shape_block: { fg: "#6a9fb5" attr: "b" } - shape_bool: "#75b5aa" - shape_custom: "#90a959" - shape_datetime: { fg: "#75b5aa" attr: "b" } - shape_directory: "#75b5aa" - shape_external: "#75b5aa" - shape_externalarg: { fg: "#90a959" attr: "b" } - shape_filepath: "#75b5aa" - shape_flag: { fg: "#6a9fb5" attr: "b" } - shape_float: { fg: "#aa759f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#75b5aa" attr: "b" } - shape_int: { fg: "#aa759f" attr: "b" } - shape_internalcall: { fg: "#75b5aa" attr: "b" } - shape_list: { fg: "#75b5aa" attr: "b" } - shape_literal: "#6a9fb5" - shape_match_pattern: "#90a959" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#75b5aa" - shape_operator: "#f4bf75" - shape_or: { fg: "#aa759f" attr: "b" } - shape_pipe: { fg: "#aa759f" attr: "b" } - shape_range: { fg: "#f4bf75" attr: "b" } - shape_record: { fg: "#75b5aa" attr: "b" } - shape_redirection: { fg: "#aa759f" attr: "b" } - shape_signature: { fg: "#90a959" attr: "b" } - shape_string: "#90a959" - shape_string_interpolation: { fg: "#75b5aa" attr: "b" } - shape_table: { fg: "#6a9fb5" attr: "b" } - shape_variable: "#aa759f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f5f5f5" - foreground: "#303030" - cursor: "#303030" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#303030' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#90a959' attr: 'b' } + empty: '#6a9fb5' + bool: {|| if $in { '#75b5aa' } else { 'light_gray' } } + int: '#303030' + filesize: {|e| + if $e == 0b { + '#303030' + } else if $e < 1mb { + '#75b5aa' + } else {{ fg: '#6a9fb5' }} + } + duration: '#303030' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ac4142' attr: 'b' } + } else if $in < 6hr { + '#ac4142' + } else if $in < 1day { + '#f4bf75' + } else if $in < 3day { + '#90a959' + } else if $in < 1wk { + { fg: '#90a959' attr: 'b' } + } else if $in < 6wk { + '#75b5aa' + } else if $in < 52wk { + '#6a9fb5' + } else { 'dark_gray' } + } + range: '#303030' + float: '#303030' + string: '#303030' + nothing: '#303030' + binary: '#303030' + cellpath: '#303030' + row_index: { fg: '#90a959' attr: 'b' } + record: '#303030' + list: '#303030' + block: '#303030' + hints: 'dark_gray' + search_result: { fg: '#ac4142' bg: '#303030' } + + shape_and: { fg: '#aa759f' attr: 'b' } + shape_binary: { fg: '#aa759f' attr: 'b' } + shape_block: { fg: '#6a9fb5' attr: 'b' } + shape_bool: '#75b5aa' + shape_custom: '#90a959' + shape_datetime: { fg: '#75b5aa' attr: 'b' } + shape_directory: '#75b5aa' + shape_external: '#75b5aa' + shape_externalarg: { fg: '#90a959' attr: 'b' } + shape_filepath: '#75b5aa' + shape_flag: { fg: '#6a9fb5' attr: 'b' } + shape_float: { fg: '#aa759f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#75b5aa' attr: 'b' } + shape_int: { fg: '#aa759f' attr: 'b' } + shape_internalcall: { fg: '#75b5aa' attr: 'b' } + shape_list: { fg: '#75b5aa' attr: 'b' } + shape_literal: '#6a9fb5' + shape_match_pattern: '#90a959' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#75b5aa' + shape_operator: '#f4bf75' + shape_or: { fg: '#aa759f' attr: 'b' } + shape_pipe: { fg: '#aa759f' attr: 'b' } + shape_range: { fg: '#f4bf75' attr: 'b' } + shape_record: { fg: '#75b5aa' attr: 'b' } + shape_redirection: { fg: '#aa759f' attr: 'b' } + shape_signature: { fg: '#90a959' attr: 'b' } + shape_string: '#90a959' + shape_string_interpolation: { fg: '#75b5aa' attr: 'b' } + shape_table: { fg: '#6a9fb5' attr: 'b' } + shape_variable: '#aa759f' + + background: '#f5f5f5' + foreground: '#303030' + cursor: '#303030' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/clone-of-ubuntu.nu b/themes/nu-themes/clone-of-ubuntu.nu index 753a5b2..f89c7cc 100644 --- a/themes/nu-themes/clone-of-ubuntu.nu +++ b/themes/nu-themes/clone-of-ubuntu.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d7cf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4e9a06" attr: "b" } - empty: "#3465a4" - bool: {|| if $in { "#34e2e2" } else { "light_gray" } } - int: "#d3d7cf" - filesize: {|e| - if $e == 0b { - "#d3d7cf" - } else if $e < 1mb { - "#06989a" - } else {{ fg: "#3465a4" }} - } - duration: "#d3d7cf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#c4a000" - } else if $in < 3day { - "#4e9a06" - } else if $in < 1wk { - { fg: "#4e9a06" attr: "b" } - } else if $in < 6wk { - "#06989a" - } else if $in < 52wk { - "#3465a4" - } else { "dark_gray" } - } - range: "#d3d7cf" - float: "#d3d7cf" - string: "#d3d7cf" - nothing: "#d3d7cf" - binary: "#d3d7cf" - cellpath: "#d3d7cf" - row_index: { fg: "#4e9a06" attr: "b" } - record: "#d3d7cf" - list: "#d3d7cf" - block: "#d3d7cf" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#d3d7cf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#75507b" attr: "b" } - shape_binary: { fg: "#75507b" attr: "b" } - shape_block: { fg: "#3465a4" attr: "b" } - shape_bool: "#34e2e2" - shape_custom: "#4e9a06" - shape_datetime: { fg: "#06989a" attr: "b" } - shape_directory: "#06989a" - shape_external: "#06989a" - shape_externalarg: { fg: "#4e9a06" attr: "b" } - shape_filepath: "#06989a" - shape_flag: { fg: "#3465a4" attr: "b" } - shape_float: { fg: "#75507b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#06989a" attr: "b" } - shape_int: { fg: "#75507b" attr: "b" } - shape_internalcall: { fg: "#06989a" attr: "b" } - shape_list: { fg: "#06989a" attr: "b" } - shape_literal: "#3465a4" - shape_match_pattern: "#4e9a06" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#34e2e2" - shape_operator: "#c4a000" - shape_or: { fg: "#75507b" attr: "b" } - shape_pipe: { fg: "#75507b" attr: "b" } - shape_range: { fg: "#c4a000" attr: "b" } - shape_record: { fg: "#06989a" attr: "b" } - shape_redirection: { fg: "#75507b" attr: "b" } - shape_signature: { fg: "#4e9a06" attr: "b" } - shape_string: "#4e9a06" - shape_string_interpolation: { fg: "#06989a" attr: "b" } - shape_table: { fg: "#3465a4" attr: "b" } - shape_variable: "#75507b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#300a24" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d7cf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4e9a06' attr: 'b' } + empty: '#3465a4' + bool: {|| if $in { '#34e2e2' } else { 'light_gray' } } + int: '#d3d7cf' + filesize: {|e| + if $e == 0b { + '#d3d7cf' + } else if $e < 1mb { + '#06989a' + } else {{ fg: '#3465a4' }} + } + duration: '#d3d7cf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#c4a000' + } else if $in < 3day { + '#4e9a06' + } else if $in < 1wk { + { fg: '#4e9a06' attr: 'b' } + } else if $in < 6wk { + '#06989a' + } else if $in < 52wk { + '#3465a4' + } else { 'dark_gray' } + } + range: '#d3d7cf' + float: '#d3d7cf' + string: '#d3d7cf' + nothing: '#d3d7cf' + binary: '#d3d7cf' + cellpath: '#d3d7cf' + row_index: { fg: '#4e9a06' attr: 'b' } + record: '#d3d7cf' + list: '#d3d7cf' + block: '#d3d7cf' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#d3d7cf' } + + shape_and: { fg: '#75507b' attr: 'b' } + shape_binary: { fg: '#75507b' attr: 'b' } + shape_block: { fg: '#3465a4' attr: 'b' } + shape_bool: '#34e2e2' + shape_custom: '#4e9a06' + shape_datetime: { fg: '#06989a' attr: 'b' } + shape_directory: '#06989a' + shape_external: '#06989a' + shape_externalarg: { fg: '#4e9a06' attr: 'b' } + shape_filepath: '#06989a' + shape_flag: { fg: '#3465a4' attr: 'b' } + shape_float: { fg: '#75507b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#06989a' attr: 'b' } + shape_int: { fg: '#75507b' attr: 'b' } + shape_internalcall: { fg: '#06989a' attr: 'b' } + shape_list: { fg: '#06989a' attr: 'b' } + shape_literal: '#3465a4' + shape_match_pattern: '#4e9a06' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#34e2e2' + shape_operator: '#c4a000' + shape_or: { fg: '#75507b' attr: 'b' } + shape_pipe: { fg: '#75507b' attr: 'b' } + shape_range: { fg: '#c4a000' attr: 'b' } + shape_record: { fg: '#06989a' attr: 'b' } + shape_redirection: { fg: '#75507b' attr: 'b' } + shape_signature: { fg: '#4e9a06' attr: 'b' } + shape_string: '#4e9a06' + shape_string_interpolation: { fg: '#06989a' attr: 'b' } + shape_table: { fg: '#3465a4' attr: 'b' } + shape_variable: '#75507b' + + background: '#300a24' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/clrs.nu b/themes/nu-themes/clrs.nu index 7ec5a69..9d2e285 100644 --- a/themes/nu-themes/clrs.nu +++ b/themes/nu-themes/clrs.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b3b3b3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#328a5d" attr: "b" } - empty: "#135cd0" - bool: {|| if $in { "#3ad5ce" } else { "light_gray" } } - int: "#b3b3b3" - filesize: {|e| - if $e == 0b { - "#b3b3b3" - } else if $e < 1mb { - "#33c3c1" - } else {{ fg: "#135cd0" }} - } - duration: "#b3b3b3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f8282a" attr: "b" } - } else if $in < 6hr { - "#f8282a" - } else if $in < 1day { - "#fa701d" - } else if $in < 3day { - "#328a5d" - } else if $in < 1wk { - { fg: "#328a5d" attr: "b" } - } else if $in < 6wk { - "#33c3c1" - } else if $in < 52wk { - "#135cd0" - } else { "dark_gray" } - } - range: "#b3b3b3" - float: "#b3b3b3" - string: "#b3b3b3" - nothing: "#b3b3b3" - binary: "#b3b3b3" - cellpath: "#b3b3b3" - row_index: { fg: "#328a5d" attr: "b" } - record: "#b3b3b3" - list: "#b3b3b3" - block: "#b3b3b3" - hints: "dark_gray" - search_result: { fg: "#f8282a" bg: "#b3b3b3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9f00bd" attr: "b" } - shape_binary: { fg: "#9f00bd" attr: "b" } - shape_block: { fg: "#135cd0" attr: "b" } - shape_bool: "#3ad5ce" - shape_custom: "#328a5d" - shape_datetime: { fg: "#33c3c1" attr: "b" } - shape_directory: "#33c3c1" - shape_external: "#33c3c1" - shape_externalarg: { fg: "#328a5d" attr: "b" } - shape_filepath: "#33c3c1" - shape_flag: { fg: "#135cd0" attr: "b" } - shape_float: { fg: "#9f00bd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#33c3c1" attr: "b" } - shape_int: { fg: "#9f00bd" attr: "b" } - shape_internalcall: { fg: "#33c3c1" attr: "b" } - shape_list: { fg: "#33c3c1" attr: "b" } - shape_literal: "#135cd0" - shape_match_pattern: "#328a5d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3ad5ce" - shape_operator: "#fa701d" - shape_or: { fg: "#9f00bd" attr: "b" } - shape_pipe: { fg: "#9f00bd" attr: "b" } - shape_range: { fg: "#fa701d" attr: "b" } - shape_record: { fg: "#33c3c1" attr: "b" } - shape_redirection: { fg: "#9f00bd" attr: "b" } - shape_signature: { fg: "#328a5d" attr: "b" } - shape_string: "#328a5d" - shape_string_interpolation: { fg: "#33c3c1" attr: "b" } - shape_table: { fg: "#135cd0" attr: "b" } - shape_variable: "#9f00bd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#262626" - cursor: "#262626" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b3b3b3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#328a5d' attr: 'b' } + empty: '#135cd0' + bool: {|| if $in { '#3ad5ce' } else { 'light_gray' } } + int: '#b3b3b3' + filesize: {|e| + if $e == 0b { + '#b3b3b3' + } else if $e < 1mb { + '#33c3c1' + } else {{ fg: '#135cd0' }} + } + duration: '#b3b3b3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f8282a' attr: 'b' } + } else if $in < 6hr { + '#f8282a' + } else if $in < 1day { + '#fa701d' + } else if $in < 3day { + '#328a5d' + } else if $in < 1wk { + { fg: '#328a5d' attr: 'b' } + } else if $in < 6wk { + '#33c3c1' + } else if $in < 52wk { + '#135cd0' + } else { 'dark_gray' } + } + range: '#b3b3b3' + float: '#b3b3b3' + string: '#b3b3b3' + nothing: '#b3b3b3' + binary: '#b3b3b3' + cellpath: '#b3b3b3' + row_index: { fg: '#328a5d' attr: 'b' } + record: '#b3b3b3' + list: '#b3b3b3' + block: '#b3b3b3' + hints: 'dark_gray' + search_result: { fg: '#f8282a' bg: '#b3b3b3' } + + shape_and: { fg: '#9f00bd' attr: 'b' } + shape_binary: { fg: '#9f00bd' attr: 'b' } + shape_block: { fg: '#135cd0' attr: 'b' } + shape_bool: '#3ad5ce' + shape_custom: '#328a5d' + shape_datetime: { fg: '#33c3c1' attr: 'b' } + shape_directory: '#33c3c1' + shape_external: '#33c3c1' + shape_externalarg: { fg: '#328a5d' attr: 'b' } + shape_filepath: '#33c3c1' + shape_flag: { fg: '#135cd0' attr: 'b' } + shape_float: { fg: '#9f00bd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#33c3c1' attr: 'b' } + shape_int: { fg: '#9f00bd' attr: 'b' } + shape_internalcall: { fg: '#33c3c1' attr: 'b' } + shape_list: { fg: '#33c3c1' attr: 'b' } + shape_literal: '#135cd0' + shape_match_pattern: '#328a5d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3ad5ce' + shape_operator: '#fa701d' + shape_or: { fg: '#9f00bd' attr: 'b' } + shape_pipe: { fg: '#9f00bd' attr: 'b' } + shape_range: { fg: '#fa701d' attr: 'b' } + shape_record: { fg: '#33c3c1' attr: 'b' } + shape_redirection: { fg: '#9f00bd' attr: 'b' } + shape_signature: { fg: '#328a5d' attr: 'b' } + shape_string: '#328a5d' + shape_string_interpolation: { fg: '#33c3c1' attr: 'b' } + shape_table: { fg: '#135cd0' attr: 'b' } + shape_variable: '#9f00bd' + + background: '#ffffff' + foreground: '#262626' + cursor: '#262626' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/cobalt-neon.nu b/themes/nu-themes/cobalt-neon.nu index f15ff9f..d4cc2a8 100644 --- a/themes/nu-themes/cobalt-neon.nu +++ b/themes/nu-themes/cobalt-neon.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ba46b2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3ba5ff" attr: "b" } - empty: "#8ff586" - bool: {|| if $in { "#6cbc67" } else { "light_gray" } } - int: "#ba46b2" - filesize: {|e| - if $e == 0b { - "#ba46b2" - } else if $e < 1mb { - "#8ff586" - } else {{ fg: "#8ff586" }} - } - duration: "#ba46b2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff2320" attr: "b" } - } else if $in < 6hr { - "#ff2320" - } else if $in < 1day { - "#e9e75c" - } else if $in < 3day { - "#3ba5ff" - } else if $in < 1wk { - { fg: "#3ba5ff" attr: "b" } - } else if $in < 6wk { - "#8ff586" - } else if $in < 52wk { - "#8ff586" - } else { "dark_gray" } - } - range: "#ba46b2" - float: "#ba46b2" - string: "#ba46b2" - nothing: "#ba46b2" - binary: "#ba46b2" - cellpath: "#ba46b2" - row_index: { fg: "#3ba5ff" attr: "b" } - record: "#ba46b2" - list: "#ba46b2" - block: "#ba46b2" - hints: "dark_gray" - search_result: { fg: "#ff2320" bg: "#ba46b2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#781aa0" attr: "b" } - shape_binary: { fg: "#781aa0" attr: "b" } - shape_block: { fg: "#8ff586" attr: "b" } - shape_bool: "#6cbc67" - shape_custom: "#3ba5ff" - shape_datetime: { fg: "#8ff586" attr: "b" } - shape_directory: "#8ff586" - shape_external: "#8ff586" - shape_externalarg: { fg: "#3ba5ff" attr: "b" } - shape_filepath: "#8ff586" - shape_flag: { fg: "#8ff586" attr: "b" } - shape_float: { fg: "#781aa0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ff586" attr: "b" } - shape_int: { fg: "#781aa0" attr: "b" } - shape_internalcall: { fg: "#8ff586" attr: "b" } - shape_list: { fg: "#8ff586" attr: "b" } - shape_literal: "#8ff586" - shape_match_pattern: "#3ba5ff" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6cbc67" - shape_operator: "#e9e75c" - shape_or: { fg: "#781aa0" attr: "b" } - shape_pipe: { fg: "#781aa0" attr: "b" } - shape_range: { fg: "#e9e75c" attr: "b" } - shape_record: { fg: "#8ff586" attr: "b" } - shape_redirection: { fg: "#781aa0" attr: "b" } - shape_signature: { fg: "#3ba5ff" attr: "b" } - shape_string: "#3ba5ff" - shape_string_interpolation: { fg: "#8ff586" attr: "b" } - shape_table: { fg: "#8ff586" attr: "b" } - shape_variable: "#781aa0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#142838" - foreground: "#8ff586" - cursor: "#8ff586" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ba46b2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3ba5ff' attr: 'b' } + empty: '#8ff586' + bool: {|| if $in { '#6cbc67' } else { 'light_gray' } } + int: '#ba46b2' + filesize: {|e| + if $e == 0b { + '#ba46b2' + } else if $e < 1mb { + '#8ff586' + } else {{ fg: '#8ff586' }} + } + duration: '#ba46b2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff2320' attr: 'b' } + } else if $in < 6hr { + '#ff2320' + } else if $in < 1day { + '#e9e75c' + } else if $in < 3day { + '#3ba5ff' + } else if $in < 1wk { + { fg: '#3ba5ff' attr: 'b' } + } else if $in < 6wk { + '#8ff586' + } else if $in < 52wk { + '#8ff586' + } else { 'dark_gray' } + } + range: '#ba46b2' + float: '#ba46b2' + string: '#ba46b2' + nothing: '#ba46b2' + binary: '#ba46b2' + cellpath: '#ba46b2' + row_index: { fg: '#3ba5ff' attr: 'b' } + record: '#ba46b2' + list: '#ba46b2' + block: '#ba46b2' + hints: 'dark_gray' + search_result: { fg: '#ff2320' bg: '#ba46b2' } + + shape_and: { fg: '#781aa0' attr: 'b' } + shape_binary: { fg: '#781aa0' attr: 'b' } + shape_block: { fg: '#8ff586' attr: 'b' } + shape_bool: '#6cbc67' + shape_custom: '#3ba5ff' + shape_datetime: { fg: '#8ff586' attr: 'b' } + shape_directory: '#8ff586' + shape_external: '#8ff586' + shape_externalarg: { fg: '#3ba5ff' attr: 'b' } + shape_filepath: '#8ff586' + shape_flag: { fg: '#8ff586' attr: 'b' } + shape_float: { fg: '#781aa0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ff586' attr: 'b' } + shape_int: { fg: '#781aa0' attr: 'b' } + shape_internalcall: { fg: '#8ff586' attr: 'b' } + shape_list: { fg: '#8ff586' attr: 'b' } + shape_literal: '#8ff586' + shape_match_pattern: '#3ba5ff' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6cbc67' + shape_operator: '#e9e75c' + shape_or: { fg: '#781aa0' attr: 'b' } + shape_pipe: { fg: '#781aa0' attr: 'b' } + shape_range: { fg: '#e9e75c' attr: 'b' } + shape_record: { fg: '#8ff586' attr: 'b' } + shape_redirection: { fg: '#781aa0' attr: 'b' } + shape_signature: { fg: '#3ba5ff' attr: 'b' } + shape_string: '#3ba5ff' + shape_string_interpolation: { fg: '#8ff586' attr: 'b' } + shape_table: { fg: '#8ff586' attr: 'b' } + shape_variable: '#781aa0' + + background: '#142838' + foreground: '#8ff586' + cursor: '#8ff586' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/cobalt2.nu b/themes/nu-themes/cobalt2.nu index f3a92c7..0f9564a 100644 --- a/themes/nu-themes/cobalt2.nu +++ b/themes/nu-themes/cobalt2.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#38de21" attr: "b" } - empty: "#1460d2" - bool: {|| if $in { "#6ae3fa" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#00bbbb" - } else {{ fg: "#1460d2" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0000" attr: "b" } - } else if $in < 6hr { - "#ff0000" - } else if $in < 1day { - "#ffe50a" - } else if $in < 3day { - "#38de21" - } else if $in < 1wk { - { fg: "#38de21" attr: "b" } - } else if $in < 6wk { - "#00bbbb" - } else if $in < 52wk { - "#1460d2" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#38de21" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#ff0000" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff005d" attr: "b" } - shape_binary: { fg: "#ff005d" attr: "b" } - shape_block: { fg: "#1460d2" attr: "b" } - shape_bool: "#6ae3fa" - shape_custom: "#38de21" - shape_datetime: { fg: "#00bbbb" attr: "b" } - shape_directory: "#00bbbb" - shape_external: "#00bbbb" - shape_externalarg: { fg: "#38de21" attr: "b" } - shape_filepath: "#00bbbb" - shape_flag: { fg: "#1460d2" attr: "b" } - shape_float: { fg: "#ff005d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00bbbb" attr: "b" } - shape_int: { fg: "#ff005d" attr: "b" } - shape_internalcall: { fg: "#00bbbb" attr: "b" } - shape_list: { fg: "#00bbbb" attr: "b" } - shape_literal: "#1460d2" - shape_match_pattern: "#38de21" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6ae3fa" - shape_operator: "#ffe50a" - shape_or: { fg: "#ff005d" attr: "b" } - shape_pipe: { fg: "#ff005d" attr: "b" } - shape_range: { fg: "#ffe50a" attr: "b" } - shape_record: { fg: "#00bbbb" attr: "b" } - shape_redirection: { fg: "#ff005d" attr: "b" } - shape_signature: { fg: "#38de21" attr: "b" } - shape_string: "#38de21" - shape_string_interpolation: { fg: "#00bbbb" attr: "b" } - shape_table: { fg: "#1460d2" attr: "b" } - shape_variable: "#ff005d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#132738" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#38de21' attr: 'b' } + empty: '#1460d2' + bool: {|| if $in { '#6ae3fa' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#00bbbb' + } else {{ fg: '#1460d2' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0000' attr: 'b' } + } else if $in < 6hr { + '#ff0000' + } else if $in < 1day { + '#ffe50a' + } else if $in < 3day { + '#38de21' + } else if $in < 1wk { + { fg: '#38de21' attr: 'b' } + } else if $in < 6wk { + '#00bbbb' + } else if $in < 52wk { + '#1460d2' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#38de21' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#ff0000' bg: '#bbbbbb' } + + shape_and: { fg: '#ff005d' attr: 'b' } + shape_binary: { fg: '#ff005d' attr: 'b' } + shape_block: { fg: '#1460d2' attr: 'b' } + shape_bool: '#6ae3fa' + shape_custom: '#38de21' + shape_datetime: { fg: '#00bbbb' attr: 'b' } + shape_directory: '#00bbbb' + shape_external: '#00bbbb' + shape_externalarg: { fg: '#38de21' attr: 'b' } + shape_filepath: '#00bbbb' + shape_flag: { fg: '#1460d2' attr: 'b' } + shape_float: { fg: '#ff005d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00bbbb' attr: 'b' } + shape_int: { fg: '#ff005d' attr: 'b' } + shape_internalcall: { fg: '#00bbbb' attr: 'b' } + shape_list: { fg: '#00bbbb' attr: 'b' } + shape_literal: '#1460d2' + shape_match_pattern: '#38de21' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6ae3fa' + shape_operator: '#ffe50a' + shape_or: { fg: '#ff005d' attr: 'b' } + shape_pipe: { fg: '#ff005d' attr: 'b' } + shape_range: { fg: '#ffe50a' attr: 'b' } + shape_record: { fg: '#00bbbb' attr: 'b' } + shape_redirection: { fg: '#ff005d' attr: 'b' } + shape_signature: { fg: '#38de21' attr: 'b' } + shape_string: '#38de21' + shape_string_interpolation: { fg: '#00bbbb' attr: 'b' } + shape_table: { fg: '#1460d2' attr: 'b' } + shape_variable: '#ff005d' + + background: '#132738' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/codeschool.nu b/themes/nu-themes/codeschool.nu index 112ea35..355ecf2 100644 --- a/themes/nu-themes/codeschool.nu +++ b/themes/nu-themes/codeschool.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#9ea7a6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#237986" attr: "b" } - empty: "#484d79" - bool: {|| if $in { "#b02f30" } else { "light_gray" } } - int: "#9ea7a6" - filesize: {|e| - if $e == 0b { - "#9ea7a6" - } else if $e < 1mb { - "#b02f30" - } else {{ fg: "#484d79" }} - } - duration: "#9ea7a6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#2a5491" attr: "b" } - } else if $in < 6hr { - "#2a5491" - } else if $in < 1day { - "#a03b1e" - } else if $in < 3day { - "#237986" - } else if $in < 1wk { - { fg: "#237986" attr: "b" } - } else if $in < 6wk { - "#b02f30" - } else if $in < 52wk { - "#484d79" - } else { "dark_gray" } - } - range: "#9ea7a6" - float: "#9ea7a6" - string: "#9ea7a6" - nothing: "#9ea7a6" - binary: "#9ea7a6" - cellpath: "#9ea7a6" - row_index: { fg: "#237986" attr: "b" } - record: "#9ea7a6" - list: "#9ea7a6" - block: "#9ea7a6" - hints: "dark_gray" - search_result: { fg: "#2a5491" bg: "#9ea7a6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c59820" attr: "b" } - shape_binary: { fg: "#c59820" attr: "b" } - shape_block: { fg: "#484d79" attr: "b" } - shape_bool: "#b02f30" - shape_custom: "#237986" - shape_datetime: { fg: "#b02f30" attr: "b" } - shape_directory: "#b02f30" - shape_external: "#b02f30" - shape_externalarg: { fg: "#237986" attr: "b" } - shape_filepath: "#b02f30" - shape_flag: { fg: "#484d79" attr: "b" } - shape_float: { fg: "#c59820" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b02f30" attr: "b" } - shape_int: { fg: "#c59820" attr: "b" } - shape_internalcall: { fg: "#b02f30" attr: "b" } - shape_list: { fg: "#b02f30" attr: "b" } - shape_literal: "#484d79" - shape_match_pattern: "#237986" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b02f30" - shape_operator: "#a03b1e" - shape_or: { fg: "#c59820" attr: "b" } - shape_pipe: { fg: "#c59820" attr: "b" } - shape_range: { fg: "#a03b1e" attr: "b" } - shape_record: { fg: "#b02f30" attr: "b" } - shape_redirection: { fg: "#c59820" attr: "b" } - shape_signature: { fg: "#237986" attr: "b" } - shape_string: "#237986" - shape_string_interpolation: { fg: "#b02f30" attr: "b" } - shape_table: { fg: "#484d79" attr: "b" } - shape_variable: "#c59820" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232c31" - foreground: "#9ea7a6" - cursor: "#9ea7a6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#9ea7a6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#237986' attr: 'b' } + empty: '#484d79' + bool: {|| if $in { '#b02f30' } else { 'light_gray' } } + int: '#9ea7a6' + filesize: {|e| + if $e == 0b { + '#9ea7a6' + } else if $e < 1mb { + '#b02f30' + } else {{ fg: '#484d79' }} + } + duration: '#9ea7a6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#2a5491' attr: 'b' } + } else if $in < 6hr { + '#2a5491' + } else if $in < 1day { + '#a03b1e' + } else if $in < 3day { + '#237986' + } else if $in < 1wk { + { fg: '#237986' attr: 'b' } + } else if $in < 6wk { + '#b02f30' + } else if $in < 52wk { + '#484d79' + } else { 'dark_gray' } + } + range: '#9ea7a6' + float: '#9ea7a6' + string: '#9ea7a6' + nothing: '#9ea7a6' + binary: '#9ea7a6' + cellpath: '#9ea7a6' + row_index: { fg: '#237986' attr: 'b' } + record: '#9ea7a6' + list: '#9ea7a6' + block: '#9ea7a6' + hints: 'dark_gray' + search_result: { fg: '#2a5491' bg: '#9ea7a6' } + + shape_and: { fg: '#c59820' attr: 'b' } + shape_binary: { fg: '#c59820' attr: 'b' } + shape_block: { fg: '#484d79' attr: 'b' } + shape_bool: '#b02f30' + shape_custom: '#237986' + shape_datetime: { fg: '#b02f30' attr: 'b' } + shape_directory: '#b02f30' + shape_external: '#b02f30' + shape_externalarg: { fg: '#237986' attr: 'b' } + shape_filepath: '#b02f30' + shape_flag: { fg: '#484d79' attr: 'b' } + shape_float: { fg: '#c59820' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b02f30' attr: 'b' } + shape_int: { fg: '#c59820' attr: 'b' } + shape_internalcall: { fg: '#b02f30' attr: 'b' } + shape_list: { fg: '#b02f30' attr: 'b' } + shape_literal: '#484d79' + shape_match_pattern: '#237986' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b02f30' + shape_operator: '#a03b1e' + shape_or: { fg: '#c59820' attr: 'b' } + shape_pipe: { fg: '#c59820' attr: 'b' } + shape_range: { fg: '#a03b1e' attr: 'b' } + shape_record: { fg: '#b02f30' attr: 'b' } + shape_redirection: { fg: '#c59820' attr: 'b' } + shape_signature: { fg: '#237986' attr: 'b' } + shape_string: '#237986' + shape_string_interpolation: { fg: '#b02f30' attr: 'b' } + shape_table: { fg: '#484d79' attr: 'b' } + shape_variable: '#c59820' + + background: '#232c31' + foreground: '#9ea7a6' + cursor: '#9ea7a6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/corvine.nu b/themes/nu-themes/corvine.nu index fc26f1f..49bc904 100644 --- a/themes/nu-themes/corvine.nu +++ b/themes/nu-themes/corvine.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c6c6c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87af5f" attr: "b" } - empty: "#87afd7" - bool: {|| if $in { "#5fd7d7" } else { "light_gray" } } - int: "#c6c6c6" - filesize: {|e| - if $e == 0b { - "#c6c6c6" - } else if $e < 1mb { - "#87d7d7" - } else {{ fg: "#87afd7" }} - } - duration: "#c6c6c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d78787" attr: "b" } - } else if $in < 6hr { - "#d78787" - } else if $in < 1day { - "#d7d7af" - } else if $in < 3day { - "#87af5f" - } else if $in < 1wk { - { fg: "#87af5f" attr: "b" } - } else if $in < 6wk { - "#87d7d7" - } else if $in < 52wk { - "#87afd7" - } else { "dark_gray" } - } - range: "#c6c6c6" - float: "#c6c6c6" - string: "#c6c6c6" - nothing: "#c6c6c6" - binary: "#c6c6c6" - cellpath: "#c6c6c6" - row_index: { fg: "#87af5f" attr: "b" } - record: "#c6c6c6" - list: "#c6c6c6" - block: "#c6c6c6" - hints: "dark_gray" - search_result: { fg: "#d78787" bg: "#c6c6c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#afafd7" attr: "b" } - shape_binary: { fg: "#afafd7" attr: "b" } - shape_block: { fg: "#87afd7" attr: "b" } - shape_bool: "#5fd7d7" - shape_custom: "#87af5f" - shape_datetime: { fg: "#87d7d7" attr: "b" } - shape_directory: "#87d7d7" - shape_external: "#87d7d7" - shape_externalarg: { fg: "#87af5f" attr: "b" } - shape_filepath: "#87d7d7" - shape_flag: { fg: "#87afd7" attr: "b" } - shape_float: { fg: "#afafd7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#87d7d7" attr: "b" } - shape_int: { fg: "#afafd7" attr: "b" } - shape_internalcall: { fg: "#87d7d7" attr: "b" } - shape_list: { fg: "#87d7d7" attr: "b" } - shape_literal: "#87afd7" - shape_match_pattern: "#87af5f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5fd7d7" - shape_operator: "#d7d7af" - shape_or: { fg: "#afafd7" attr: "b" } - shape_pipe: { fg: "#afafd7" attr: "b" } - shape_range: { fg: "#d7d7af" attr: "b" } - shape_record: { fg: "#87d7d7" attr: "b" } - shape_redirection: { fg: "#afafd7" attr: "b" } - shape_signature: { fg: "#87af5f" attr: "b" } - shape_string: "#87af5f" - shape_string_interpolation: { fg: "#87d7d7" attr: "b" } - shape_table: { fg: "#87afd7" attr: "b" } - shape_variable: "#afafd7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262626" - foreground: "#c6c6c6" - cursor: "#c6c6c6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c6c6c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87af5f' attr: 'b' } + empty: '#87afd7' + bool: {|| if $in { '#5fd7d7' } else { 'light_gray' } } + int: '#c6c6c6' + filesize: {|e| + if $e == 0b { + '#c6c6c6' + } else if $e < 1mb { + '#87d7d7' + } else {{ fg: '#87afd7' }} + } + duration: '#c6c6c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d78787' attr: 'b' } + } else if $in < 6hr { + '#d78787' + } else if $in < 1day { + '#d7d7af' + } else if $in < 3day { + '#87af5f' + } else if $in < 1wk { + { fg: '#87af5f' attr: 'b' } + } else if $in < 6wk { + '#87d7d7' + } else if $in < 52wk { + '#87afd7' + } else { 'dark_gray' } + } + range: '#c6c6c6' + float: '#c6c6c6' + string: '#c6c6c6' + nothing: '#c6c6c6' + binary: '#c6c6c6' + cellpath: '#c6c6c6' + row_index: { fg: '#87af5f' attr: 'b' } + record: '#c6c6c6' + list: '#c6c6c6' + block: '#c6c6c6' + hints: 'dark_gray' + search_result: { fg: '#d78787' bg: '#c6c6c6' } + + shape_and: { fg: '#afafd7' attr: 'b' } + shape_binary: { fg: '#afafd7' attr: 'b' } + shape_block: { fg: '#87afd7' attr: 'b' } + shape_bool: '#5fd7d7' + shape_custom: '#87af5f' + shape_datetime: { fg: '#87d7d7' attr: 'b' } + shape_directory: '#87d7d7' + shape_external: '#87d7d7' + shape_externalarg: { fg: '#87af5f' attr: 'b' } + shape_filepath: '#87d7d7' + shape_flag: { fg: '#87afd7' attr: 'b' } + shape_float: { fg: '#afafd7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#87d7d7' attr: 'b' } + shape_int: { fg: '#afafd7' attr: 'b' } + shape_internalcall: { fg: '#87d7d7' attr: 'b' } + shape_list: { fg: '#87d7d7' attr: 'b' } + shape_literal: '#87afd7' + shape_match_pattern: '#87af5f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5fd7d7' + shape_operator: '#d7d7af' + shape_or: { fg: '#afafd7' attr: 'b' } + shape_pipe: { fg: '#afafd7' attr: 'b' } + shape_range: { fg: '#d7d7af' attr: 'b' } + shape_record: { fg: '#87d7d7' attr: 'b' } + shape_redirection: { fg: '#afafd7' attr: 'b' } + shape_signature: { fg: '#87af5f' attr: 'b' } + shape_string: '#87af5f' + shape_string_interpolation: { fg: '#87d7d7' attr: 'b' } + shape_table: { fg: '#87afd7' attr: 'b' } + shape_variable: '#afafd7' + + background: '#262626' + foreground: '#c6c6c6' + cursor: '#c6c6c6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/crayon-pony-fish.nu b/themes/nu-themes/crayon-pony-fish.nu index b629c71..85e167e 100644 --- a/themes/nu-themes/crayon-pony-fish.nu +++ b/themes/nu-themes/crayon-pony-fish.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#68525a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#579524" attr: "b" } - empty: "#8c87b0" - bool: {|| if $in { "#ffceaf" } else { "light_gray" } } - int: "#68525a" - filesize: {|e| - if $e == 0b { - "#68525a" - } else if $e < 1mb { - "#e8a866" - } else {{ fg: "#8c87b0" }} - } - duration: "#68525a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#91002b" attr: "b" } - } else if $in < 6hr { - "#91002b" - } else if $in < 1day { - "#ab311b" - } else if $in < 3day { - "#579524" - } else if $in < 1wk { - { fg: "#579524" attr: "b" } - } else if $in < 6wk { - "#e8a866" - } else if $in < 52wk { - "#8c87b0" - } else { "dark_gray" } - } - range: "#68525a" - float: "#68525a" - string: "#68525a" - nothing: "#68525a" - binary: "#68525a" - cellpath: "#68525a" - row_index: { fg: "#579524" attr: "b" } - record: "#68525a" - list: "#68525a" - block: "#68525a" - hints: "dark_gray" - search_result: { fg: "#91002b" bg: "#68525a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#692f50" attr: "b" } - shape_binary: { fg: "#692f50" attr: "b" } - shape_block: { fg: "#8c87b0" attr: "b" } - shape_bool: "#ffceaf" - shape_custom: "#579524" - shape_datetime: { fg: "#e8a866" attr: "b" } - shape_directory: "#e8a866" - shape_external: "#e8a866" - shape_externalarg: { fg: "#579524" attr: "b" } - shape_filepath: "#e8a866" - shape_flag: { fg: "#8c87b0" attr: "b" } - shape_float: { fg: "#692f50" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#e8a866" attr: "b" } - shape_int: { fg: "#692f50" attr: "b" } - shape_internalcall: { fg: "#e8a866" attr: "b" } - shape_list: { fg: "#e8a866" attr: "b" } - shape_literal: "#8c87b0" - shape_match_pattern: "#579524" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ffceaf" - shape_operator: "#ab311b" - shape_or: { fg: "#692f50" attr: "b" } - shape_pipe: { fg: "#692f50" attr: "b" } - shape_range: { fg: "#ab311b" attr: "b" } - shape_record: { fg: "#e8a866" attr: "b" } - shape_redirection: { fg: "#692f50" attr: "b" } - shape_signature: { fg: "#579524" attr: "b" } - shape_string: "#579524" - shape_string_interpolation: { fg: "#e8a866" attr: "b" } - shape_table: { fg: "#8c87b0" attr: "b" } - shape_variable: "#692f50" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#150707" - foreground: "#68525a" - cursor: "#68525a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#68525a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#579524' attr: 'b' } + empty: '#8c87b0' + bool: {|| if $in { '#ffceaf' } else { 'light_gray' } } + int: '#68525a' + filesize: {|e| + if $e == 0b { + '#68525a' + } else if $e < 1mb { + '#e8a866' + } else {{ fg: '#8c87b0' }} + } + duration: '#68525a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#91002b' attr: 'b' } + } else if $in < 6hr { + '#91002b' + } else if $in < 1day { + '#ab311b' + } else if $in < 3day { + '#579524' + } else if $in < 1wk { + { fg: '#579524' attr: 'b' } + } else if $in < 6wk { + '#e8a866' + } else if $in < 52wk { + '#8c87b0' + } else { 'dark_gray' } + } + range: '#68525a' + float: '#68525a' + string: '#68525a' + nothing: '#68525a' + binary: '#68525a' + cellpath: '#68525a' + row_index: { fg: '#579524' attr: 'b' } + record: '#68525a' + list: '#68525a' + block: '#68525a' + hints: 'dark_gray' + search_result: { fg: '#91002b' bg: '#68525a' } + + shape_and: { fg: '#692f50' attr: 'b' } + shape_binary: { fg: '#692f50' attr: 'b' } + shape_block: { fg: '#8c87b0' attr: 'b' } + shape_bool: '#ffceaf' + shape_custom: '#579524' + shape_datetime: { fg: '#e8a866' attr: 'b' } + shape_directory: '#e8a866' + shape_external: '#e8a866' + shape_externalarg: { fg: '#579524' attr: 'b' } + shape_filepath: '#e8a866' + shape_flag: { fg: '#8c87b0' attr: 'b' } + shape_float: { fg: '#692f50' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#e8a866' attr: 'b' } + shape_int: { fg: '#692f50' attr: 'b' } + shape_internalcall: { fg: '#e8a866' attr: 'b' } + shape_list: { fg: '#e8a866' attr: 'b' } + shape_literal: '#8c87b0' + shape_match_pattern: '#579524' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ffceaf' + shape_operator: '#ab311b' + shape_or: { fg: '#692f50' attr: 'b' } + shape_pipe: { fg: '#692f50' attr: 'b' } + shape_range: { fg: '#ab311b' attr: 'b' } + shape_record: { fg: '#e8a866' attr: 'b' } + shape_redirection: { fg: '#692f50' attr: 'b' } + shape_signature: { fg: '#579524' attr: 'b' } + shape_string: '#579524' + shape_string_interpolation: { fg: '#e8a866' attr: 'b' } + shape_table: { fg: '#8c87b0' attr: 'b' } + shape_variable: '#692f50' + + background: '#150707' + foreground: '#68525a' + cursor: '#68525a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/cupcake.nu b/themes/nu-themes/cupcake.nu index 193f6cb..80809a3 100644 --- a/themes/nu-themes/cupcake.nu +++ b/themes/nu-themes/cupcake.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8b8198" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a3b367" attr: "b" } - empty: "#7297b9" - bool: {|| if $in { "#69a9a7" } else { "light_gray" } } - int: "#8b8198" - filesize: {|e| - if $e == 0b { - "#8b8198" - } else if $e < 1mb { - "#69a9a7" - } else {{ fg: "#7297b9" }} - } - duration: "#8b8198" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d57e85" attr: "b" } - } else if $in < 6hr { - "#d57e85" - } else if $in < 1day { - "#dcb16c" - } else if $in < 3day { - "#a3b367" - } else if $in < 1wk { - { fg: "#a3b367" attr: "b" } - } else if $in < 6wk { - "#69a9a7" - } else if $in < 52wk { - "#7297b9" - } else { "dark_gray" } - } - range: "#8b8198" - float: "#8b8198" - string: "#8b8198" - nothing: "#8b8198" - binary: "#8b8198" - cellpath: "#8b8198" - row_index: { fg: "#a3b367" attr: "b" } - record: "#8b8198" - list: "#8b8198" - block: "#8b8198" - hints: "dark_gray" - search_result: { fg: "#d57e85" bg: "#8b8198" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb99b4" attr: "b" } - shape_binary: { fg: "#bb99b4" attr: "b" } - shape_block: { fg: "#7297b9" attr: "b" } - shape_bool: "#69a9a7" - shape_custom: "#a3b367" - shape_datetime: { fg: "#69a9a7" attr: "b" } - shape_directory: "#69a9a7" - shape_external: "#69a9a7" - shape_externalarg: { fg: "#a3b367" attr: "b" } - shape_filepath: "#69a9a7" - shape_flag: { fg: "#7297b9" attr: "b" } - shape_float: { fg: "#bb99b4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#69a9a7" attr: "b" } - shape_int: { fg: "#bb99b4" attr: "b" } - shape_internalcall: { fg: "#69a9a7" attr: "b" } - shape_list: { fg: "#69a9a7" attr: "b" } - shape_literal: "#7297b9" - shape_match_pattern: "#a3b367" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#69a9a7" - shape_operator: "#dcb16c" - shape_or: { fg: "#bb99b4" attr: "b" } - shape_pipe: { fg: "#bb99b4" attr: "b" } - shape_range: { fg: "#dcb16c" attr: "b" } - shape_record: { fg: "#69a9a7" attr: "b" } - shape_redirection: { fg: "#bb99b4" attr: "b" } - shape_signature: { fg: "#a3b367" attr: "b" } - shape_string: "#a3b367" - shape_string_interpolation: { fg: "#69a9a7" attr: "b" } - shape_table: { fg: "#7297b9" attr: "b" } - shape_variable: "#bb99b4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf1f2" - foreground: "#8b8198" - cursor: "#8b8198" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8b8198' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a3b367' attr: 'b' } + empty: '#7297b9' + bool: {|| if $in { '#69a9a7' } else { 'light_gray' } } + int: '#8b8198' + filesize: {|e| + if $e == 0b { + '#8b8198' + } else if $e < 1mb { + '#69a9a7' + } else {{ fg: '#7297b9' }} + } + duration: '#8b8198' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d57e85' attr: 'b' } + } else if $in < 6hr { + '#d57e85' + } else if $in < 1day { + '#dcb16c' + } else if $in < 3day { + '#a3b367' + } else if $in < 1wk { + { fg: '#a3b367' attr: 'b' } + } else if $in < 6wk { + '#69a9a7' + } else if $in < 52wk { + '#7297b9' + } else { 'dark_gray' } + } + range: '#8b8198' + float: '#8b8198' + string: '#8b8198' + nothing: '#8b8198' + binary: '#8b8198' + cellpath: '#8b8198' + row_index: { fg: '#a3b367' attr: 'b' } + record: '#8b8198' + list: '#8b8198' + block: '#8b8198' + hints: 'dark_gray' + search_result: { fg: '#d57e85' bg: '#8b8198' } + + shape_and: { fg: '#bb99b4' attr: 'b' } + shape_binary: { fg: '#bb99b4' attr: 'b' } + shape_block: { fg: '#7297b9' attr: 'b' } + shape_bool: '#69a9a7' + shape_custom: '#a3b367' + shape_datetime: { fg: '#69a9a7' attr: 'b' } + shape_directory: '#69a9a7' + shape_external: '#69a9a7' + shape_externalarg: { fg: '#a3b367' attr: 'b' } + shape_filepath: '#69a9a7' + shape_flag: { fg: '#7297b9' attr: 'b' } + shape_float: { fg: '#bb99b4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#69a9a7' attr: 'b' } + shape_int: { fg: '#bb99b4' attr: 'b' } + shape_internalcall: { fg: '#69a9a7' attr: 'b' } + shape_list: { fg: '#69a9a7' attr: 'b' } + shape_literal: '#7297b9' + shape_match_pattern: '#a3b367' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#69a9a7' + shape_operator: '#dcb16c' + shape_or: { fg: '#bb99b4' attr: 'b' } + shape_pipe: { fg: '#bb99b4' attr: 'b' } + shape_range: { fg: '#dcb16c' attr: 'b' } + shape_record: { fg: '#69a9a7' attr: 'b' } + shape_redirection: { fg: '#bb99b4' attr: 'b' } + shape_signature: { fg: '#a3b367' attr: 'b' } + shape_string: '#a3b367' + shape_string_interpolation: { fg: '#69a9a7' attr: 'b' } + shape_table: { fg: '#7297b9' attr: 'b' } + shape_variable: '#bb99b4' + + background: '#fbf1f2' + foreground: '#8b8198' + cursor: '#8b8198' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/cupertino.nu b/themes/nu-themes/cupertino.nu index d32ce2f..edec4b6 100644 --- a/themes/nu-themes/cupertino.nu +++ b/themes/nu-themes/cupertino.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#404040" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#007400" attr: "b" } - empty: "#0000ff" - bool: {|| if $in { "#318495" } else { "light_gray" } } - int: "#404040" - filesize: {|e| - if $e == 0b { - "#404040" - } else if $e < 1mb { - "#318495" - } else {{ fg: "#0000ff" }} - } - duration: "#404040" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c41a15" attr: "b" } - } else if $in < 6hr { - "#c41a15" - } else if $in < 1day { - "#826b28" - } else if $in < 3day { - "#007400" - } else if $in < 1wk { - { fg: "#007400" attr: "b" } - } else if $in < 6wk { - "#318495" - } else if $in < 52wk { - "#0000ff" - } else { "dark_gray" } - } - range: "#404040" - float: "#404040" - string: "#404040" - nothing: "#404040" - binary: "#404040" - cellpath: "#404040" - row_index: { fg: "#007400" attr: "b" } - record: "#404040" - list: "#404040" - block: "#404040" - hints: "dark_gray" - search_result: { fg: "#c41a15" bg: "#404040" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a90d91" attr: "b" } - shape_binary: { fg: "#a90d91" attr: "b" } - shape_block: { fg: "#0000ff" attr: "b" } - shape_bool: "#318495" - shape_custom: "#007400" - shape_datetime: { fg: "#318495" attr: "b" } - shape_directory: "#318495" - shape_external: "#318495" - shape_externalarg: { fg: "#007400" attr: "b" } - shape_filepath: "#318495" - shape_flag: { fg: "#0000ff" attr: "b" } - shape_float: { fg: "#a90d91" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#318495" attr: "b" } - shape_int: { fg: "#a90d91" attr: "b" } - shape_internalcall: { fg: "#318495" attr: "b" } - shape_list: { fg: "#318495" attr: "b" } - shape_literal: "#0000ff" - shape_match_pattern: "#007400" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#318495" - shape_operator: "#826b28" - shape_or: { fg: "#a90d91" attr: "b" } - shape_pipe: { fg: "#a90d91" attr: "b" } - shape_range: { fg: "#826b28" attr: "b" } - shape_record: { fg: "#318495" attr: "b" } - shape_redirection: { fg: "#a90d91" attr: "b" } - shape_signature: { fg: "#007400" attr: "b" } - shape_string: "#007400" - shape_string_interpolation: { fg: "#318495" attr: "b" } - shape_table: { fg: "#0000ff" attr: "b" } - shape_variable: "#a90d91" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#404040" - cursor: "#404040" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#404040' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#007400' attr: 'b' } + empty: '#0000ff' + bool: {|| if $in { '#318495' } else { 'light_gray' } } + int: '#404040' + filesize: {|e| + if $e == 0b { + '#404040' + } else if $e < 1mb { + '#318495' + } else {{ fg: '#0000ff' }} + } + duration: '#404040' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c41a15' attr: 'b' } + } else if $in < 6hr { + '#c41a15' + } else if $in < 1day { + '#826b28' + } else if $in < 3day { + '#007400' + } else if $in < 1wk { + { fg: '#007400' attr: 'b' } + } else if $in < 6wk { + '#318495' + } else if $in < 52wk { + '#0000ff' + } else { 'dark_gray' } + } + range: '#404040' + float: '#404040' + string: '#404040' + nothing: '#404040' + binary: '#404040' + cellpath: '#404040' + row_index: { fg: '#007400' attr: 'b' } + record: '#404040' + list: '#404040' + block: '#404040' + hints: 'dark_gray' + search_result: { fg: '#c41a15' bg: '#404040' } + + shape_and: { fg: '#a90d91' attr: 'b' } + shape_binary: { fg: '#a90d91' attr: 'b' } + shape_block: { fg: '#0000ff' attr: 'b' } + shape_bool: '#318495' + shape_custom: '#007400' + shape_datetime: { fg: '#318495' attr: 'b' } + shape_directory: '#318495' + shape_external: '#318495' + shape_externalarg: { fg: '#007400' attr: 'b' } + shape_filepath: '#318495' + shape_flag: { fg: '#0000ff' attr: 'b' } + shape_float: { fg: '#a90d91' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#318495' attr: 'b' } + shape_int: { fg: '#a90d91' attr: 'b' } + shape_internalcall: { fg: '#318495' attr: 'b' } + shape_list: { fg: '#318495' attr: 'b' } + shape_literal: '#0000ff' + shape_match_pattern: '#007400' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#318495' + shape_operator: '#826b28' + shape_or: { fg: '#a90d91' attr: 'b' } + shape_pipe: { fg: '#a90d91' attr: 'b' } + shape_range: { fg: '#826b28' attr: 'b' } + shape_record: { fg: '#318495' attr: 'b' } + shape_redirection: { fg: '#a90d91' attr: 'b' } + shape_signature: { fg: '#007400' attr: 'b' } + shape_string: '#007400' + shape_string_interpolation: { fg: '#318495' attr: 'b' } + shape_table: { fg: '#0000ff' attr: 'b' } + shape_variable: '#a90d91' + + background: '#ffffff' + foreground: '#404040' + cursor: '#404040' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/danqing.nu b/themes/nu-themes/danqing.nu index 67b7a8a..ae0abf9 100644 --- a/themes/nu-themes/danqing.nu +++ b/themes/nu-themes/danqing.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0f0ef" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8ab361" attr: "b" } - empty: "#b0a4e3" - bool: {|| if $in { "#30dff3" } else { "light_gray" } } - int: "#e0f0ef" - filesize: {|e| - if $e == 0b { - "#e0f0ef" - } else if $e < 1mb { - "#30dff3" - } else {{ fg: "#b0a4e3" }} - } - duration: "#e0f0ef" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f9906f" attr: "b" } - } else if $in < 6hr { - "#f9906f" - } else if $in < 1day { - "#f0c239" - } else if $in < 3day { - "#8ab361" - } else if $in < 1wk { - { fg: "#8ab361" attr: "b" } - } else if $in < 6wk { - "#30dff3" - } else if $in < 52wk { - "#b0a4e3" - } else { "dark_gray" } - } - range: "#e0f0ef" - float: "#e0f0ef" - string: "#e0f0ef" - nothing: "#e0f0ef" - binary: "#e0f0ef" - cellpath: "#e0f0ef" - row_index: { fg: "#8ab361" attr: "b" } - record: "#e0f0ef" - list: "#e0f0ef" - block: "#e0f0ef" - hints: "dark_gray" - search_result: { fg: "#f9906f" bg: "#e0f0ef" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cca4e3" attr: "b" } - shape_binary: { fg: "#cca4e3" attr: "b" } - shape_block: { fg: "#b0a4e3" attr: "b" } - shape_bool: "#30dff3" - shape_custom: "#8ab361" - shape_datetime: { fg: "#30dff3" attr: "b" } - shape_directory: "#30dff3" - shape_external: "#30dff3" - shape_externalarg: { fg: "#8ab361" attr: "b" } - shape_filepath: "#30dff3" - shape_flag: { fg: "#b0a4e3" attr: "b" } - shape_float: { fg: "#cca4e3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#30dff3" attr: "b" } - shape_int: { fg: "#cca4e3" attr: "b" } - shape_internalcall: { fg: "#30dff3" attr: "b" } - shape_list: { fg: "#30dff3" attr: "b" } - shape_literal: "#b0a4e3" - shape_match_pattern: "#8ab361" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#30dff3" - shape_operator: "#f0c239" - shape_or: { fg: "#cca4e3" attr: "b" } - shape_pipe: { fg: "#cca4e3" attr: "b" } - shape_range: { fg: "#f0c239" attr: "b" } - shape_record: { fg: "#30dff3" attr: "b" } - shape_redirection: { fg: "#cca4e3" attr: "b" } - shape_signature: { fg: "#8ab361" attr: "b" } - shape_string: "#8ab361" - shape_string_interpolation: { fg: "#30dff3" attr: "b" } - shape_table: { fg: "#b0a4e3" attr: "b" } - shape_variable: "#cca4e3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2d302f" - foreground: "#e0f0ef" - cursor: "#e0f0ef" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0f0ef' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8ab361' attr: 'b' } + empty: '#b0a4e3' + bool: {|| if $in { '#30dff3' } else { 'light_gray' } } + int: '#e0f0ef' + filesize: {|e| + if $e == 0b { + '#e0f0ef' + } else if $e < 1mb { + '#30dff3' + } else {{ fg: '#b0a4e3' }} + } + duration: '#e0f0ef' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f9906f' attr: 'b' } + } else if $in < 6hr { + '#f9906f' + } else if $in < 1day { + '#f0c239' + } else if $in < 3day { + '#8ab361' + } else if $in < 1wk { + { fg: '#8ab361' attr: 'b' } + } else if $in < 6wk { + '#30dff3' + } else if $in < 52wk { + '#b0a4e3' + } else { 'dark_gray' } + } + range: '#e0f0ef' + float: '#e0f0ef' + string: '#e0f0ef' + nothing: '#e0f0ef' + binary: '#e0f0ef' + cellpath: '#e0f0ef' + row_index: { fg: '#8ab361' attr: 'b' } + record: '#e0f0ef' + list: '#e0f0ef' + block: '#e0f0ef' + hints: 'dark_gray' + search_result: { fg: '#f9906f' bg: '#e0f0ef' } + + shape_and: { fg: '#cca4e3' attr: 'b' } + shape_binary: { fg: '#cca4e3' attr: 'b' } + shape_block: { fg: '#b0a4e3' attr: 'b' } + shape_bool: '#30dff3' + shape_custom: '#8ab361' + shape_datetime: { fg: '#30dff3' attr: 'b' } + shape_directory: '#30dff3' + shape_external: '#30dff3' + shape_externalarg: { fg: '#8ab361' attr: 'b' } + shape_filepath: '#30dff3' + shape_flag: { fg: '#b0a4e3' attr: 'b' } + shape_float: { fg: '#cca4e3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#30dff3' attr: 'b' } + shape_int: { fg: '#cca4e3' attr: 'b' } + shape_internalcall: { fg: '#30dff3' attr: 'b' } + shape_list: { fg: '#30dff3' attr: 'b' } + shape_literal: '#b0a4e3' + shape_match_pattern: '#8ab361' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#30dff3' + shape_operator: '#f0c239' + shape_or: { fg: '#cca4e3' attr: 'b' } + shape_pipe: { fg: '#cca4e3' attr: 'b' } + shape_range: { fg: '#f0c239' attr: 'b' } + shape_record: { fg: '#30dff3' attr: 'b' } + shape_redirection: { fg: '#cca4e3' attr: 'b' } + shape_signature: { fg: '#8ab361' attr: 'b' } + shape_string: '#8ab361' + shape_string_interpolation: { fg: '#30dff3' attr: 'b' } + shape_table: { fg: '#b0a4e3' attr: 'b' } + shape_variable: '#cca4e3' + + background: '#2d302f' + foreground: '#e0f0ef' + cursor: '#e0f0ef' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/darcula.nu b/themes/nu-themes/darcula.nu index 4482d68..cd93c52 100644 --- a/themes/nu-themes/darcula.nu +++ b/themes/nu-themes/darcula.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a9b7c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6a8759" attr: "b" } - empty: "#9876aa" - bool: {|| if $in { "#629755" } else { "light_gray" } } - int: "#a9b7c6" - filesize: {|e| - if $e == 0b { - "#a9b7c6" - } else if $e < 1mb { - "#629755" - } else {{ fg: "#9876aa" }} - } - duration: "#a9b7c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#4eade5" attr: "b" } - } else if $in < 6hr { - "#4eade5" - } else if $in < 1day { - "#bbb529" - } else if $in < 3day { - "#6a8759" - } else if $in < 1wk { - { fg: "#6a8759" attr: "b" } - } else if $in < 6wk { - "#629755" - } else if $in < 52wk { - "#9876aa" - } else { "dark_gray" } - } - range: "#a9b7c6" - float: "#a9b7c6" - string: "#a9b7c6" - nothing: "#a9b7c6" - binary: "#a9b7c6" - cellpath: "#a9b7c6" - row_index: { fg: "#6a8759" attr: "b" } - record: "#a9b7c6" - list: "#a9b7c6" - block: "#a9b7c6" - hints: "dark_gray" - search_result: { fg: "#4eade5" bg: "#a9b7c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc7832" attr: "b" } - shape_binary: { fg: "#cc7832" attr: "b" } - shape_block: { fg: "#9876aa" attr: "b" } - shape_bool: "#629755" - shape_custom: "#6a8759" - shape_datetime: { fg: "#629755" attr: "b" } - shape_directory: "#629755" - shape_external: "#629755" - shape_externalarg: { fg: "#6a8759" attr: "b" } - shape_filepath: "#629755" - shape_flag: { fg: "#9876aa" attr: "b" } - shape_float: { fg: "#cc7832" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#629755" attr: "b" } - shape_int: { fg: "#cc7832" attr: "b" } - shape_internalcall: { fg: "#629755" attr: "b" } - shape_list: { fg: "#629755" attr: "b" } - shape_literal: "#9876aa" - shape_match_pattern: "#6a8759" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#629755" - shape_operator: "#bbb529" - shape_or: { fg: "#cc7832" attr: "b" } - shape_pipe: { fg: "#cc7832" attr: "b" } - shape_range: { fg: "#bbb529" attr: "b" } - shape_record: { fg: "#629755" attr: "b" } - shape_redirection: { fg: "#cc7832" attr: "b" } - shape_signature: { fg: "#6a8759" attr: "b" } - shape_string: "#6a8759" - shape_string_interpolation: { fg: "#629755" attr: "b" } - shape_table: { fg: "#9876aa" attr: "b" } - shape_variable: "#cc7832" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b2b2b" - foreground: "#a9b7c6" - cursor: "#a9b7c6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a9b7c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6a8759' attr: 'b' } + empty: '#9876aa' + bool: {|| if $in { '#629755' } else { 'light_gray' } } + int: '#a9b7c6' + filesize: {|e| + if $e == 0b { + '#a9b7c6' + } else if $e < 1mb { + '#629755' + } else {{ fg: '#9876aa' }} + } + duration: '#a9b7c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#4eade5' attr: 'b' } + } else if $in < 6hr { + '#4eade5' + } else if $in < 1day { + '#bbb529' + } else if $in < 3day { + '#6a8759' + } else if $in < 1wk { + { fg: '#6a8759' attr: 'b' } + } else if $in < 6wk { + '#629755' + } else if $in < 52wk { + '#9876aa' + } else { 'dark_gray' } + } + range: '#a9b7c6' + float: '#a9b7c6' + string: '#a9b7c6' + nothing: '#a9b7c6' + binary: '#a9b7c6' + cellpath: '#a9b7c6' + row_index: { fg: '#6a8759' attr: 'b' } + record: '#a9b7c6' + list: '#a9b7c6' + block: '#a9b7c6' + hints: 'dark_gray' + search_result: { fg: '#4eade5' bg: '#a9b7c6' } + + shape_and: { fg: '#cc7832' attr: 'b' } + shape_binary: { fg: '#cc7832' attr: 'b' } + shape_block: { fg: '#9876aa' attr: 'b' } + shape_bool: '#629755' + shape_custom: '#6a8759' + shape_datetime: { fg: '#629755' attr: 'b' } + shape_directory: '#629755' + shape_external: '#629755' + shape_externalarg: { fg: '#6a8759' attr: 'b' } + shape_filepath: '#629755' + shape_flag: { fg: '#9876aa' attr: 'b' } + shape_float: { fg: '#cc7832' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#629755' attr: 'b' } + shape_int: { fg: '#cc7832' attr: 'b' } + shape_internalcall: { fg: '#629755' attr: 'b' } + shape_list: { fg: '#629755' attr: 'b' } + shape_literal: '#9876aa' + shape_match_pattern: '#6a8759' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#629755' + shape_operator: '#bbb529' + shape_or: { fg: '#cc7832' attr: 'b' } + shape_pipe: { fg: '#cc7832' attr: 'b' } + shape_range: { fg: '#bbb529' attr: 'b' } + shape_record: { fg: '#629755' attr: 'b' } + shape_redirection: { fg: '#cc7832' attr: 'b' } + shape_signature: { fg: '#6a8759' attr: 'b' } + shape_string: '#6a8759' + shape_string_interpolation: { fg: '#629755' attr: 'b' } + shape_table: { fg: '#9876aa' attr: 'b' } + shape_variable: '#cc7832' + + background: '#2b2b2b' + foreground: '#a9b7c6' + cursor: '#a9b7c6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/dark-pastel.nu b/themes/nu-themes/dark-pastel.nu index 2a6ad5c..6eeed7a 100644 --- a/themes/nu-themes/dark-pastel.nu +++ b/themes/nu-themes/dark-pastel.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#55ff55" attr: "b" } - empty: "#5555ff" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#55ffff" - } else {{ fg: "#5555ff" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff5555" attr: "b" } - } else if $in < 6hr { - "#ff5555" - } else if $in < 1day { - "#ffff55" - } else if $in < 3day { - "#55ff55" - } else if $in < 1wk { - { fg: "#55ff55" attr: "b" } - } else if $in < 6wk { - "#55ffff" - } else if $in < 52wk { - "#5555ff" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#55ff55" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#ff5555" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff55ff" attr: "b" } - shape_binary: { fg: "#ff55ff" attr: "b" } - shape_block: { fg: "#5555ff" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#55ff55" - shape_datetime: { fg: "#55ffff" attr: "b" } - shape_directory: "#55ffff" - shape_external: "#55ffff" - shape_externalarg: { fg: "#55ff55" attr: "b" } - shape_filepath: "#55ffff" - shape_flag: { fg: "#5555ff" attr: "b" } - shape_float: { fg: "#ff55ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#55ffff" attr: "b" } - shape_int: { fg: "#ff55ff" attr: "b" } - shape_internalcall: { fg: "#55ffff" attr: "b" } - shape_list: { fg: "#55ffff" attr: "b" } - shape_literal: "#5555ff" - shape_match_pattern: "#55ff55" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#ffff55" - shape_or: { fg: "#ff55ff" attr: "b" } - shape_pipe: { fg: "#ff55ff" attr: "b" } - shape_range: { fg: "#ffff55" attr: "b" } - shape_record: { fg: "#55ffff" attr: "b" } - shape_redirection: { fg: "#ff55ff" attr: "b" } - shape_signature: { fg: "#55ff55" attr: "b" } - shape_string: "#55ff55" - shape_string_interpolation: { fg: "#55ffff" attr: "b" } - shape_table: { fg: "#5555ff" attr: "b" } - shape_variable: "#ff55ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#55ff55' attr: 'b' } + empty: '#5555ff' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#55ffff' + } else {{ fg: '#5555ff' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff5555' attr: 'b' } + } else if $in < 6hr { + '#ff5555' + } else if $in < 1day { + '#ffff55' + } else if $in < 3day { + '#55ff55' + } else if $in < 1wk { + { fg: '#55ff55' attr: 'b' } + } else if $in < 6wk { + '#55ffff' + } else if $in < 52wk { + '#5555ff' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#55ff55' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#ff5555' bg: '#bbbbbb' } + + shape_and: { fg: '#ff55ff' attr: 'b' } + shape_binary: { fg: '#ff55ff' attr: 'b' } + shape_block: { fg: '#5555ff' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#55ff55' + shape_datetime: { fg: '#55ffff' attr: 'b' } + shape_directory: '#55ffff' + shape_external: '#55ffff' + shape_externalarg: { fg: '#55ff55' attr: 'b' } + shape_filepath: '#55ffff' + shape_flag: { fg: '#5555ff' attr: 'b' } + shape_float: { fg: '#ff55ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#55ffff' attr: 'b' } + shape_int: { fg: '#ff55ff' attr: 'b' } + shape_internalcall: { fg: '#55ffff' attr: 'b' } + shape_list: { fg: '#55ffff' attr: 'b' } + shape_literal: '#5555ff' + shape_match_pattern: '#55ff55' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#ffff55' + shape_or: { fg: '#ff55ff' attr: 'b' } + shape_pipe: { fg: '#ff55ff' attr: 'b' } + shape_range: { fg: '#ffff55' attr: 'b' } + shape_record: { fg: '#55ffff' attr: 'b' } + shape_redirection: { fg: '#ff55ff' attr: 'b' } + shape_signature: { fg: '#55ff55' attr: 'b' } + shape_string: '#55ff55' + shape_string_interpolation: { fg: '#55ffff' attr: 'b' } + shape_table: { fg: '#5555ff' attr: 'b' } + shape_variable: '#ff55ff' + + background: '#000000' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/darkmoss.nu b/themes/nu-themes/darkmoss.nu index a3ca0da..94af5be 100644 --- a/themes/nu-themes/darkmoss.nu +++ b/themes/nu-themes/darkmoss.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c7c7a5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#499180" attr: "b" } - empty: "#498091" - bool: {|| if $in { "#66d9ef" } else { "light_gray" } } - int: "#c7c7a5" - filesize: {|e| - if $e == 0b { - "#c7c7a5" - } else if $e < 1mb { - "#66d9ef" - } else {{ fg: "#498091" }} - } - duration: "#c7c7a5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff4658" attr: "b" } - } else if $in < 6hr { - "#ff4658" - } else if $in < 1day { - "#fdb11f" - } else if $in < 3day { - "#499180" - } else if $in < 1wk { - { fg: "#499180" attr: "b" } - } else if $in < 6wk { - "#66d9ef" - } else if $in < 52wk { - "#498091" - } else { "dark_gray" } - } - range: "#c7c7a5" - float: "#c7c7a5" - string: "#c7c7a5" - nothing: "#c7c7a5" - binary: "#c7c7a5" - cellpath: "#c7c7a5" - row_index: { fg: "#499180" attr: "b" } - record: "#c7c7a5" - list: "#c7c7a5" - block: "#c7c7a5" - hints: "dark_gray" - search_result: { fg: "#ff4658" bg: "#c7c7a5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9bc0c8" attr: "b" } - shape_binary: { fg: "#9bc0c8" attr: "b" } - shape_block: { fg: "#498091" attr: "b" } - shape_bool: "#66d9ef" - shape_custom: "#499180" - shape_datetime: { fg: "#66d9ef" attr: "b" } - shape_directory: "#66d9ef" - shape_external: "#66d9ef" - shape_externalarg: { fg: "#499180" attr: "b" } - shape_filepath: "#66d9ef" - shape_flag: { fg: "#498091" attr: "b" } - shape_float: { fg: "#9bc0c8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#66d9ef" attr: "b" } - shape_int: { fg: "#9bc0c8" attr: "b" } - shape_internalcall: { fg: "#66d9ef" attr: "b" } - shape_list: { fg: "#66d9ef" attr: "b" } - shape_literal: "#498091" - shape_match_pattern: "#499180" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#66d9ef" - shape_operator: "#fdb11f" - shape_or: { fg: "#9bc0c8" attr: "b" } - shape_pipe: { fg: "#9bc0c8" attr: "b" } - shape_range: { fg: "#fdb11f" attr: "b" } - shape_record: { fg: "#66d9ef" attr: "b" } - shape_redirection: { fg: "#9bc0c8" attr: "b" } - shape_signature: { fg: "#499180" attr: "b" } - shape_string: "#499180" - shape_string_interpolation: { fg: "#66d9ef" attr: "b" } - shape_table: { fg: "#498091" attr: "b" } - shape_variable: "#9bc0c8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#171e1f" - foreground: "#c7c7a5" - cursor: "#c7c7a5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c7c7a5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#499180' attr: 'b' } + empty: '#498091' + bool: {|| if $in { '#66d9ef' } else { 'light_gray' } } + int: '#c7c7a5' + filesize: {|e| + if $e == 0b { + '#c7c7a5' + } else if $e < 1mb { + '#66d9ef' + } else {{ fg: '#498091' }} + } + duration: '#c7c7a5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff4658' attr: 'b' } + } else if $in < 6hr { + '#ff4658' + } else if $in < 1day { + '#fdb11f' + } else if $in < 3day { + '#499180' + } else if $in < 1wk { + { fg: '#499180' attr: 'b' } + } else if $in < 6wk { + '#66d9ef' + } else if $in < 52wk { + '#498091' + } else { 'dark_gray' } + } + range: '#c7c7a5' + float: '#c7c7a5' + string: '#c7c7a5' + nothing: '#c7c7a5' + binary: '#c7c7a5' + cellpath: '#c7c7a5' + row_index: { fg: '#499180' attr: 'b' } + record: '#c7c7a5' + list: '#c7c7a5' + block: '#c7c7a5' + hints: 'dark_gray' + search_result: { fg: '#ff4658' bg: '#c7c7a5' } + + shape_and: { fg: '#9bc0c8' attr: 'b' } + shape_binary: { fg: '#9bc0c8' attr: 'b' } + shape_block: { fg: '#498091' attr: 'b' } + shape_bool: '#66d9ef' + shape_custom: '#499180' + shape_datetime: { fg: '#66d9ef' attr: 'b' } + shape_directory: '#66d9ef' + shape_external: '#66d9ef' + shape_externalarg: { fg: '#499180' attr: 'b' } + shape_filepath: '#66d9ef' + shape_flag: { fg: '#498091' attr: 'b' } + shape_float: { fg: '#9bc0c8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#66d9ef' attr: 'b' } + shape_int: { fg: '#9bc0c8' attr: 'b' } + shape_internalcall: { fg: '#66d9ef' attr: 'b' } + shape_list: { fg: '#66d9ef' attr: 'b' } + shape_literal: '#498091' + shape_match_pattern: '#499180' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#66d9ef' + shape_operator: '#fdb11f' + shape_or: { fg: '#9bc0c8' attr: 'b' } + shape_pipe: { fg: '#9bc0c8' attr: 'b' } + shape_range: { fg: '#fdb11f' attr: 'b' } + shape_record: { fg: '#66d9ef' attr: 'b' } + shape_redirection: { fg: '#9bc0c8' attr: 'b' } + shape_signature: { fg: '#499180' attr: 'b' } + shape_string: '#499180' + shape_string_interpolation: { fg: '#66d9ef' attr: 'b' } + shape_table: { fg: '#498091' attr: 'b' } + shape_variable: '#9bc0c8' + + background: '#171e1f' + foreground: '#c7c7a5' + cursor: '#c7c7a5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/darkside.nu b/themes/nu-themes/darkside.nu index 6da08e2..7470387 100644 --- a/themes/nu-themes/darkside.nu +++ b/themes/nu-themes/darkside.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bababa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#68c256" attr: "b" } - empty: "#1c98e8" - bool: {|| if $in { "#3d97e2" } else { "light_gray" } } - int: "#bababa" - filesize: {|e| - if $e == 0b { - "#bababa" - } else if $e < 1mb { - "#1c98e8" - } else {{ fg: "#1c98e8" }} - } - duration: "#bababa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e8341c" attr: "b" } - } else if $in < 6hr { - "#e8341c" - } else if $in < 1day { - "#f2d42c" - } else if $in < 3day { - "#68c256" - } else if $in < 1wk { - { fg: "#68c256" attr: "b" } - } else if $in < 6wk { - "#1c98e8" - } else if $in < 52wk { - "#1c98e8" - } else { "dark_gray" } - } - range: "#bababa" - float: "#bababa" - string: "#bababa" - nothing: "#bababa" - binary: "#bababa" - cellpath: "#bababa" - row_index: { fg: "#68c256" attr: "b" } - record: "#bababa" - list: "#bababa" - block: "#bababa" - hints: "dark_gray" - search_result: { fg: "#e8341c" bg: "#bababa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8e69c9" attr: "b" } - shape_binary: { fg: "#8e69c9" attr: "b" } - shape_block: { fg: "#1c98e8" attr: "b" } - shape_bool: "#3d97e2" - shape_custom: "#68c256" - shape_datetime: { fg: "#1c98e8" attr: "b" } - shape_directory: "#1c98e8" - shape_external: "#1c98e8" - shape_externalarg: { fg: "#68c256" attr: "b" } - shape_filepath: "#1c98e8" - shape_flag: { fg: "#1c98e8" attr: "b" } - shape_float: { fg: "#8e69c9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1c98e8" attr: "b" } - shape_int: { fg: "#8e69c9" attr: "b" } - shape_internalcall: { fg: "#1c98e8" attr: "b" } - shape_list: { fg: "#1c98e8" attr: "b" } - shape_literal: "#1c98e8" - shape_match_pattern: "#68c256" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3d97e2" - shape_operator: "#f2d42c" - shape_or: { fg: "#8e69c9" attr: "b" } - shape_pipe: { fg: "#8e69c9" attr: "b" } - shape_range: { fg: "#f2d42c" attr: "b" } - shape_record: { fg: "#1c98e8" attr: "b" } - shape_redirection: { fg: "#8e69c9" attr: "b" } - shape_signature: { fg: "#68c256" attr: "b" } - shape_string: "#68c256" - shape_string_interpolation: { fg: "#1c98e8" attr: "b" } - shape_table: { fg: "#1c98e8" attr: "b" } - shape_variable: "#8e69c9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222324" - foreground: "#bababa" - cursor: "#bababa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bababa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#68c256' attr: 'b' } + empty: '#1c98e8' + bool: {|| if $in { '#3d97e2' } else { 'light_gray' } } + int: '#bababa' + filesize: {|e| + if $e == 0b { + '#bababa' + } else if $e < 1mb { + '#1c98e8' + } else {{ fg: '#1c98e8' }} + } + duration: '#bababa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e8341c' attr: 'b' } + } else if $in < 6hr { + '#e8341c' + } else if $in < 1day { + '#f2d42c' + } else if $in < 3day { + '#68c256' + } else if $in < 1wk { + { fg: '#68c256' attr: 'b' } + } else if $in < 6wk { + '#1c98e8' + } else if $in < 52wk { + '#1c98e8' + } else { 'dark_gray' } + } + range: '#bababa' + float: '#bababa' + string: '#bababa' + nothing: '#bababa' + binary: '#bababa' + cellpath: '#bababa' + row_index: { fg: '#68c256' attr: 'b' } + record: '#bababa' + list: '#bababa' + block: '#bababa' + hints: 'dark_gray' + search_result: { fg: '#e8341c' bg: '#bababa' } + + shape_and: { fg: '#8e69c9' attr: 'b' } + shape_binary: { fg: '#8e69c9' attr: 'b' } + shape_block: { fg: '#1c98e8' attr: 'b' } + shape_bool: '#3d97e2' + shape_custom: '#68c256' + shape_datetime: { fg: '#1c98e8' attr: 'b' } + shape_directory: '#1c98e8' + shape_external: '#1c98e8' + shape_externalarg: { fg: '#68c256' attr: 'b' } + shape_filepath: '#1c98e8' + shape_flag: { fg: '#1c98e8' attr: 'b' } + shape_float: { fg: '#8e69c9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1c98e8' attr: 'b' } + shape_int: { fg: '#8e69c9' attr: 'b' } + shape_internalcall: { fg: '#1c98e8' attr: 'b' } + shape_list: { fg: '#1c98e8' attr: 'b' } + shape_literal: '#1c98e8' + shape_match_pattern: '#68c256' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3d97e2' + shape_operator: '#f2d42c' + shape_or: { fg: '#8e69c9' attr: 'b' } + shape_pipe: { fg: '#8e69c9' attr: 'b' } + shape_range: { fg: '#f2d42c' attr: 'b' } + shape_record: { fg: '#1c98e8' attr: 'b' } + shape_redirection: { fg: '#8e69c9' attr: 'b' } + shape_signature: { fg: '#68c256' attr: 'b' } + shape_string: '#68c256' + shape_string_interpolation: { fg: '#1c98e8' attr: 'b' } + shape_table: { fg: '#1c98e8' attr: 'b' } + shape_variable: '#8e69c9' + + background: '#222324' + foreground: '#bababa' + cursor: '#bababa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/darktooth.nu b/themes/nu-themes/darktooth.nu index a78f77e..24e8609 100644 --- a/themes/nu-themes/darktooth.nu +++ b/themes/nu-themes/darktooth.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a89984" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#95c085" attr: "b" } - empty: "#0d6678" - bool: {|| if $in { "#8ba59b" } else { "light_gray" } } - int: "#a89984" - filesize: {|e| - if $e == 0b { - "#a89984" - } else if $e < 1mb { - "#8ba59b" - } else {{ fg: "#0d6678" }} - } - duration: "#a89984" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb543f" attr: "b" } - } else if $in < 6hr { - "#fb543f" - } else if $in < 1day { - "#fac03b" - } else if $in < 3day { - "#95c085" - } else if $in < 1wk { - { fg: "#95c085" attr: "b" } - } else if $in < 6wk { - "#8ba59b" - } else if $in < 52wk { - "#0d6678" - } else { "dark_gray" } - } - range: "#a89984" - float: "#a89984" - string: "#a89984" - nothing: "#a89984" - binary: "#a89984" - cellpath: "#a89984" - row_index: { fg: "#95c085" attr: "b" } - record: "#a89984" - list: "#a89984" - block: "#a89984" - hints: "dark_gray" - search_result: { fg: "#fb543f" bg: "#a89984" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f4673" attr: "b" } - shape_binary: { fg: "#8f4673" attr: "b" } - shape_block: { fg: "#0d6678" attr: "b" } - shape_bool: "#8ba59b" - shape_custom: "#95c085" - shape_datetime: { fg: "#8ba59b" attr: "b" } - shape_directory: "#8ba59b" - shape_external: "#8ba59b" - shape_externalarg: { fg: "#95c085" attr: "b" } - shape_filepath: "#8ba59b" - shape_flag: { fg: "#0d6678" attr: "b" } - shape_float: { fg: "#8f4673" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ba59b" attr: "b" } - shape_int: { fg: "#8f4673" attr: "b" } - shape_internalcall: { fg: "#8ba59b" attr: "b" } - shape_list: { fg: "#8ba59b" attr: "b" } - shape_literal: "#0d6678" - shape_match_pattern: "#95c085" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ba59b" - shape_operator: "#fac03b" - shape_or: { fg: "#8f4673" attr: "b" } - shape_pipe: { fg: "#8f4673" attr: "b" } - shape_range: { fg: "#fac03b" attr: "b" } - shape_record: { fg: "#8ba59b" attr: "b" } - shape_redirection: { fg: "#8f4673" attr: "b" } - shape_signature: { fg: "#95c085" attr: "b" } - shape_string: "#95c085" - shape_string_interpolation: { fg: "#8ba59b" attr: "b" } - shape_table: { fg: "#0d6678" attr: "b" } - shape_variable: "#8f4673" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2021" - foreground: "#a89984" - cursor: "#a89984" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a89984' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#95c085' attr: 'b' } + empty: '#0d6678' + bool: {|| if $in { '#8ba59b' } else { 'light_gray' } } + int: '#a89984' + filesize: {|e| + if $e == 0b { + '#a89984' + } else if $e < 1mb { + '#8ba59b' + } else {{ fg: '#0d6678' }} + } + duration: '#a89984' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb543f' attr: 'b' } + } else if $in < 6hr { + '#fb543f' + } else if $in < 1day { + '#fac03b' + } else if $in < 3day { + '#95c085' + } else if $in < 1wk { + { fg: '#95c085' attr: 'b' } + } else if $in < 6wk { + '#8ba59b' + } else if $in < 52wk { + '#0d6678' + } else { 'dark_gray' } + } + range: '#a89984' + float: '#a89984' + string: '#a89984' + nothing: '#a89984' + binary: '#a89984' + cellpath: '#a89984' + row_index: { fg: '#95c085' attr: 'b' } + record: '#a89984' + list: '#a89984' + block: '#a89984' + hints: 'dark_gray' + search_result: { fg: '#fb543f' bg: '#a89984' } + + shape_and: { fg: '#8f4673' attr: 'b' } + shape_binary: { fg: '#8f4673' attr: 'b' } + shape_block: { fg: '#0d6678' attr: 'b' } + shape_bool: '#8ba59b' + shape_custom: '#95c085' + shape_datetime: { fg: '#8ba59b' attr: 'b' } + shape_directory: '#8ba59b' + shape_external: '#8ba59b' + shape_externalarg: { fg: '#95c085' attr: 'b' } + shape_filepath: '#8ba59b' + shape_flag: { fg: '#0d6678' attr: 'b' } + shape_float: { fg: '#8f4673' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ba59b' attr: 'b' } + shape_int: { fg: '#8f4673' attr: 'b' } + shape_internalcall: { fg: '#8ba59b' attr: 'b' } + shape_list: { fg: '#8ba59b' attr: 'b' } + shape_literal: '#0d6678' + shape_match_pattern: '#95c085' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ba59b' + shape_operator: '#fac03b' + shape_or: { fg: '#8f4673' attr: 'b' } + shape_pipe: { fg: '#8f4673' attr: 'b' } + shape_range: { fg: '#fac03b' attr: 'b' } + shape_record: { fg: '#8ba59b' attr: 'b' } + shape_redirection: { fg: '#8f4673' attr: 'b' } + shape_signature: { fg: '#95c085' attr: 'b' } + shape_string: '#95c085' + shape_string_interpolation: { fg: '#8ba59b' attr: 'b' } + shape_table: { fg: '#0d6678' attr: 'b' } + shape_variable: '#8f4673' + + background: '#1d2021' + foreground: '#a89984' + cursor: '#a89984' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/darkviolet.nu b/themes/nu-themes/darkviolet.nu index 8f628fb..bc497af 100644 --- a/themes/nu-themes/darkviolet.nu +++ b/themes/nu-themes/darkviolet.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b08ae6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4595e6" attr: "b" } - empty: "#4136d9" - bool: {|| if $in { "#40dfff" } else { "light_gray" } } - int: "#b08ae6" - filesize: {|e| - if $e == 0b { - "#b08ae6" - } else if $e < 1mb { - "#40dfff" - } else {{ fg: "#4136d9" }} - } - duration: "#b08ae6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a82ee6" attr: "b" } - } else if $in < 6hr { - "#a82ee6" - } else if $in < 1day { - "#f29df2" - } else if $in < 3day { - "#4595e6" - } else if $in < 1wk { - { fg: "#4595e6" attr: "b" } - } else if $in < 6wk { - "#40dfff" - } else if $in < 52wk { - "#4136d9" - } else { "dark_gray" } - } - range: "#b08ae6" - float: "#b08ae6" - string: "#b08ae6" - nothing: "#b08ae6" - binary: "#b08ae6" - cellpath: "#b08ae6" - row_index: { fg: "#4595e6" attr: "b" } - record: "#b08ae6" - list: "#b08ae6" - block: "#b08ae6" - hints: "dark_gray" - search_result: { fg: "#a82ee6" bg: "#b08ae6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7e5ce6" attr: "b" } - shape_binary: { fg: "#7e5ce6" attr: "b" } - shape_block: { fg: "#4136d9" attr: "b" } - shape_bool: "#40dfff" - shape_custom: "#4595e6" - shape_datetime: { fg: "#40dfff" attr: "b" } - shape_directory: "#40dfff" - shape_external: "#40dfff" - shape_externalarg: { fg: "#4595e6" attr: "b" } - shape_filepath: "#40dfff" - shape_flag: { fg: "#4136d9" attr: "b" } - shape_float: { fg: "#7e5ce6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#40dfff" attr: "b" } - shape_int: { fg: "#7e5ce6" attr: "b" } - shape_internalcall: { fg: "#40dfff" attr: "b" } - shape_list: { fg: "#40dfff" attr: "b" } - shape_literal: "#4136d9" - shape_match_pattern: "#4595e6" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#40dfff" - shape_operator: "#f29df2" - shape_or: { fg: "#7e5ce6" attr: "b" } - shape_pipe: { fg: "#7e5ce6" attr: "b" } - shape_range: { fg: "#f29df2" attr: "b" } - shape_record: { fg: "#40dfff" attr: "b" } - shape_redirection: { fg: "#7e5ce6" attr: "b" } - shape_signature: { fg: "#4595e6" attr: "b" } - shape_string: "#4595e6" - shape_string_interpolation: { fg: "#40dfff" attr: "b" } - shape_table: { fg: "#4136d9" attr: "b" } - shape_variable: "#7e5ce6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#b08ae6" - cursor: "#b08ae6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b08ae6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4595e6' attr: 'b' } + empty: '#4136d9' + bool: {|| if $in { '#40dfff' } else { 'light_gray' } } + int: '#b08ae6' + filesize: {|e| + if $e == 0b { + '#b08ae6' + } else if $e < 1mb { + '#40dfff' + } else {{ fg: '#4136d9' }} + } + duration: '#b08ae6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a82ee6' attr: 'b' } + } else if $in < 6hr { + '#a82ee6' + } else if $in < 1day { + '#f29df2' + } else if $in < 3day { + '#4595e6' + } else if $in < 1wk { + { fg: '#4595e6' attr: 'b' } + } else if $in < 6wk { + '#40dfff' + } else if $in < 52wk { + '#4136d9' + } else { 'dark_gray' } + } + range: '#b08ae6' + float: '#b08ae6' + string: '#b08ae6' + nothing: '#b08ae6' + binary: '#b08ae6' + cellpath: '#b08ae6' + row_index: { fg: '#4595e6' attr: 'b' } + record: '#b08ae6' + list: '#b08ae6' + block: '#b08ae6' + hints: 'dark_gray' + search_result: { fg: '#a82ee6' bg: '#b08ae6' } + + shape_and: { fg: '#7e5ce6' attr: 'b' } + shape_binary: { fg: '#7e5ce6' attr: 'b' } + shape_block: { fg: '#4136d9' attr: 'b' } + shape_bool: '#40dfff' + shape_custom: '#4595e6' + shape_datetime: { fg: '#40dfff' attr: 'b' } + shape_directory: '#40dfff' + shape_external: '#40dfff' + shape_externalarg: { fg: '#4595e6' attr: 'b' } + shape_filepath: '#40dfff' + shape_flag: { fg: '#4136d9' attr: 'b' } + shape_float: { fg: '#7e5ce6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#40dfff' attr: 'b' } + shape_int: { fg: '#7e5ce6' attr: 'b' } + shape_internalcall: { fg: '#40dfff' attr: 'b' } + shape_list: { fg: '#40dfff' attr: 'b' } + shape_literal: '#4136d9' + shape_match_pattern: '#4595e6' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#40dfff' + shape_operator: '#f29df2' + shape_or: { fg: '#7e5ce6' attr: 'b' } + shape_pipe: { fg: '#7e5ce6' attr: 'b' } + shape_range: { fg: '#f29df2' attr: 'b' } + shape_record: { fg: '#40dfff' attr: 'b' } + shape_redirection: { fg: '#7e5ce6' attr: 'b' } + shape_signature: { fg: '#4595e6' attr: 'b' } + shape_string: '#4595e6' + shape_string_interpolation: { fg: '#40dfff' attr: 'b' } + shape_table: { fg: '#4136d9' attr: 'b' } + shape_variable: '#7e5ce6' + + background: '#000000' + foreground: '#b08ae6' + cursor: '#b08ae6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/decaf.nu b/themes/nu-themes/decaf.nu index 7a25326..0d21385 100644 --- a/themes/nu-themes/decaf.nu +++ b/themes/nu-themes/decaf.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#beda78" attr: "b" } - empty: "#90bee1" - bool: {|| if $in { "#bed6ff" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#bed6ff" - } else {{ fg: "#90bee1" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff7f7b" attr: "b" } - } else if $in < 6hr { - "#ff7f7b" - } else if $in < 1day { - "#ffd67c" - } else if $in < 3day { - "#beda78" - } else if $in < 1wk { - { fg: "#beda78" attr: "b" } - } else if $in < 6wk { - "#bed6ff" - } else if $in < 52wk { - "#90bee1" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#beda78" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#ff7f7b" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#efb3f7" attr: "b" } - shape_binary: { fg: "#efb3f7" attr: "b" } - shape_block: { fg: "#90bee1" attr: "b" } - shape_bool: "#bed6ff" - shape_custom: "#beda78" - shape_datetime: { fg: "#bed6ff" attr: "b" } - shape_directory: "#bed6ff" - shape_external: "#bed6ff" - shape_externalarg: { fg: "#beda78" attr: "b" } - shape_filepath: "#bed6ff" - shape_flag: { fg: "#90bee1" attr: "b" } - shape_float: { fg: "#efb3f7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#bed6ff" attr: "b" } - shape_int: { fg: "#efb3f7" attr: "b" } - shape_internalcall: { fg: "#bed6ff" attr: "b" } - shape_list: { fg: "#bed6ff" attr: "b" } - shape_literal: "#90bee1" - shape_match_pattern: "#beda78" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#bed6ff" - shape_operator: "#ffd67c" - shape_or: { fg: "#efb3f7" attr: "b" } - shape_pipe: { fg: "#efb3f7" attr: "b" } - shape_range: { fg: "#ffd67c" attr: "b" } - shape_record: { fg: "#bed6ff" attr: "b" } - shape_redirection: { fg: "#efb3f7" attr: "b" } - shape_signature: { fg: "#beda78" attr: "b" } - shape_string: "#beda78" - shape_string_interpolation: { fg: "#bed6ff" attr: "b" } - shape_table: { fg: "#90bee1" attr: "b" } - shape_variable: "#efb3f7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2d2d2d" - foreground: "#cccccc" - cursor: "#cccccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#beda78' attr: 'b' } + empty: '#90bee1' + bool: {|| if $in { '#bed6ff' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#bed6ff' + } else {{ fg: '#90bee1' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff7f7b' attr: 'b' } + } else if $in < 6hr { + '#ff7f7b' + } else if $in < 1day { + '#ffd67c' + } else if $in < 3day { + '#beda78' + } else if $in < 1wk { + { fg: '#beda78' attr: 'b' } + } else if $in < 6wk { + '#bed6ff' + } else if $in < 52wk { + '#90bee1' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#beda78' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#ff7f7b' bg: '#cccccc' } + + shape_and: { fg: '#efb3f7' attr: 'b' } + shape_binary: { fg: '#efb3f7' attr: 'b' } + shape_block: { fg: '#90bee1' attr: 'b' } + shape_bool: '#bed6ff' + shape_custom: '#beda78' + shape_datetime: { fg: '#bed6ff' attr: 'b' } + shape_directory: '#bed6ff' + shape_external: '#bed6ff' + shape_externalarg: { fg: '#beda78' attr: 'b' } + shape_filepath: '#bed6ff' + shape_flag: { fg: '#90bee1' attr: 'b' } + shape_float: { fg: '#efb3f7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#bed6ff' attr: 'b' } + shape_int: { fg: '#efb3f7' attr: 'b' } + shape_internalcall: { fg: '#bed6ff' attr: 'b' } + shape_list: { fg: '#bed6ff' attr: 'b' } + shape_literal: '#90bee1' + shape_match_pattern: '#beda78' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#bed6ff' + shape_operator: '#ffd67c' + shape_or: { fg: '#efb3f7' attr: 'b' } + shape_pipe: { fg: '#efb3f7' attr: 'b' } + shape_range: { fg: '#ffd67c' attr: 'b' } + shape_record: { fg: '#bed6ff' attr: 'b' } + shape_redirection: { fg: '#efb3f7' attr: 'b' } + shape_signature: { fg: '#beda78' attr: 'b' } + shape_string: '#beda78' + shape_string_interpolation: { fg: '#bed6ff' attr: 'b' } + shape_table: { fg: '#90bee1' attr: 'b' } + shape_variable: '#efb3f7' + + background: '#2d2d2d' + foreground: '#cccccc' + cursor: '#cccccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/default-dark.nu b/themes/nu-themes/default-dark.nu index 737edfa..80b8219 100644 --- a/themes/nu-themes/default-dark.nu +++ b/themes/nu-themes/default-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d8d8d8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1b56c" attr: "b" } - empty: "#7cafc2" - bool: {|| if $in { "#86c1b9" } else { "light_gray" } } - int: "#d8d8d8" - filesize: {|e| - if $e == 0b { - "#d8d8d8" - } else if $e < 1mb { - "#86c1b9" - } else {{ fg: "#7cafc2" }} - } - duration: "#d8d8d8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ab4642" attr: "b" } - } else if $in < 6hr { - "#ab4642" - } else if $in < 1day { - "#f7ca88" - } else if $in < 3day { - "#a1b56c" - } else if $in < 1wk { - { fg: "#a1b56c" attr: "b" } - } else if $in < 6wk { - "#86c1b9" - } else if $in < 52wk { - "#7cafc2" - } else { "dark_gray" } - } - range: "#d8d8d8" - float: "#d8d8d8" - string: "#d8d8d8" - nothing: "#d8d8d8" - binary: "#d8d8d8" - cellpath: "#d8d8d8" - row_index: { fg: "#a1b56c" attr: "b" } - record: "#d8d8d8" - list: "#d8d8d8" - block: "#d8d8d8" - hints: "dark_gray" - search_result: { fg: "#ab4642" bg: "#d8d8d8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ba8baf" attr: "b" } - shape_binary: { fg: "#ba8baf" attr: "b" } - shape_block: { fg: "#7cafc2" attr: "b" } - shape_bool: "#86c1b9" - shape_custom: "#a1b56c" - shape_datetime: { fg: "#86c1b9" attr: "b" } - shape_directory: "#86c1b9" - shape_external: "#86c1b9" - shape_externalarg: { fg: "#a1b56c" attr: "b" } - shape_filepath: "#86c1b9" - shape_flag: { fg: "#7cafc2" attr: "b" } - shape_float: { fg: "#ba8baf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#86c1b9" attr: "b" } - shape_int: { fg: "#ba8baf" attr: "b" } - shape_internalcall: { fg: "#86c1b9" attr: "b" } - shape_list: { fg: "#86c1b9" attr: "b" } - shape_literal: "#7cafc2" - shape_match_pattern: "#a1b56c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86c1b9" - shape_operator: "#f7ca88" - shape_or: { fg: "#ba8baf" attr: "b" } - shape_pipe: { fg: "#ba8baf" attr: "b" } - shape_range: { fg: "#f7ca88" attr: "b" } - shape_record: { fg: "#86c1b9" attr: "b" } - shape_redirection: { fg: "#ba8baf" attr: "b" } - shape_signature: { fg: "#a1b56c" attr: "b" } - shape_string: "#a1b56c" - shape_string_interpolation: { fg: "#86c1b9" attr: "b" } - shape_table: { fg: "#7cafc2" attr: "b" } - shape_variable: "#ba8baf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#181818" - foreground: "#d8d8d8" - cursor: "#d8d8d8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d8d8d8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1b56c' attr: 'b' } + empty: '#7cafc2' + bool: {|| if $in { '#86c1b9' } else { 'light_gray' } } + int: '#d8d8d8' + filesize: {|e| + if $e == 0b { + '#d8d8d8' + } else if $e < 1mb { + '#86c1b9' + } else {{ fg: '#7cafc2' }} + } + duration: '#d8d8d8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ab4642' attr: 'b' } + } else if $in < 6hr { + '#ab4642' + } else if $in < 1day { + '#f7ca88' + } else if $in < 3day { + '#a1b56c' + } else if $in < 1wk { + { fg: '#a1b56c' attr: 'b' } + } else if $in < 6wk { + '#86c1b9' + } else if $in < 52wk { + '#7cafc2' + } else { 'dark_gray' } + } + range: '#d8d8d8' + float: '#d8d8d8' + string: '#d8d8d8' + nothing: '#d8d8d8' + binary: '#d8d8d8' + cellpath: '#d8d8d8' + row_index: { fg: '#a1b56c' attr: 'b' } + record: '#d8d8d8' + list: '#d8d8d8' + block: '#d8d8d8' + hints: 'dark_gray' + search_result: { fg: '#ab4642' bg: '#d8d8d8' } + + shape_and: { fg: '#ba8baf' attr: 'b' } + shape_binary: { fg: '#ba8baf' attr: 'b' } + shape_block: { fg: '#7cafc2' attr: 'b' } + shape_bool: '#86c1b9' + shape_custom: '#a1b56c' + shape_datetime: { fg: '#86c1b9' attr: 'b' } + shape_directory: '#86c1b9' + shape_external: '#86c1b9' + shape_externalarg: { fg: '#a1b56c' attr: 'b' } + shape_filepath: '#86c1b9' + shape_flag: { fg: '#7cafc2' attr: 'b' } + shape_float: { fg: '#ba8baf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#86c1b9' attr: 'b' } + shape_int: { fg: '#ba8baf' attr: 'b' } + shape_internalcall: { fg: '#86c1b9' attr: 'b' } + shape_list: { fg: '#86c1b9' attr: 'b' } + shape_literal: '#7cafc2' + shape_match_pattern: '#a1b56c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#86c1b9' + shape_operator: '#f7ca88' + shape_or: { fg: '#ba8baf' attr: 'b' } + shape_pipe: { fg: '#ba8baf' attr: 'b' } + shape_range: { fg: '#f7ca88' attr: 'b' } + shape_record: { fg: '#86c1b9' attr: 'b' } + shape_redirection: { fg: '#ba8baf' attr: 'b' } + shape_signature: { fg: '#a1b56c' attr: 'b' } + shape_string: '#a1b56c' + shape_string_interpolation: { fg: '#86c1b9' attr: 'b' } + shape_table: { fg: '#7cafc2' attr: 'b' } + shape_variable: '#ba8baf' + + background: '#181818' + foreground: '#d8d8d8' + cursor: '#d8d8d8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/default-light.nu b/themes/nu-themes/default-light.nu index 456b8aa..ffd2b90 100644 --- a/themes/nu-themes/default-light.nu +++ b/themes/nu-themes/default-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#383838" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1b56c" attr: "b" } - empty: "#7cafc2" - bool: {|| if $in { "#86c1b9" } else { "light_gray" } } - int: "#383838" - filesize: {|e| - if $e == 0b { - "#383838" - } else if $e < 1mb { - "#86c1b9" - } else {{ fg: "#7cafc2" }} - } - duration: "#383838" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ab4642" attr: "b" } - } else if $in < 6hr { - "#ab4642" - } else if $in < 1day { - "#f7ca88" - } else if $in < 3day { - "#a1b56c" - } else if $in < 1wk { - { fg: "#a1b56c" attr: "b" } - } else if $in < 6wk { - "#86c1b9" - } else if $in < 52wk { - "#7cafc2" - } else { "dark_gray" } - } - range: "#383838" - float: "#383838" - string: "#383838" - nothing: "#383838" - binary: "#383838" - cellpath: "#383838" - row_index: { fg: "#a1b56c" attr: "b" } - record: "#383838" - list: "#383838" - block: "#383838" - hints: "dark_gray" - search_result: { fg: "#ab4642" bg: "#383838" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ba8baf" attr: "b" } - shape_binary: { fg: "#ba8baf" attr: "b" } - shape_block: { fg: "#7cafc2" attr: "b" } - shape_bool: "#86c1b9" - shape_custom: "#a1b56c" - shape_datetime: { fg: "#86c1b9" attr: "b" } - shape_directory: "#86c1b9" - shape_external: "#86c1b9" - shape_externalarg: { fg: "#a1b56c" attr: "b" } - shape_filepath: "#86c1b9" - shape_flag: { fg: "#7cafc2" attr: "b" } - shape_float: { fg: "#ba8baf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#86c1b9" attr: "b" } - shape_int: { fg: "#ba8baf" attr: "b" } - shape_internalcall: { fg: "#86c1b9" attr: "b" } - shape_list: { fg: "#86c1b9" attr: "b" } - shape_literal: "#7cafc2" - shape_match_pattern: "#a1b56c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86c1b9" - shape_operator: "#f7ca88" - shape_or: { fg: "#ba8baf" attr: "b" } - shape_pipe: { fg: "#ba8baf" attr: "b" } - shape_range: { fg: "#f7ca88" attr: "b" } - shape_record: { fg: "#86c1b9" attr: "b" } - shape_redirection: { fg: "#ba8baf" attr: "b" } - shape_signature: { fg: "#a1b56c" attr: "b" } - shape_string: "#a1b56c" - shape_string_interpolation: { fg: "#86c1b9" attr: "b" } - shape_table: { fg: "#7cafc2" attr: "b" } - shape_variable: "#ba8baf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f8f8" - foreground: "#383838" - cursor: "#383838" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#383838' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1b56c' attr: 'b' } + empty: '#7cafc2' + bool: {|| if $in { '#86c1b9' } else { 'light_gray' } } + int: '#383838' + filesize: {|e| + if $e == 0b { + '#383838' + } else if $e < 1mb { + '#86c1b9' + } else {{ fg: '#7cafc2' }} + } + duration: '#383838' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ab4642' attr: 'b' } + } else if $in < 6hr { + '#ab4642' + } else if $in < 1day { + '#f7ca88' + } else if $in < 3day { + '#a1b56c' + } else if $in < 1wk { + { fg: '#a1b56c' attr: 'b' } + } else if $in < 6wk { + '#86c1b9' + } else if $in < 52wk { + '#7cafc2' + } else { 'dark_gray' } + } + range: '#383838' + float: '#383838' + string: '#383838' + nothing: '#383838' + binary: '#383838' + cellpath: '#383838' + row_index: { fg: '#a1b56c' attr: 'b' } + record: '#383838' + list: '#383838' + block: '#383838' + hints: 'dark_gray' + search_result: { fg: '#ab4642' bg: '#383838' } + + shape_and: { fg: '#ba8baf' attr: 'b' } + shape_binary: { fg: '#ba8baf' attr: 'b' } + shape_block: { fg: '#7cafc2' attr: 'b' } + shape_bool: '#86c1b9' + shape_custom: '#a1b56c' + shape_datetime: { fg: '#86c1b9' attr: 'b' } + shape_directory: '#86c1b9' + shape_external: '#86c1b9' + shape_externalarg: { fg: '#a1b56c' attr: 'b' } + shape_filepath: '#86c1b9' + shape_flag: { fg: '#7cafc2' attr: 'b' } + shape_float: { fg: '#ba8baf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#86c1b9' attr: 'b' } + shape_int: { fg: '#ba8baf' attr: 'b' } + shape_internalcall: { fg: '#86c1b9' attr: 'b' } + shape_list: { fg: '#86c1b9' attr: 'b' } + shape_literal: '#7cafc2' + shape_match_pattern: '#a1b56c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#86c1b9' + shape_operator: '#f7ca88' + shape_or: { fg: '#ba8baf' attr: 'b' } + shape_pipe: { fg: '#ba8baf' attr: 'b' } + shape_range: { fg: '#f7ca88' attr: 'b' } + shape_record: { fg: '#86c1b9' attr: 'b' } + shape_redirection: { fg: '#ba8baf' attr: 'b' } + shape_signature: { fg: '#a1b56c' attr: 'b' } + shape_string: '#a1b56c' + shape_string_interpolation: { fg: '#86c1b9' attr: 'b' } + shape_table: { fg: '#7cafc2' attr: 'b' } + shape_variable: '#ba8baf' + + background: '#f8f8f8' + foreground: '#383838' + cursor: '#383838' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/desert-night.nu b/themes/nu-themes/desert-night.nu index b53c766..214006d 100644 --- a/themes/nu-themes/desert-night.nu +++ b/themes/nu-themes/desert-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#87765d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#99b05f" attr: "b" } - empty: "#949fb4" - bool: {|| if $in { "#bfab36" } else { "light_gray" } } - int: "#87765d" - filesize: {|e| - if $e == 0b { - "#87765d" - } else if $e < 1mb { - "#bfab36" - } else {{ fg: "#949fb4" }} - } - duration: "#87765d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e56b55" attr: "b" } - } else if $in < 6hr { - "#e56b55" - } else if $in < 1day { - "#e18245" - } else if $in < 3day { - "#99b05f" - } else if $in < 1wk { - { fg: "#99b05f" attr: "b" } - } else if $in < 6wk { - "#bfab36" - } else if $in < 52wk { - "#949fb4" - } else { "dark_gray" } - } - range: "#87765d" - float: "#87765d" - string: "#87765d" - nothing: "#87765d" - binary: "#87765d" - cellpath: "#87765d" - row_index: { fg: "#99b05f" attr: "b" } - record: "#87765d" - list: "#87765d" - block: "#87765d" - hints: "dark_gray" - search_result: { fg: "#e56b55" bg: "#87765d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d261a5" attr: "b" } - shape_binary: { fg: "#d261a5" attr: "b" } - shape_block: { fg: "#949fb4" attr: "b" } - shape_bool: "#bfab36" - shape_custom: "#99b05f" - shape_datetime: { fg: "#bfab36" attr: "b" } - shape_directory: "#bfab36" - shape_external: "#bfab36" - shape_externalarg: { fg: "#99b05f" attr: "b" } - shape_filepath: "#bfab36" - shape_flag: { fg: "#949fb4" attr: "b" } - shape_float: { fg: "#d261a5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#bfab36" attr: "b" } - shape_int: { fg: "#d261a5" attr: "b" } - shape_internalcall: { fg: "#bfab36" attr: "b" } - shape_list: { fg: "#bfab36" attr: "b" } - shape_literal: "#949fb4" - shape_match_pattern: "#99b05f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#bfab36" - shape_operator: "#e18245" - shape_or: { fg: "#d261a5" attr: "b" } - shape_pipe: { fg: "#d261a5" attr: "b" } - shape_range: { fg: "#e18245" attr: "b" } - shape_record: { fg: "#bfab36" attr: "b" } - shape_redirection: { fg: "#d261a5" attr: "b" } - shape_signature: { fg: "#99b05f" attr: "b" } - shape_string: "#99b05f" - shape_string_interpolation: { fg: "#bfab36" attr: "b" } - shape_table: { fg: "#949fb4" attr: "b" } - shape_variable: "#d261a5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#24221c" - foreground: "#d4b07b" - cursor: "#d4b07b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#87765d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#99b05f' attr: 'b' } + empty: '#949fb4' + bool: {|| if $in { '#bfab36' } else { 'light_gray' } } + int: '#87765d' + filesize: {|e| + if $e == 0b { + '#87765d' + } else if $e < 1mb { + '#bfab36' + } else {{ fg: '#949fb4' }} + } + duration: '#87765d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e56b55' attr: 'b' } + } else if $in < 6hr { + '#e56b55' + } else if $in < 1day { + '#e18245' + } else if $in < 3day { + '#99b05f' + } else if $in < 1wk { + { fg: '#99b05f' attr: 'b' } + } else if $in < 6wk { + '#bfab36' + } else if $in < 52wk { + '#949fb4' + } else { 'dark_gray' } + } + range: '#87765d' + float: '#87765d' + string: '#87765d' + nothing: '#87765d' + binary: '#87765d' + cellpath: '#87765d' + row_index: { fg: '#99b05f' attr: 'b' } + record: '#87765d' + list: '#87765d' + block: '#87765d' + hints: 'dark_gray' + search_result: { fg: '#e56b55' bg: '#87765d' } + + shape_and: { fg: '#d261a5' attr: 'b' } + shape_binary: { fg: '#d261a5' attr: 'b' } + shape_block: { fg: '#949fb4' attr: 'b' } + shape_bool: '#bfab36' + shape_custom: '#99b05f' + shape_datetime: { fg: '#bfab36' attr: 'b' } + shape_directory: '#bfab36' + shape_external: '#bfab36' + shape_externalarg: { fg: '#99b05f' attr: 'b' } + shape_filepath: '#bfab36' + shape_flag: { fg: '#949fb4' attr: 'b' } + shape_float: { fg: '#d261a5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#bfab36' attr: 'b' } + shape_int: { fg: '#d261a5' attr: 'b' } + shape_internalcall: { fg: '#bfab36' attr: 'b' } + shape_list: { fg: '#bfab36' attr: 'b' } + shape_literal: '#949fb4' + shape_match_pattern: '#99b05f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#bfab36' + shape_operator: '#e18245' + shape_or: { fg: '#d261a5' attr: 'b' } + shape_pipe: { fg: '#d261a5' attr: 'b' } + shape_range: { fg: '#e18245' attr: 'b' } + shape_record: { fg: '#bfab36' attr: 'b' } + shape_redirection: { fg: '#d261a5' attr: 'b' } + shape_signature: { fg: '#99b05f' attr: 'b' } + shape_string: '#99b05f' + shape_string_interpolation: { fg: '#bfab36' attr: 'b' } + shape_table: { fg: '#949fb4' attr: 'b' } + shape_variable: '#d261a5' + + background: '#24221c' + foreground: '#d4b07b' + cursor: '#d4b07b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/desert.nu b/themes/nu-themes/desert.nu index a13e301..cb61db4 100644 --- a/themes/nu-themes/desert.nu +++ b/themes/nu-themes/desert.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f5deb3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98fb98" attr: "b" } - empty: "#cd853f" - bool: {|| if $in { "#ffd700" } else { "light_gray" } } - int: "#f5deb3" - filesize: {|e| - if $e == 0b { - "#f5deb3" - } else if $e < 1mb { - "#ffa0a0" - } else {{ fg: "#cd853f" }} - } - duration: "#f5deb3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff2b2b" attr: "b" } - } else if $in < 6hr { - "#ff2b2b" - } else if $in < 1day { - "#f0e68c" - } else if $in < 3day { - "#98fb98" - } else if $in < 1wk { - { fg: "#98fb98" attr: "b" } - } else if $in < 6wk { - "#ffa0a0" - } else if $in < 52wk { - "#cd853f" - } else { "dark_gray" } - } - range: "#f5deb3" - float: "#f5deb3" - string: "#f5deb3" - nothing: "#f5deb3" - binary: "#f5deb3" - cellpath: "#f5deb3" - row_index: { fg: "#98fb98" attr: "b" } - record: "#f5deb3" - list: "#f5deb3" - block: "#f5deb3" - hints: "dark_gray" - search_result: { fg: "#ff2b2b" bg: "#f5deb3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ffdead" attr: "b" } - shape_binary: { fg: "#ffdead" attr: "b" } - shape_block: { fg: "#cd853f" attr: "b" } - shape_bool: "#ffd700" - shape_custom: "#98fb98" - shape_datetime: { fg: "#ffa0a0" attr: "b" } - shape_directory: "#ffa0a0" - shape_external: "#ffa0a0" - shape_externalarg: { fg: "#98fb98" attr: "b" } - shape_filepath: "#ffa0a0" - shape_flag: { fg: "#cd853f" attr: "b" } - shape_float: { fg: "#ffdead" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ffa0a0" attr: "b" } - shape_int: { fg: "#ffdead" attr: "b" } - shape_internalcall: { fg: "#ffa0a0" attr: "b" } - shape_list: { fg: "#ffa0a0" attr: "b" } - shape_literal: "#cd853f" - shape_match_pattern: "#98fb98" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ffd700" - shape_operator: "#f0e68c" - shape_or: { fg: "#ffdead" attr: "b" } - shape_pipe: { fg: "#ffdead" attr: "b" } - shape_range: { fg: "#f0e68c" attr: "b" } - shape_record: { fg: "#ffa0a0" attr: "b" } - shape_redirection: { fg: "#ffdead" attr: "b" } - shape_signature: { fg: "#98fb98" attr: "b" } - shape_string: "#98fb98" - shape_string_interpolation: { fg: "#ffa0a0" attr: "b" } - shape_table: { fg: "#cd853f" attr: "b" } - shape_variable: "#ffdead" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#333333" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f5deb3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98fb98' attr: 'b' } + empty: '#cd853f' + bool: {|| if $in { '#ffd700' } else { 'light_gray' } } + int: '#f5deb3' + filesize: {|e| + if $e == 0b { + '#f5deb3' + } else if $e < 1mb { + '#ffa0a0' + } else {{ fg: '#cd853f' }} + } + duration: '#f5deb3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff2b2b' attr: 'b' } + } else if $in < 6hr { + '#ff2b2b' + } else if $in < 1day { + '#f0e68c' + } else if $in < 3day { + '#98fb98' + } else if $in < 1wk { + { fg: '#98fb98' attr: 'b' } + } else if $in < 6wk { + '#ffa0a0' + } else if $in < 52wk { + '#cd853f' + } else { 'dark_gray' } + } + range: '#f5deb3' + float: '#f5deb3' + string: '#f5deb3' + nothing: '#f5deb3' + binary: '#f5deb3' + cellpath: '#f5deb3' + row_index: { fg: '#98fb98' attr: 'b' } + record: '#f5deb3' + list: '#f5deb3' + block: '#f5deb3' + hints: 'dark_gray' + search_result: { fg: '#ff2b2b' bg: '#f5deb3' } + + shape_and: { fg: '#ffdead' attr: 'b' } + shape_binary: { fg: '#ffdead' attr: 'b' } + shape_block: { fg: '#cd853f' attr: 'b' } + shape_bool: '#ffd700' + shape_custom: '#98fb98' + shape_datetime: { fg: '#ffa0a0' attr: 'b' } + shape_directory: '#ffa0a0' + shape_external: '#ffa0a0' + shape_externalarg: { fg: '#98fb98' attr: 'b' } + shape_filepath: '#ffa0a0' + shape_flag: { fg: '#cd853f' attr: 'b' } + shape_float: { fg: '#ffdead' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ffa0a0' attr: 'b' } + shape_int: { fg: '#ffdead' attr: 'b' } + shape_internalcall: { fg: '#ffa0a0' attr: 'b' } + shape_list: { fg: '#ffa0a0' attr: 'b' } + shape_literal: '#cd853f' + shape_match_pattern: '#98fb98' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ffd700' + shape_operator: '#f0e68c' + shape_or: { fg: '#ffdead' attr: 'b' } + shape_pipe: { fg: '#ffdead' attr: 'b' } + shape_range: { fg: '#f0e68c' attr: 'b' } + shape_record: { fg: '#ffa0a0' attr: 'b' } + shape_redirection: { fg: '#ffdead' attr: 'b' } + shape_signature: { fg: '#98fb98' attr: 'b' } + shape_string: '#98fb98' + shape_string_interpolation: { fg: '#ffa0a0' attr: 'b' } + shape_table: { fg: '#cd853f' attr: 'b' } + shape_variable: '#ffdead' + + background: '#333333' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/dimmed-monokai.nu b/themes/nu-themes/dimmed-monokai.nu index b5de32e..7d609ad 100644 --- a/themes/nu-themes/dimmed-monokai.nu +++ b/themes/nu-themes/dimmed-monokai.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b9bcba" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#879a3b" attr: "b" } - empty: "#4f76a1" - bool: {|| if $in { "#2e706d" } else { "light_gray" } } - int: "#b9bcba" - filesize: {|e| - if $e == 0b { - "#b9bcba" - } else if $e < 1mb { - "#578fa4" - } else {{ fg: "#4f76a1" }} - } - duration: "#b9bcba" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be3f48" attr: "b" } - } else if $in < 6hr { - "#be3f48" - } else if $in < 1day { - "#c5a635" - } else if $in < 3day { - "#879a3b" - } else if $in < 1wk { - { fg: "#879a3b" attr: "b" } - } else if $in < 6wk { - "#578fa4" - } else if $in < 52wk { - "#4f76a1" - } else { "dark_gray" } - } - range: "#b9bcba" - float: "#b9bcba" - string: "#b9bcba" - nothing: "#b9bcba" - binary: "#b9bcba" - cellpath: "#b9bcba" - row_index: { fg: "#879a3b" attr: "b" } - record: "#b9bcba" - list: "#b9bcba" - block: "#b9bcba" - hints: "dark_gray" - search_result: { fg: "#be3f48" bg: "#b9bcba" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#855c8d" attr: "b" } - shape_binary: { fg: "#855c8d" attr: "b" } - shape_block: { fg: "#4f76a1" attr: "b" } - shape_bool: "#2e706d" - shape_custom: "#879a3b" - shape_datetime: { fg: "#578fa4" attr: "b" } - shape_directory: "#578fa4" - shape_external: "#578fa4" - shape_externalarg: { fg: "#879a3b" attr: "b" } - shape_filepath: "#578fa4" - shape_flag: { fg: "#4f76a1" attr: "b" } - shape_float: { fg: "#855c8d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#578fa4" attr: "b" } - shape_int: { fg: "#855c8d" attr: "b" } - shape_internalcall: { fg: "#578fa4" attr: "b" } - shape_list: { fg: "#578fa4" attr: "b" } - shape_literal: "#4f76a1" - shape_match_pattern: "#879a3b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2e706d" - shape_operator: "#c5a635" - shape_or: { fg: "#855c8d" attr: "b" } - shape_pipe: { fg: "#855c8d" attr: "b" } - shape_range: { fg: "#c5a635" attr: "b" } - shape_record: { fg: "#578fa4" attr: "b" } - shape_redirection: { fg: "#855c8d" attr: "b" } - shape_signature: { fg: "#879a3b" attr: "b" } - shape_string: "#879a3b" - shape_string_interpolation: { fg: "#578fa4" attr: "b" } - shape_table: { fg: "#4f76a1" attr: "b" } - shape_variable: "#855c8d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1f1f" - foreground: "#b9bcba" - cursor: "#b9bcba" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b9bcba' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#879a3b' attr: 'b' } + empty: '#4f76a1' + bool: {|| if $in { '#2e706d' } else { 'light_gray' } } + int: '#b9bcba' + filesize: {|e| + if $e == 0b { + '#b9bcba' + } else if $e < 1mb { + '#578fa4' + } else {{ fg: '#4f76a1' }} + } + duration: '#b9bcba' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be3f48' attr: 'b' } + } else if $in < 6hr { + '#be3f48' + } else if $in < 1day { + '#c5a635' + } else if $in < 3day { + '#879a3b' + } else if $in < 1wk { + { fg: '#879a3b' attr: 'b' } + } else if $in < 6wk { + '#578fa4' + } else if $in < 52wk { + '#4f76a1' + } else { 'dark_gray' } + } + range: '#b9bcba' + float: '#b9bcba' + string: '#b9bcba' + nothing: '#b9bcba' + binary: '#b9bcba' + cellpath: '#b9bcba' + row_index: { fg: '#879a3b' attr: 'b' } + record: '#b9bcba' + list: '#b9bcba' + block: '#b9bcba' + hints: 'dark_gray' + search_result: { fg: '#be3f48' bg: '#b9bcba' } + + shape_and: { fg: '#855c8d' attr: 'b' } + shape_binary: { fg: '#855c8d' attr: 'b' } + shape_block: { fg: '#4f76a1' attr: 'b' } + shape_bool: '#2e706d' + shape_custom: '#879a3b' + shape_datetime: { fg: '#578fa4' attr: 'b' } + shape_directory: '#578fa4' + shape_external: '#578fa4' + shape_externalarg: { fg: '#879a3b' attr: 'b' } + shape_filepath: '#578fa4' + shape_flag: { fg: '#4f76a1' attr: 'b' } + shape_float: { fg: '#855c8d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#578fa4' attr: 'b' } + shape_int: { fg: '#855c8d' attr: 'b' } + shape_internalcall: { fg: '#578fa4' attr: 'b' } + shape_list: { fg: '#578fa4' attr: 'b' } + shape_literal: '#4f76a1' + shape_match_pattern: '#879a3b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2e706d' + shape_operator: '#c5a635' + shape_or: { fg: '#855c8d' attr: 'b' } + shape_pipe: { fg: '#855c8d' attr: 'b' } + shape_range: { fg: '#c5a635' attr: 'b' } + shape_record: { fg: '#578fa4' attr: 'b' } + shape_redirection: { fg: '#855c8d' attr: 'b' } + shape_signature: { fg: '#879a3b' attr: 'b' } + shape_string: '#879a3b' + shape_string_interpolation: { fg: '#578fa4' attr: 'b' } + shape_table: { fg: '#4f76a1' attr: 'b' } + shape_variable: '#855c8d' + + background: '#1f1f1f' + foreground: '#b9bcba' + cursor: '#b9bcba' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/dirtysea.nu b/themes/nu-themes/dirtysea.nu index 6f52754..e48169f 100644 --- a/themes/nu-themes/dirtysea.nu +++ b/themes/nu-themes/dirtysea.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#000000" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#730073" attr: "b" } - empty: "#007300" - bool: {|| if $in { "#755b00" } else { "light_gray" } } - int: "#000000" - filesize: {|e| - if $e == 0b { - "#000000" - } else if $e < 1mb { - "#755b00" - } else {{ fg: "#007300" }} - } - duration: "#000000" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#840000" attr: "b" } - } else if $in < 6hr { - "#840000" - } else if $in < 1day { - "#755b00" - } else if $in < 3day { - "#730073" - } else if $in < 1wk { - { fg: "#730073" attr: "b" } - } else if $in < 6wk { - "#755b00" - } else if $in < 52wk { - "#007300" - } else { "dark_gray" } - } - range: "#000000" - float: "#000000" - string: "#000000" - nothing: "#000000" - binary: "#000000" - cellpath: "#000000" - row_index: { fg: "#730073" attr: "b" } - record: "#000000" - list: "#000000" - block: "#000000" - hints: "dark_gray" - search_result: { fg: "#840000" bg: "#000000" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#000090" attr: "b" } - shape_binary: { fg: "#000090" attr: "b" } - shape_block: { fg: "#007300" attr: "b" } - shape_bool: "#755b00" - shape_custom: "#730073" - shape_datetime: { fg: "#755b00" attr: "b" } - shape_directory: "#755b00" - shape_external: "#755b00" - shape_externalarg: { fg: "#730073" attr: "b" } - shape_filepath: "#755b00" - shape_flag: { fg: "#007300" attr: "b" } - shape_float: { fg: "#000090" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#755b00" attr: "b" } - shape_int: { fg: "#000090" attr: "b" } - shape_internalcall: { fg: "#755b00" attr: "b" } - shape_list: { fg: "#755b00" attr: "b" } - shape_literal: "#007300" - shape_match_pattern: "#730073" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#755b00" - shape_operator: "#755b00" - shape_or: { fg: "#000090" attr: "b" } - shape_pipe: { fg: "#000090" attr: "b" } - shape_range: { fg: "#755b00" attr: "b" } - shape_record: { fg: "#755b00" attr: "b" } - shape_redirection: { fg: "#000090" attr: "b" } - shape_signature: { fg: "#730073" attr: "b" } - shape_string: "#730073" - shape_string_interpolation: { fg: "#755b00" attr: "b" } - shape_table: { fg: "#007300" attr: "b" } - shape_variable: "#000090" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#e0e0e0" - foreground: "#000000" - cursor: "#000000" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#000000' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#730073' attr: 'b' } + empty: '#007300' + bool: {|| if $in { '#755b00' } else { 'light_gray' } } + int: '#000000' + filesize: {|e| + if $e == 0b { + '#000000' + } else if $e < 1mb { + '#755b00' + } else {{ fg: '#007300' }} + } + duration: '#000000' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#840000' attr: 'b' } + } else if $in < 6hr { + '#840000' + } else if $in < 1day { + '#755b00' + } else if $in < 3day { + '#730073' + } else if $in < 1wk { + { fg: '#730073' attr: 'b' } + } else if $in < 6wk { + '#755b00' + } else if $in < 52wk { + '#007300' + } else { 'dark_gray' } + } + range: '#000000' + float: '#000000' + string: '#000000' + nothing: '#000000' + binary: '#000000' + cellpath: '#000000' + row_index: { fg: '#730073' attr: 'b' } + record: '#000000' + list: '#000000' + block: '#000000' + hints: 'dark_gray' + search_result: { fg: '#840000' bg: '#000000' } + + shape_and: { fg: '#000090' attr: 'b' } + shape_binary: { fg: '#000090' attr: 'b' } + shape_block: { fg: '#007300' attr: 'b' } + shape_bool: '#755b00' + shape_custom: '#730073' + shape_datetime: { fg: '#755b00' attr: 'b' } + shape_directory: '#755b00' + shape_external: '#755b00' + shape_externalarg: { fg: '#730073' attr: 'b' } + shape_filepath: '#755b00' + shape_flag: { fg: '#007300' attr: 'b' } + shape_float: { fg: '#000090' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#755b00' attr: 'b' } + shape_int: { fg: '#000090' attr: 'b' } + shape_internalcall: { fg: '#755b00' attr: 'b' } + shape_list: { fg: '#755b00' attr: 'b' } + shape_literal: '#007300' + shape_match_pattern: '#730073' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#755b00' + shape_operator: '#755b00' + shape_or: { fg: '#000090' attr: 'b' } + shape_pipe: { fg: '#000090' attr: 'b' } + shape_range: { fg: '#755b00' attr: 'b' } + shape_record: { fg: '#755b00' attr: 'b' } + shape_redirection: { fg: '#000090' attr: 'b' } + shape_signature: { fg: '#730073' attr: 'b' } + shape_string: '#730073' + shape_string_interpolation: { fg: '#755b00' attr: 'b' } + shape_table: { fg: '#007300' attr: 'b' } + shape_variable: '#000090' + + background: '#e0e0e0' + foreground: '#000000' + cursor: '#000000' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/dot-gov.nu b/themes/nu-themes/dot-gov.nu index 1d5d630..098be64 100644 --- a/themes/nu-themes/dot-gov.nu +++ b/themes/nu-themes/dot-gov.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3d9751" attr: "b" } - empty: "#16b1df" - bool: {|| if $in { "#8bd1ed" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#8bd1ed" - } else {{ fg: "#16b1df" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf081d" attr: "b" } - } else if $in < 6hr { - "#bf081d" - } else if $in < 1day { - "#f6bb33" - } else if $in < 3day { - "#3d9751" - } else if $in < 1wk { - { fg: "#3d9751" attr: "b" } - } else if $in < 6wk { - "#8bd1ed" - } else if $in < 52wk { - "#16b1df" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#3d9751" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#bf081d" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#772fb0" attr: "b" } - shape_binary: { fg: "#772fb0" attr: "b" } - shape_block: { fg: "#16b1df" attr: "b" } - shape_bool: "#8bd1ed" - shape_custom: "#3d9751" - shape_datetime: { fg: "#8bd1ed" attr: "b" } - shape_directory: "#8bd1ed" - shape_external: "#8bd1ed" - shape_externalarg: { fg: "#3d9751" attr: "b" } - shape_filepath: "#8bd1ed" - shape_flag: { fg: "#16b1df" attr: "b" } - shape_float: { fg: "#772fb0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8bd1ed" attr: "b" } - shape_int: { fg: "#772fb0" attr: "b" } - shape_internalcall: { fg: "#8bd1ed" attr: "b" } - shape_list: { fg: "#8bd1ed" attr: "b" } - shape_literal: "#16b1df" - shape_match_pattern: "#3d9751" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8bd1ed" - shape_operator: "#f6bb33" - shape_or: { fg: "#772fb0" attr: "b" } - shape_pipe: { fg: "#772fb0" attr: "b" } - shape_range: { fg: "#f6bb33" attr: "b" } - shape_record: { fg: "#8bd1ed" attr: "b" } - shape_redirection: { fg: "#772fb0" attr: "b" } - shape_signature: { fg: "#3d9751" attr: "b" } - shape_string: "#3d9751" - shape_string_interpolation: { fg: "#8bd1ed" attr: "b" } - shape_table: { fg: "#16b1df" attr: "b" } - shape_variable: "#772fb0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#252b35" - foreground: "#eaeaea" - cursor: "#d9002f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3d9751' attr: 'b' } + empty: '#16b1df' + bool: {|| if $in { '#8bd1ed' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#8bd1ed' + } else {{ fg: '#16b1df' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf081d' attr: 'b' } + } else if $in < 6hr { + '#bf081d' + } else if $in < 1day { + '#f6bb33' + } else if $in < 3day { + '#3d9751' + } else if $in < 1wk { + { fg: '#3d9751' attr: 'b' } + } else if $in < 6wk { + '#8bd1ed' + } else if $in < 52wk { + '#16b1df' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#3d9751' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#bf081d' bg: '#ffffff' } + + shape_and: { fg: '#772fb0' attr: 'b' } + shape_binary: { fg: '#772fb0' attr: 'b' } + shape_block: { fg: '#16b1df' attr: 'b' } + shape_bool: '#8bd1ed' + shape_custom: '#3d9751' + shape_datetime: { fg: '#8bd1ed' attr: 'b' } + shape_directory: '#8bd1ed' + shape_external: '#8bd1ed' + shape_externalarg: { fg: '#3d9751' attr: 'b' } + shape_filepath: '#8bd1ed' + shape_flag: { fg: '#16b1df' attr: 'b' } + shape_float: { fg: '#772fb0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8bd1ed' attr: 'b' } + shape_int: { fg: '#772fb0' attr: 'b' } + shape_internalcall: { fg: '#8bd1ed' attr: 'b' } + shape_list: { fg: '#8bd1ed' attr: 'b' } + shape_literal: '#16b1df' + shape_match_pattern: '#3d9751' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8bd1ed' + shape_operator: '#f6bb33' + shape_or: { fg: '#772fb0' attr: 'b' } + shape_pipe: { fg: '#772fb0' attr: 'b' } + shape_range: { fg: '#f6bb33' attr: 'b' } + shape_record: { fg: '#8bd1ed' attr: 'b' } + shape_redirection: { fg: '#772fb0' attr: 'b' } + shape_signature: { fg: '#3d9751' attr: 'b' } + shape_string: '#3d9751' + shape_string_interpolation: { fg: '#8bd1ed' attr: 'b' } + shape_table: { fg: '#16b1df' attr: 'b' } + shape_variable: '#772fb0' + + background: '#252b35' + foreground: '#eaeaea' + cursor: '#d9002f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/dracula.nu b/themes/nu-themes/dracula.nu index 6cdbf42..db783ed 100644 --- a/themes/nu-themes/dracula.nu +++ b/themes/nu-themes/dracula.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e9e9f4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ebff87" attr: "b" } - empty: "#62d6e8" - bool: {|| if $in { "#a1efe4" } else { "light_gray" } } - int: "#e9e9f4" - filesize: {|e| - if $e == 0b { - "#e9e9f4" - } else if $e < 1mb { - "#a1efe4" - } else {{ fg: "#62d6e8" }} - } - duration: "#e9e9f4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ea51b2" attr: "b" } - } else if $in < 6hr { - "#ea51b2" - } else if $in < 1day { - "#00f769" - } else if $in < 3day { - "#ebff87" - } else if $in < 1wk { - { fg: "#ebff87" attr: "b" } - } else if $in < 6wk { - "#a1efe4" - } else if $in < 52wk { - "#62d6e8" - } else { "dark_gray" } - } - range: "#e9e9f4" - float: "#e9e9f4" - string: "#e9e9f4" - nothing: "#e9e9f4" - binary: "#e9e9f4" - cellpath: "#e9e9f4" - row_index: { fg: "#ebff87" attr: "b" } - record: "#e9e9f4" - list: "#e9e9f4" - block: "#e9e9f4" - hints: "dark_gray" - search_result: { fg: "#ea51b2" bg: "#e9e9f4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b45bcf" attr: "b" } - shape_binary: { fg: "#b45bcf" attr: "b" } - shape_block: { fg: "#62d6e8" attr: "b" } - shape_bool: "#a1efe4" - shape_custom: "#ebff87" - shape_datetime: { fg: "#a1efe4" attr: "b" } - shape_directory: "#a1efe4" - shape_external: "#a1efe4" - shape_externalarg: { fg: "#ebff87" attr: "b" } - shape_filepath: "#a1efe4" - shape_flag: { fg: "#62d6e8" attr: "b" } - shape_float: { fg: "#b45bcf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#a1efe4" attr: "b" } - shape_int: { fg: "#b45bcf" attr: "b" } - shape_internalcall: { fg: "#a1efe4" attr: "b" } - shape_list: { fg: "#a1efe4" attr: "b" } - shape_literal: "#62d6e8" - shape_match_pattern: "#ebff87" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a1efe4" - shape_operator: "#00f769" - shape_or: { fg: "#b45bcf" attr: "b" } - shape_pipe: { fg: "#b45bcf" attr: "b" } - shape_range: { fg: "#00f769" attr: "b" } - shape_record: { fg: "#a1efe4" attr: "b" } - shape_redirection: { fg: "#b45bcf" attr: "b" } - shape_signature: { fg: "#ebff87" attr: "b" } - shape_string: "#ebff87" - shape_string_interpolation: { fg: "#a1efe4" attr: "b" } - shape_table: { fg: "#62d6e8" attr: "b" } - shape_variable: "#b45bcf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282936" - foreground: "#e9e9f4" - cursor: "#e9e9f4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e9e9f4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ebff87' attr: 'b' } + empty: '#62d6e8' + bool: {|| if $in { '#a1efe4' } else { 'light_gray' } } + int: '#e9e9f4' + filesize: {|e| + if $e == 0b { + '#e9e9f4' + } else if $e < 1mb { + '#a1efe4' + } else {{ fg: '#62d6e8' }} + } + duration: '#e9e9f4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ea51b2' attr: 'b' } + } else if $in < 6hr { + '#ea51b2' + } else if $in < 1day { + '#00f769' + } else if $in < 3day { + '#ebff87' + } else if $in < 1wk { + { fg: '#ebff87' attr: 'b' } + } else if $in < 6wk { + '#a1efe4' + } else if $in < 52wk { + '#62d6e8' + } else { 'dark_gray' } + } + range: '#e9e9f4' + float: '#e9e9f4' + string: '#e9e9f4' + nothing: '#e9e9f4' + binary: '#e9e9f4' + cellpath: '#e9e9f4' + row_index: { fg: '#ebff87' attr: 'b' } + record: '#e9e9f4' + list: '#e9e9f4' + block: '#e9e9f4' + hints: 'dark_gray' + search_result: { fg: '#ea51b2' bg: '#e9e9f4' } + + shape_and: { fg: '#b45bcf' attr: 'b' } + shape_binary: { fg: '#b45bcf' attr: 'b' } + shape_block: { fg: '#62d6e8' attr: 'b' } + shape_bool: '#a1efe4' + shape_custom: '#ebff87' + shape_datetime: { fg: '#a1efe4' attr: 'b' } + shape_directory: '#a1efe4' + shape_external: '#a1efe4' + shape_externalarg: { fg: '#ebff87' attr: 'b' } + shape_filepath: '#a1efe4' + shape_flag: { fg: '#62d6e8' attr: 'b' } + shape_float: { fg: '#b45bcf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#a1efe4' attr: 'b' } + shape_int: { fg: '#b45bcf' attr: 'b' } + shape_internalcall: { fg: '#a1efe4' attr: 'b' } + shape_list: { fg: '#a1efe4' attr: 'b' } + shape_literal: '#62d6e8' + shape_match_pattern: '#ebff87' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a1efe4' + shape_operator: '#00f769' + shape_or: { fg: '#b45bcf' attr: 'b' } + shape_pipe: { fg: '#b45bcf' attr: 'b' } + shape_range: { fg: '#00f769' attr: 'b' } + shape_record: { fg: '#a1efe4' attr: 'b' } + shape_redirection: { fg: '#b45bcf' attr: 'b' } + shape_signature: { fg: '#ebff87' attr: 'b' } + shape_string: '#ebff87' + shape_string_interpolation: { fg: '#a1efe4' attr: 'b' } + shape_table: { fg: '#62d6e8' attr: 'b' } + shape_variable: '#b45bcf' + + background: '#282936' + foreground: '#e9e9f4' + cursor: '#e9e9f4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/dumbledore.nu b/themes/nu-themes/dumbledore.nu index 698ff51..0380f3b 100644 --- a/themes/nu-themes/dumbledore.nu +++ b/themes/nu-themes/dumbledore.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#850000" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3e7c54" attr: "b" } - empty: "#415baf" - bool: {|| if $in { "#25de50" } else { "light_gray" } } - int: "#850000" - filesize: {|e| - if $e == 0b { - "#850000" - } else if $e < 1mb { - "#008aff" - } else {{ fg: "#415baf" }} - } - duration: "#850000" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ae0000" attr: "b" } - } else if $in < 6hr { - "#ae0000" - } else if $in < 1day { - "#f0c75e" - } else if $in < 3day { - "#3e7c54" - } else if $in < 1wk { - { fg: "#3e7c54" attr: "b" } - } else if $in < 6wk { - "#008aff" - } else if $in < 52wk { - "#415baf" - } else { "dark_gray" } - } - range: "#850000" - float: "#850000" - string: "#850000" - nothing: "#850000" - binary: "#850000" - cellpath: "#850000" - row_index: { fg: "#3e7c54" attr: "b" } - record: "#850000" - list: "#850000" - block: "#850000" - hints: "dark_gray" - search_result: { fg: "#ae0000" bg: "#850000" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9445ae" attr: "b" } - shape_binary: { fg: "#9445ae" attr: "b" } - shape_block: { fg: "#415baf" attr: "b" } - shape_bool: "#25de50" - shape_custom: "#3e7c54" - shape_datetime: { fg: "#008aff" attr: "b" } - shape_directory: "#008aff" - shape_external: "#008aff" - shape_externalarg: { fg: "#3e7c54" attr: "b" } - shape_filepath: "#008aff" - shape_flag: { fg: "#415baf" attr: "b" } - shape_float: { fg: "#9445ae" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#008aff" attr: "b" } - shape_int: { fg: "#9445ae" attr: "b" } - shape_internalcall: { fg: "#008aff" attr: "b" } - shape_list: { fg: "#008aff" attr: "b" } - shape_literal: "#415baf" - shape_match_pattern: "#3e7c54" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#25de50" - shape_operator: "#f0c75e" - shape_or: { fg: "#9445ae" attr: "b" } - shape_pipe: { fg: "#9445ae" attr: "b" } - shape_range: { fg: "#f0c75e" attr: "b" } - shape_record: { fg: "#008aff" attr: "b" } - shape_redirection: { fg: "#9445ae" attr: "b" } - shape_signature: { fg: "#3e7c54" attr: "b" } - shape_string: "#3e7c54" - shape_string_interpolation: { fg: "#008aff" attr: "b" } - shape_table: { fg: "#415baf" attr: "b" } - shape_variable: "#9445ae" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#422553" - foreground: "#c4c8c5" - cursor: "#c4c8c5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#850000' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3e7c54' attr: 'b' } + empty: '#415baf' + bool: {|| if $in { '#25de50' } else { 'light_gray' } } + int: '#850000' + filesize: {|e| + if $e == 0b { + '#850000' + } else if $e < 1mb { + '#008aff' + } else {{ fg: '#415baf' }} + } + duration: '#850000' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ae0000' attr: 'b' } + } else if $in < 6hr { + '#ae0000' + } else if $in < 1day { + '#f0c75e' + } else if $in < 3day { + '#3e7c54' + } else if $in < 1wk { + { fg: '#3e7c54' attr: 'b' } + } else if $in < 6wk { + '#008aff' + } else if $in < 52wk { + '#415baf' + } else { 'dark_gray' } + } + range: '#850000' + float: '#850000' + string: '#850000' + nothing: '#850000' + binary: '#850000' + cellpath: '#850000' + row_index: { fg: '#3e7c54' attr: 'b' } + record: '#850000' + list: '#850000' + block: '#850000' + hints: 'dark_gray' + search_result: { fg: '#ae0000' bg: '#850000' } + + shape_and: { fg: '#9445ae' attr: 'b' } + shape_binary: { fg: '#9445ae' attr: 'b' } + shape_block: { fg: '#415baf' attr: 'b' } + shape_bool: '#25de50' + shape_custom: '#3e7c54' + shape_datetime: { fg: '#008aff' attr: 'b' } + shape_directory: '#008aff' + shape_external: '#008aff' + shape_externalarg: { fg: '#3e7c54' attr: 'b' } + shape_filepath: '#008aff' + shape_flag: { fg: '#415baf' attr: 'b' } + shape_float: { fg: '#9445ae' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#008aff' attr: 'b' } + shape_int: { fg: '#9445ae' attr: 'b' } + shape_internalcall: { fg: '#008aff' attr: 'b' } + shape_list: { fg: '#008aff' attr: 'b' } + shape_literal: '#415baf' + shape_match_pattern: '#3e7c54' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#25de50' + shape_operator: '#f0c75e' + shape_or: { fg: '#9445ae' attr: 'b' } + shape_pipe: { fg: '#9445ae' attr: 'b' } + shape_range: { fg: '#f0c75e' attr: 'b' } + shape_record: { fg: '#008aff' attr: 'b' } + shape_redirection: { fg: '#9445ae' attr: 'b' } + shape_signature: { fg: '#3e7c54' attr: 'b' } + shape_string: '#3e7c54' + shape_string_interpolation: { fg: '#008aff' attr: 'b' } + shape_table: { fg: '#415baf' attr: 'b' } + shape_variable: '#9445ae' + + background: '#422553' + foreground: '#c4c8c5' + cursor: '#c4c8c5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/duotone-dark.nu b/themes/nu-themes/duotone-dark.nu index 2712d80..d5be708 100644 --- a/themes/nu-themes/duotone-dark.nu +++ b/themes/nu-themes/duotone-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b6a0ff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2dcc72" attr: "b" } - empty: "#ffc183" - bool: {|| if $in { "#2388ff" } else { "light_gray" } } - int: "#b6a0ff" - filesize: {|e| - if $e == 0b { - "#b6a0ff" - } else if $e < 1mb { - "#2388ff" - } else {{ fg: "#ffc183" }} - } - duration: "#b6a0ff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d8393d" attr: "b" } - } else if $in < 6hr { - "#d8393d" - } else if $in < 1day { - "#d8b76e" - } else if $in < 3day { - "#2dcc72" - } else if $in < 1wk { - { fg: "#2dcc72" attr: "b" } - } else if $in < 6wk { - "#2388ff" - } else if $in < 52wk { - "#ffc183" - } else { "dark_gray" } - } - range: "#b6a0ff" - float: "#b6a0ff" - string: "#b6a0ff" - nothing: "#b6a0ff" - binary: "#b6a0ff" - cellpath: "#b6a0ff" - row_index: { fg: "#2dcc72" attr: "b" } - record: "#b6a0ff" - list: "#b6a0ff" - block: "#b6a0ff" - hints: "dark_gray" - search_result: { fg: "#d8393d" bg: "#b6a0ff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#dd8d40" attr: "b" } - shape_binary: { fg: "#dd8d40" attr: "b" } - shape_block: { fg: "#ffc183" attr: "b" } - shape_bool: "#2388ff" - shape_custom: "#2dcc72" - shape_datetime: { fg: "#2388ff" attr: "b" } - shape_directory: "#2388ff" - shape_external: "#2388ff" - shape_externalarg: { fg: "#2dcc72" attr: "b" } - shape_filepath: "#2388ff" - shape_flag: { fg: "#ffc183" attr: "b" } - shape_float: { fg: "#dd8d40" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2388ff" attr: "b" } - shape_int: { fg: "#dd8d40" attr: "b" } - shape_internalcall: { fg: "#2388ff" attr: "b" } - shape_list: { fg: "#2388ff" attr: "b" } - shape_literal: "#ffc183" - shape_match_pattern: "#2dcc72" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2388ff" - shape_operator: "#d8b76e" - shape_or: { fg: "#dd8d40" attr: "b" } - shape_pipe: { fg: "#dd8d40" attr: "b" } - shape_range: { fg: "#d8b76e" attr: "b" } - shape_record: { fg: "#2388ff" attr: "b" } - shape_redirection: { fg: "#dd8d40" attr: "b" } - shape_signature: { fg: "#2dcc72" attr: "b" } - shape_string: "#2dcc72" - shape_string_interpolation: { fg: "#2388ff" attr: "b" } - shape_table: { fg: "#ffc183" attr: "b" } - shape_variable: "#dd8d40" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1c27" - foreground: "#b6a0ff" - cursor: "#ff9738" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b6a0ff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2dcc72' attr: 'b' } + empty: '#ffc183' + bool: {|| if $in { '#2388ff' } else { 'light_gray' } } + int: '#b6a0ff' + filesize: {|e| + if $e == 0b { + '#b6a0ff' + } else if $e < 1mb { + '#2388ff' + } else {{ fg: '#ffc183' }} + } + duration: '#b6a0ff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d8393d' attr: 'b' } + } else if $in < 6hr { + '#d8393d' + } else if $in < 1day { + '#d8b76e' + } else if $in < 3day { + '#2dcc72' + } else if $in < 1wk { + { fg: '#2dcc72' attr: 'b' } + } else if $in < 6wk { + '#2388ff' + } else if $in < 52wk { + '#ffc183' + } else { 'dark_gray' } + } + range: '#b6a0ff' + float: '#b6a0ff' + string: '#b6a0ff' + nothing: '#b6a0ff' + binary: '#b6a0ff' + cellpath: '#b6a0ff' + row_index: { fg: '#2dcc72' attr: 'b' } + record: '#b6a0ff' + list: '#b6a0ff' + block: '#b6a0ff' + hints: 'dark_gray' + search_result: { fg: '#d8393d' bg: '#b6a0ff' } + + shape_and: { fg: '#dd8d40' attr: 'b' } + shape_binary: { fg: '#dd8d40' attr: 'b' } + shape_block: { fg: '#ffc183' attr: 'b' } + shape_bool: '#2388ff' + shape_custom: '#2dcc72' + shape_datetime: { fg: '#2388ff' attr: 'b' } + shape_directory: '#2388ff' + shape_external: '#2388ff' + shape_externalarg: { fg: '#2dcc72' attr: 'b' } + shape_filepath: '#2388ff' + shape_flag: { fg: '#ffc183' attr: 'b' } + shape_float: { fg: '#dd8d40' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2388ff' attr: 'b' } + shape_int: { fg: '#dd8d40' attr: 'b' } + shape_internalcall: { fg: '#2388ff' attr: 'b' } + shape_list: { fg: '#2388ff' attr: 'b' } + shape_literal: '#ffc183' + shape_match_pattern: '#2dcc72' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2388ff' + shape_operator: '#d8b76e' + shape_or: { fg: '#dd8d40' attr: 'b' } + shape_pipe: { fg: '#dd8d40' attr: 'b' } + shape_range: { fg: '#d8b76e' attr: 'b' } + shape_record: { fg: '#2388ff' attr: 'b' } + shape_redirection: { fg: '#dd8d40' attr: 'b' } + shape_signature: { fg: '#2dcc72' attr: 'b' } + shape_string: '#2dcc72' + shape_string_interpolation: { fg: '#2388ff' attr: 'b' } + shape_table: { fg: '#ffc183' attr: 'b' } + shape_variable: '#dd8d40' + + background: '#1f1c27' + foreground: '#b6a0ff' + cursor: '#ff9738' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/e-n-c-o-m.nu b/themes/nu-themes/e-n-c-o-m.nu index 09e4e88..6f77d38 100644 --- a/themes/nu-themes/e-n-c-o-m.nu +++ b/themes/nu-themes/e-n-c-o-m.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#008b00" attr: "b" } - empty: "#0081ff" - bool: {|| if $in { "#00cdcd" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#008b8b" - } else {{ fg: "#0081ff" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9f0000" attr: "b" } - } else if $in < 6hr { - "#9f0000" - } else if $in < 1day { - "#ffcf00" - } else if $in < 3day { - "#008b00" - } else if $in < 1wk { - { fg: "#008b00" attr: "b" } - } else if $in < 6wk { - "#008b8b" - } else if $in < 52wk { - "#0081ff" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#008b00" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#9f0000" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bc00ca" attr: "b" } - shape_binary: { fg: "#bc00ca" attr: "b" } - shape_block: { fg: "#0081ff" attr: "b" } - shape_bool: "#00cdcd" - shape_custom: "#008b00" - shape_datetime: { fg: "#008b8b" attr: "b" } - shape_directory: "#008b8b" - shape_external: "#008b8b" - shape_externalarg: { fg: "#008b00" attr: "b" } - shape_filepath: "#008b8b" - shape_flag: { fg: "#0081ff" attr: "b" } - shape_float: { fg: "#bc00ca" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#008b8b" attr: "b" } - shape_int: { fg: "#bc00ca" attr: "b" } - shape_internalcall: { fg: "#008b8b" attr: "b" } - shape_list: { fg: "#008b8b" attr: "b" } - shape_literal: "#0081ff" - shape_match_pattern: "#008b00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00cdcd" - shape_operator: "#ffcf00" - shape_or: { fg: "#bc00ca" attr: "b" } - shape_pipe: { fg: "#bc00ca" attr: "b" } - shape_range: { fg: "#ffcf00" attr: "b" } - shape_record: { fg: "#008b8b" attr: "b" } - shape_redirection: { fg: "#bc00ca" attr: "b" } - shape_signature: { fg: "#008b00" attr: "b" } - shape_string: "#008b00" - shape_string_interpolation: { fg: "#008b8b" attr: "b" } - shape_table: { fg: "#0081ff" attr: "b" } - shape_variable: "#bc00ca" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#00a595" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#008b00' attr: 'b' } + empty: '#0081ff' + bool: {|| if $in { '#00cdcd' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#008b8b' + } else {{ fg: '#0081ff' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9f0000' attr: 'b' } + } else if $in < 6hr { + '#9f0000' + } else if $in < 1day { + '#ffcf00' + } else if $in < 3day { + '#008b00' + } else if $in < 1wk { + { fg: '#008b00' attr: 'b' } + } else if $in < 6wk { + '#008b8b' + } else if $in < 52wk { + '#0081ff' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#008b00' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#9f0000' bg: '#bbbbbb' } + + shape_and: { fg: '#bc00ca' attr: 'b' } + shape_binary: { fg: '#bc00ca' attr: 'b' } + shape_block: { fg: '#0081ff' attr: 'b' } + shape_bool: '#00cdcd' + shape_custom: '#008b00' + shape_datetime: { fg: '#008b8b' attr: 'b' } + shape_directory: '#008b8b' + shape_external: '#008b8b' + shape_externalarg: { fg: '#008b00' attr: 'b' } + shape_filepath: '#008b8b' + shape_flag: { fg: '#0081ff' attr: 'b' } + shape_float: { fg: '#bc00ca' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#008b8b' attr: 'b' } + shape_int: { fg: '#bc00ca' attr: 'b' } + shape_internalcall: { fg: '#008b8b' attr: 'b' } + shape_list: { fg: '#008b8b' attr: 'b' } + shape_literal: '#0081ff' + shape_match_pattern: '#008b00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00cdcd' + shape_operator: '#ffcf00' + shape_or: { fg: '#bc00ca' attr: 'b' } + shape_pipe: { fg: '#bc00ca' attr: 'b' } + shape_range: { fg: '#ffcf00' attr: 'b' } + shape_record: { fg: '#008b8b' attr: 'b' } + shape_redirection: { fg: '#bc00ca' attr: 'b' } + shape_signature: { fg: '#008b00' attr: 'b' } + shape_string: '#008b00' + shape_string_interpolation: { fg: '#008b8b' attr: 'b' } + shape_table: { fg: '#0081ff' attr: 'b' } + shape_variable: '#bc00ca' + + background: '#000000' + foreground: '#00a595' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/earthsong.nu b/themes/nu-themes/earthsong.nu index f150528..5ef48f9 100644 --- a/themes/nu-themes/earthsong.nu +++ b/themes/nu-themes/earthsong.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e5c6aa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#85c54c" attr: "b" } - empty: "#1398b9" - bool: {|| if $in { "#84f088" } else { "light_gray" } } - int: "#e5c6aa" - filesize: {|e| - if $e == 0b { - "#e5c6aa" - } else if $e < 1mb { - "#509552" - } else {{ fg: "#1398b9" }} - } - duration: "#e5c6aa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c94234" attr: "b" } - } else if $in < 6hr { - "#c94234" - } else if $in < 1day { - "#f5ae2e" - } else if $in < 3day { - "#85c54c" - } else if $in < 1wk { - { fg: "#85c54c" attr: "b" } - } else if $in < 6wk { - "#509552" - } else if $in < 52wk { - "#1398b9" - } else { "dark_gray" } - } - range: "#e5c6aa" - float: "#e5c6aa" - string: "#e5c6aa" - nothing: "#e5c6aa" - binary: "#e5c6aa" - cellpath: "#e5c6aa" - row_index: { fg: "#85c54c" attr: "b" } - record: "#e5c6aa" - list: "#e5c6aa" - block: "#e5c6aa" - hints: "dark_gray" - search_result: { fg: "#c94234" bg: "#e5c6aa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d0633d" attr: "b" } - shape_binary: { fg: "#d0633d" attr: "b" } - shape_block: { fg: "#1398b9" attr: "b" } - shape_bool: "#84f088" - shape_custom: "#85c54c" - shape_datetime: { fg: "#509552" attr: "b" } - shape_directory: "#509552" - shape_external: "#509552" - shape_externalarg: { fg: "#85c54c" attr: "b" } - shape_filepath: "#509552" - shape_flag: { fg: "#1398b9" attr: "b" } - shape_float: { fg: "#d0633d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#509552" attr: "b" } - shape_int: { fg: "#d0633d" attr: "b" } - shape_internalcall: { fg: "#509552" attr: "b" } - shape_list: { fg: "#509552" attr: "b" } - shape_literal: "#1398b9" - shape_match_pattern: "#85c54c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#84f088" - shape_operator: "#f5ae2e" - shape_or: { fg: "#d0633d" attr: "b" } - shape_pipe: { fg: "#d0633d" attr: "b" } - shape_range: { fg: "#f5ae2e" attr: "b" } - shape_record: { fg: "#509552" attr: "b" } - shape_redirection: { fg: "#d0633d" attr: "b" } - shape_signature: { fg: "#85c54c" attr: "b" } - shape_string: "#85c54c" - shape_string_interpolation: { fg: "#509552" attr: "b" } - shape_table: { fg: "#1398b9" attr: "b" } - shape_variable: "#d0633d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#292520" - foreground: "#e5c7a9" - cursor: "#e5c7a9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e5c6aa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#85c54c' attr: 'b' } + empty: '#1398b9' + bool: {|| if $in { '#84f088' } else { 'light_gray' } } + int: '#e5c6aa' + filesize: {|e| + if $e == 0b { + '#e5c6aa' + } else if $e < 1mb { + '#509552' + } else {{ fg: '#1398b9' }} + } + duration: '#e5c6aa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c94234' attr: 'b' } + } else if $in < 6hr { + '#c94234' + } else if $in < 1day { + '#f5ae2e' + } else if $in < 3day { + '#85c54c' + } else if $in < 1wk { + { fg: '#85c54c' attr: 'b' } + } else if $in < 6wk { + '#509552' + } else if $in < 52wk { + '#1398b9' + } else { 'dark_gray' } + } + range: '#e5c6aa' + float: '#e5c6aa' + string: '#e5c6aa' + nothing: '#e5c6aa' + binary: '#e5c6aa' + cellpath: '#e5c6aa' + row_index: { fg: '#85c54c' attr: 'b' } + record: '#e5c6aa' + list: '#e5c6aa' + block: '#e5c6aa' + hints: 'dark_gray' + search_result: { fg: '#c94234' bg: '#e5c6aa' } + + shape_and: { fg: '#d0633d' attr: 'b' } + shape_binary: { fg: '#d0633d' attr: 'b' } + shape_block: { fg: '#1398b9' attr: 'b' } + shape_bool: '#84f088' + shape_custom: '#85c54c' + shape_datetime: { fg: '#509552' attr: 'b' } + shape_directory: '#509552' + shape_external: '#509552' + shape_externalarg: { fg: '#85c54c' attr: 'b' } + shape_filepath: '#509552' + shape_flag: { fg: '#1398b9' attr: 'b' } + shape_float: { fg: '#d0633d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#509552' attr: 'b' } + shape_int: { fg: '#d0633d' attr: 'b' } + shape_internalcall: { fg: '#509552' attr: 'b' } + shape_list: { fg: '#509552' attr: 'b' } + shape_literal: '#1398b9' + shape_match_pattern: '#85c54c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#84f088' + shape_operator: '#f5ae2e' + shape_or: { fg: '#d0633d' attr: 'b' } + shape_pipe: { fg: '#d0633d' attr: 'b' } + shape_range: { fg: '#f5ae2e' attr: 'b' } + shape_record: { fg: '#509552' attr: 'b' } + shape_redirection: { fg: '#d0633d' attr: 'b' } + shape_signature: { fg: '#85c54c' attr: 'b' } + shape_string: '#85c54c' + shape_string_interpolation: { fg: '#509552' attr: 'b' } + shape_table: { fg: '#1398b9' attr: 'b' } + shape_variable: '#d0633d' + + background: '#292520' + foreground: '#e5c7a9' + cursor: '#e5c7a9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/edge-dark.nu b/themes/nu-themes/edge-dark.nu index ed95bec..022ea94 100644 --- a/themes/nu-themes/edge-dark.nu +++ b/themes/nu-themes/edge-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b7bec9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1bf78" attr: "b" } - empty: "#73b3e7" - bool: {|| if $in { "#5ebaa5" } else { "light_gray" } } - int: "#b7bec9" - filesize: {|e| - if $e == 0b { - "#b7bec9" - } else if $e < 1mb { - "#5ebaa5" - } else {{ fg: "#73b3e7" }} - } - duration: "#b7bec9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e77171" attr: "b" } - } else if $in < 6hr { - "#e77171" - } else if $in < 1day { - "#dbb774" - } else if $in < 3day { - "#a1bf78" - } else if $in < 1wk { - { fg: "#a1bf78" attr: "b" } - } else if $in < 6wk { - "#5ebaa5" - } else if $in < 52wk { - "#73b3e7" - } else { "dark_gray" } - } - range: "#b7bec9" - float: "#b7bec9" - string: "#b7bec9" - nothing: "#b7bec9" - binary: "#b7bec9" - cellpath: "#b7bec9" - row_index: { fg: "#a1bf78" attr: "b" } - record: "#b7bec9" - list: "#b7bec9" - block: "#b7bec9" - hints: "dark_gray" - search_result: { fg: "#e77171" bg: "#b7bec9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d390e7" attr: "b" } - shape_binary: { fg: "#d390e7" attr: "b" } - shape_block: { fg: "#73b3e7" attr: "b" } - shape_bool: "#5ebaa5" - shape_custom: "#a1bf78" - shape_datetime: { fg: "#5ebaa5" attr: "b" } - shape_directory: "#5ebaa5" - shape_external: "#5ebaa5" - shape_externalarg: { fg: "#a1bf78" attr: "b" } - shape_filepath: "#5ebaa5" - shape_flag: { fg: "#73b3e7" attr: "b" } - shape_float: { fg: "#d390e7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5ebaa5" attr: "b" } - shape_int: { fg: "#d390e7" attr: "b" } - shape_internalcall: { fg: "#5ebaa5" attr: "b" } - shape_list: { fg: "#5ebaa5" attr: "b" } - shape_literal: "#73b3e7" - shape_match_pattern: "#a1bf78" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5ebaa5" - shape_operator: "#dbb774" - shape_or: { fg: "#d390e7" attr: "b" } - shape_pipe: { fg: "#d390e7" attr: "b" } - shape_range: { fg: "#dbb774" attr: "b" } - shape_record: { fg: "#5ebaa5" attr: "b" } - shape_redirection: { fg: "#d390e7" attr: "b" } - shape_signature: { fg: "#a1bf78" attr: "b" } - shape_string: "#a1bf78" - shape_string_interpolation: { fg: "#5ebaa5" attr: "b" } - shape_table: { fg: "#73b3e7" attr: "b" } - shape_variable: "#d390e7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262729" - foreground: "#b7bec9" - cursor: "#b7bec9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b7bec9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1bf78' attr: 'b' } + empty: '#73b3e7' + bool: {|| if $in { '#5ebaa5' } else { 'light_gray' } } + int: '#b7bec9' + filesize: {|e| + if $e == 0b { + '#b7bec9' + } else if $e < 1mb { + '#5ebaa5' + } else {{ fg: '#73b3e7' }} + } + duration: '#b7bec9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e77171' attr: 'b' } + } else if $in < 6hr { + '#e77171' + } else if $in < 1day { + '#dbb774' + } else if $in < 3day { + '#a1bf78' + } else if $in < 1wk { + { fg: '#a1bf78' attr: 'b' } + } else if $in < 6wk { + '#5ebaa5' + } else if $in < 52wk { + '#73b3e7' + } else { 'dark_gray' } + } + range: '#b7bec9' + float: '#b7bec9' + string: '#b7bec9' + nothing: '#b7bec9' + binary: '#b7bec9' + cellpath: '#b7bec9' + row_index: { fg: '#a1bf78' attr: 'b' } + record: '#b7bec9' + list: '#b7bec9' + block: '#b7bec9' + hints: 'dark_gray' + search_result: { fg: '#e77171' bg: '#b7bec9' } + + shape_and: { fg: '#d390e7' attr: 'b' } + shape_binary: { fg: '#d390e7' attr: 'b' } + shape_block: { fg: '#73b3e7' attr: 'b' } + shape_bool: '#5ebaa5' + shape_custom: '#a1bf78' + shape_datetime: { fg: '#5ebaa5' attr: 'b' } + shape_directory: '#5ebaa5' + shape_external: '#5ebaa5' + shape_externalarg: { fg: '#a1bf78' attr: 'b' } + shape_filepath: '#5ebaa5' + shape_flag: { fg: '#73b3e7' attr: 'b' } + shape_float: { fg: '#d390e7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5ebaa5' attr: 'b' } + shape_int: { fg: '#d390e7' attr: 'b' } + shape_internalcall: { fg: '#5ebaa5' attr: 'b' } + shape_list: { fg: '#5ebaa5' attr: 'b' } + shape_literal: '#73b3e7' + shape_match_pattern: '#a1bf78' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5ebaa5' + shape_operator: '#dbb774' + shape_or: { fg: '#d390e7' attr: 'b' } + shape_pipe: { fg: '#d390e7' attr: 'b' } + shape_range: { fg: '#dbb774' attr: 'b' } + shape_record: { fg: '#5ebaa5' attr: 'b' } + shape_redirection: { fg: '#d390e7' attr: 'b' } + shape_signature: { fg: '#a1bf78' attr: 'b' } + shape_string: '#a1bf78' + shape_string_interpolation: { fg: '#5ebaa5' attr: 'b' } + shape_table: { fg: '#73b3e7' attr: 'b' } + shape_variable: '#d390e7' + + background: '#262729' + foreground: '#b7bec9' + cursor: '#b7bec9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/edge-light.nu b/themes/nu-themes/edge-light.nu index 174d654..6153ab0 100644 --- a/themes/nu-themes/edge-light.nu +++ b/themes/nu-themes/edge-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5e646f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7c9f4b" attr: "b" } - empty: "#6587bf" - bool: {|| if $in { "#509c93" } else { "light_gray" } } - int: "#5e646f" - filesize: {|e| - if $e == 0b { - "#5e646f" - } else if $e < 1mb { - "#509c93" - } else {{ fg: "#6587bf" }} - } - duration: "#5e646f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#db7070" attr: "b" } - } else if $in < 6hr { - "#db7070" - } else if $in < 1day { - "#d69822" - } else if $in < 3day { - "#7c9f4b" - } else if $in < 1wk { - { fg: "#7c9f4b" attr: "b" } - } else if $in < 6wk { - "#509c93" - } else if $in < 52wk { - "#6587bf" - } else { "dark_gray" } - } - range: "#5e646f" - float: "#5e646f" - string: "#5e646f" - nothing: "#5e646f" - binary: "#5e646f" - cellpath: "#5e646f" - row_index: { fg: "#7c9f4b" attr: "b" } - record: "#5e646f" - list: "#5e646f" - block: "#5e646f" - hints: "dark_gray" - search_result: { fg: "#db7070" bg: "#5e646f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b870ce" attr: "b" } - shape_binary: { fg: "#b870ce" attr: "b" } - shape_block: { fg: "#6587bf" attr: "b" } - shape_bool: "#509c93" - shape_custom: "#7c9f4b" - shape_datetime: { fg: "#509c93" attr: "b" } - shape_directory: "#509c93" - shape_external: "#509c93" - shape_externalarg: { fg: "#7c9f4b" attr: "b" } - shape_filepath: "#509c93" - shape_flag: { fg: "#6587bf" attr: "b" } - shape_float: { fg: "#b870ce" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#509c93" attr: "b" } - shape_int: { fg: "#b870ce" attr: "b" } - shape_internalcall: { fg: "#509c93" attr: "b" } - shape_list: { fg: "#509c93" attr: "b" } - shape_literal: "#6587bf" - shape_match_pattern: "#7c9f4b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#509c93" - shape_operator: "#d69822" - shape_or: { fg: "#b870ce" attr: "b" } - shape_pipe: { fg: "#b870ce" attr: "b" } - shape_range: { fg: "#d69822" attr: "b" } - shape_record: { fg: "#509c93" attr: "b" } - shape_redirection: { fg: "#b870ce" attr: "b" } - shape_signature: { fg: "#7c9f4b" attr: "b" } - shape_string: "#7c9f4b" - shape_string_interpolation: { fg: "#509c93" attr: "b" } - shape_table: { fg: "#6587bf" attr: "b" } - shape_variable: "#b870ce" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fafafa" - foreground: "#5e646f" - cursor: "#5e646f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5e646f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7c9f4b' attr: 'b' } + empty: '#6587bf' + bool: {|| if $in { '#509c93' } else { 'light_gray' } } + int: '#5e646f' + filesize: {|e| + if $e == 0b { + '#5e646f' + } else if $e < 1mb { + '#509c93' + } else {{ fg: '#6587bf' }} + } + duration: '#5e646f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#db7070' attr: 'b' } + } else if $in < 6hr { + '#db7070' + } else if $in < 1day { + '#d69822' + } else if $in < 3day { + '#7c9f4b' + } else if $in < 1wk { + { fg: '#7c9f4b' attr: 'b' } + } else if $in < 6wk { + '#509c93' + } else if $in < 52wk { + '#6587bf' + } else { 'dark_gray' } + } + range: '#5e646f' + float: '#5e646f' + string: '#5e646f' + nothing: '#5e646f' + binary: '#5e646f' + cellpath: '#5e646f' + row_index: { fg: '#7c9f4b' attr: 'b' } + record: '#5e646f' + list: '#5e646f' + block: '#5e646f' + hints: 'dark_gray' + search_result: { fg: '#db7070' bg: '#5e646f' } + + shape_and: { fg: '#b870ce' attr: 'b' } + shape_binary: { fg: '#b870ce' attr: 'b' } + shape_block: { fg: '#6587bf' attr: 'b' } + shape_bool: '#509c93' + shape_custom: '#7c9f4b' + shape_datetime: { fg: '#509c93' attr: 'b' } + shape_directory: '#509c93' + shape_external: '#509c93' + shape_externalarg: { fg: '#7c9f4b' attr: 'b' } + shape_filepath: '#509c93' + shape_flag: { fg: '#6587bf' attr: 'b' } + shape_float: { fg: '#b870ce' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#509c93' attr: 'b' } + shape_int: { fg: '#b870ce' attr: 'b' } + shape_internalcall: { fg: '#509c93' attr: 'b' } + shape_list: { fg: '#509c93' attr: 'b' } + shape_literal: '#6587bf' + shape_match_pattern: '#7c9f4b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#509c93' + shape_operator: '#d69822' + shape_or: { fg: '#b870ce' attr: 'b' } + shape_pipe: { fg: '#b870ce' attr: 'b' } + shape_range: { fg: '#d69822' attr: 'b' } + shape_record: { fg: '#509c93' attr: 'b' } + shape_redirection: { fg: '#b870ce' attr: 'b' } + shape_signature: { fg: '#7c9f4b' attr: 'b' } + shape_string: '#7c9f4b' + shape_string_interpolation: { fg: '#509c93' attr: 'b' } + shape_table: { fg: '#6587bf' attr: 'b' } + shape_variable: '#b870ce' + + background: '#fafafa' + foreground: '#5e646f' + cursor: '#5e646f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/eighties.nu b/themes/nu-themes/eighties.nu index 737c616..f746ea8 100644 --- a/themes/nu-themes/eighties.nu +++ b/themes/nu-themes/eighties.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d0c8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#99cc99" attr: "b" } - empty: "#6699cc" - bool: {|| if $in { "#66cccc" } else { "light_gray" } } - int: "#d3d0c8" - filesize: {|e| - if $e == 0b { - "#d3d0c8" - } else if $e < 1mb { - "#66cccc" - } else {{ fg: "#6699cc" }} - } - duration: "#d3d0c8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f2777a" attr: "b" } - } else if $in < 6hr { - "#f2777a" - } else if $in < 1day { - "#ffcc66" - } else if $in < 3day { - "#99cc99" - } else if $in < 1wk { - { fg: "#99cc99" attr: "b" } - } else if $in < 6wk { - "#66cccc" - } else if $in < 52wk { - "#6699cc" - } else { "dark_gray" } - } - range: "#d3d0c8" - float: "#d3d0c8" - string: "#d3d0c8" - nothing: "#d3d0c8" - binary: "#d3d0c8" - cellpath: "#d3d0c8" - row_index: { fg: "#99cc99" attr: "b" } - record: "#d3d0c8" - list: "#d3d0c8" - block: "#d3d0c8" - hints: "dark_gray" - search_result: { fg: "#f2777a" bg: "#d3d0c8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc99cc" attr: "b" } - shape_binary: { fg: "#cc99cc" attr: "b" } - shape_block: { fg: "#6699cc" attr: "b" } - shape_bool: "#66cccc" - shape_custom: "#99cc99" - shape_datetime: { fg: "#66cccc" attr: "b" } - shape_directory: "#66cccc" - shape_external: "#66cccc" - shape_externalarg: { fg: "#99cc99" attr: "b" } - shape_filepath: "#66cccc" - shape_flag: { fg: "#6699cc" attr: "b" } - shape_float: { fg: "#cc99cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#66cccc" attr: "b" } - shape_int: { fg: "#cc99cc" attr: "b" } - shape_internalcall: { fg: "#66cccc" attr: "b" } - shape_list: { fg: "#66cccc" attr: "b" } - shape_literal: "#6699cc" - shape_match_pattern: "#99cc99" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#66cccc" - shape_operator: "#ffcc66" - shape_or: { fg: "#cc99cc" attr: "b" } - shape_pipe: { fg: "#cc99cc" attr: "b" } - shape_range: { fg: "#ffcc66" attr: "b" } - shape_record: { fg: "#66cccc" attr: "b" } - shape_redirection: { fg: "#cc99cc" attr: "b" } - shape_signature: { fg: "#99cc99" attr: "b" } - shape_string: "#99cc99" - shape_string_interpolation: { fg: "#66cccc" attr: "b" } - shape_table: { fg: "#6699cc" attr: "b" } - shape_variable: "#cc99cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2d2d2d" - foreground: "#d3d0c8" - cursor: "#d3d0c8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d0c8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#99cc99' attr: 'b' } + empty: '#6699cc' + bool: {|| if $in { '#66cccc' } else { 'light_gray' } } + int: '#d3d0c8' + filesize: {|e| + if $e == 0b { + '#d3d0c8' + } else if $e < 1mb { + '#66cccc' + } else {{ fg: '#6699cc' }} + } + duration: '#d3d0c8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f2777a' attr: 'b' } + } else if $in < 6hr { + '#f2777a' + } else if $in < 1day { + '#ffcc66' + } else if $in < 3day { + '#99cc99' + } else if $in < 1wk { + { fg: '#99cc99' attr: 'b' } + } else if $in < 6wk { + '#66cccc' + } else if $in < 52wk { + '#6699cc' + } else { 'dark_gray' } + } + range: '#d3d0c8' + float: '#d3d0c8' + string: '#d3d0c8' + nothing: '#d3d0c8' + binary: '#d3d0c8' + cellpath: '#d3d0c8' + row_index: { fg: '#99cc99' attr: 'b' } + record: '#d3d0c8' + list: '#d3d0c8' + block: '#d3d0c8' + hints: 'dark_gray' + search_result: { fg: '#f2777a' bg: '#d3d0c8' } + + shape_and: { fg: '#cc99cc' attr: 'b' } + shape_binary: { fg: '#cc99cc' attr: 'b' } + shape_block: { fg: '#6699cc' attr: 'b' } + shape_bool: '#66cccc' + shape_custom: '#99cc99' + shape_datetime: { fg: '#66cccc' attr: 'b' } + shape_directory: '#66cccc' + shape_external: '#66cccc' + shape_externalarg: { fg: '#99cc99' attr: 'b' } + shape_filepath: '#66cccc' + shape_flag: { fg: '#6699cc' attr: 'b' } + shape_float: { fg: '#cc99cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#66cccc' attr: 'b' } + shape_int: { fg: '#cc99cc' attr: 'b' } + shape_internalcall: { fg: '#66cccc' attr: 'b' } + shape_list: { fg: '#66cccc' attr: 'b' } + shape_literal: '#6699cc' + shape_match_pattern: '#99cc99' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#66cccc' + shape_operator: '#ffcc66' + shape_or: { fg: '#cc99cc' attr: 'b' } + shape_pipe: { fg: '#cc99cc' attr: 'b' } + shape_range: { fg: '#ffcc66' attr: 'b' } + shape_record: { fg: '#66cccc' attr: 'b' } + shape_redirection: { fg: '#cc99cc' attr: 'b' } + shape_signature: { fg: '#99cc99' attr: 'b' } + shape_string: '#99cc99' + shape_string_interpolation: { fg: '#66cccc' attr: 'b' } + shape_table: { fg: '#6699cc' attr: 'b' } + shape_variable: '#cc99cc' + + background: '#2d2d2d' + foreground: '#d3d0c8' + cursor: '#d3d0c8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/elemental.nu b/themes/nu-themes/elemental.nu index 0b21742..6307319 100644 --- a/themes/nu-themes/elemental.nu +++ b/themes/nu-themes/elemental.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#807974" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#479a43" attr: "b" } - empty: "#497f7d" - bool: {|| if $in { "#59d599" } else { "light_gray" } } - int: "#807974" - filesize: {|e| - if $e == 0b { - "#807974" - } else if $e < 1mb { - "#387f58" - } else {{ fg: "#497f7d" }} - } - duration: "#807974" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#98290f" attr: "b" } - } else if $in < 6hr { - "#98290f" - } else if $in < 1day { - "#7f7111" - } else if $in < 3day { - "#479a43" - } else if $in < 1wk { - { fg: "#479a43" attr: "b" } - } else if $in < 6wk { - "#387f58" - } else if $in < 52wk { - "#497f7d" - } else { "dark_gray" } - } - range: "#807974" - float: "#807974" - string: "#807974" - nothing: "#807974" - binary: "#807974" - cellpath: "#807974" - row_index: { fg: "#479a43" attr: "b" } - record: "#807974" - list: "#807974" - block: "#807974" - hints: "dark_gray" - search_result: { fg: "#98290f" bg: "#807974" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7f4e2f" attr: "b" } - shape_binary: { fg: "#7f4e2f" attr: "b" } - shape_block: { fg: "#497f7d" attr: "b" } - shape_bool: "#59d599" - shape_custom: "#479a43" - shape_datetime: { fg: "#387f58" attr: "b" } - shape_directory: "#387f58" - shape_external: "#387f58" - shape_externalarg: { fg: "#479a43" attr: "b" } - shape_filepath: "#387f58" - shape_flag: { fg: "#497f7d" attr: "b" } - shape_float: { fg: "#7f4e2f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#387f58" attr: "b" } - shape_int: { fg: "#7f4e2f" attr: "b" } - shape_internalcall: { fg: "#387f58" attr: "b" } - shape_list: { fg: "#387f58" attr: "b" } - shape_literal: "#497f7d" - shape_match_pattern: "#479a43" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#59d599" - shape_operator: "#7f7111" - shape_or: { fg: "#7f4e2f" attr: "b" } - shape_pipe: { fg: "#7f4e2f" attr: "b" } - shape_range: { fg: "#7f7111" attr: "b" } - shape_record: { fg: "#387f58" attr: "b" } - shape_redirection: { fg: "#7f4e2f" attr: "b" } - shape_signature: { fg: "#479a43" attr: "b" } - shape_string: "#479a43" - shape_string_interpolation: { fg: "#387f58" attr: "b" } - shape_table: { fg: "#497f7d" attr: "b" } - shape_variable: "#7f4e2f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#22211d" - foreground: "#807a74" - cursor: "#807a74" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#807974' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#479a43' attr: 'b' } + empty: '#497f7d' + bool: {|| if $in { '#59d599' } else { 'light_gray' } } + int: '#807974' + filesize: {|e| + if $e == 0b { + '#807974' + } else if $e < 1mb { + '#387f58' + } else {{ fg: '#497f7d' }} + } + duration: '#807974' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#98290f' attr: 'b' } + } else if $in < 6hr { + '#98290f' + } else if $in < 1day { + '#7f7111' + } else if $in < 3day { + '#479a43' + } else if $in < 1wk { + { fg: '#479a43' attr: 'b' } + } else if $in < 6wk { + '#387f58' + } else if $in < 52wk { + '#497f7d' + } else { 'dark_gray' } + } + range: '#807974' + float: '#807974' + string: '#807974' + nothing: '#807974' + binary: '#807974' + cellpath: '#807974' + row_index: { fg: '#479a43' attr: 'b' } + record: '#807974' + list: '#807974' + block: '#807974' + hints: 'dark_gray' + search_result: { fg: '#98290f' bg: '#807974' } + + shape_and: { fg: '#7f4e2f' attr: 'b' } + shape_binary: { fg: '#7f4e2f' attr: 'b' } + shape_block: { fg: '#497f7d' attr: 'b' } + shape_bool: '#59d599' + shape_custom: '#479a43' + shape_datetime: { fg: '#387f58' attr: 'b' } + shape_directory: '#387f58' + shape_external: '#387f58' + shape_externalarg: { fg: '#479a43' attr: 'b' } + shape_filepath: '#387f58' + shape_flag: { fg: '#497f7d' attr: 'b' } + shape_float: { fg: '#7f4e2f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#387f58' attr: 'b' } + shape_int: { fg: '#7f4e2f' attr: 'b' } + shape_internalcall: { fg: '#387f58' attr: 'b' } + shape_list: { fg: '#387f58' attr: 'b' } + shape_literal: '#497f7d' + shape_match_pattern: '#479a43' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#59d599' + shape_operator: '#7f7111' + shape_or: { fg: '#7f4e2f' attr: 'b' } + shape_pipe: { fg: '#7f4e2f' attr: 'b' } + shape_range: { fg: '#7f7111' attr: 'b' } + shape_record: { fg: '#387f58' attr: 'b' } + shape_redirection: { fg: '#7f4e2f' attr: 'b' } + shape_signature: { fg: '#479a43' attr: 'b' } + shape_string: '#479a43' + shape_string_interpolation: { fg: '#387f58' attr: 'b' } + shape_table: { fg: '#497f7d' attr: 'b' } + shape_variable: '#7f4e2f' + + background: '#22211d' + foreground: '#807a74' + cursor: '#807a74' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/elementary.nu b/themes/nu-themes/elementary.nu index f841af3..4dfc785 100644 --- a/themes/nu-themes/elementary.nu +++ b/themes/nu-themes/elementary.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ab017" attr: "b" } - empty: "#004f9e" - bool: {|| if $in { "#4bb8fd" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#2aa7e7" - } else {{ fg: "#004f9e" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e1321a" attr: "b" } - } else if $in < 6hr { - "#e1321a" - } else if $in < 1day { - "#ffc005" - } else if $in < 3day { - "#6ab017" - } else if $in < 1wk { - { fg: "#6ab017" attr: "b" } - } else if $in < 6wk { - "#2aa7e7" - } else if $in < 52wk { - "#004f9e" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#6ab017" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#e1321a" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ec0048" attr: "b" } - shape_binary: { fg: "#ec0048" attr: "b" } - shape_block: { fg: "#004f9e" attr: "b" } - shape_bool: "#4bb8fd" - shape_custom: "#6ab017" - shape_datetime: { fg: "#2aa7e7" attr: "b" } - shape_directory: "#2aa7e7" - shape_external: "#2aa7e7" - shape_externalarg: { fg: "#6ab017" attr: "b" } - shape_filepath: "#2aa7e7" - shape_flag: { fg: "#004f9e" attr: "b" } - shape_float: { fg: "#ec0048" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2aa7e7" attr: "b" } - shape_int: { fg: "#ec0048" attr: "b" } - shape_internalcall: { fg: "#2aa7e7" attr: "b" } - shape_list: { fg: "#2aa7e7" attr: "b" } - shape_literal: "#004f9e" - shape_match_pattern: "#6ab017" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4bb8fd" - shape_operator: "#ffc005" - shape_or: { fg: "#ec0048" attr: "b" } - shape_pipe: { fg: "#ec0048" attr: "b" } - shape_range: { fg: "#ffc005" attr: "b" } - shape_record: { fg: "#2aa7e7" attr: "b" } - shape_redirection: { fg: "#ec0048" attr: "b" } - shape_signature: { fg: "#6ab017" attr: "b" } - shape_string: "#6ab017" - shape_string_interpolation: { fg: "#2aa7e7" attr: "b" } - shape_table: { fg: "#004f9e" attr: "b" } - shape_variable: "#ec0048" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#101010" - foreground: "#f2f2f2" - cursor: "#f2f2f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ab017' attr: 'b' } + empty: '#004f9e' + bool: {|| if $in { '#4bb8fd' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#2aa7e7' + } else {{ fg: '#004f9e' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e1321a' attr: 'b' } + } else if $in < 6hr { + '#e1321a' + } else if $in < 1day { + '#ffc005' + } else if $in < 3day { + '#6ab017' + } else if $in < 1wk { + { fg: '#6ab017' attr: 'b' } + } else if $in < 6wk { + '#2aa7e7' + } else if $in < 52wk { + '#004f9e' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#6ab017' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#e1321a' bg: '#f2f2f2' } + + shape_and: { fg: '#ec0048' attr: 'b' } + shape_binary: { fg: '#ec0048' attr: 'b' } + shape_block: { fg: '#004f9e' attr: 'b' } + shape_bool: '#4bb8fd' + shape_custom: '#6ab017' + shape_datetime: { fg: '#2aa7e7' attr: 'b' } + shape_directory: '#2aa7e7' + shape_external: '#2aa7e7' + shape_externalarg: { fg: '#6ab017' attr: 'b' } + shape_filepath: '#2aa7e7' + shape_flag: { fg: '#004f9e' attr: 'b' } + shape_float: { fg: '#ec0048' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2aa7e7' attr: 'b' } + shape_int: { fg: '#ec0048' attr: 'b' } + shape_internalcall: { fg: '#2aa7e7' attr: 'b' } + shape_list: { fg: '#2aa7e7' attr: 'b' } + shape_literal: '#004f9e' + shape_match_pattern: '#6ab017' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4bb8fd' + shape_operator: '#ffc005' + shape_or: { fg: '#ec0048' attr: 'b' } + shape_pipe: { fg: '#ec0048' attr: 'b' } + shape_range: { fg: '#ffc005' attr: 'b' } + shape_record: { fg: '#2aa7e7' attr: 'b' } + shape_redirection: { fg: '#ec0048' attr: 'b' } + shape_signature: { fg: '#6ab017' attr: 'b' } + shape_string: '#6ab017' + shape_string_interpolation: { fg: '#2aa7e7' attr: 'b' } + shape_table: { fg: '#004f9e' attr: 'b' } + shape_variable: '#ec0048' + + background: '#101010' + foreground: '#f2f2f2' + cursor: '#f2f2f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/elic.nu b/themes/nu-themes/elic.nu index e5274a1..c584157 100644 --- a/themes/nu-themes/elic.nu +++ b/themes/nu-themes/elic.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#2aa7e7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ab017" attr: "b" } - empty: "#729fcf" - bool: {|| if $in { "#4bb8fd" } else { "light_gray" } } - int: "#2aa7e7" - filesize: {|e| - if $e == 0b { - "#2aa7e7" - } else if $e < 1mb { - "#f2f2f2" - } else {{ fg: "#729fcf" }} - } - duration: "#2aa7e7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e1321a" attr: "b" } - } else if $in < 6hr { - "#e1321a" - } else if $in < 1day { - "#ffc005" - } else if $in < 3day { - "#6ab017" - } else if $in < 1wk { - { fg: "#6ab017" attr: "b" } - } else if $in < 6wk { - "#f2f2f2" - } else if $in < 52wk { - "#729fcf" - } else { "dark_gray" } - } - range: "#2aa7e7" - float: "#2aa7e7" - string: "#2aa7e7" - nothing: "#2aa7e7" - binary: "#2aa7e7" - cellpath: "#2aa7e7" - row_index: { fg: "#6ab017" attr: "b" } - record: "#2aa7e7" - list: "#2aa7e7" - block: "#2aa7e7" - hints: "dark_gray" - search_result: { fg: "#e1321a" bg: "#2aa7e7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ec0048" attr: "b" } - shape_binary: { fg: "#ec0048" attr: "b" } - shape_block: { fg: "#729fcf" attr: "b" } - shape_bool: "#4bb8fd" - shape_custom: "#6ab017" - shape_datetime: { fg: "#f2f2f2" attr: "b" } - shape_directory: "#f2f2f2" - shape_external: "#f2f2f2" - shape_externalarg: { fg: "#6ab017" attr: "b" } - shape_filepath: "#f2f2f2" - shape_flag: { fg: "#729fcf" attr: "b" } - shape_float: { fg: "#ec0048" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#f2f2f2" attr: "b" } - shape_int: { fg: "#ec0048" attr: "b" } - shape_internalcall: { fg: "#f2f2f2" attr: "b" } - shape_list: { fg: "#f2f2f2" attr: "b" } - shape_literal: "#729fcf" - shape_match_pattern: "#6ab017" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4bb8fd" - shape_operator: "#ffc005" - shape_or: { fg: "#ec0048" attr: "b" } - shape_pipe: { fg: "#ec0048" attr: "b" } - shape_range: { fg: "#ffc005" attr: "b" } - shape_record: { fg: "#f2f2f2" attr: "b" } - shape_redirection: { fg: "#ec0048" attr: "b" } - shape_signature: { fg: "#6ab017" attr: "b" } - shape_string: "#6ab017" - shape_string_interpolation: { fg: "#f2f2f2" attr: "b" } - shape_table: { fg: "#729fcf" attr: "b" } - shape_variable: "#ec0048" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#4a453e" - foreground: "#f2f2f2" - cursor: "#f2f2f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#2aa7e7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ab017' attr: 'b' } + empty: '#729fcf' + bool: {|| if $in { '#4bb8fd' } else { 'light_gray' } } + int: '#2aa7e7' + filesize: {|e| + if $e == 0b { + '#2aa7e7' + } else if $e < 1mb { + '#f2f2f2' + } else {{ fg: '#729fcf' }} + } + duration: '#2aa7e7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e1321a' attr: 'b' } + } else if $in < 6hr { + '#e1321a' + } else if $in < 1day { + '#ffc005' + } else if $in < 3day { + '#6ab017' + } else if $in < 1wk { + { fg: '#6ab017' attr: 'b' } + } else if $in < 6wk { + '#f2f2f2' + } else if $in < 52wk { + '#729fcf' + } else { 'dark_gray' } + } + range: '#2aa7e7' + float: '#2aa7e7' + string: '#2aa7e7' + nothing: '#2aa7e7' + binary: '#2aa7e7' + cellpath: '#2aa7e7' + row_index: { fg: '#6ab017' attr: 'b' } + record: '#2aa7e7' + list: '#2aa7e7' + block: '#2aa7e7' + hints: 'dark_gray' + search_result: { fg: '#e1321a' bg: '#2aa7e7' } + + shape_and: { fg: '#ec0048' attr: 'b' } + shape_binary: { fg: '#ec0048' attr: 'b' } + shape_block: { fg: '#729fcf' attr: 'b' } + shape_bool: '#4bb8fd' + shape_custom: '#6ab017' + shape_datetime: { fg: '#f2f2f2' attr: 'b' } + shape_directory: '#f2f2f2' + shape_external: '#f2f2f2' + shape_externalarg: { fg: '#6ab017' attr: 'b' } + shape_filepath: '#f2f2f2' + shape_flag: { fg: '#729fcf' attr: 'b' } + shape_float: { fg: '#ec0048' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#f2f2f2' attr: 'b' } + shape_int: { fg: '#ec0048' attr: 'b' } + shape_internalcall: { fg: '#f2f2f2' attr: 'b' } + shape_list: { fg: '#f2f2f2' attr: 'b' } + shape_literal: '#729fcf' + shape_match_pattern: '#6ab017' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4bb8fd' + shape_operator: '#ffc005' + shape_or: { fg: '#ec0048' attr: 'b' } + shape_pipe: { fg: '#ec0048' attr: 'b' } + shape_range: { fg: '#ffc005' attr: 'b' } + shape_record: { fg: '#f2f2f2' attr: 'b' } + shape_redirection: { fg: '#ec0048' attr: 'b' } + shape_signature: { fg: '#6ab017' attr: 'b' } + shape_string: '#6ab017' + shape_string_interpolation: { fg: '#f2f2f2' attr: 'b' } + shape_table: { fg: '#729fcf' attr: 'b' } + shape_variable: '#ec0048' + + background: '#4a453e' + foreground: '#f2f2f2' + cursor: '#f2f2f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/elio.nu b/themes/nu-themes/elio.nu index aa6f47b..ace4613 100644 --- a/themes/nu-themes/elio.nu +++ b/themes/nu-themes/elio.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ab017" attr: "b" } - empty: "#729fcf" - bool: {|| if $in { "#4bb8fd" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#2aa7e7" - } else {{ fg: "#729fcf" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e1321a" attr: "b" } - } else if $in < 6hr { - "#e1321a" - } else if $in < 1day { - "#ffc005" - } else if $in < 3day { - "#6ab017" - } else if $in < 1wk { - { fg: "#6ab017" attr: "b" } - } else if $in < 6wk { - "#2aa7e7" - } else if $in < 52wk { - "#729fcf" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#6ab017" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#e1321a" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ec0048" attr: "b" } - shape_binary: { fg: "#ec0048" attr: "b" } - shape_block: { fg: "#729fcf" attr: "b" } - shape_bool: "#4bb8fd" - shape_custom: "#6ab017" - shape_datetime: { fg: "#2aa7e7" attr: "b" } - shape_directory: "#2aa7e7" - shape_external: "#2aa7e7" - shape_externalarg: { fg: "#6ab017" attr: "b" } - shape_filepath: "#2aa7e7" - shape_flag: { fg: "#729fcf" attr: "b" } - shape_float: { fg: "#ec0048" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2aa7e7" attr: "b" } - shape_int: { fg: "#ec0048" attr: "b" } - shape_internalcall: { fg: "#2aa7e7" attr: "b" } - shape_list: { fg: "#2aa7e7" attr: "b" } - shape_literal: "#729fcf" - shape_match_pattern: "#6ab017" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4bb8fd" - shape_operator: "#ffc005" - shape_or: { fg: "#ec0048" attr: "b" } - shape_pipe: { fg: "#ec0048" attr: "b" } - shape_range: { fg: "#ffc005" attr: "b" } - shape_record: { fg: "#2aa7e7" attr: "b" } - shape_redirection: { fg: "#ec0048" attr: "b" } - shape_signature: { fg: "#6ab017" attr: "b" } - shape_string: "#6ab017" - shape_string_interpolation: { fg: "#2aa7e7" attr: "b" } - shape_table: { fg: "#729fcf" attr: "b" } - shape_variable: "#ec0048" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#041a3b" - foreground: "#f2f2f2" - cursor: "#f2f2f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ab017' attr: 'b' } + empty: '#729fcf' + bool: {|| if $in { '#4bb8fd' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#2aa7e7' + } else {{ fg: '#729fcf' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e1321a' attr: 'b' } + } else if $in < 6hr { + '#e1321a' + } else if $in < 1day { + '#ffc005' + } else if $in < 3day { + '#6ab017' + } else if $in < 1wk { + { fg: '#6ab017' attr: 'b' } + } else if $in < 6wk { + '#2aa7e7' + } else if $in < 52wk { + '#729fcf' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#6ab017' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#e1321a' bg: '#f2f2f2' } + + shape_and: { fg: '#ec0048' attr: 'b' } + shape_binary: { fg: '#ec0048' attr: 'b' } + shape_block: { fg: '#729fcf' attr: 'b' } + shape_bool: '#4bb8fd' + shape_custom: '#6ab017' + shape_datetime: { fg: '#2aa7e7' attr: 'b' } + shape_directory: '#2aa7e7' + shape_external: '#2aa7e7' + shape_externalarg: { fg: '#6ab017' attr: 'b' } + shape_filepath: '#2aa7e7' + shape_flag: { fg: '#729fcf' attr: 'b' } + shape_float: { fg: '#ec0048' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2aa7e7' attr: 'b' } + shape_int: { fg: '#ec0048' attr: 'b' } + shape_internalcall: { fg: '#2aa7e7' attr: 'b' } + shape_list: { fg: '#2aa7e7' attr: 'b' } + shape_literal: '#729fcf' + shape_match_pattern: '#6ab017' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4bb8fd' + shape_operator: '#ffc005' + shape_or: { fg: '#ec0048' attr: 'b' } + shape_pipe: { fg: '#ec0048' attr: 'b' } + shape_range: { fg: '#ffc005' attr: 'b' } + shape_record: { fg: '#2aa7e7' attr: 'b' } + shape_redirection: { fg: '#ec0048' attr: 'b' } + shape_signature: { fg: '#6ab017' attr: 'b' } + shape_string: '#6ab017' + shape_string_interpolation: { fg: '#2aa7e7' attr: 'b' } + shape_table: { fg: '#729fcf' attr: 'b' } + shape_variable: '#ec0048' + + background: '#041a3b' + foreground: '#f2f2f2' + cursor: '#f2f2f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/embark.nu b/themes/nu-themes/embark.nu index 68f680b..e1d1ebb 100644 --- a/themes/nu-themes/embark.nu +++ b/themes/nu-themes/embark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbe3e7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1efd3" attr: "b" } - empty: "#91ddff" - bool: {|| if $in { "#63f2f1" } else { "light_gray" } } - int: "#cbe3e7" - filesize: {|e| - if $e == 0b { - "#cbe3e7" - } else if $e < 1mb { - "#87dfeb" - } else {{ fg: "#91ddff" }} - } - duration: "#cbe3e7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f48fb1" attr: "b" } - } else if $in < 6hr { - "#f48fb1" - } else if $in < 1day { - "#ffe6b3" - } else if $in < 3day { - "#a1efd3" - } else if $in < 1wk { - { fg: "#a1efd3" attr: "b" } - } else if $in < 6wk { - "#87dfeb" - } else if $in < 52wk { - "#91ddff" - } else { "dark_gray" } - } - range: "#cbe3e7" - float: "#cbe3e7" - string: "#cbe3e7" - nothing: "#cbe3e7" - binary: "#cbe3e7" - cellpath: "#cbe3e7" - row_index: { fg: "#a1efd3" attr: "b" } - record: "#cbe3e7" - list: "#cbe3e7" - block: "#cbe3e7" - hints: "dark_gray" - search_result: { fg: "#f48fb1" bg: "#cbe3e7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d4bfff" attr: "b" } - shape_binary: { fg: "#d4bfff" attr: "b" } - shape_block: { fg: "#91ddff" attr: "b" } - shape_bool: "#63f2f1" - shape_custom: "#a1efd3" - shape_datetime: { fg: "#87dfeb" attr: "b" } - shape_directory: "#87dfeb" - shape_external: "#87dfeb" - shape_externalarg: { fg: "#a1efd3" attr: "b" } - shape_filepath: "#87dfeb" - shape_flag: { fg: "#91ddff" attr: "b" } - shape_float: { fg: "#d4bfff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#87dfeb" attr: "b" } - shape_int: { fg: "#d4bfff" attr: "b" } - shape_internalcall: { fg: "#87dfeb" attr: "b" } - shape_list: { fg: "#87dfeb" attr: "b" } - shape_literal: "#91ddff" - shape_match_pattern: "#a1efd3" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#63f2f1" - shape_operator: "#ffe6b3" - shape_or: { fg: "#d4bfff" attr: "b" } - shape_pipe: { fg: "#d4bfff" attr: "b" } - shape_range: { fg: "#ffe6b3" attr: "b" } - shape_record: { fg: "#87dfeb" attr: "b" } - shape_redirection: { fg: "#d4bfff" attr: "b" } - shape_signature: { fg: "#a1efd3" attr: "b" } - shape_string: "#a1efd3" - shape_string_interpolation: { fg: "#87dfeb" attr: "b" } - shape_table: { fg: "#91ddff" attr: "b" } - shape_variable: "#d4bfff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e1c31" - foreground: "#cbe3e7" - cursor: "#cbe3e7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbe3e7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1efd3' attr: 'b' } + empty: '#91ddff' + bool: {|| if $in { '#63f2f1' } else { 'light_gray' } } + int: '#cbe3e7' + filesize: {|e| + if $e == 0b { + '#cbe3e7' + } else if $e < 1mb { + '#87dfeb' + } else {{ fg: '#91ddff' }} + } + duration: '#cbe3e7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f48fb1' attr: 'b' } + } else if $in < 6hr { + '#f48fb1' + } else if $in < 1day { + '#ffe6b3' + } else if $in < 3day { + '#a1efd3' + } else if $in < 1wk { + { fg: '#a1efd3' attr: 'b' } + } else if $in < 6wk { + '#87dfeb' + } else if $in < 52wk { + '#91ddff' + } else { 'dark_gray' } + } + range: '#cbe3e7' + float: '#cbe3e7' + string: '#cbe3e7' + nothing: '#cbe3e7' + binary: '#cbe3e7' + cellpath: '#cbe3e7' + row_index: { fg: '#a1efd3' attr: 'b' } + record: '#cbe3e7' + list: '#cbe3e7' + block: '#cbe3e7' + hints: 'dark_gray' + search_result: { fg: '#f48fb1' bg: '#cbe3e7' } + + shape_and: { fg: '#d4bfff' attr: 'b' } + shape_binary: { fg: '#d4bfff' attr: 'b' } + shape_block: { fg: '#91ddff' attr: 'b' } + shape_bool: '#63f2f1' + shape_custom: '#a1efd3' + shape_datetime: { fg: '#87dfeb' attr: 'b' } + shape_directory: '#87dfeb' + shape_external: '#87dfeb' + shape_externalarg: { fg: '#a1efd3' attr: 'b' } + shape_filepath: '#87dfeb' + shape_flag: { fg: '#91ddff' attr: 'b' } + shape_float: { fg: '#d4bfff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#87dfeb' attr: 'b' } + shape_int: { fg: '#d4bfff' attr: 'b' } + shape_internalcall: { fg: '#87dfeb' attr: 'b' } + shape_list: { fg: '#87dfeb' attr: 'b' } + shape_literal: '#91ddff' + shape_match_pattern: '#a1efd3' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#63f2f1' + shape_operator: '#ffe6b3' + shape_or: { fg: '#d4bfff' attr: 'b' } + shape_pipe: { fg: '#d4bfff' attr: 'b' } + shape_range: { fg: '#ffe6b3' attr: 'b' } + shape_record: { fg: '#87dfeb' attr: 'b' } + shape_redirection: { fg: '#d4bfff' attr: 'b' } + shape_signature: { fg: '#a1efd3' attr: 'b' } + shape_string: '#a1efd3' + shape_string_interpolation: { fg: '#87dfeb' attr: 'b' } + shape_table: { fg: '#91ddff' attr: 'b' } + shape_variable: '#d4bfff' + + background: '#1e1c31' + foreground: '#cbe3e7' + cursor: '#cbe3e7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/embers.nu b/themes/nu-themes/embers.nu index 89833b1..6909cdb 100644 --- a/themes/nu-themes/embers.nu +++ b/themes/nu-themes/embers.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a39a90" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#57826d" attr: "b" } - empty: "#6d5782" - bool: {|| if $in { "#576d82" } else { "light_gray" } } - int: "#a39a90" - filesize: {|e| - if $e == 0b { - "#a39a90" - } else if $e < 1mb { - "#576d82" - } else {{ fg: "#6d5782" }} - } - duration: "#a39a90" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#826d57" attr: "b" } - } else if $in < 6hr { - "#826d57" - } else if $in < 1day { - "#6d8257" - } else if $in < 3day { - "#57826d" - } else if $in < 1wk { - { fg: "#57826d" attr: "b" } - } else if $in < 6wk { - "#576d82" - } else if $in < 52wk { - "#6d5782" - } else { "dark_gray" } - } - range: "#a39a90" - float: "#a39a90" - string: "#a39a90" - nothing: "#a39a90" - binary: "#a39a90" - cellpath: "#a39a90" - row_index: { fg: "#57826d" attr: "b" } - record: "#a39a90" - list: "#a39a90" - block: "#a39a90" - hints: "dark_gray" - search_result: { fg: "#826d57" bg: "#a39a90" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#82576d" attr: "b" } - shape_binary: { fg: "#82576d" attr: "b" } - shape_block: { fg: "#6d5782" attr: "b" } - shape_bool: "#576d82" - shape_custom: "#57826d" - shape_datetime: { fg: "#576d82" attr: "b" } - shape_directory: "#576d82" - shape_external: "#576d82" - shape_externalarg: { fg: "#57826d" attr: "b" } - shape_filepath: "#576d82" - shape_flag: { fg: "#6d5782" attr: "b" } - shape_float: { fg: "#82576d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#576d82" attr: "b" } - shape_int: { fg: "#82576d" attr: "b" } - shape_internalcall: { fg: "#576d82" attr: "b" } - shape_list: { fg: "#576d82" attr: "b" } - shape_literal: "#6d5782" - shape_match_pattern: "#57826d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#576d82" - shape_operator: "#6d8257" - shape_or: { fg: "#82576d" attr: "b" } - shape_pipe: { fg: "#82576d" attr: "b" } - shape_range: { fg: "#6d8257" attr: "b" } - shape_record: { fg: "#576d82" attr: "b" } - shape_redirection: { fg: "#82576d" attr: "b" } - shape_signature: { fg: "#57826d" attr: "b" } - shape_string: "#57826d" - shape_string_interpolation: { fg: "#576d82" attr: "b" } - shape_table: { fg: "#6d5782" attr: "b" } - shape_variable: "#82576d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#16130f" - foreground: "#a39a90" - cursor: "#a39a90" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a39a90' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#57826d' attr: 'b' } + empty: '#6d5782' + bool: {|| if $in { '#576d82' } else { 'light_gray' } } + int: '#a39a90' + filesize: {|e| + if $e == 0b { + '#a39a90' + } else if $e < 1mb { + '#576d82' + } else {{ fg: '#6d5782' }} + } + duration: '#a39a90' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#826d57' attr: 'b' } + } else if $in < 6hr { + '#826d57' + } else if $in < 1day { + '#6d8257' + } else if $in < 3day { + '#57826d' + } else if $in < 1wk { + { fg: '#57826d' attr: 'b' } + } else if $in < 6wk { + '#576d82' + } else if $in < 52wk { + '#6d5782' + } else { 'dark_gray' } + } + range: '#a39a90' + float: '#a39a90' + string: '#a39a90' + nothing: '#a39a90' + binary: '#a39a90' + cellpath: '#a39a90' + row_index: { fg: '#57826d' attr: 'b' } + record: '#a39a90' + list: '#a39a90' + block: '#a39a90' + hints: 'dark_gray' + search_result: { fg: '#826d57' bg: '#a39a90' } + + shape_and: { fg: '#82576d' attr: 'b' } + shape_binary: { fg: '#82576d' attr: 'b' } + shape_block: { fg: '#6d5782' attr: 'b' } + shape_bool: '#576d82' + shape_custom: '#57826d' + shape_datetime: { fg: '#576d82' attr: 'b' } + shape_directory: '#576d82' + shape_external: '#576d82' + shape_externalarg: { fg: '#57826d' attr: 'b' } + shape_filepath: '#576d82' + shape_flag: { fg: '#6d5782' attr: 'b' } + shape_float: { fg: '#82576d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#576d82' attr: 'b' } + shape_int: { fg: '#82576d' attr: 'b' } + shape_internalcall: { fg: '#576d82' attr: 'b' } + shape_list: { fg: '#576d82' attr: 'b' } + shape_literal: '#6d5782' + shape_match_pattern: '#57826d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#576d82' + shape_operator: '#6d8257' + shape_or: { fg: '#82576d' attr: 'b' } + shape_pipe: { fg: '#82576d' attr: 'b' } + shape_range: { fg: '#6d8257' attr: 'b' } + shape_record: { fg: '#576d82' attr: 'b' } + shape_redirection: { fg: '#82576d' attr: 'b' } + shape_signature: { fg: '#57826d' attr: 'b' } + shape_string: '#57826d' + shape_string_interpolation: { fg: '#576d82' attr: 'b' } + shape_table: { fg: '#6d5782' attr: 'b' } + shape_variable: '#82576d' + + background: '#16130f' + foreground: '#a39a90' + cursor: '#a39a90' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/equilibrium-dark.nu b/themes/nu-themes/equilibrium-dark.nu index 2e584a9..c0c6f6b 100644 --- a/themes/nu-themes/equilibrium-dark.nu +++ b/themes/nu-themes/equilibrium-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#afaba2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7f8b00" attr: "b" } - empty: "#008dd1" - bool: {|| if $in { "#00948b" } else { "light_gray" } } - int: "#afaba2" - filesize: {|e| - if $e == 0b { - "#afaba2" - } else if $e < 1mb { - "#00948b" - } else {{ fg: "#008dd1" }} - } - duration: "#afaba2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f04339" attr: "b" } - } else if $in < 6hr { - "#f04339" - } else if $in < 1day { - "#bb8801" - } else if $in < 3day { - "#7f8b00" - } else if $in < 1wk { - { fg: "#7f8b00" attr: "b" } - } else if $in < 6wk { - "#00948b" - } else if $in < 52wk { - "#008dd1" - } else { "dark_gray" } - } - range: "#afaba2" - float: "#afaba2" - string: "#afaba2" - nothing: "#afaba2" - binary: "#afaba2" - cellpath: "#afaba2" - row_index: { fg: "#7f8b00" attr: "b" } - record: "#afaba2" - list: "#afaba2" - block: "#afaba2" - hints: "dark_gray" - search_result: { fg: "#f04339" bg: "#afaba2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6a7fd2" attr: "b" } - shape_binary: { fg: "#6a7fd2" attr: "b" } - shape_block: { fg: "#008dd1" attr: "b" } - shape_bool: "#00948b" - shape_custom: "#7f8b00" - shape_datetime: { fg: "#00948b" attr: "b" } - shape_directory: "#00948b" - shape_external: "#00948b" - shape_externalarg: { fg: "#7f8b00" attr: "b" } - shape_filepath: "#00948b" - shape_flag: { fg: "#008dd1" attr: "b" } - shape_float: { fg: "#6a7fd2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00948b" attr: "b" } - shape_int: { fg: "#6a7fd2" attr: "b" } - shape_internalcall: { fg: "#00948b" attr: "b" } - shape_list: { fg: "#00948b" attr: "b" } - shape_literal: "#008dd1" - shape_match_pattern: "#7f8b00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00948b" - shape_operator: "#bb8801" - shape_or: { fg: "#6a7fd2" attr: "b" } - shape_pipe: { fg: "#6a7fd2" attr: "b" } - shape_range: { fg: "#bb8801" attr: "b" } - shape_record: { fg: "#00948b" attr: "b" } - shape_redirection: { fg: "#6a7fd2" attr: "b" } - shape_signature: { fg: "#7f8b00" attr: "b" } - shape_string: "#7f8b00" - shape_string_interpolation: { fg: "#00948b" attr: "b" } - shape_table: { fg: "#008dd1" attr: "b" } - shape_variable: "#6a7fd2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0c1118" - foreground: "#afaba2" - cursor: "#afaba2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#afaba2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7f8b00' attr: 'b' } + empty: '#008dd1' + bool: {|| if $in { '#00948b' } else { 'light_gray' } } + int: '#afaba2' + filesize: {|e| + if $e == 0b { + '#afaba2' + } else if $e < 1mb { + '#00948b' + } else {{ fg: '#008dd1' }} + } + duration: '#afaba2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f04339' attr: 'b' } + } else if $in < 6hr { + '#f04339' + } else if $in < 1day { + '#bb8801' + } else if $in < 3day { + '#7f8b00' + } else if $in < 1wk { + { fg: '#7f8b00' attr: 'b' } + } else if $in < 6wk { + '#00948b' + } else if $in < 52wk { + '#008dd1' + } else { 'dark_gray' } + } + range: '#afaba2' + float: '#afaba2' + string: '#afaba2' + nothing: '#afaba2' + binary: '#afaba2' + cellpath: '#afaba2' + row_index: { fg: '#7f8b00' attr: 'b' } + record: '#afaba2' + list: '#afaba2' + block: '#afaba2' + hints: 'dark_gray' + search_result: { fg: '#f04339' bg: '#afaba2' } + + shape_and: { fg: '#6a7fd2' attr: 'b' } + shape_binary: { fg: '#6a7fd2' attr: 'b' } + shape_block: { fg: '#008dd1' attr: 'b' } + shape_bool: '#00948b' + shape_custom: '#7f8b00' + shape_datetime: { fg: '#00948b' attr: 'b' } + shape_directory: '#00948b' + shape_external: '#00948b' + shape_externalarg: { fg: '#7f8b00' attr: 'b' } + shape_filepath: '#00948b' + shape_flag: { fg: '#008dd1' attr: 'b' } + shape_float: { fg: '#6a7fd2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00948b' attr: 'b' } + shape_int: { fg: '#6a7fd2' attr: 'b' } + shape_internalcall: { fg: '#00948b' attr: 'b' } + shape_list: { fg: '#00948b' attr: 'b' } + shape_literal: '#008dd1' + shape_match_pattern: '#7f8b00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00948b' + shape_operator: '#bb8801' + shape_or: { fg: '#6a7fd2' attr: 'b' } + shape_pipe: { fg: '#6a7fd2' attr: 'b' } + shape_range: { fg: '#bb8801' attr: 'b' } + shape_record: { fg: '#00948b' attr: 'b' } + shape_redirection: { fg: '#6a7fd2' attr: 'b' } + shape_signature: { fg: '#7f8b00' attr: 'b' } + shape_string: '#7f8b00' + shape_string_interpolation: { fg: '#00948b' attr: 'b' } + shape_table: { fg: '#008dd1' attr: 'b' } + shape_variable: '#6a7fd2' + + background: '#0c1118' + foreground: '#afaba2' + cursor: '#afaba2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/equilibrium-gray-dark.nu b/themes/nu-themes/equilibrium-gray-dark.nu index 895c6cb..c7f6c04 100644 --- a/themes/nu-themes/equilibrium-gray-dark.nu +++ b/themes/nu-themes/equilibrium-gray-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ababab" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7f8b00" attr: "b" } - empty: "#008dd1" - bool: {|| if $in { "#00948b" } else { "light_gray" } } - int: "#ababab" - filesize: {|e| - if $e == 0b { - "#ababab" - } else if $e < 1mb { - "#00948b" - } else {{ fg: "#008dd1" }} - } - duration: "#ababab" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f04339" attr: "b" } - } else if $in < 6hr { - "#f04339" - } else if $in < 1day { - "#bb8801" - } else if $in < 3day { - "#7f8b00" - } else if $in < 1wk { - { fg: "#7f8b00" attr: "b" } - } else if $in < 6wk { - "#00948b" - } else if $in < 52wk { - "#008dd1" - } else { "dark_gray" } - } - range: "#ababab" - float: "#ababab" - string: "#ababab" - nothing: "#ababab" - binary: "#ababab" - cellpath: "#ababab" - row_index: { fg: "#7f8b00" attr: "b" } - record: "#ababab" - list: "#ababab" - block: "#ababab" - hints: "dark_gray" - search_result: { fg: "#f04339" bg: "#ababab" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6a7fd2" attr: "b" } - shape_binary: { fg: "#6a7fd2" attr: "b" } - shape_block: { fg: "#008dd1" attr: "b" } - shape_bool: "#00948b" - shape_custom: "#7f8b00" - shape_datetime: { fg: "#00948b" attr: "b" } - shape_directory: "#00948b" - shape_external: "#00948b" - shape_externalarg: { fg: "#7f8b00" attr: "b" } - shape_filepath: "#00948b" - shape_flag: { fg: "#008dd1" attr: "b" } - shape_float: { fg: "#6a7fd2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00948b" attr: "b" } - shape_int: { fg: "#6a7fd2" attr: "b" } - shape_internalcall: { fg: "#00948b" attr: "b" } - shape_list: { fg: "#00948b" attr: "b" } - shape_literal: "#008dd1" - shape_match_pattern: "#7f8b00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00948b" - shape_operator: "#bb8801" - shape_or: { fg: "#6a7fd2" attr: "b" } - shape_pipe: { fg: "#6a7fd2" attr: "b" } - shape_range: { fg: "#bb8801" attr: "b" } - shape_record: { fg: "#00948b" attr: "b" } - shape_redirection: { fg: "#6a7fd2" attr: "b" } - shape_signature: { fg: "#7f8b00" attr: "b" } - shape_string: "#7f8b00" - shape_string_interpolation: { fg: "#00948b" attr: "b" } - shape_table: { fg: "#008dd1" attr: "b" } - shape_variable: "#6a7fd2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#111111" - foreground: "#ababab" - cursor: "#ababab" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ababab' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7f8b00' attr: 'b' } + empty: '#008dd1' + bool: {|| if $in { '#00948b' } else { 'light_gray' } } + int: '#ababab' + filesize: {|e| + if $e == 0b { + '#ababab' + } else if $e < 1mb { + '#00948b' + } else {{ fg: '#008dd1' }} + } + duration: '#ababab' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f04339' attr: 'b' } + } else if $in < 6hr { + '#f04339' + } else if $in < 1day { + '#bb8801' + } else if $in < 3day { + '#7f8b00' + } else if $in < 1wk { + { fg: '#7f8b00' attr: 'b' } + } else if $in < 6wk { + '#00948b' + } else if $in < 52wk { + '#008dd1' + } else { 'dark_gray' } + } + range: '#ababab' + float: '#ababab' + string: '#ababab' + nothing: '#ababab' + binary: '#ababab' + cellpath: '#ababab' + row_index: { fg: '#7f8b00' attr: 'b' } + record: '#ababab' + list: '#ababab' + block: '#ababab' + hints: 'dark_gray' + search_result: { fg: '#f04339' bg: '#ababab' } + + shape_and: { fg: '#6a7fd2' attr: 'b' } + shape_binary: { fg: '#6a7fd2' attr: 'b' } + shape_block: { fg: '#008dd1' attr: 'b' } + shape_bool: '#00948b' + shape_custom: '#7f8b00' + shape_datetime: { fg: '#00948b' attr: 'b' } + shape_directory: '#00948b' + shape_external: '#00948b' + shape_externalarg: { fg: '#7f8b00' attr: 'b' } + shape_filepath: '#00948b' + shape_flag: { fg: '#008dd1' attr: 'b' } + shape_float: { fg: '#6a7fd2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00948b' attr: 'b' } + shape_int: { fg: '#6a7fd2' attr: 'b' } + shape_internalcall: { fg: '#00948b' attr: 'b' } + shape_list: { fg: '#00948b' attr: 'b' } + shape_literal: '#008dd1' + shape_match_pattern: '#7f8b00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00948b' + shape_operator: '#bb8801' + shape_or: { fg: '#6a7fd2' attr: 'b' } + shape_pipe: { fg: '#6a7fd2' attr: 'b' } + shape_range: { fg: '#bb8801' attr: 'b' } + shape_record: { fg: '#00948b' attr: 'b' } + shape_redirection: { fg: '#6a7fd2' attr: 'b' } + shape_signature: { fg: '#7f8b00' attr: 'b' } + shape_string: '#7f8b00' + shape_string_interpolation: { fg: '#00948b' attr: 'b' } + shape_table: { fg: '#008dd1' attr: 'b' } + shape_variable: '#6a7fd2' + + background: '#111111' + foreground: '#ababab' + cursor: '#ababab' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/equilibrium-gray-light.nu b/themes/nu-themes/equilibrium-gray-light.nu index 38f5d08..930270d 100644 --- a/themes/nu-themes/equilibrium-gray-light.nu +++ b/themes/nu-themes/equilibrium-gray-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#474747" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#637200" attr: "b" } - empty: "#0073b5" - bool: {|| if $in { "#007a72" } else { "light_gray" } } - int: "#474747" - filesize: {|e| - if $e == 0b { - "#474747" - } else if $e < 1mb { - "#007a72" - } else {{ fg: "#0073b5" }} - } - duration: "#474747" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d02023" attr: "b" } - } else if $in < 6hr { - "#d02023" - } else if $in < 1day { - "#9d6f00" - } else if $in < 3day { - "#637200" - } else if $in < 1wk { - { fg: "#637200" attr: "b" } - } else if $in < 6wk { - "#007a72" - } else if $in < 52wk { - "#0073b5" - } else { "dark_gray" } - } - range: "#474747" - float: "#474747" - string: "#474747" - nothing: "#474747" - binary: "#474747" - cellpath: "#474747" - row_index: { fg: "#637200" attr: "b" } - record: "#474747" - list: "#474747" - block: "#474747" - hints: "dark_gray" - search_result: { fg: "#d02023" bg: "#474747" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#4e66b6" attr: "b" } - shape_binary: { fg: "#4e66b6" attr: "b" } - shape_block: { fg: "#0073b5" attr: "b" } - shape_bool: "#007a72" - shape_custom: "#637200" - shape_datetime: { fg: "#007a72" attr: "b" } - shape_directory: "#007a72" - shape_external: "#007a72" - shape_externalarg: { fg: "#637200" attr: "b" } - shape_filepath: "#007a72" - shape_flag: { fg: "#0073b5" attr: "b" } - shape_float: { fg: "#4e66b6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#007a72" attr: "b" } - shape_int: { fg: "#4e66b6" attr: "b" } - shape_internalcall: { fg: "#007a72" attr: "b" } - shape_list: { fg: "#007a72" attr: "b" } - shape_literal: "#0073b5" - shape_match_pattern: "#637200" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#007a72" - shape_operator: "#9d6f00" - shape_or: { fg: "#4e66b6" attr: "b" } - shape_pipe: { fg: "#4e66b6" attr: "b" } - shape_range: { fg: "#9d6f00" attr: "b" } - shape_record: { fg: "#007a72" attr: "b" } - shape_redirection: { fg: "#4e66b6" attr: "b" } - shape_signature: { fg: "#637200" attr: "b" } - shape_string: "#637200" - shape_string_interpolation: { fg: "#007a72" attr: "b" } - shape_table: { fg: "#0073b5" attr: "b" } - shape_variable: "#4e66b6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f1f1f1" - foreground: "#474747" - cursor: "#474747" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#474747' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#637200' attr: 'b' } + empty: '#0073b5' + bool: {|| if $in { '#007a72' } else { 'light_gray' } } + int: '#474747' + filesize: {|e| + if $e == 0b { + '#474747' + } else if $e < 1mb { + '#007a72' + } else {{ fg: '#0073b5' }} + } + duration: '#474747' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d02023' attr: 'b' } + } else if $in < 6hr { + '#d02023' + } else if $in < 1day { + '#9d6f00' + } else if $in < 3day { + '#637200' + } else if $in < 1wk { + { fg: '#637200' attr: 'b' } + } else if $in < 6wk { + '#007a72' + } else if $in < 52wk { + '#0073b5' + } else { 'dark_gray' } + } + range: '#474747' + float: '#474747' + string: '#474747' + nothing: '#474747' + binary: '#474747' + cellpath: '#474747' + row_index: { fg: '#637200' attr: 'b' } + record: '#474747' + list: '#474747' + block: '#474747' + hints: 'dark_gray' + search_result: { fg: '#d02023' bg: '#474747' } + + shape_and: { fg: '#4e66b6' attr: 'b' } + shape_binary: { fg: '#4e66b6' attr: 'b' } + shape_block: { fg: '#0073b5' attr: 'b' } + shape_bool: '#007a72' + shape_custom: '#637200' + shape_datetime: { fg: '#007a72' attr: 'b' } + shape_directory: '#007a72' + shape_external: '#007a72' + shape_externalarg: { fg: '#637200' attr: 'b' } + shape_filepath: '#007a72' + shape_flag: { fg: '#0073b5' attr: 'b' } + shape_float: { fg: '#4e66b6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#007a72' attr: 'b' } + shape_int: { fg: '#4e66b6' attr: 'b' } + shape_internalcall: { fg: '#007a72' attr: 'b' } + shape_list: { fg: '#007a72' attr: 'b' } + shape_literal: '#0073b5' + shape_match_pattern: '#637200' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#007a72' + shape_operator: '#9d6f00' + shape_or: { fg: '#4e66b6' attr: 'b' } + shape_pipe: { fg: '#4e66b6' attr: 'b' } + shape_range: { fg: '#9d6f00' attr: 'b' } + shape_record: { fg: '#007a72' attr: 'b' } + shape_redirection: { fg: '#4e66b6' attr: 'b' } + shape_signature: { fg: '#637200' attr: 'b' } + shape_string: '#637200' + shape_string_interpolation: { fg: '#007a72' attr: 'b' } + shape_table: { fg: '#0073b5' attr: 'b' } + shape_variable: '#4e66b6' + + background: '#f1f1f1' + foreground: '#474747' + cursor: '#474747' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/equilibrium-light.nu b/themes/nu-themes/equilibrium-light.nu index ab1d23c..afe0719 100644 --- a/themes/nu-themes/equilibrium-light.nu +++ b/themes/nu-themes/equilibrium-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#43474e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#637200" attr: "b" } - empty: "#0073b5" - bool: {|| if $in { "#007a72" } else { "light_gray" } } - int: "#43474e" - filesize: {|e| - if $e == 0b { - "#43474e" - } else if $e < 1mb { - "#007a72" - } else {{ fg: "#0073b5" }} - } - duration: "#43474e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d02023" attr: "b" } - } else if $in < 6hr { - "#d02023" - } else if $in < 1day { - "#9d6f00" - } else if $in < 3day { - "#637200" - } else if $in < 1wk { - { fg: "#637200" attr: "b" } - } else if $in < 6wk { - "#007a72" - } else if $in < 52wk { - "#0073b5" - } else { "dark_gray" } - } - range: "#43474e" - float: "#43474e" - string: "#43474e" - nothing: "#43474e" - binary: "#43474e" - cellpath: "#43474e" - row_index: { fg: "#637200" attr: "b" } - record: "#43474e" - list: "#43474e" - block: "#43474e" - hints: "dark_gray" - search_result: { fg: "#d02023" bg: "#43474e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#4e66b6" attr: "b" } - shape_binary: { fg: "#4e66b6" attr: "b" } - shape_block: { fg: "#0073b5" attr: "b" } - shape_bool: "#007a72" - shape_custom: "#637200" - shape_datetime: { fg: "#007a72" attr: "b" } - shape_directory: "#007a72" - shape_external: "#007a72" - shape_externalarg: { fg: "#637200" attr: "b" } - shape_filepath: "#007a72" - shape_flag: { fg: "#0073b5" attr: "b" } - shape_float: { fg: "#4e66b6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#007a72" attr: "b" } - shape_int: { fg: "#4e66b6" attr: "b" } - shape_internalcall: { fg: "#007a72" attr: "b" } - shape_list: { fg: "#007a72" attr: "b" } - shape_literal: "#0073b5" - shape_match_pattern: "#637200" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#007a72" - shape_operator: "#9d6f00" - shape_or: { fg: "#4e66b6" attr: "b" } - shape_pipe: { fg: "#4e66b6" attr: "b" } - shape_range: { fg: "#9d6f00" attr: "b" } - shape_record: { fg: "#007a72" attr: "b" } - shape_redirection: { fg: "#4e66b6" attr: "b" } - shape_signature: { fg: "#637200" attr: "b" } - shape_string: "#637200" - shape_string_interpolation: { fg: "#007a72" attr: "b" } - shape_table: { fg: "#0073b5" attr: "b" } - shape_variable: "#4e66b6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f5f0e7" - foreground: "#43474e" - cursor: "#43474e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#43474e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#637200' attr: 'b' } + empty: '#0073b5' + bool: {|| if $in { '#007a72' } else { 'light_gray' } } + int: '#43474e' + filesize: {|e| + if $e == 0b { + '#43474e' + } else if $e < 1mb { + '#007a72' + } else {{ fg: '#0073b5' }} + } + duration: '#43474e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d02023' attr: 'b' } + } else if $in < 6hr { + '#d02023' + } else if $in < 1day { + '#9d6f00' + } else if $in < 3day { + '#637200' + } else if $in < 1wk { + { fg: '#637200' attr: 'b' } + } else if $in < 6wk { + '#007a72' + } else if $in < 52wk { + '#0073b5' + } else { 'dark_gray' } + } + range: '#43474e' + float: '#43474e' + string: '#43474e' + nothing: '#43474e' + binary: '#43474e' + cellpath: '#43474e' + row_index: { fg: '#637200' attr: 'b' } + record: '#43474e' + list: '#43474e' + block: '#43474e' + hints: 'dark_gray' + search_result: { fg: '#d02023' bg: '#43474e' } + + shape_and: { fg: '#4e66b6' attr: 'b' } + shape_binary: { fg: '#4e66b6' attr: 'b' } + shape_block: { fg: '#0073b5' attr: 'b' } + shape_bool: '#007a72' + shape_custom: '#637200' + shape_datetime: { fg: '#007a72' attr: 'b' } + shape_directory: '#007a72' + shape_external: '#007a72' + shape_externalarg: { fg: '#637200' attr: 'b' } + shape_filepath: '#007a72' + shape_flag: { fg: '#0073b5' attr: 'b' } + shape_float: { fg: '#4e66b6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#007a72' attr: 'b' } + shape_int: { fg: '#4e66b6' attr: 'b' } + shape_internalcall: { fg: '#007a72' attr: 'b' } + shape_list: { fg: '#007a72' attr: 'b' } + shape_literal: '#0073b5' + shape_match_pattern: '#637200' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#007a72' + shape_operator: '#9d6f00' + shape_or: { fg: '#4e66b6' attr: 'b' } + shape_pipe: { fg: '#4e66b6' attr: 'b' } + shape_range: { fg: '#9d6f00' attr: 'b' } + shape_record: { fg: '#007a72' attr: 'b' } + shape_redirection: { fg: '#4e66b6' attr: 'b' } + shape_signature: { fg: '#637200' attr: 'b' } + shape_string: '#637200' + shape_string_interpolation: { fg: '#007a72' attr: 'b' } + shape_table: { fg: '#0073b5' attr: 'b' } + shape_variable: '#4e66b6' + + background: '#f5f0e7' + foreground: '#43474e' + cursor: '#43474e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/espresso-libre.nu b/themes/nu-themes/espresso-libre.nu index 0157911..692619c 100644 --- a/themes/nu-themes/espresso-libre.nu +++ b/themes/nu-themes/espresso-libre.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d7cf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#1a921c" attr: "b" } - empty: "#0066ff" - bool: {|| if $in { "#34e2e2" } else { "light_gray" } } - int: "#d3d7cf" - filesize: {|e| - if $e == 0b { - "#d3d7cf" - } else if $e < 1mb { - "#06989a" - } else {{ fg: "#0066ff" }} - } - duration: "#d3d7cf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#f0e53a" - } else if $in < 3day { - "#1a921c" - } else if $in < 1wk { - { fg: "#1a921c" attr: "b" } - } else if $in < 6wk { - "#06989a" - } else if $in < 52wk { - "#0066ff" - } else { "dark_gray" } - } - range: "#d3d7cf" - float: "#d3d7cf" - string: "#d3d7cf" - nothing: "#d3d7cf" - binary: "#d3d7cf" - cellpath: "#d3d7cf" - row_index: { fg: "#1a921c" attr: "b" } - record: "#d3d7cf" - list: "#d3d7cf" - block: "#d3d7cf" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#d3d7cf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c5656b" attr: "b" } - shape_binary: { fg: "#c5656b" attr: "b" } - shape_block: { fg: "#0066ff" attr: "b" } - shape_bool: "#34e2e2" - shape_custom: "#1a921c" - shape_datetime: { fg: "#06989a" attr: "b" } - shape_directory: "#06989a" - shape_external: "#06989a" - shape_externalarg: { fg: "#1a921c" attr: "b" } - shape_filepath: "#06989a" - shape_flag: { fg: "#0066ff" attr: "b" } - shape_float: { fg: "#c5656b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#06989a" attr: "b" } - shape_int: { fg: "#c5656b" attr: "b" } - shape_internalcall: { fg: "#06989a" attr: "b" } - shape_list: { fg: "#06989a" attr: "b" } - shape_literal: "#0066ff" - shape_match_pattern: "#1a921c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#34e2e2" - shape_operator: "#f0e53a" - shape_or: { fg: "#c5656b" attr: "b" } - shape_pipe: { fg: "#c5656b" attr: "b" } - shape_range: { fg: "#f0e53a" attr: "b" } - shape_record: { fg: "#06989a" attr: "b" } - shape_redirection: { fg: "#c5656b" attr: "b" } - shape_signature: { fg: "#1a921c" attr: "b" } - shape_string: "#1a921c" - shape_string_interpolation: { fg: "#06989a" attr: "b" } - shape_table: { fg: "#0066ff" attr: "b" } - shape_variable: "#c5656b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a211c" - foreground: "#b8a898" - cursor: "#b8a898" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d7cf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#1a921c' attr: 'b' } + empty: '#0066ff' + bool: {|| if $in { '#34e2e2' } else { 'light_gray' } } + int: '#d3d7cf' + filesize: {|e| + if $e == 0b { + '#d3d7cf' + } else if $e < 1mb { + '#06989a' + } else {{ fg: '#0066ff' }} + } + duration: '#d3d7cf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#f0e53a' + } else if $in < 3day { + '#1a921c' + } else if $in < 1wk { + { fg: '#1a921c' attr: 'b' } + } else if $in < 6wk { + '#06989a' + } else if $in < 52wk { + '#0066ff' + } else { 'dark_gray' } + } + range: '#d3d7cf' + float: '#d3d7cf' + string: '#d3d7cf' + nothing: '#d3d7cf' + binary: '#d3d7cf' + cellpath: '#d3d7cf' + row_index: { fg: '#1a921c' attr: 'b' } + record: '#d3d7cf' + list: '#d3d7cf' + block: '#d3d7cf' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#d3d7cf' } + + shape_and: { fg: '#c5656b' attr: 'b' } + shape_binary: { fg: '#c5656b' attr: 'b' } + shape_block: { fg: '#0066ff' attr: 'b' } + shape_bool: '#34e2e2' + shape_custom: '#1a921c' + shape_datetime: { fg: '#06989a' attr: 'b' } + shape_directory: '#06989a' + shape_external: '#06989a' + shape_externalarg: { fg: '#1a921c' attr: 'b' } + shape_filepath: '#06989a' + shape_flag: { fg: '#0066ff' attr: 'b' } + shape_float: { fg: '#c5656b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#06989a' attr: 'b' } + shape_int: { fg: '#c5656b' attr: 'b' } + shape_internalcall: { fg: '#06989a' attr: 'b' } + shape_list: { fg: '#06989a' attr: 'b' } + shape_literal: '#0066ff' + shape_match_pattern: '#1a921c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#34e2e2' + shape_operator: '#f0e53a' + shape_or: { fg: '#c5656b' attr: 'b' } + shape_pipe: { fg: '#c5656b' attr: 'b' } + shape_range: { fg: '#f0e53a' attr: 'b' } + shape_record: { fg: '#06989a' attr: 'b' } + shape_redirection: { fg: '#c5656b' attr: 'b' } + shape_signature: { fg: '#1a921c' attr: 'b' } + shape_string: '#1a921c' + shape_string_interpolation: { fg: '#06989a' attr: 'b' } + shape_table: { fg: '#0066ff' attr: 'b' } + shape_variable: '#c5656b' + + background: '#2a211c' + foreground: '#b8a898' + cursor: '#b8a898' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/espresso.nu b/themes/nu-themes/espresso.nu index a114703..87ff7ac 100644 --- a/themes/nu-themes/espresso.nu +++ b/themes/nu-themes/espresso.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a5c261" attr: "b" } - empty: "#6c99bb" - bool: {|| if $in { "#bed6ff" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#bed6ff" - } else {{ fg: "#6c99bb" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d25252" attr: "b" } - } else if $in < 6hr { - "#d25252" - } else if $in < 1day { - "#ffc66d" - } else if $in < 3day { - "#a5c261" - } else if $in < 1wk { - { fg: "#a5c261" attr: "b" } - } else if $in < 6wk { - "#bed6ff" - } else if $in < 52wk { - "#6c99bb" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#a5c261" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#d25252" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d197d9" attr: "b" } - shape_binary: { fg: "#d197d9" attr: "b" } - shape_block: { fg: "#6c99bb" attr: "b" } - shape_bool: "#bed6ff" - shape_custom: "#a5c261" - shape_datetime: { fg: "#bed6ff" attr: "b" } - shape_directory: "#bed6ff" - shape_external: "#bed6ff" - shape_externalarg: { fg: "#a5c261" attr: "b" } - shape_filepath: "#bed6ff" - shape_flag: { fg: "#6c99bb" attr: "b" } - shape_float: { fg: "#d197d9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#bed6ff" attr: "b" } - shape_int: { fg: "#d197d9" attr: "b" } - shape_internalcall: { fg: "#bed6ff" attr: "b" } - shape_list: { fg: "#bed6ff" attr: "b" } - shape_literal: "#6c99bb" - shape_match_pattern: "#a5c261" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#bed6ff" - shape_operator: "#ffc66d" - shape_or: { fg: "#d197d9" attr: "b" } - shape_pipe: { fg: "#d197d9" attr: "b" } - shape_range: { fg: "#ffc66d" attr: "b" } - shape_record: { fg: "#bed6ff" attr: "b" } - shape_redirection: { fg: "#d197d9" attr: "b" } - shape_signature: { fg: "#a5c261" attr: "b" } - shape_string: "#a5c261" - shape_string_interpolation: { fg: "#bed6ff" attr: "b" } - shape_table: { fg: "#6c99bb" attr: "b" } - shape_variable: "#d197d9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2d2d2d" - foreground: "#cccccc" - cursor: "#cccccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a5c261' attr: 'b' } + empty: '#6c99bb' + bool: {|| if $in { '#bed6ff' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#bed6ff' + } else {{ fg: '#6c99bb' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d25252' attr: 'b' } + } else if $in < 6hr { + '#d25252' + } else if $in < 1day { + '#ffc66d' + } else if $in < 3day { + '#a5c261' + } else if $in < 1wk { + { fg: '#a5c261' attr: 'b' } + } else if $in < 6wk { + '#bed6ff' + } else if $in < 52wk { + '#6c99bb' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#a5c261' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#d25252' bg: '#cccccc' } + + shape_and: { fg: '#d197d9' attr: 'b' } + shape_binary: { fg: '#d197d9' attr: 'b' } + shape_block: { fg: '#6c99bb' attr: 'b' } + shape_bool: '#bed6ff' + shape_custom: '#a5c261' + shape_datetime: { fg: '#bed6ff' attr: 'b' } + shape_directory: '#bed6ff' + shape_external: '#bed6ff' + shape_externalarg: { fg: '#a5c261' attr: 'b' } + shape_filepath: '#bed6ff' + shape_flag: { fg: '#6c99bb' attr: 'b' } + shape_float: { fg: '#d197d9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#bed6ff' attr: 'b' } + shape_int: { fg: '#d197d9' attr: 'b' } + shape_internalcall: { fg: '#bed6ff' attr: 'b' } + shape_list: { fg: '#bed6ff' attr: 'b' } + shape_literal: '#6c99bb' + shape_match_pattern: '#a5c261' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#bed6ff' + shape_operator: '#ffc66d' + shape_or: { fg: '#d197d9' attr: 'b' } + shape_pipe: { fg: '#d197d9' attr: 'b' } + shape_range: { fg: '#ffc66d' attr: 'b' } + shape_record: { fg: '#bed6ff' attr: 'b' } + shape_redirection: { fg: '#d197d9' attr: 'b' } + shape_signature: { fg: '#a5c261' attr: 'b' } + shape_string: '#a5c261' + shape_string_interpolation: { fg: '#bed6ff' attr: 'b' } + shape_table: { fg: '#6c99bb' attr: 'b' } + shape_variable: '#d197d9' + + background: '#2d2d2d' + foreground: '#cccccc' + cursor: '#cccccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/eva-dim.nu b/themes/nu-themes/eva-dim.nu index 7864dd9..18e5715 100644 --- a/themes/nu-themes/eva-dim.nu +++ b/themes/nu-themes/eva-dim.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#9fa2a6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5de561" attr: "b" } - empty: "#1ae1dc" - bool: {|| if $in { "#4b8f77" } else { "light_gray" } } - int: "#9fa2a6" - filesize: {|e| - if $e == 0b { - "#9fa2a6" - } else if $e < 1mb { - "#4b8f77" - } else {{ fg: "#1ae1dc" }} - } - duration: "#9fa2a6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c4676c" attr: "b" } - } else if $in < 6hr { - "#c4676c" - } else if $in < 1day { - "#cfd05d" - } else if $in < 3day { - "#5de561" - } else if $in < 1wk { - { fg: "#5de561" attr: "b" } - } else if $in < 6wk { - "#4b8f77" - } else if $in < 52wk { - "#1ae1dc" - } else { "dark_gray" } - } - range: "#9fa2a6" - float: "#9fa2a6" - string: "#9fa2a6" - nothing: "#9fa2a6" - binary: "#9fa2a6" - cellpath: "#9fa2a6" - row_index: { fg: "#5de561" attr: "b" } - record: "#9fa2a6" - list: "#9fa2a6" - block: "#9fa2a6" - hints: "dark_gray" - search_result: { fg: "#c4676c" bg: "#9fa2a6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9c6cd3" attr: "b" } - shape_binary: { fg: "#9c6cd3" attr: "b" } - shape_block: { fg: "#1ae1dc" attr: "b" } - shape_bool: "#4b8f77" - shape_custom: "#5de561" - shape_datetime: { fg: "#4b8f77" attr: "b" } - shape_directory: "#4b8f77" - shape_external: "#4b8f77" - shape_externalarg: { fg: "#5de561" attr: "b" } - shape_filepath: "#4b8f77" - shape_flag: { fg: "#1ae1dc" attr: "b" } - shape_float: { fg: "#9c6cd3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4b8f77" attr: "b" } - shape_int: { fg: "#9c6cd3" attr: "b" } - shape_internalcall: { fg: "#4b8f77" attr: "b" } - shape_list: { fg: "#4b8f77" attr: "b" } - shape_literal: "#1ae1dc" - shape_match_pattern: "#5de561" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4b8f77" - shape_operator: "#cfd05d" - shape_or: { fg: "#9c6cd3" attr: "b" } - shape_pipe: { fg: "#9c6cd3" attr: "b" } - shape_range: { fg: "#cfd05d" attr: "b" } - shape_record: { fg: "#4b8f77" attr: "b" } - shape_redirection: { fg: "#9c6cd3" attr: "b" } - shape_signature: { fg: "#5de561" attr: "b" } - shape_string: "#5de561" - shape_string_interpolation: { fg: "#4b8f77" attr: "b" } - shape_table: { fg: "#1ae1dc" attr: "b" } - shape_variable: "#9c6cd3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a3b4d" - foreground: "#9fa2a6" - cursor: "#9fa2a6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#9fa2a6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5de561' attr: 'b' } + empty: '#1ae1dc' + bool: {|| if $in { '#4b8f77' } else { 'light_gray' } } + int: '#9fa2a6' + filesize: {|e| + if $e == 0b { + '#9fa2a6' + } else if $e < 1mb { + '#4b8f77' + } else {{ fg: '#1ae1dc' }} + } + duration: '#9fa2a6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c4676c' attr: 'b' } + } else if $in < 6hr { + '#c4676c' + } else if $in < 1day { + '#cfd05d' + } else if $in < 3day { + '#5de561' + } else if $in < 1wk { + { fg: '#5de561' attr: 'b' } + } else if $in < 6wk { + '#4b8f77' + } else if $in < 52wk { + '#1ae1dc' + } else { 'dark_gray' } + } + range: '#9fa2a6' + float: '#9fa2a6' + string: '#9fa2a6' + nothing: '#9fa2a6' + binary: '#9fa2a6' + cellpath: '#9fa2a6' + row_index: { fg: '#5de561' attr: 'b' } + record: '#9fa2a6' + list: '#9fa2a6' + block: '#9fa2a6' + hints: 'dark_gray' + search_result: { fg: '#c4676c' bg: '#9fa2a6' } + + shape_and: { fg: '#9c6cd3' attr: 'b' } + shape_binary: { fg: '#9c6cd3' attr: 'b' } + shape_block: { fg: '#1ae1dc' attr: 'b' } + shape_bool: '#4b8f77' + shape_custom: '#5de561' + shape_datetime: { fg: '#4b8f77' attr: 'b' } + shape_directory: '#4b8f77' + shape_external: '#4b8f77' + shape_externalarg: { fg: '#5de561' attr: 'b' } + shape_filepath: '#4b8f77' + shape_flag: { fg: '#1ae1dc' attr: 'b' } + shape_float: { fg: '#9c6cd3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4b8f77' attr: 'b' } + shape_int: { fg: '#9c6cd3' attr: 'b' } + shape_internalcall: { fg: '#4b8f77' attr: 'b' } + shape_list: { fg: '#4b8f77' attr: 'b' } + shape_literal: '#1ae1dc' + shape_match_pattern: '#5de561' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4b8f77' + shape_operator: '#cfd05d' + shape_or: { fg: '#9c6cd3' attr: 'b' } + shape_pipe: { fg: '#9c6cd3' attr: 'b' } + shape_range: { fg: '#cfd05d' attr: 'b' } + shape_record: { fg: '#4b8f77' attr: 'b' } + shape_redirection: { fg: '#9c6cd3' attr: 'b' } + shape_signature: { fg: '#5de561' attr: 'b' } + shape_string: '#5de561' + shape_string_interpolation: { fg: '#4b8f77' attr: 'b' } + shape_table: { fg: '#1ae1dc' attr: 'b' } + shape_variable: '#9c6cd3' + + background: '#2a3b4d' + foreground: '#9fa2a6' + cursor: '#9fa2a6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/eva.nu b/themes/nu-themes/eva.nu index 88ae793..23220f9 100644 --- a/themes/nu-themes/eva.nu +++ b/themes/nu-themes/eva.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#9fa2a6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#66ff66" attr: "b" } - empty: "#15f4ee" - bool: {|| if $in { "#4b8f77" } else { "light_gray" } } - int: "#9fa2a6" - filesize: {|e| - if $e == 0b { - "#9fa2a6" - } else if $e < 1mb { - "#4b8f77" - } else {{ fg: "#15f4ee" }} - } - duration: "#9fa2a6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c4676c" attr: "b" } - } else if $in < 6hr { - "#c4676c" - } else if $in < 1day { - "#ffff66" - } else if $in < 3day { - "#66ff66" - } else if $in < 1wk { - { fg: "#66ff66" attr: "b" } - } else if $in < 6wk { - "#4b8f77" - } else if $in < 52wk { - "#15f4ee" - } else { "dark_gray" } - } - range: "#9fa2a6" - float: "#9fa2a6" - string: "#9fa2a6" - nothing: "#9fa2a6" - binary: "#9fa2a6" - cellpath: "#9fa2a6" - row_index: { fg: "#66ff66" attr: "b" } - record: "#9fa2a6" - list: "#9fa2a6" - block: "#9fa2a6" - hints: "dark_gray" - search_result: { fg: "#c4676c" bg: "#9fa2a6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9c6cd3" attr: "b" } - shape_binary: { fg: "#9c6cd3" attr: "b" } - shape_block: { fg: "#15f4ee" attr: "b" } - shape_bool: "#4b8f77" - shape_custom: "#66ff66" - shape_datetime: { fg: "#4b8f77" attr: "b" } - shape_directory: "#4b8f77" - shape_external: "#4b8f77" - shape_externalarg: { fg: "#66ff66" attr: "b" } - shape_filepath: "#4b8f77" - shape_flag: { fg: "#15f4ee" attr: "b" } - shape_float: { fg: "#9c6cd3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4b8f77" attr: "b" } - shape_int: { fg: "#9c6cd3" attr: "b" } - shape_internalcall: { fg: "#4b8f77" attr: "b" } - shape_list: { fg: "#4b8f77" attr: "b" } - shape_literal: "#15f4ee" - shape_match_pattern: "#66ff66" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4b8f77" - shape_operator: "#ffff66" - shape_or: { fg: "#9c6cd3" attr: "b" } - shape_pipe: { fg: "#9c6cd3" attr: "b" } - shape_range: { fg: "#ffff66" attr: "b" } - shape_record: { fg: "#4b8f77" attr: "b" } - shape_redirection: { fg: "#9c6cd3" attr: "b" } - shape_signature: { fg: "#66ff66" attr: "b" } - shape_string: "#66ff66" - shape_string_interpolation: { fg: "#4b8f77" attr: "b" } - shape_table: { fg: "#15f4ee" attr: "b" } - shape_variable: "#9c6cd3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a3b4d" - foreground: "#9fa2a6" - cursor: "#9fa2a6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#9fa2a6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#66ff66' attr: 'b' } + empty: '#15f4ee' + bool: {|| if $in { '#4b8f77' } else { 'light_gray' } } + int: '#9fa2a6' + filesize: {|e| + if $e == 0b { + '#9fa2a6' + } else if $e < 1mb { + '#4b8f77' + } else {{ fg: '#15f4ee' }} + } + duration: '#9fa2a6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c4676c' attr: 'b' } + } else if $in < 6hr { + '#c4676c' + } else if $in < 1day { + '#ffff66' + } else if $in < 3day { + '#66ff66' + } else if $in < 1wk { + { fg: '#66ff66' attr: 'b' } + } else if $in < 6wk { + '#4b8f77' + } else if $in < 52wk { + '#15f4ee' + } else { 'dark_gray' } + } + range: '#9fa2a6' + float: '#9fa2a6' + string: '#9fa2a6' + nothing: '#9fa2a6' + binary: '#9fa2a6' + cellpath: '#9fa2a6' + row_index: { fg: '#66ff66' attr: 'b' } + record: '#9fa2a6' + list: '#9fa2a6' + block: '#9fa2a6' + hints: 'dark_gray' + search_result: { fg: '#c4676c' bg: '#9fa2a6' } + + shape_and: { fg: '#9c6cd3' attr: 'b' } + shape_binary: { fg: '#9c6cd3' attr: 'b' } + shape_block: { fg: '#15f4ee' attr: 'b' } + shape_bool: '#4b8f77' + shape_custom: '#66ff66' + shape_datetime: { fg: '#4b8f77' attr: 'b' } + shape_directory: '#4b8f77' + shape_external: '#4b8f77' + shape_externalarg: { fg: '#66ff66' attr: 'b' } + shape_filepath: '#4b8f77' + shape_flag: { fg: '#15f4ee' attr: 'b' } + shape_float: { fg: '#9c6cd3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4b8f77' attr: 'b' } + shape_int: { fg: '#9c6cd3' attr: 'b' } + shape_internalcall: { fg: '#4b8f77' attr: 'b' } + shape_list: { fg: '#4b8f77' attr: 'b' } + shape_literal: '#15f4ee' + shape_match_pattern: '#66ff66' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4b8f77' + shape_operator: '#ffff66' + shape_or: { fg: '#9c6cd3' attr: 'b' } + shape_pipe: { fg: '#9c6cd3' attr: 'b' } + shape_range: { fg: '#ffff66' attr: 'b' } + shape_record: { fg: '#4b8f77' attr: 'b' } + shape_redirection: { fg: '#9c6cd3' attr: 'b' } + shape_signature: { fg: '#66ff66' attr: 'b' } + shape_string: '#66ff66' + shape_string_interpolation: { fg: '#4b8f77' attr: 'b' } + shape_table: { fg: '#15f4ee' attr: 'b' } + shape_variable: '#9c6cd3' + + background: '#2a3b4d' + foreground: '#9fa2a6' + cursor: '#9fa2a6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/everforest-light.nu b/themes/nu-themes/everforest-light.nu index 4a4a1a7..6346ba9 100644 --- a/themes/nu-themes/everforest-light.nu +++ b/themes/nu-themes/everforest-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dfddc8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8da101" attr: "b" } - empty: "#3a94c5" - bool: {|| if $in { "#35a77c" } else { "light_gray" } } - int: "#dfddc8" - filesize: {|e| - if $e == 0b { - "#dfddc8" - } else if $e < 1mb { - "#35a77c" - } else {{ fg: "#3a94c5" }} - } - duration: "#dfddc8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f85552" attr: "b" } - } else if $in < 6hr { - "#f85552" - } else if $in < 1day { - "#dfa000" - } else if $in < 3day { - "#8da101" - } else if $in < 1wk { - { fg: "#8da101" attr: "b" } - } else if $in < 6wk { - "#35a77c" - } else if $in < 52wk { - "#3a94c5" - } else { "dark_gray" } - } - range: "#dfddc8" - float: "#dfddc8" - string: "#dfddc8" - nothing: "#dfddc8" - binary: "#dfddc8" - cellpath: "#dfddc8" - row_index: { fg: "#8da101" attr: "b" } - record: "#dfddc8" - list: "#dfddc8" - block: "#dfddc8" - hints: "dark_gray" - search_result: { fg: "#f85552" bg: "#dfddc8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#df69ba" attr: "b" } - shape_binary: { fg: "#df69ba" attr: "b" } - shape_block: { fg: "#3a94c5" attr: "b" } - shape_bool: "#35a77c" - shape_custom: "#8da101" - shape_datetime: { fg: "#35a77c" attr: "b" } - shape_directory: "#35a77c" - shape_external: "#35a77c" - shape_externalarg: { fg: "#8da101" attr: "b" } - shape_filepath: "#35a77c" - shape_flag: { fg: "#3a94c5" attr: "b" } - shape_float: { fg: "#df69ba" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#35a77c" attr: "b" } - shape_int: { fg: "#df69ba" attr: "b" } - shape_internalcall: { fg: "#35a77c" attr: "b" } - shape_list: { fg: "#35a77c" attr: "b" } - shape_literal: "#3a94c5" - shape_match_pattern: "#8da101" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#35a77c" - shape_operator: "#dfa000" - shape_or: { fg: "#df69ba" attr: "b" } - shape_pipe: { fg: "#df69ba" attr: "b" } - shape_range: { fg: "#dfa000" attr: "b" } - shape_record: { fg: "#35a77c" attr: "b" } - shape_redirection: { fg: "#df69ba" attr: "b" } - shape_signature: { fg: "#8da101" attr: "b" } - shape_string: "#8da101" - shape_string_interpolation: { fg: "#35a77c" attr: "b" } - shape_table: { fg: "#3a94c5" attr: "b" } - shape_variable: "#df69ba" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f0dc" - foreground: "#5c6a72" - cursor: "#5c6a72" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dfddc8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8da101' attr: 'b' } + empty: '#3a94c5' + bool: {|| if $in { '#35a77c' } else { 'light_gray' } } + int: '#dfddc8' + filesize: {|e| + if $e == 0b { + '#dfddc8' + } else if $e < 1mb { + '#35a77c' + } else {{ fg: '#3a94c5' }} + } + duration: '#dfddc8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f85552' attr: 'b' } + } else if $in < 6hr { + '#f85552' + } else if $in < 1day { + '#dfa000' + } else if $in < 3day { + '#8da101' + } else if $in < 1wk { + { fg: '#8da101' attr: 'b' } + } else if $in < 6wk { + '#35a77c' + } else if $in < 52wk { + '#3a94c5' + } else { 'dark_gray' } + } + range: '#dfddc8' + float: '#dfddc8' + string: '#dfddc8' + nothing: '#dfddc8' + binary: '#dfddc8' + cellpath: '#dfddc8' + row_index: { fg: '#8da101' attr: 'b' } + record: '#dfddc8' + list: '#dfddc8' + block: '#dfddc8' + hints: 'dark_gray' + search_result: { fg: '#f85552' bg: '#dfddc8' } + + shape_and: { fg: '#df69ba' attr: 'b' } + shape_binary: { fg: '#df69ba' attr: 'b' } + shape_block: { fg: '#3a94c5' attr: 'b' } + shape_bool: '#35a77c' + shape_custom: '#8da101' + shape_datetime: { fg: '#35a77c' attr: 'b' } + shape_directory: '#35a77c' + shape_external: '#35a77c' + shape_externalarg: { fg: '#8da101' attr: 'b' } + shape_filepath: '#35a77c' + shape_flag: { fg: '#3a94c5' attr: 'b' } + shape_float: { fg: '#df69ba' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#35a77c' attr: 'b' } + shape_int: { fg: '#df69ba' attr: 'b' } + shape_internalcall: { fg: '#35a77c' attr: 'b' } + shape_list: { fg: '#35a77c' attr: 'b' } + shape_literal: '#3a94c5' + shape_match_pattern: '#8da101' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#35a77c' + shape_operator: '#dfa000' + shape_or: { fg: '#df69ba' attr: 'b' } + shape_pipe: { fg: '#df69ba' attr: 'b' } + shape_range: { fg: '#dfa000' attr: 'b' } + shape_record: { fg: '#35a77c' attr: 'b' } + shape_redirection: { fg: '#df69ba' attr: 'b' } + shape_signature: { fg: '#8da101' attr: 'b' } + shape_string: '#8da101' + shape_string_interpolation: { fg: '#35a77c' attr: 'b' } + shape_table: { fg: '#3a94c5' attr: 'b' } + shape_variable: '#df69ba' + + background: '#f8f0dc' + foreground: '#5c6a72' + cursor: '#5c6a72' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/everforest.nu b/themes/nu-themes/everforest.nu index c8202f0..fab5136 100644 --- a/themes/nu-themes/everforest.nu +++ b/themes/nu-themes/everforest.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3c6aa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a7c080" attr: "b" } - empty: "#7fbbb3" - bool: {|| if $in { "#83c092" } else { "light_gray" } } - int: "#d3c6aa" - filesize: {|e| - if $e == 0b { - "#d3c6aa" - } else if $e < 1mb { - "#83c092" - } else {{ fg: "#7fbbb3" }} - } - duration: "#d3c6aa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e67e80" attr: "b" } - } else if $in < 6hr { - "#e67e80" - } else if $in < 1day { - "#dbbc7f" - } else if $in < 3day { - "#a7c080" - } else if $in < 1wk { - { fg: "#a7c080" attr: "b" } - } else if $in < 6wk { - "#83c092" - } else if $in < 52wk { - "#7fbbb3" - } else { "dark_gray" } - } - range: "#d3c6aa" - float: "#d3c6aa" - string: "#d3c6aa" - nothing: "#d3c6aa" - binary: "#d3c6aa" - cellpath: "#d3c6aa" - row_index: { fg: "#a7c080" attr: "b" } - record: "#d3c6aa" - list: "#d3c6aa" - block: "#d3c6aa" - hints: "dark_gray" - search_result: { fg: "#e67e80" bg: "#d3c6aa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d699b6" attr: "b" } - shape_binary: { fg: "#d699b6" attr: "b" } - shape_block: { fg: "#7fbbb3" attr: "b" } - shape_bool: "#83c092" - shape_custom: "#a7c080" - shape_datetime: { fg: "#83c092" attr: "b" } - shape_directory: "#83c092" - shape_external: "#83c092" - shape_externalarg: { fg: "#a7c080" attr: "b" } - shape_filepath: "#83c092" - shape_flag: { fg: "#7fbbb3" attr: "b" } - shape_float: { fg: "#d699b6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#83c092" attr: "b" } - shape_int: { fg: "#d699b6" attr: "b" } - shape_internalcall: { fg: "#83c092" attr: "b" } - shape_list: { fg: "#83c092" attr: "b" } - shape_literal: "#7fbbb3" - shape_match_pattern: "#a7c080" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#83c092" - shape_operator: "#dbbc7f" - shape_or: { fg: "#d699b6" attr: "b" } - shape_pipe: { fg: "#d699b6" attr: "b" } - shape_range: { fg: "#dbbc7f" attr: "b" } - shape_record: { fg: "#83c092" attr: "b" } - shape_redirection: { fg: "#d699b6" attr: "b" } - shape_signature: { fg: "#a7c080" attr: "b" } - shape_string: "#a7c080" - shape_string_interpolation: { fg: "#83c092" attr: "b" } - shape_table: { fg: "#7fbbb3" attr: "b" } - shape_variable: "#d699b6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2f383e" - foreground: "#d3c6aa" - cursor: "#d3c6aa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3c6aa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a7c080' attr: 'b' } + empty: '#7fbbb3' + bool: {|| if $in { '#83c092' } else { 'light_gray' } } + int: '#d3c6aa' + filesize: {|e| + if $e == 0b { + '#d3c6aa' + } else if $e < 1mb { + '#83c092' + } else {{ fg: '#7fbbb3' }} + } + duration: '#d3c6aa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e67e80' attr: 'b' } + } else if $in < 6hr { + '#e67e80' + } else if $in < 1day { + '#dbbc7f' + } else if $in < 3day { + '#a7c080' + } else if $in < 1wk { + { fg: '#a7c080' attr: 'b' } + } else if $in < 6wk { + '#83c092' + } else if $in < 52wk { + '#7fbbb3' + } else { 'dark_gray' } + } + range: '#d3c6aa' + float: '#d3c6aa' + string: '#d3c6aa' + nothing: '#d3c6aa' + binary: '#d3c6aa' + cellpath: '#d3c6aa' + row_index: { fg: '#a7c080' attr: 'b' } + record: '#d3c6aa' + list: '#d3c6aa' + block: '#d3c6aa' + hints: 'dark_gray' + search_result: { fg: '#e67e80' bg: '#d3c6aa' } + + shape_and: { fg: '#d699b6' attr: 'b' } + shape_binary: { fg: '#d699b6' attr: 'b' } + shape_block: { fg: '#7fbbb3' attr: 'b' } + shape_bool: '#83c092' + shape_custom: '#a7c080' + shape_datetime: { fg: '#83c092' attr: 'b' } + shape_directory: '#83c092' + shape_external: '#83c092' + shape_externalarg: { fg: '#a7c080' attr: 'b' } + shape_filepath: '#83c092' + shape_flag: { fg: '#7fbbb3' attr: 'b' } + shape_float: { fg: '#d699b6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#83c092' attr: 'b' } + shape_int: { fg: '#d699b6' attr: 'b' } + shape_internalcall: { fg: '#83c092' attr: 'b' } + shape_list: { fg: '#83c092' attr: 'b' } + shape_literal: '#7fbbb3' + shape_match_pattern: '#a7c080' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#83c092' + shape_operator: '#dbbc7f' + shape_or: { fg: '#d699b6' attr: 'b' } + shape_pipe: { fg: '#d699b6' attr: 'b' } + shape_range: { fg: '#dbbc7f' attr: 'b' } + shape_record: { fg: '#83c092' attr: 'b' } + shape_redirection: { fg: '#d699b6' attr: 'b' } + shape_signature: { fg: '#a7c080' attr: 'b' } + shape_string: '#a7c080' + shape_string_interpolation: { fg: '#83c092' attr: 'b' } + shape_table: { fg: '#7fbbb3' attr: 'b' } + shape_variable: '#d699b6' + + background: '#2f383e' + foreground: '#d3c6aa' + cursor: '#d3c6aa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/falcon.nu b/themes/nu-themes/falcon.nu index b9067e0..535f0ef 100644 --- a/themes/nu-themes/falcon.nu +++ b/themes/nu-themes/falcon.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b4b4b9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#718e3f" attr: "b" } - empty: "#635196" - bool: {|| if $in { "#8bccbf" } else { "light_gray" } } - int: "#b4b4b9" - filesize: {|e| - if $e == 0b { - "#b4b4b9" - } else if $e < 1mb { - "#34bfa4" - } else {{ fg: "#635196" }} - } - duration: "#b4b4b9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3600" attr: "b" } - } else if $in < 6hr { - "#ff3600" - } else if $in < 1day { - "#ffc552" - } else if $in < 3day { - "#718e3f" - } else if $in < 1wk { - { fg: "#718e3f" attr: "b" } - } else if $in < 6wk { - "#34bfa4" - } else if $in < 52wk { - "#635196" - } else { "dark_gray" } - } - range: "#b4b4b9" - float: "#b4b4b9" - string: "#b4b4b9" - nothing: "#b4b4b9" - binary: "#b4b4b9" - cellpath: "#b4b4b9" - row_index: { fg: "#718e3f" attr: "b" } - record: "#b4b4b9" - list: "#b4b4b9" - block: "#b4b4b9" - hints: "dark_gray" - search_result: { fg: "#ff3600" bg: "#b4b4b9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff761a" attr: "b" } - shape_binary: { fg: "#ff761a" attr: "b" } - shape_block: { fg: "#635196" attr: "b" } - shape_bool: "#8bccbf" - shape_custom: "#718e3f" - shape_datetime: { fg: "#34bfa4" attr: "b" } - shape_directory: "#34bfa4" - shape_external: "#34bfa4" - shape_externalarg: { fg: "#718e3f" attr: "b" } - shape_filepath: "#34bfa4" - shape_flag: { fg: "#635196" attr: "b" } - shape_float: { fg: "#ff761a" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#34bfa4" attr: "b" } - shape_int: { fg: "#ff761a" attr: "b" } - shape_internalcall: { fg: "#34bfa4" attr: "b" } - shape_list: { fg: "#34bfa4" attr: "b" } - shape_literal: "#635196" - shape_match_pattern: "#718e3f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8bccbf" - shape_operator: "#ffc552" - shape_or: { fg: "#ff761a" attr: "b" } - shape_pipe: { fg: "#ff761a" attr: "b" } - shape_range: { fg: "#ffc552" attr: "b" } - shape_record: { fg: "#34bfa4" attr: "b" } - shape_redirection: { fg: "#ff761a" attr: "b" } - shape_signature: { fg: "#718e3f" attr: "b" } - shape_string: "#718e3f" - shape_string_interpolation: { fg: "#34bfa4" attr: "b" } - shape_table: { fg: "#635196" attr: "b" } - shape_variable: "#ff761a" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#020221" - foreground: "#b4b4b9" - cursor: "#ffe8c0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b4b4b9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#718e3f' attr: 'b' } + empty: '#635196' + bool: {|| if $in { '#8bccbf' } else { 'light_gray' } } + int: '#b4b4b9' + filesize: {|e| + if $e == 0b { + '#b4b4b9' + } else if $e < 1mb { + '#34bfa4' + } else {{ fg: '#635196' }} + } + duration: '#b4b4b9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3600' attr: 'b' } + } else if $in < 6hr { + '#ff3600' + } else if $in < 1day { + '#ffc552' + } else if $in < 3day { + '#718e3f' + } else if $in < 1wk { + { fg: '#718e3f' attr: 'b' } + } else if $in < 6wk { + '#34bfa4' + } else if $in < 52wk { + '#635196' + } else { 'dark_gray' } + } + range: '#b4b4b9' + float: '#b4b4b9' + string: '#b4b4b9' + nothing: '#b4b4b9' + binary: '#b4b4b9' + cellpath: '#b4b4b9' + row_index: { fg: '#718e3f' attr: 'b' } + record: '#b4b4b9' + list: '#b4b4b9' + block: '#b4b4b9' + hints: 'dark_gray' + search_result: { fg: '#ff3600' bg: '#b4b4b9' } + + shape_and: { fg: '#ff761a' attr: 'b' } + shape_binary: { fg: '#ff761a' attr: 'b' } + shape_block: { fg: '#635196' attr: 'b' } + shape_bool: '#8bccbf' + shape_custom: '#718e3f' + shape_datetime: { fg: '#34bfa4' attr: 'b' } + shape_directory: '#34bfa4' + shape_external: '#34bfa4' + shape_externalarg: { fg: '#718e3f' attr: 'b' } + shape_filepath: '#34bfa4' + shape_flag: { fg: '#635196' attr: 'b' } + shape_float: { fg: '#ff761a' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#34bfa4' attr: 'b' } + shape_int: { fg: '#ff761a' attr: 'b' } + shape_internalcall: { fg: '#34bfa4' attr: 'b' } + shape_list: { fg: '#34bfa4' attr: 'b' } + shape_literal: '#635196' + shape_match_pattern: '#718e3f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8bccbf' + shape_operator: '#ffc552' + shape_or: { fg: '#ff761a' attr: 'b' } + shape_pipe: { fg: '#ff761a' attr: 'b' } + shape_range: { fg: '#ffc552' attr: 'b' } + shape_record: { fg: '#34bfa4' attr: 'b' } + shape_redirection: { fg: '#ff761a' attr: 'b' } + shape_signature: { fg: '#718e3f' attr: 'b' } + shape_string: '#718e3f' + shape_string_interpolation: { fg: '#34bfa4' attr: 'b' } + shape_table: { fg: '#635196' attr: 'b' } + shape_variable: '#ff761a' + + background: '#020221' + foreground: '#b4b4b9' + cursor: '#ffe8c0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/farin.nu b/themes/nu-themes/farin.nu index e6d51ba..0c767e9 100644 --- a/themes/nu-themes/farin.nu +++ b/themes/nu-themes/farin.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#11ff55" attr: "b" } - empty: "#1155ff" - bool: {|| if $in { "#66ffdd" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#00ffbb" - } else {{ fg: "#1155ff" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff1155" attr: "b" } - } else if $in < 6hr { - "#ff1155" - } else if $in < 1day { - "#ffbb33" - } else if $in < 3day { - "#11ff55" - } else if $in < 1wk { - { fg: "#11ff55" attr: "b" } - } else if $in < 6wk { - "#00ffbb" - } else if $in < 52wk { - "#1155ff" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#11ff55" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#ff1155" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ed53c9" attr: "b" } - shape_binary: { fg: "#ed53c9" attr: "b" } - shape_block: { fg: "#1155ff" attr: "b" } - shape_bool: "#66ffdd" - shape_custom: "#11ff55" - shape_datetime: { fg: "#00ffbb" attr: "b" } - shape_directory: "#00ffbb" - shape_external: "#00ffbb" - shape_externalarg: { fg: "#11ff55" attr: "b" } - shape_filepath: "#00ffbb" - shape_flag: { fg: "#1155ff" attr: "b" } - shape_float: { fg: "#ed53c9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00ffbb" attr: "b" } - shape_int: { fg: "#ed53c9" attr: "b" } - shape_internalcall: { fg: "#00ffbb" attr: "b" } - shape_list: { fg: "#00ffbb" attr: "b" } - shape_literal: "#1155ff" - shape_match_pattern: "#11ff55" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#66ffdd" - shape_operator: "#ffbb33" - shape_or: { fg: "#ed53c9" attr: "b" } - shape_pipe: { fg: "#ed53c9" attr: "b" } - shape_range: { fg: "#ffbb33" attr: "b" } - shape_record: { fg: "#00ffbb" attr: "b" } - shape_redirection: { fg: "#ed53c9" attr: "b" } - shape_signature: { fg: "#11ff55" attr: "b" } - shape_string: "#11ff55" - shape_string_interpolation: { fg: "#00ffbb" attr: "b" } - shape_table: { fg: "#1155ff" attr: "b" } - shape_variable: "#ed53c9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e1e1e" - foreground: "#aaaaaa" - cursor: "#aaaaaa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#11ff55' attr: 'b' } + empty: '#1155ff' + bool: {|| if $in { '#66ffdd' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#00ffbb' + } else {{ fg: '#1155ff' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff1155' attr: 'b' } + } else if $in < 6hr { + '#ff1155' + } else if $in < 1day { + '#ffbb33' + } else if $in < 3day { + '#11ff55' + } else if $in < 1wk { + { fg: '#11ff55' attr: 'b' } + } else if $in < 6wk { + '#00ffbb' + } else if $in < 52wk { + '#1155ff' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#11ff55' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#ff1155' bg: '#cccccc' } + + shape_and: { fg: '#ed53c9' attr: 'b' } + shape_binary: { fg: '#ed53c9' attr: 'b' } + shape_block: { fg: '#1155ff' attr: 'b' } + shape_bool: '#66ffdd' + shape_custom: '#11ff55' + shape_datetime: { fg: '#00ffbb' attr: 'b' } + shape_directory: '#00ffbb' + shape_external: '#00ffbb' + shape_externalarg: { fg: '#11ff55' attr: 'b' } + shape_filepath: '#00ffbb' + shape_flag: { fg: '#1155ff' attr: 'b' } + shape_float: { fg: '#ed53c9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00ffbb' attr: 'b' } + shape_int: { fg: '#ed53c9' attr: 'b' } + shape_internalcall: { fg: '#00ffbb' attr: 'b' } + shape_list: { fg: '#00ffbb' attr: 'b' } + shape_literal: '#1155ff' + shape_match_pattern: '#11ff55' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#66ffdd' + shape_operator: '#ffbb33' + shape_or: { fg: '#ed53c9' attr: 'b' } + shape_pipe: { fg: '#ed53c9' attr: 'b' } + shape_range: { fg: '#ffbb33' attr: 'b' } + shape_record: { fg: '#00ffbb' attr: 'b' } + shape_redirection: { fg: '#ed53c9' attr: 'b' } + shape_signature: { fg: '#11ff55' attr: 'b' } + shape_string: '#11ff55' + shape_string_interpolation: { fg: '#00ffbb' attr: 'b' } + shape_table: { fg: '#1155ff' attr: 'b' } + shape_variable: '#ed53c9' + + background: '#1e1e1e' + foreground: '#aaaaaa' + cursor: '#aaaaaa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ffive.nu b/themes/nu-themes/ffive.nu index ad155d0..c465d43 100644 --- a/themes/nu-themes/ffive.nu +++ b/themes/nu-themes/ffive.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dadadb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#32bf46" attr: "b" } - empty: "#356abf" - bool: {|| if $in { "#6dd8d8" } else { "light_gray" } } - int: "#dadadb" - filesize: {|e| - if $e == 0b { - "#dadadb" - } else if $e < 1mb { - "#54cece" - } else {{ fg: "#356abf" }} - } - duration: "#dadadb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ea2639" attr: "b" } - } else if $in < 6hr { - "#ea2639" - } else if $in < 1day { - "#f8f800" - } else if $in < 3day { - "#32bf46" - } else if $in < 1wk { - { fg: "#32bf46" attr: "b" } - } else if $in < 6wk { - "#54cece" - } else if $in < 52wk { - "#356abf" - } else { "dark_gray" } - } - range: "#dadadb" - float: "#dadadb" - string: "#dadadb" - nothing: "#dadadb" - binary: "#dadadb" - cellpath: "#dadadb" - row_index: { fg: "#32bf46" attr: "b" } - record: "#dadadb" - list: "#dadadb" - block: "#dadadb" - hints: "dark_gray" - search_result: { fg: "#ea2639" bg: "#dadadb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b035c0" attr: "b" } - shape_binary: { fg: "#b035c0" attr: "b" } - shape_block: { fg: "#356abf" attr: "b" } - shape_bool: "#6dd8d8" - shape_custom: "#32bf46" - shape_datetime: { fg: "#54cece" attr: "b" } - shape_directory: "#54cece" - shape_external: "#54cece" - shape_externalarg: { fg: "#32bf46" attr: "b" } - shape_filepath: "#54cece" - shape_flag: { fg: "#356abf" attr: "b" } - shape_float: { fg: "#b035c0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#54cece" attr: "b" } - shape_int: { fg: "#b035c0" attr: "b" } - shape_internalcall: { fg: "#54cece" attr: "b" } - shape_list: { fg: "#54cece" attr: "b" } - shape_literal: "#356abf" - shape_match_pattern: "#32bf46" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6dd8d8" - shape_operator: "#f8f800" - shape_or: { fg: "#b035c0" attr: "b" } - shape_pipe: { fg: "#b035c0" attr: "b" } - shape_range: { fg: "#f8f800" attr: "b" } - shape_record: { fg: "#54cece" attr: "b" } - shape_redirection: { fg: "#b035c0" attr: "b" } - shape_signature: { fg: "#32bf46" attr: "b" } - shape_string: "#32bf46" - shape_string_interpolation: { fg: "#54cece" attr: "b" } - shape_table: { fg: "#356abf" attr: "b" } - shape_variable: "#b035c0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d1e20" - foreground: "#dadadb" - cursor: "#dadadb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dadadb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#32bf46' attr: 'b' } + empty: '#356abf' + bool: {|| if $in { '#6dd8d8' } else { 'light_gray' } } + int: '#dadadb' + filesize: {|e| + if $e == 0b { + '#dadadb' + } else if $e < 1mb { + '#54cece' + } else {{ fg: '#356abf' }} + } + duration: '#dadadb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ea2639' attr: 'b' } + } else if $in < 6hr { + '#ea2639' + } else if $in < 1day { + '#f8f800' + } else if $in < 3day { + '#32bf46' + } else if $in < 1wk { + { fg: '#32bf46' attr: 'b' } + } else if $in < 6wk { + '#54cece' + } else if $in < 52wk { + '#356abf' + } else { 'dark_gray' } + } + range: '#dadadb' + float: '#dadadb' + string: '#dadadb' + nothing: '#dadadb' + binary: '#dadadb' + cellpath: '#dadadb' + row_index: { fg: '#32bf46' attr: 'b' } + record: '#dadadb' + list: '#dadadb' + block: '#dadadb' + hints: 'dark_gray' + search_result: { fg: '#ea2639' bg: '#dadadb' } + + shape_and: { fg: '#b035c0' attr: 'b' } + shape_binary: { fg: '#b035c0' attr: 'b' } + shape_block: { fg: '#356abf' attr: 'b' } + shape_bool: '#6dd8d8' + shape_custom: '#32bf46' + shape_datetime: { fg: '#54cece' attr: 'b' } + shape_directory: '#54cece' + shape_external: '#54cece' + shape_externalarg: { fg: '#32bf46' attr: 'b' } + shape_filepath: '#54cece' + shape_flag: { fg: '#356abf' attr: 'b' } + shape_float: { fg: '#b035c0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#54cece' attr: 'b' } + shape_int: { fg: '#b035c0' attr: 'b' } + shape_internalcall: { fg: '#54cece' attr: 'b' } + shape_list: { fg: '#54cece' attr: 'b' } + shape_literal: '#356abf' + shape_match_pattern: '#32bf46' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6dd8d8' + shape_operator: '#f8f800' + shape_or: { fg: '#b035c0' attr: 'b' } + shape_pipe: { fg: '#b035c0' attr: 'b' } + shape_range: { fg: '#f8f800' attr: 'b' } + shape_record: { fg: '#54cece' attr: 'b' } + shape_redirection: { fg: '#b035c0' attr: 'b' } + shape_signature: { fg: '#32bf46' attr: 'b' } + shape_string: '#32bf46' + shape_string_interpolation: { fg: '#54cece' attr: 'b' } + shape_table: { fg: '#356abf' attr: 'b' } + shape_variable: '#b035c0' + + background: '#1d1e20' + foreground: '#dadadb' + cursor: '#dadadb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/fideloper.nu b/themes/nu-themes/fideloper.nu index 2048393..fdd7777 100644 --- a/themes/nu-themes/fideloper.nu +++ b/themes/nu-themes/fideloper.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e9e2cd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#edb7ab" attr: "b" } - empty: "#2e78c1" - bool: {|| if $in { "#81908f" } else { "light_gray" } } - int: "#e9e2cd" - filesize: {|e| - if $e == 0b { - "#e9e2cd" - } else if $e < 1mb { - "#309185" - } else {{ fg: "#2e78c1" }} - } - duration: "#e9e2cd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca1d2c" attr: "b" } - } else if $in < 6hr { - "#ca1d2c" - } else if $in < 1day { - "#b7aa9a" - } else if $in < 3day { - "#edb7ab" - } else if $in < 1wk { - { fg: "#edb7ab" attr: "b" } - } else if $in < 6wk { - "#309185" - } else if $in < 52wk { - "#2e78c1" - } else { "dark_gray" } - } - range: "#e9e2cd" - float: "#e9e2cd" - string: "#e9e2cd" - nothing: "#e9e2cd" - binary: "#e9e2cd" - cellpath: "#e9e2cd" - row_index: { fg: "#edb7ab" attr: "b" } - record: "#e9e2cd" - list: "#e9e2cd" - block: "#e9e2cd" - hints: "dark_gray" - search_result: { fg: "#ca1d2c" bg: "#e9e2cd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c0226e" attr: "b" } - shape_binary: { fg: "#c0226e" attr: "b" } - shape_block: { fg: "#2e78c1" attr: "b" } - shape_bool: "#81908f" - shape_custom: "#edb7ab" - shape_datetime: { fg: "#309185" attr: "b" } - shape_directory: "#309185" - shape_external: "#309185" - shape_externalarg: { fg: "#edb7ab" attr: "b" } - shape_filepath: "#309185" - shape_flag: { fg: "#2e78c1" attr: "b" } - shape_float: { fg: "#c0226e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#309185" attr: "b" } - shape_int: { fg: "#c0226e" attr: "b" } - shape_internalcall: { fg: "#309185" attr: "b" } - shape_list: { fg: "#309185" attr: "b" } - shape_literal: "#2e78c1" - shape_match_pattern: "#edb7ab" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#81908f" - shape_operator: "#b7aa9a" - shape_or: { fg: "#c0226e" attr: "b" } - shape_pipe: { fg: "#c0226e" attr: "b" } - shape_range: { fg: "#b7aa9a" attr: "b" } - shape_record: { fg: "#309185" attr: "b" } - shape_redirection: { fg: "#c0226e" attr: "b" } - shape_signature: { fg: "#edb7ab" attr: "b" } - shape_string: "#edb7ab" - shape_string_interpolation: { fg: "#309185" attr: "b" } - shape_table: { fg: "#2e78c1" attr: "b" } - shape_variable: "#c0226e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282f32" - foreground: "#dad9df" - cursor: "#d35f5a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e9e2cd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#edb7ab' attr: 'b' } + empty: '#2e78c1' + bool: {|| if $in { '#81908f' } else { 'light_gray' } } + int: '#e9e2cd' + filesize: {|e| + if $e == 0b { + '#e9e2cd' + } else if $e < 1mb { + '#309185' + } else {{ fg: '#2e78c1' }} + } + duration: '#e9e2cd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca1d2c' attr: 'b' } + } else if $in < 6hr { + '#ca1d2c' + } else if $in < 1day { + '#b7aa9a' + } else if $in < 3day { + '#edb7ab' + } else if $in < 1wk { + { fg: '#edb7ab' attr: 'b' } + } else if $in < 6wk { + '#309185' + } else if $in < 52wk { + '#2e78c1' + } else { 'dark_gray' } + } + range: '#e9e2cd' + float: '#e9e2cd' + string: '#e9e2cd' + nothing: '#e9e2cd' + binary: '#e9e2cd' + cellpath: '#e9e2cd' + row_index: { fg: '#edb7ab' attr: 'b' } + record: '#e9e2cd' + list: '#e9e2cd' + block: '#e9e2cd' + hints: 'dark_gray' + search_result: { fg: '#ca1d2c' bg: '#e9e2cd' } + + shape_and: { fg: '#c0226e' attr: 'b' } + shape_binary: { fg: '#c0226e' attr: 'b' } + shape_block: { fg: '#2e78c1' attr: 'b' } + shape_bool: '#81908f' + shape_custom: '#edb7ab' + shape_datetime: { fg: '#309185' attr: 'b' } + shape_directory: '#309185' + shape_external: '#309185' + shape_externalarg: { fg: '#edb7ab' attr: 'b' } + shape_filepath: '#309185' + shape_flag: { fg: '#2e78c1' attr: 'b' } + shape_float: { fg: '#c0226e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#309185' attr: 'b' } + shape_int: { fg: '#c0226e' attr: 'b' } + shape_internalcall: { fg: '#309185' attr: 'b' } + shape_list: { fg: '#309185' attr: 'b' } + shape_literal: '#2e78c1' + shape_match_pattern: '#edb7ab' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#81908f' + shape_operator: '#b7aa9a' + shape_or: { fg: '#c0226e' attr: 'b' } + shape_pipe: { fg: '#c0226e' attr: 'b' } + shape_range: { fg: '#b7aa9a' attr: 'b' } + shape_record: { fg: '#309185' attr: 'b' } + shape_redirection: { fg: '#c0226e' attr: 'b' } + shape_signature: { fg: '#edb7ab' attr: 'b' } + shape_string: '#edb7ab' + shape_string_interpolation: { fg: '#309185' attr: 'b' } + shape_table: { fg: '#2e78c1' attr: 'b' } + shape_variable: '#c0226e' + + background: '#282f32' + foreground: '#dad9df' + cursor: '#d35f5a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/fishtank.nu b/themes/nu-themes/fishtank.nu index a67b302..4cda439 100644 --- a/themes/nu-themes/fishtank.nu +++ b/themes/nu-themes/fishtank.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ecf0fc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#acf157" attr: "b" } - empty: "#525fb8" - bool: {|| if $in { "#a5bd86" } else { "light_gray" } } - int: "#ecf0fc" - filesize: {|e| - if $e == 0b { - "#ecf0fc" - } else if $e < 1mb { - "#968763" - } else {{ fg: "#525fb8" }} - } - duration: "#ecf0fc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c6004a" attr: "b" } - } else if $in < 6hr { - "#c6004a" - } else if $in < 1day { - "#fecd5e" - } else if $in < 3day { - "#acf157" - } else if $in < 1wk { - { fg: "#acf157" attr: "b" } - } else if $in < 6wk { - "#968763" - } else if $in < 52wk { - "#525fb8" - } else { "dark_gray" } - } - range: "#ecf0fc" - float: "#ecf0fc" - string: "#ecf0fc" - nothing: "#ecf0fc" - binary: "#ecf0fc" - cellpath: "#ecf0fc" - row_index: { fg: "#acf157" attr: "b" } - record: "#ecf0fc" - list: "#ecf0fc" - block: "#ecf0fc" - hints: "dark_gray" - search_result: { fg: "#c6004a" bg: "#ecf0fc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#986f82" attr: "b" } - shape_binary: { fg: "#986f82" attr: "b" } - shape_block: { fg: "#525fb8" attr: "b" } - shape_bool: "#a5bd86" - shape_custom: "#acf157" - shape_datetime: { fg: "#968763" attr: "b" } - shape_directory: "#968763" - shape_external: "#968763" - shape_externalarg: { fg: "#acf157" attr: "b" } - shape_filepath: "#968763" - shape_flag: { fg: "#525fb8" attr: "b" } - shape_float: { fg: "#986f82" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#968763" attr: "b" } - shape_int: { fg: "#986f82" attr: "b" } - shape_internalcall: { fg: "#968763" attr: "b" } - shape_list: { fg: "#968763" attr: "b" } - shape_literal: "#525fb8" - shape_match_pattern: "#acf157" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a5bd86" - shape_operator: "#fecd5e" - shape_or: { fg: "#986f82" attr: "b" } - shape_pipe: { fg: "#986f82" attr: "b" } - shape_range: { fg: "#fecd5e" attr: "b" } - shape_record: { fg: "#968763" attr: "b" } - shape_redirection: { fg: "#986f82" attr: "b" } - shape_signature: { fg: "#acf157" attr: "b" } - shape_string: "#acf157" - shape_string_interpolation: { fg: "#968763" attr: "b" } - shape_table: { fg: "#525fb8" attr: "b" } - shape_variable: "#986f82" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232537" - foreground: "#ecf0fe" - cursor: "#ecf0fe" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ecf0fc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#acf157' attr: 'b' } + empty: '#525fb8' + bool: {|| if $in { '#a5bd86' } else { 'light_gray' } } + int: '#ecf0fc' + filesize: {|e| + if $e == 0b { + '#ecf0fc' + } else if $e < 1mb { + '#968763' + } else {{ fg: '#525fb8' }} + } + duration: '#ecf0fc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c6004a' attr: 'b' } + } else if $in < 6hr { + '#c6004a' + } else if $in < 1day { + '#fecd5e' + } else if $in < 3day { + '#acf157' + } else if $in < 1wk { + { fg: '#acf157' attr: 'b' } + } else if $in < 6wk { + '#968763' + } else if $in < 52wk { + '#525fb8' + } else { 'dark_gray' } + } + range: '#ecf0fc' + float: '#ecf0fc' + string: '#ecf0fc' + nothing: '#ecf0fc' + binary: '#ecf0fc' + cellpath: '#ecf0fc' + row_index: { fg: '#acf157' attr: 'b' } + record: '#ecf0fc' + list: '#ecf0fc' + block: '#ecf0fc' + hints: 'dark_gray' + search_result: { fg: '#c6004a' bg: '#ecf0fc' } + + shape_and: { fg: '#986f82' attr: 'b' } + shape_binary: { fg: '#986f82' attr: 'b' } + shape_block: { fg: '#525fb8' attr: 'b' } + shape_bool: '#a5bd86' + shape_custom: '#acf157' + shape_datetime: { fg: '#968763' attr: 'b' } + shape_directory: '#968763' + shape_external: '#968763' + shape_externalarg: { fg: '#acf157' attr: 'b' } + shape_filepath: '#968763' + shape_flag: { fg: '#525fb8' attr: 'b' } + shape_float: { fg: '#986f82' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#968763' attr: 'b' } + shape_int: { fg: '#986f82' attr: 'b' } + shape_internalcall: { fg: '#968763' attr: 'b' } + shape_list: { fg: '#968763' attr: 'b' } + shape_literal: '#525fb8' + shape_match_pattern: '#acf157' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a5bd86' + shape_operator: '#fecd5e' + shape_or: { fg: '#986f82' attr: 'b' } + shape_pipe: { fg: '#986f82' attr: 'b' } + shape_range: { fg: '#fecd5e' attr: 'b' } + shape_record: { fg: '#968763' attr: 'b' } + shape_redirection: { fg: '#986f82' attr: 'b' } + shape_signature: { fg: '#acf157' attr: 'b' } + shape_string: '#acf157' + shape_string_interpolation: { fg: '#968763' attr: 'b' } + shape_table: { fg: '#525fb8' attr: 'b' } + shape_variable: '#986f82' + + background: '#232537' + foreground: '#ecf0fe' + cursor: '#ecf0fe' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/flat.nu b/themes/nu-themes/flat.nu index d5b6230..7165777 100644 --- a/themes/nu-themes/flat.nu +++ b/themes/nu-themes/flat.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0e0e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2ecc71" attr: "b" } - empty: "#3498db" - bool: {|| if $in { "#1abc9c" } else { "light_gray" } } - int: "#e0e0e0" - filesize: {|e| - if $e == 0b { - "#e0e0e0" - } else if $e < 1mb { - "#1abc9c" - } else {{ fg: "#3498db" }} - } - duration: "#e0e0e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e74c3c" attr: "b" } - } else if $in < 6hr { - "#e74c3c" - } else if $in < 1day { - "#f1c40f" - } else if $in < 3day { - "#2ecc71" - } else if $in < 1wk { - { fg: "#2ecc71" attr: "b" } - } else if $in < 6wk { - "#1abc9c" - } else if $in < 52wk { - "#3498db" - } else { "dark_gray" } - } - range: "#e0e0e0" - float: "#e0e0e0" - string: "#e0e0e0" - nothing: "#e0e0e0" - binary: "#e0e0e0" - cellpath: "#e0e0e0" - row_index: { fg: "#2ecc71" attr: "b" } - record: "#e0e0e0" - list: "#e0e0e0" - block: "#e0e0e0" - hints: "dark_gray" - search_result: { fg: "#e74c3c" bg: "#e0e0e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9b59b6" attr: "b" } - shape_binary: { fg: "#9b59b6" attr: "b" } - shape_block: { fg: "#3498db" attr: "b" } - shape_bool: "#1abc9c" - shape_custom: "#2ecc71" - shape_datetime: { fg: "#1abc9c" attr: "b" } - shape_directory: "#1abc9c" - shape_external: "#1abc9c" - shape_externalarg: { fg: "#2ecc71" attr: "b" } - shape_filepath: "#1abc9c" - shape_flag: { fg: "#3498db" attr: "b" } - shape_float: { fg: "#9b59b6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1abc9c" attr: "b" } - shape_int: { fg: "#9b59b6" attr: "b" } - shape_internalcall: { fg: "#1abc9c" attr: "b" } - shape_list: { fg: "#1abc9c" attr: "b" } - shape_literal: "#3498db" - shape_match_pattern: "#2ecc71" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1abc9c" - shape_operator: "#f1c40f" - shape_or: { fg: "#9b59b6" attr: "b" } - shape_pipe: { fg: "#9b59b6" attr: "b" } - shape_range: { fg: "#f1c40f" attr: "b" } - shape_record: { fg: "#1abc9c" attr: "b" } - shape_redirection: { fg: "#9b59b6" attr: "b" } - shape_signature: { fg: "#2ecc71" attr: "b" } - shape_string: "#2ecc71" - shape_string_interpolation: { fg: "#1abc9c" attr: "b" } - shape_table: { fg: "#3498db" attr: "b" } - shape_variable: "#9b59b6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2c3e50" - foreground: "#e0e0e0" - cursor: "#e0e0e0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0e0e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2ecc71' attr: 'b' } + empty: '#3498db' + bool: {|| if $in { '#1abc9c' } else { 'light_gray' } } + int: '#e0e0e0' + filesize: {|e| + if $e == 0b { + '#e0e0e0' + } else if $e < 1mb { + '#1abc9c' + } else {{ fg: '#3498db' }} + } + duration: '#e0e0e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e74c3c' attr: 'b' } + } else if $in < 6hr { + '#e74c3c' + } else if $in < 1day { + '#f1c40f' + } else if $in < 3day { + '#2ecc71' + } else if $in < 1wk { + { fg: '#2ecc71' attr: 'b' } + } else if $in < 6wk { + '#1abc9c' + } else if $in < 52wk { + '#3498db' + } else { 'dark_gray' } + } + range: '#e0e0e0' + float: '#e0e0e0' + string: '#e0e0e0' + nothing: '#e0e0e0' + binary: '#e0e0e0' + cellpath: '#e0e0e0' + row_index: { fg: '#2ecc71' attr: 'b' } + record: '#e0e0e0' + list: '#e0e0e0' + block: '#e0e0e0' + hints: 'dark_gray' + search_result: { fg: '#e74c3c' bg: '#e0e0e0' } + + shape_and: { fg: '#9b59b6' attr: 'b' } + shape_binary: { fg: '#9b59b6' attr: 'b' } + shape_block: { fg: '#3498db' attr: 'b' } + shape_bool: '#1abc9c' + shape_custom: '#2ecc71' + shape_datetime: { fg: '#1abc9c' attr: 'b' } + shape_directory: '#1abc9c' + shape_external: '#1abc9c' + shape_externalarg: { fg: '#2ecc71' attr: 'b' } + shape_filepath: '#1abc9c' + shape_flag: { fg: '#3498db' attr: 'b' } + shape_float: { fg: '#9b59b6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1abc9c' attr: 'b' } + shape_int: { fg: '#9b59b6' attr: 'b' } + shape_internalcall: { fg: '#1abc9c' attr: 'b' } + shape_list: { fg: '#1abc9c' attr: 'b' } + shape_literal: '#3498db' + shape_match_pattern: '#2ecc71' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1abc9c' + shape_operator: '#f1c40f' + shape_or: { fg: '#9b59b6' attr: 'b' } + shape_pipe: { fg: '#9b59b6' attr: 'b' } + shape_range: { fg: '#f1c40f' attr: 'b' } + shape_record: { fg: '#1abc9c' attr: 'b' } + shape_redirection: { fg: '#9b59b6' attr: 'b' } + shape_signature: { fg: '#2ecc71' attr: 'b' } + shape_string: '#2ecc71' + shape_string_interpolation: { fg: '#1abc9c' attr: 'b' } + shape_table: { fg: '#3498db' attr: 'b' } + shape_variable: '#9b59b6' + + background: '#2c3e50' + foreground: '#e0e0e0' + cursor: '#e0e0e0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/flatland.nu b/themes/nu-themes/flatland.nu index 6836afd..8aa00d1 100644 --- a/themes/nu-themes/flatland.nu +++ b/themes/nu-themes/flatland.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9fd364" attr: "b" } - empty: "#5096be" - bool: {|| if $in { "#d63865" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#d63865" - } else {{ fg: "#5096be" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f18339" attr: "b" } - } else if $in < 6hr { - "#f18339" - } else if $in < 1day { - "#f4ef6d" - } else if $in < 3day { - "#9fd364" - } else if $in < 1wk { - { fg: "#9fd364" attr: "b" } - } else if $in < 6wk { - "#d63865" - } else if $in < 52wk { - "#5096be" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#9fd364" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#f18339" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#695abc" attr: "b" } - shape_binary: { fg: "#695abc" attr: "b" } - shape_block: { fg: "#5096be" attr: "b" } - shape_bool: "#d63865" - shape_custom: "#9fd364" - shape_datetime: { fg: "#d63865" attr: "b" } - shape_directory: "#d63865" - shape_external: "#d63865" - shape_externalarg: { fg: "#9fd364" attr: "b" } - shape_filepath: "#d63865" - shape_flag: { fg: "#5096be" attr: "b" } - shape_float: { fg: "#695abc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#d63865" attr: "b" } - shape_int: { fg: "#695abc" attr: "b" } - shape_internalcall: { fg: "#d63865" attr: "b" } - shape_list: { fg: "#d63865" attr: "b" } - shape_literal: "#5096be" - shape_match_pattern: "#9fd364" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#d63865" - shape_operator: "#f4ef6d" - shape_or: { fg: "#695abc" attr: "b" } - shape_pipe: { fg: "#695abc" attr: "b" } - shape_range: { fg: "#f4ef6d" attr: "b" } - shape_record: { fg: "#d63865" attr: "b" } - shape_redirection: { fg: "#695abc" attr: "b" } - shape_signature: { fg: "#9fd364" attr: "b" } - shape_string: "#9fd364" - shape_string_interpolation: { fg: "#d63865" attr: "b" } - shape_table: { fg: "#5096be" attr: "b" } - shape_variable: "#695abc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d1f21" - foreground: "#b8dbef" - cursor: "#b8dbef" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9fd364' attr: 'b' } + empty: '#5096be' + bool: {|| if $in { '#d63865' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#d63865' + } else {{ fg: '#5096be' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f18339' attr: 'b' } + } else if $in < 6hr { + '#f18339' + } else if $in < 1day { + '#f4ef6d' + } else if $in < 3day { + '#9fd364' + } else if $in < 1wk { + { fg: '#9fd364' attr: 'b' } + } else if $in < 6wk { + '#d63865' + } else if $in < 52wk { + '#5096be' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#9fd364' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#f18339' bg: '#ffffff' } + + shape_and: { fg: '#695abc' attr: 'b' } + shape_binary: { fg: '#695abc' attr: 'b' } + shape_block: { fg: '#5096be' attr: 'b' } + shape_bool: '#d63865' + shape_custom: '#9fd364' + shape_datetime: { fg: '#d63865' attr: 'b' } + shape_directory: '#d63865' + shape_external: '#d63865' + shape_externalarg: { fg: '#9fd364' attr: 'b' } + shape_filepath: '#d63865' + shape_flag: { fg: '#5096be' attr: 'b' } + shape_float: { fg: '#695abc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#d63865' attr: 'b' } + shape_int: { fg: '#695abc' attr: 'b' } + shape_internalcall: { fg: '#d63865' attr: 'b' } + shape_list: { fg: '#d63865' attr: 'b' } + shape_literal: '#5096be' + shape_match_pattern: '#9fd364' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#d63865' + shape_operator: '#f4ef6d' + shape_or: { fg: '#695abc' attr: 'b' } + shape_pipe: { fg: '#695abc' attr: 'b' } + shape_range: { fg: '#f4ef6d' attr: 'b' } + shape_record: { fg: '#d63865' attr: 'b' } + shape_redirection: { fg: '#695abc' attr: 'b' } + shape_signature: { fg: '#9fd364' attr: 'b' } + shape_string: '#9fd364' + shape_string_interpolation: { fg: '#d63865' attr: 'b' } + shape_table: { fg: '#5096be' attr: 'b' } + shape_variable: '#695abc' + + background: '#1d1f21' + foreground: '#b8dbef' + cursor: '#b8dbef' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/floraverse.nu b/themes/nu-themes/floraverse.nu index a087f86..cfd4374 100644 --- a/themes/nu-themes/floraverse.nu +++ b/themes/nu-themes/floraverse.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f3e0b8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5d731a" attr: "b" } - empty: "#1d6da1" - bool: {|| if $in { "#62caa8" } else { "light_gray" } } - int: "#f3e0b8" - filesize: {|e| - if $e == 0b { - "#f3e0b8" - } else if $e < 1mb { - "#42a38c" - } else {{ fg: "#1d6da1" }} - } - duration: "#f3e0b8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#64002c" attr: "b" } - } else if $in < 6hr { - "#64002c" - } else if $in < 1day { - "#cd751c" - } else if $in < 3day { - "#5d731a" - } else if $in < 1wk { - { fg: "#5d731a" attr: "b" } - } else if $in < 6wk { - "#42a38c" - } else if $in < 52wk { - "#1d6da1" - } else { "dark_gray" } - } - range: "#f3e0b8" - float: "#f3e0b8" - string: "#f3e0b8" - nothing: "#f3e0b8" - binary: "#f3e0b8" - cellpath: "#f3e0b8" - row_index: { fg: "#5d731a" attr: "b" } - record: "#f3e0b8" - list: "#f3e0b8" - block: "#f3e0b8" - hints: "dark_gray" - search_result: { fg: "#64002c" bg: "#f3e0b8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b7077e" attr: "b" } - shape_binary: { fg: "#b7077e" attr: "b" } - shape_block: { fg: "#1d6da1" attr: "b" } - shape_bool: "#62caa8" - shape_custom: "#5d731a" - shape_datetime: { fg: "#42a38c" attr: "b" } - shape_directory: "#42a38c" - shape_external: "#42a38c" - shape_externalarg: { fg: "#5d731a" attr: "b" } - shape_filepath: "#42a38c" - shape_flag: { fg: "#1d6da1" attr: "b" } - shape_float: { fg: "#b7077e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#42a38c" attr: "b" } - shape_int: { fg: "#b7077e" attr: "b" } - shape_internalcall: { fg: "#42a38c" attr: "b" } - shape_list: { fg: "#42a38c" attr: "b" } - shape_literal: "#1d6da1" - shape_match_pattern: "#5d731a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#62caa8" - shape_operator: "#cd751c" - shape_or: { fg: "#b7077e" attr: "b" } - shape_pipe: { fg: "#b7077e" attr: "b" } - shape_range: { fg: "#cd751c" attr: "b" } - shape_record: { fg: "#42a38c" attr: "b" } - shape_redirection: { fg: "#b7077e" attr: "b" } - shape_signature: { fg: "#5d731a" attr: "b" } - shape_string: "#5d731a" - shape_string_interpolation: { fg: "#42a38c" attr: "b" } - shape_table: { fg: "#1d6da1" attr: "b" } - shape_variable: "#b7077e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0e0c15" - foreground: "#dbd0b9" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f3e0b8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5d731a' attr: 'b' } + empty: '#1d6da1' + bool: {|| if $in { '#62caa8' } else { 'light_gray' } } + int: '#f3e0b8' + filesize: {|e| + if $e == 0b { + '#f3e0b8' + } else if $e < 1mb { + '#42a38c' + } else {{ fg: '#1d6da1' }} + } + duration: '#f3e0b8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#64002c' attr: 'b' } + } else if $in < 6hr { + '#64002c' + } else if $in < 1day { + '#cd751c' + } else if $in < 3day { + '#5d731a' + } else if $in < 1wk { + { fg: '#5d731a' attr: 'b' } + } else if $in < 6wk { + '#42a38c' + } else if $in < 52wk { + '#1d6da1' + } else { 'dark_gray' } + } + range: '#f3e0b8' + float: '#f3e0b8' + string: '#f3e0b8' + nothing: '#f3e0b8' + binary: '#f3e0b8' + cellpath: '#f3e0b8' + row_index: { fg: '#5d731a' attr: 'b' } + record: '#f3e0b8' + list: '#f3e0b8' + block: '#f3e0b8' + hints: 'dark_gray' + search_result: { fg: '#64002c' bg: '#f3e0b8' } + + shape_and: { fg: '#b7077e' attr: 'b' } + shape_binary: { fg: '#b7077e' attr: 'b' } + shape_block: { fg: '#1d6da1' attr: 'b' } + shape_bool: '#62caa8' + shape_custom: '#5d731a' + shape_datetime: { fg: '#42a38c' attr: 'b' } + shape_directory: '#42a38c' + shape_external: '#42a38c' + shape_externalarg: { fg: '#5d731a' attr: 'b' } + shape_filepath: '#42a38c' + shape_flag: { fg: '#1d6da1' attr: 'b' } + shape_float: { fg: '#b7077e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#42a38c' attr: 'b' } + shape_int: { fg: '#b7077e' attr: 'b' } + shape_internalcall: { fg: '#42a38c' attr: 'b' } + shape_list: { fg: '#42a38c' attr: 'b' } + shape_literal: '#1d6da1' + shape_match_pattern: '#5d731a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#62caa8' + shape_operator: '#cd751c' + shape_or: { fg: '#b7077e' attr: 'b' } + shape_pipe: { fg: '#b7077e' attr: 'b' } + shape_range: { fg: '#cd751c' attr: 'b' } + shape_record: { fg: '#42a38c' attr: 'b' } + shape_redirection: { fg: '#b7077e' attr: 'b' } + shape_signature: { fg: '#5d731a' attr: 'b' } + shape_string: '#5d731a' + shape_string_interpolation: { fg: '#42a38c' attr: 'b' } + shape_table: { fg: '#1d6da1' attr: 'b' } + shape_variable: '#b7077e' + + background: '#0e0c15' + foreground: '#dbd0b9' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/forest-night.nu b/themes/nu-themes/forest-night.nu index 4a41ee8..745ade3 100644 --- a/themes/nu-themes/forest-night.nu +++ b/themes/nu-themes/forest-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffebc3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a9dd9d" attr: "b" } - empty: "#bdd0e5" - bool: {|| if $in { "#a9dd9d" } else { "light_gray" } } - int: "#ffebc3" - filesize: {|e| - if $e == 0b { - "#ffebc3" - } else if $e < 1mb { - "#a9dd9d" - } else {{ fg: "#bdd0e5" }} - } - duration: "#ffebc3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fd8489" attr: "b" } - } else if $in < 6hr { - "#fd8489" - } else if $in < 1day { - "#f0aa8a" - } else if $in < 3day { - "#a9dd9d" - } else if $in < 1wk { - { fg: "#a9dd9d" attr: "b" } - } else if $in < 6wk { - "#a9dd9d" - } else if $in < 52wk { - "#bdd0e5" - } else { "dark_gray" } - } - range: "#ffebc3" - float: "#ffebc3" - string: "#ffebc3" - nothing: "#ffebc3" - binary: "#ffebc3" - cellpath: "#ffebc3" - row_index: { fg: "#a9dd9d" attr: "b" } - record: "#ffebc3" - list: "#ffebc3" - block: "#ffebc3" - hints: "dark_gray" - search_result: { fg: "#fd8489" bg: "#ffebc3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#daccf0" attr: "b" } - shape_binary: { fg: "#daccf0" attr: "b" } - shape_block: { fg: "#bdd0e5" attr: "b" } - shape_bool: "#a9dd9d" - shape_custom: "#a9dd9d" - shape_datetime: { fg: "#a9dd9d" attr: "b" } - shape_directory: "#a9dd9d" - shape_external: "#a9dd9d" - shape_externalarg: { fg: "#a9dd9d" attr: "b" } - shape_filepath: "#a9dd9d" - shape_flag: { fg: "#bdd0e5" attr: "b" } - shape_float: { fg: "#daccf0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#a9dd9d" attr: "b" } - shape_int: { fg: "#daccf0" attr: "b" } - shape_internalcall: { fg: "#a9dd9d" attr: "b" } - shape_list: { fg: "#a9dd9d" attr: "b" } - shape_literal: "#bdd0e5" - shape_match_pattern: "#a9dd9d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a9dd9d" - shape_operator: "#f0aa8a" - shape_or: { fg: "#daccf0" attr: "b" } - shape_pipe: { fg: "#daccf0" attr: "b" } - shape_range: { fg: "#f0aa8a" attr: "b" } - shape_record: { fg: "#a9dd9d" attr: "b" } - shape_redirection: { fg: "#daccf0" attr: "b" } - shape_signature: { fg: "#a9dd9d" attr: "b" } - shape_string: "#a9dd9d" - shape_string_interpolation: { fg: "#a9dd9d" attr: "b" } - shape_table: { fg: "#bdd0e5" attr: "b" } - shape_variable: "#daccf0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3c4c55" - foreground: "#ffebc3" - cursor: "#ffebc3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffebc3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a9dd9d' attr: 'b' } + empty: '#bdd0e5' + bool: {|| if $in { '#a9dd9d' } else { 'light_gray' } } + int: '#ffebc3' + filesize: {|e| + if $e == 0b { + '#ffebc3' + } else if $e < 1mb { + '#a9dd9d' + } else {{ fg: '#bdd0e5' }} + } + duration: '#ffebc3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fd8489' attr: 'b' } + } else if $in < 6hr { + '#fd8489' + } else if $in < 1day { + '#f0aa8a' + } else if $in < 3day { + '#a9dd9d' + } else if $in < 1wk { + { fg: '#a9dd9d' attr: 'b' } + } else if $in < 6wk { + '#a9dd9d' + } else if $in < 52wk { + '#bdd0e5' + } else { 'dark_gray' } + } + range: '#ffebc3' + float: '#ffebc3' + string: '#ffebc3' + nothing: '#ffebc3' + binary: '#ffebc3' + cellpath: '#ffebc3' + row_index: { fg: '#a9dd9d' attr: 'b' } + record: '#ffebc3' + list: '#ffebc3' + block: '#ffebc3' + hints: 'dark_gray' + search_result: { fg: '#fd8489' bg: '#ffebc3' } + + shape_and: { fg: '#daccf0' attr: 'b' } + shape_binary: { fg: '#daccf0' attr: 'b' } + shape_block: { fg: '#bdd0e5' attr: 'b' } + shape_bool: '#a9dd9d' + shape_custom: '#a9dd9d' + shape_datetime: { fg: '#a9dd9d' attr: 'b' } + shape_directory: '#a9dd9d' + shape_external: '#a9dd9d' + shape_externalarg: { fg: '#a9dd9d' attr: 'b' } + shape_filepath: '#a9dd9d' + shape_flag: { fg: '#bdd0e5' attr: 'b' } + shape_float: { fg: '#daccf0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#a9dd9d' attr: 'b' } + shape_int: { fg: '#daccf0' attr: 'b' } + shape_internalcall: { fg: '#a9dd9d' attr: 'b' } + shape_list: { fg: '#a9dd9d' attr: 'b' } + shape_literal: '#bdd0e5' + shape_match_pattern: '#a9dd9d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a9dd9d' + shape_operator: '#f0aa8a' + shape_or: { fg: '#daccf0' attr: 'b' } + shape_pipe: { fg: '#daccf0' attr: 'b' } + shape_range: { fg: '#f0aa8a' attr: 'b' } + shape_record: { fg: '#a9dd9d' attr: 'b' } + shape_redirection: { fg: '#daccf0' attr: 'b' } + shape_signature: { fg: '#a9dd9d' attr: 'b' } + shape_string: '#a9dd9d' + shape_string_interpolation: { fg: '#a9dd9d' attr: 'b' } + shape_table: { fg: '#bdd0e5' attr: 'b' } + shape_variable: '#daccf0' + + background: '#3c4c55' + foreground: '#ffebc3' + cursor: '#ffebc3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/foxnightly.nu b/themes/nu-themes/foxnightly.nu index b196ee2..5681f59 100644 --- a/themes/nu-themes/foxnightly.nu +++ b/themes/nu-themes/foxnightly.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ff7de9" attr: "b" } - empty: "#66a05b" - bool: {|| if $in { "#c4a000" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#acacae" - } else {{ fg: "#66a05b" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b98eff" attr: "b" } - } else if $in < 6hr { - "#b98eff" - } else if $in < 1day { - "#729fcf" - } else if $in < 3day { - "#ff7de9" - } else if $in < 1wk { - { fg: "#ff7de9" attr: "b" } - } else if $in < 6wk { - "#acacae" - } else if $in < 52wk { - "#66a05b" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#ff7de9" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#b98eff" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#75507b" attr: "b" } - shape_binary: { fg: "#75507b" attr: "b" } - shape_block: { fg: "#66a05b" attr: "b" } - shape_bool: "#c4a000" - shape_custom: "#ff7de9" - shape_datetime: { fg: "#acacae" attr: "b" } - shape_directory: "#acacae" - shape_external: "#acacae" - shape_externalarg: { fg: "#ff7de9" attr: "b" } - shape_filepath: "#acacae" - shape_flag: { fg: "#66a05b" attr: "b" } - shape_float: { fg: "#75507b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#acacae" attr: "b" } - shape_int: { fg: "#75507b" attr: "b" } - shape_internalcall: { fg: "#acacae" attr: "b" } - shape_list: { fg: "#acacae" attr: "b" } - shape_literal: "#66a05b" - shape_match_pattern: "#ff7de9" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c4a000" - shape_operator: "#729fcf" - shape_or: { fg: "#75507b" attr: "b" } - shape_pipe: { fg: "#75507b" attr: "b" } - shape_range: { fg: "#729fcf" attr: "b" } - shape_record: { fg: "#acacae" attr: "b" } - shape_redirection: { fg: "#75507b" attr: "b" } - shape_signature: { fg: "#ff7de9" attr: "b" } - shape_string: "#ff7de9" - shape_string_interpolation: { fg: "#acacae" attr: "b" } - shape_table: { fg: "#66a05b" attr: "b" } - shape_variable: "#75507b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a2a2e" - foreground: "#d7d7db" - cursor: "#d7d7db" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ff7de9' attr: 'b' } + empty: '#66a05b' + bool: {|| if $in { '#c4a000' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#acacae' + } else {{ fg: '#66a05b' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b98eff' attr: 'b' } + } else if $in < 6hr { + '#b98eff' + } else if $in < 1day { + '#729fcf' + } else if $in < 3day { + '#ff7de9' + } else if $in < 1wk { + { fg: '#ff7de9' attr: 'b' } + } else if $in < 6wk { + '#acacae' + } else if $in < 52wk { + '#66a05b' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#ff7de9' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#b98eff' bg: '#ffffff' } + + shape_and: { fg: '#75507b' attr: 'b' } + shape_binary: { fg: '#75507b' attr: 'b' } + shape_block: { fg: '#66a05b' attr: 'b' } + shape_bool: '#c4a000' + shape_custom: '#ff7de9' + shape_datetime: { fg: '#acacae' attr: 'b' } + shape_directory: '#acacae' + shape_external: '#acacae' + shape_externalarg: { fg: '#ff7de9' attr: 'b' } + shape_filepath: '#acacae' + shape_flag: { fg: '#66a05b' attr: 'b' } + shape_float: { fg: '#75507b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#acacae' attr: 'b' } + shape_int: { fg: '#75507b' attr: 'b' } + shape_internalcall: { fg: '#acacae' attr: 'b' } + shape_list: { fg: '#acacae' attr: 'b' } + shape_literal: '#66a05b' + shape_match_pattern: '#ff7de9' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c4a000' + shape_operator: '#729fcf' + shape_or: { fg: '#75507b' attr: 'b' } + shape_pipe: { fg: '#75507b' attr: 'b' } + shape_range: { fg: '#729fcf' attr: 'b' } + shape_record: { fg: '#acacae' attr: 'b' } + shape_redirection: { fg: '#75507b' attr: 'b' } + shape_signature: { fg: '#ff7de9' attr: 'b' } + shape_string: '#ff7de9' + shape_string_interpolation: { fg: '#acacae' attr: 'b' } + shape_table: { fg: '#66a05b' attr: 'b' } + shape_variable: '#75507b' + + background: '#2a2a2e' + foreground: '#d7d7db' + cursor: '#d7d7db' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/framer.nu b/themes/nu-themes/framer.nu index c65a029..607f047 100644 --- a/themes/nu-themes/framer.nu +++ b/themes/nu-themes/framer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#32ccdc" attr: "b" } - empty: "#20bcfc" - bool: {|| if $in { "#acddfd" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#acddfd" - } else {{ fg: "#20bcfc" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fd886b" attr: "b" } - } else if $in < 6hr { - "#fd886b" - } else if $in < 1day { - "#fecb6e" - } else if $in < 3day { - "#32ccdc" - } else if $in < 1wk { - { fg: "#32ccdc" attr: "b" } - } else if $in < 6wk { - "#acddfd" - } else if $in < 52wk { - "#20bcfc" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#32ccdc" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#fd886b" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ba8cfc" attr: "b" } - shape_binary: { fg: "#ba8cfc" attr: "b" } - shape_block: { fg: "#20bcfc" attr: "b" } - shape_bool: "#acddfd" - shape_custom: "#32ccdc" - shape_datetime: { fg: "#acddfd" attr: "b" } - shape_directory: "#acddfd" - shape_external: "#acddfd" - shape_externalarg: { fg: "#32ccdc" attr: "b" } - shape_filepath: "#acddfd" - shape_flag: { fg: "#20bcfc" attr: "b" } - shape_float: { fg: "#ba8cfc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#acddfd" attr: "b" } - shape_int: { fg: "#ba8cfc" attr: "b" } - shape_internalcall: { fg: "#acddfd" attr: "b" } - shape_list: { fg: "#acddfd" attr: "b" } - shape_literal: "#20bcfc" - shape_match_pattern: "#32ccdc" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#acddfd" - shape_operator: "#fecb6e" - shape_or: { fg: "#ba8cfc" attr: "b" } - shape_pipe: { fg: "#ba8cfc" attr: "b" } - shape_range: { fg: "#fecb6e" attr: "b" } - shape_record: { fg: "#acddfd" attr: "b" } - shape_redirection: { fg: "#ba8cfc" attr: "b" } - shape_signature: { fg: "#32ccdc" attr: "b" } - shape_string: "#32ccdc" - shape_string_interpolation: { fg: "#acddfd" attr: "b" } - shape_table: { fg: "#20bcfc" attr: "b" } - shape_variable: "#ba8cfc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#181818" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#32ccdc' attr: 'b' } + empty: '#20bcfc' + bool: {|| if $in { '#acddfd' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#acddfd' + } else {{ fg: '#20bcfc' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fd886b' attr: 'b' } + } else if $in < 6hr { + '#fd886b' + } else if $in < 1day { + '#fecb6e' + } else if $in < 3day { + '#32ccdc' + } else if $in < 1wk { + { fg: '#32ccdc' attr: 'b' } + } else if $in < 6wk { + '#acddfd' + } else if $in < 52wk { + '#20bcfc' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#32ccdc' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#fd886b' bg: '#d0d0d0' } + + shape_and: { fg: '#ba8cfc' attr: 'b' } + shape_binary: { fg: '#ba8cfc' attr: 'b' } + shape_block: { fg: '#20bcfc' attr: 'b' } + shape_bool: '#acddfd' + shape_custom: '#32ccdc' + shape_datetime: { fg: '#acddfd' attr: 'b' } + shape_directory: '#acddfd' + shape_external: '#acddfd' + shape_externalarg: { fg: '#32ccdc' attr: 'b' } + shape_filepath: '#acddfd' + shape_flag: { fg: '#20bcfc' attr: 'b' } + shape_float: { fg: '#ba8cfc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#acddfd' attr: 'b' } + shape_int: { fg: '#ba8cfc' attr: 'b' } + shape_internalcall: { fg: '#acddfd' attr: 'b' } + shape_list: { fg: '#acddfd' attr: 'b' } + shape_literal: '#20bcfc' + shape_match_pattern: '#32ccdc' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#acddfd' + shape_operator: '#fecb6e' + shape_or: { fg: '#ba8cfc' attr: 'b' } + shape_pipe: { fg: '#ba8cfc' attr: 'b' } + shape_range: { fg: '#fecb6e' attr: 'b' } + shape_record: { fg: '#acddfd' attr: 'b' } + shape_redirection: { fg: '#ba8cfc' attr: 'b' } + shape_signature: { fg: '#32ccdc' attr: 'b' } + shape_string: '#32ccdc' + shape_string_interpolation: { fg: '#acddfd' attr: 'b' } + shape_table: { fg: '#20bcfc' attr: 'b' } + shape_variable: '#ba8cfc' + + background: '#181818' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/freya.nu b/themes/nu-themes/freya.nu index f0e173a..a786944 100644 --- a/themes/nu-themes/freya.nu +++ b/themes/nu-themes/freya.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#94a3a5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#859900" attr: "b" } - empty: "#268bd2" - bool: {|| if $in { "#2aa198" } else { "light_gray" } } - int: "#94a3a5" - filesize: {|e| - if $e == 0b { - "#94a3a5" - } else if $e < 1mb { - "#2aa198" - } else {{ fg: "#268bd2" }} - } - duration: "#94a3a5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dc322f" attr: "b" } - } else if $in < 6hr { - "#dc322f" - } else if $in < 1day { - "#b58900" - } else if $in < 3day { - "#859900" - } else if $in < 1wk { - { fg: "#859900" attr: "b" } - } else if $in < 6wk { - "#2aa198" - } else if $in < 52wk { - "#268bd2" - } else { "dark_gray" } - } - range: "#94a3a5" - float: "#94a3a5" - string: "#94a3a5" - nothing: "#94a3a5" - binary: "#94a3a5" - cellpath: "#94a3a5" - row_index: { fg: "#859900" attr: "b" } - record: "#94a3a5" - list: "#94a3a5" - block: "#94a3a5" - hints: "dark_gray" - search_result: { fg: "#dc322f" bg: "#94a3a5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ec0048" attr: "b" } - shape_binary: { fg: "#ec0048" attr: "b" } - shape_block: { fg: "#268bd2" attr: "b" } - shape_bool: "#2aa198" - shape_custom: "#859900" - shape_datetime: { fg: "#2aa198" attr: "b" } - shape_directory: "#2aa198" - shape_external: "#2aa198" - shape_externalarg: { fg: "#859900" attr: "b" } - shape_filepath: "#2aa198" - shape_flag: { fg: "#268bd2" attr: "b" } - shape_float: { fg: "#ec0048" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2aa198" attr: "b" } - shape_int: { fg: "#ec0048" attr: "b" } - shape_internalcall: { fg: "#2aa198" attr: "b" } - shape_list: { fg: "#2aa198" attr: "b" } - shape_literal: "#268bd2" - shape_match_pattern: "#859900" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2aa198" - shape_operator: "#b58900" - shape_or: { fg: "#ec0048" attr: "b" } - shape_pipe: { fg: "#ec0048" attr: "b" } - shape_range: { fg: "#b58900" attr: "b" } - shape_record: { fg: "#2aa198" attr: "b" } - shape_redirection: { fg: "#ec0048" attr: "b" } - shape_signature: { fg: "#859900" attr: "b" } - shape_string: "#859900" - shape_string_interpolation: { fg: "#2aa198" attr: "b" } - shape_table: { fg: "#268bd2" attr: "b" } - shape_variable: "#ec0048" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#252e32" - foreground: "#94a3a5" - cursor: "#839496" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#94a3a5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#859900' attr: 'b' } + empty: '#268bd2' + bool: {|| if $in { '#2aa198' } else { 'light_gray' } } + int: '#94a3a5' + filesize: {|e| + if $e == 0b { + '#94a3a5' + } else if $e < 1mb { + '#2aa198' + } else {{ fg: '#268bd2' }} + } + duration: '#94a3a5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dc322f' attr: 'b' } + } else if $in < 6hr { + '#dc322f' + } else if $in < 1day { + '#b58900' + } else if $in < 3day { + '#859900' + } else if $in < 1wk { + { fg: '#859900' attr: 'b' } + } else if $in < 6wk { + '#2aa198' + } else if $in < 52wk { + '#268bd2' + } else { 'dark_gray' } + } + range: '#94a3a5' + float: '#94a3a5' + string: '#94a3a5' + nothing: '#94a3a5' + binary: '#94a3a5' + cellpath: '#94a3a5' + row_index: { fg: '#859900' attr: 'b' } + record: '#94a3a5' + list: '#94a3a5' + block: '#94a3a5' + hints: 'dark_gray' + search_result: { fg: '#dc322f' bg: '#94a3a5' } + + shape_and: { fg: '#ec0048' attr: 'b' } + shape_binary: { fg: '#ec0048' attr: 'b' } + shape_block: { fg: '#268bd2' attr: 'b' } + shape_bool: '#2aa198' + shape_custom: '#859900' + shape_datetime: { fg: '#2aa198' attr: 'b' } + shape_directory: '#2aa198' + shape_external: '#2aa198' + shape_externalarg: { fg: '#859900' attr: 'b' } + shape_filepath: '#2aa198' + shape_flag: { fg: '#268bd2' attr: 'b' } + shape_float: { fg: '#ec0048' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2aa198' attr: 'b' } + shape_int: { fg: '#ec0048' attr: 'b' } + shape_internalcall: { fg: '#2aa198' attr: 'b' } + shape_list: { fg: '#2aa198' attr: 'b' } + shape_literal: '#268bd2' + shape_match_pattern: '#859900' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2aa198' + shape_operator: '#b58900' + shape_or: { fg: '#ec0048' attr: 'b' } + shape_pipe: { fg: '#ec0048' attr: 'b' } + shape_range: { fg: '#b58900' attr: 'b' } + shape_record: { fg: '#2aa198' attr: 'b' } + shape_redirection: { fg: '#ec0048' attr: 'b' } + shape_signature: { fg: '#859900' attr: 'b' } + shape_string: '#859900' + shape_string_interpolation: { fg: '#2aa198' attr: 'b' } + shape_table: { fg: '#268bd2' attr: 'b' } + shape_variable: '#ec0048' + + background: '#252e32' + foreground: '#94a3a5' + cursor: '#839496' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/frontend-delight.nu b/themes/nu-themes/frontend-delight.nu index 80a8962..39a214c 100644 --- a/themes/nu-themes/frontend-delight.nu +++ b/themes/nu-themes/frontend-delight.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#adadad" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#565747" attr: "b" } - empty: "#2c70b7" - bool: {|| if $in { "#4fbce6" } else { "light_gray" } } - int: "#adadad" - filesize: {|e| - if $e == 0b { - "#adadad" - } else if $e < 1mb { - "#3ca1a6" - } else {{ fg: "#2c70b7" }} - } - duration: "#adadad" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f8511b" attr: "b" } - } else if $in < 6hr { - "#f8511b" - } else if $in < 1day { - "#fa771d" - } else if $in < 3day { - "#565747" - } else if $in < 1wk { - { fg: "#565747" attr: "b" } - } else if $in < 6wk { - "#3ca1a6" - } else if $in < 52wk { - "#2c70b7" - } else { "dark_gray" } - } - range: "#adadad" - float: "#adadad" - string: "#adadad" - nothing: "#adadad" - binary: "#adadad" - cellpath: "#adadad" - row_index: { fg: "#565747" attr: "b" } - record: "#adadad" - list: "#adadad" - block: "#adadad" - hints: "dark_gray" - search_result: { fg: "#f8511b" bg: "#adadad" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f02e4f" attr: "b" } - shape_binary: { fg: "#f02e4f" attr: "b" } - shape_block: { fg: "#2c70b7" attr: "b" } - shape_bool: "#4fbce6" - shape_custom: "#565747" - shape_datetime: { fg: "#3ca1a6" attr: "b" } - shape_directory: "#3ca1a6" - shape_external: "#3ca1a6" - shape_externalarg: { fg: "#565747" attr: "b" } - shape_filepath: "#3ca1a6" - shape_flag: { fg: "#2c70b7" attr: "b" } - shape_float: { fg: "#f02e4f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3ca1a6" attr: "b" } - shape_int: { fg: "#f02e4f" attr: "b" } - shape_internalcall: { fg: "#3ca1a6" attr: "b" } - shape_list: { fg: "#3ca1a6" attr: "b" } - shape_literal: "#2c70b7" - shape_match_pattern: "#565747" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4fbce6" - shape_operator: "#fa771d" - shape_or: { fg: "#f02e4f" attr: "b" } - shape_pipe: { fg: "#f02e4f" attr: "b" } - shape_range: { fg: "#fa771d" attr: "b" } - shape_record: { fg: "#3ca1a6" attr: "b" } - shape_redirection: { fg: "#f02e4f" attr: "b" } - shape_signature: { fg: "#565747" attr: "b" } - shape_string: "#565747" - shape_string_interpolation: { fg: "#3ca1a6" attr: "b" } - shape_table: { fg: "#2c70b7" attr: "b" } - shape_variable: "#f02e4f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1c1d" - foreground: "#adadad" - cursor: "#adadad" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#adadad' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#565747' attr: 'b' } + empty: '#2c70b7' + bool: {|| if $in { '#4fbce6' } else { 'light_gray' } } + int: '#adadad' + filesize: {|e| + if $e == 0b { + '#adadad' + } else if $e < 1mb { + '#3ca1a6' + } else {{ fg: '#2c70b7' }} + } + duration: '#adadad' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f8511b' attr: 'b' } + } else if $in < 6hr { + '#f8511b' + } else if $in < 1day { + '#fa771d' + } else if $in < 3day { + '#565747' + } else if $in < 1wk { + { fg: '#565747' attr: 'b' } + } else if $in < 6wk { + '#3ca1a6' + } else if $in < 52wk { + '#2c70b7' + } else { 'dark_gray' } + } + range: '#adadad' + float: '#adadad' + string: '#adadad' + nothing: '#adadad' + binary: '#adadad' + cellpath: '#adadad' + row_index: { fg: '#565747' attr: 'b' } + record: '#adadad' + list: '#adadad' + block: '#adadad' + hints: 'dark_gray' + search_result: { fg: '#f8511b' bg: '#adadad' } + + shape_and: { fg: '#f02e4f' attr: 'b' } + shape_binary: { fg: '#f02e4f' attr: 'b' } + shape_block: { fg: '#2c70b7' attr: 'b' } + shape_bool: '#4fbce6' + shape_custom: '#565747' + shape_datetime: { fg: '#3ca1a6' attr: 'b' } + shape_directory: '#3ca1a6' + shape_external: '#3ca1a6' + shape_externalarg: { fg: '#565747' attr: 'b' } + shape_filepath: '#3ca1a6' + shape_flag: { fg: '#2c70b7' attr: 'b' } + shape_float: { fg: '#f02e4f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3ca1a6' attr: 'b' } + shape_int: { fg: '#f02e4f' attr: 'b' } + shape_internalcall: { fg: '#3ca1a6' attr: 'b' } + shape_list: { fg: '#3ca1a6' attr: 'b' } + shape_literal: '#2c70b7' + shape_match_pattern: '#565747' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4fbce6' + shape_operator: '#fa771d' + shape_or: { fg: '#f02e4f' attr: 'b' } + shape_pipe: { fg: '#f02e4f' attr: 'b' } + shape_range: { fg: '#fa771d' attr: 'b' } + shape_record: { fg: '#3ca1a6' attr: 'b' } + shape_redirection: { fg: '#f02e4f' attr: 'b' } + shape_signature: { fg: '#565747' attr: 'b' } + shape_string: '#565747' + shape_string_interpolation: { fg: '#3ca1a6' attr: 'b' } + shape_table: { fg: '#2c70b7' attr: 'b' } + shape_variable: '#f02e4f' + + background: '#1b1c1d' + foreground: '#adadad' + cursor: '#adadad' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/frontend-fun-forrest.nu b/themes/nu-themes/frontend-fun-forrest.nu index a9369c3..7e6a170 100644 --- a/themes/nu-themes/frontend-fun-forrest.nu +++ b/themes/nu-themes/frontend-fun-forrest.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ddc265" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#919c00" attr: "b" } - empty: "#4699a3" - bool: {|| if $in { "#e6a96b" } else { "light_gray" } } - int: "#ddc265" - filesize: {|e| - if $e == 0b { - "#ddc265" - } else if $e < 1mb { - "#da8213" - } else {{ fg: "#4699a3" }} - } - duration: "#ddc265" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d6262b" attr: "b" } - } else if $in < 6hr { - "#d6262b" - } else if $in < 1day { - "#be8a13" - } else if $in < 3day { - "#919c00" - } else if $in < 1wk { - { fg: "#919c00" attr: "b" } - } else if $in < 6wk { - "#da8213" - } else if $in < 52wk { - "#4699a3" - } else { "dark_gray" } - } - range: "#ddc265" - float: "#ddc265" - string: "#ddc265" - nothing: "#ddc265" - binary: "#ddc265" - cellpath: "#ddc265" - row_index: { fg: "#919c00" attr: "b" } - record: "#ddc265" - list: "#ddc265" - block: "#ddc265" - hints: "dark_gray" - search_result: { fg: "#d6262b" bg: "#ddc265" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8d4331" attr: "b" } - shape_binary: { fg: "#8d4331" attr: "b" } - shape_block: { fg: "#4699a3" attr: "b" } - shape_bool: "#e6a96b" - shape_custom: "#919c00" - shape_datetime: { fg: "#da8213" attr: "b" } - shape_directory: "#da8213" - shape_external: "#da8213" - shape_externalarg: { fg: "#919c00" attr: "b" } - shape_filepath: "#da8213" - shape_flag: { fg: "#4699a3" attr: "b" } - shape_float: { fg: "#8d4331" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#da8213" attr: "b" } - shape_int: { fg: "#8d4331" attr: "b" } - shape_internalcall: { fg: "#da8213" attr: "b" } - shape_list: { fg: "#da8213" attr: "b" } - shape_literal: "#4699a3" - shape_match_pattern: "#919c00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#e6a96b" - shape_operator: "#be8a13" - shape_or: { fg: "#8d4331" attr: "b" } - shape_pipe: { fg: "#8d4331" attr: "b" } - shape_range: { fg: "#be8a13" attr: "b" } - shape_record: { fg: "#da8213" attr: "b" } - shape_redirection: { fg: "#8d4331" attr: "b" } - shape_signature: { fg: "#919c00" attr: "b" } - shape_string: "#919c00" - shape_string_interpolation: { fg: "#da8213" attr: "b" } - shape_table: { fg: "#4699a3" attr: "b" } - shape_variable: "#8d4331" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#251200" - foreground: "#dec165" - cursor: "#dec165" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ddc265' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#919c00' attr: 'b' } + empty: '#4699a3' + bool: {|| if $in { '#e6a96b' } else { 'light_gray' } } + int: '#ddc265' + filesize: {|e| + if $e == 0b { + '#ddc265' + } else if $e < 1mb { + '#da8213' + } else {{ fg: '#4699a3' }} + } + duration: '#ddc265' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d6262b' attr: 'b' } + } else if $in < 6hr { + '#d6262b' + } else if $in < 1day { + '#be8a13' + } else if $in < 3day { + '#919c00' + } else if $in < 1wk { + { fg: '#919c00' attr: 'b' } + } else if $in < 6wk { + '#da8213' + } else if $in < 52wk { + '#4699a3' + } else { 'dark_gray' } + } + range: '#ddc265' + float: '#ddc265' + string: '#ddc265' + nothing: '#ddc265' + binary: '#ddc265' + cellpath: '#ddc265' + row_index: { fg: '#919c00' attr: 'b' } + record: '#ddc265' + list: '#ddc265' + block: '#ddc265' + hints: 'dark_gray' + search_result: { fg: '#d6262b' bg: '#ddc265' } + + shape_and: { fg: '#8d4331' attr: 'b' } + shape_binary: { fg: '#8d4331' attr: 'b' } + shape_block: { fg: '#4699a3' attr: 'b' } + shape_bool: '#e6a96b' + shape_custom: '#919c00' + shape_datetime: { fg: '#da8213' attr: 'b' } + shape_directory: '#da8213' + shape_external: '#da8213' + shape_externalarg: { fg: '#919c00' attr: 'b' } + shape_filepath: '#da8213' + shape_flag: { fg: '#4699a3' attr: 'b' } + shape_float: { fg: '#8d4331' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#da8213' attr: 'b' } + shape_int: { fg: '#8d4331' attr: 'b' } + shape_internalcall: { fg: '#da8213' attr: 'b' } + shape_list: { fg: '#da8213' attr: 'b' } + shape_literal: '#4699a3' + shape_match_pattern: '#919c00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#e6a96b' + shape_operator: '#be8a13' + shape_or: { fg: '#8d4331' attr: 'b' } + shape_pipe: { fg: '#8d4331' attr: 'b' } + shape_range: { fg: '#be8a13' attr: 'b' } + shape_record: { fg: '#da8213' attr: 'b' } + shape_redirection: { fg: '#8d4331' attr: 'b' } + shape_signature: { fg: '#919c00' attr: 'b' } + shape_string: '#919c00' + shape_string_interpolation: { fg: '#da8213' attr: 'b' } + shape_table: { fg: '#4699a3' attr: 'b' } + shape_variable: '#8d4331' + + background: '#251200' + foreground: '#dec165' + cursor: '#dec165' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/frontend-galaxy.nu b/themes/nu-themes/frontend-galaxy.nu index 33f175f..31bb237 100644 --- a/themes/nu-themes/frontend-galaxy.nu +++ b/themes/nu-themes/frontend-galaxy.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#21b089" attr: "b" } - empty: "#589df6" - bool: {|| if $in { "#3979bc" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#1f9ee7" - } else {{ fg: "#589df6" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f9555f" attr: "b" } - } else if $in < 6hr { - "#f9555f" - } else if $in < 1day { - "#fef02a" - } else if $in < 3day { - "#21b089" - } else if $in < 1wk { - { fg: "#21b089" attr: "b" } - } else if $in < 6wk { - "#1f9ee7" - } else if $in < 52wk { - "#589df6" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#21b089" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#f9555f" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#944d95" attr: "b" } - shape_binary: { fg: "#944d95" attr: "b" } - shape_block: { fg: "#589df6" attr: "b" } - shape_bool: "#3979bc" - shape_custom: "#21b089" - shape_datetime: { fg: "#1f9ee7" attr: "b" } - shape_directory: "#1f9ee7" - shape_external: "#1f9ee7" - shape_externalarg: { fg: "#21b089" attr: "b" } - shape_filepath: "#1f9ee7" - shape_flag: { fg: "#589df6" attr: "b" } - shape_float: { fg: "#944d95" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1f9ee7" attr: "b" } - shape_int: { fg: "#944d95" attr: "b" } - shape_internalcall: { fg: "#1f9ee7" attr: "b" } - shape_list: { fg: "#1f9ee7" attr: "b" } - shape_literal: "#589df6" - shape_match_pattern: "#21b089" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3979bc" - shape_operator: "#fef02a" - shape_or: { fg: "#944d95" attr: "b" } - shape_pipe: { fg: "#944d95" attr: "b" } - shape_range: { fg: "#fef02a" attr: "b" } - shape_record: { fg: "#1f9ee7" attr: "b" } - shape_redirection: { fg: "#944d95" attr: "b" } - shape_signature: { fg: "#21b089" attr: "b" } - shape_string: "#21b089" - shape_string_interpolation: { fg: "#1f9ee7" attr: "b" } - shape_table: { fg: "#589df6" attr: "b" } - shape_variable: "#944d95" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2837" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#21b089' attr: 'b' } + empty: '#589df6' + bool: {|| if $in { '#3979bc' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#1f9ee7' + } else {{ fg: '#589df6' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f9555f' attr: 'b' } + } else if $in < 6hr { + '#f9555f' + } else if $in < 1day { + '#fef02a' + } else if $in < 3day { + '#21b089' + } else if $in < 1wk { + { fg: '#21b089' attr: 'b' } + } else if $in < 6wk { + '#1f9ee7' + } else if $in < 52wk { + '#589df6' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#21b089' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#f9555f' bg: '#bbbbbb' } + + shape_and: { fg: '#944d95' attr: 'b' } + shape_binary: { fg: '#944d95' attr: 'b' } + shape_block: { fg: '#589df6' attr: 'b' } + shape_bool: '#3979bc' + shape_custom: '#21b089' + shape_datetime: { fg: '#1f9ee7' attr: 'b' } + shape_directory: '#1f9ee7' + shape_external: '#1f9ee7' + shape_externalarg: { fg: '#21b089' attr: 'b' } + shape_filepath: '#1f9ee7' + shape_flag: { fg: '#589df6' attr: 'b' } + shape_float: { fg: '#944d95' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1f9ee7' attr: 'b' } + shape_int: { fg: '#944d95' attr: 'b' } + shape_internalcall: { fg: '#1f9ee7' attr: 'b' } + shape_list: { fg: '#1f9ee7' attr: 'b' } + shape_literal: '#589df6' + shape_match_pattern: '#21b089' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3979bc' + shape_operator: '#fef02a' + shape_or: { fg: '#944d95' attr: 'b' } + shape_pipe: { fg: '#944d95' attr: 'b' } + shape_range: { fg: '#fef02a' attr: 'b' } + shape_record: { fg: '#1f9ee7' attr: 'b' } + shape_redirection: { fg: '#944d95' attr: 'b' } + shape_signature: { fg: '#21b089' attr: 'b' } + shape_string: '#21b089' + shape_string_interpolation: { fg: '#1f9ee7' attr: 'b' } + shape_table: { fg: '#589df6' attr: 'b' } + shape_variable: '#944d95' + + background: '#1d2837' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/fruit-soda.nu b/themes/nu-themes/fruit-soda.nu index 5887642..8926e23 100644 --- a/themes/nu-themes/fruit-soda.nu +++ b/themes/nu-themes/fruit-soda.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#515151" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#47f74c" attr: "b" } - empty: "#2931df" - bool: {|| if $in { "#0f9cfd" } else { "light_gray" } } - int: "#515151" - filesize: {|e| - if $e == 0b { - "#515151" - } else if $e < 1mb { - "#0f9cfd" - } else {{ fg: "#2931df" }} - } - duration: "#515151" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fe3e31" attr: "b" } - } else if $in < 6hr { - "#fe3e31" - } else if $in < 1day { - "#f7e203" - } else if $in < 3day { - "#47f74c" - } else if $in < 1wk { - { fg: "#47f74c" attr: "b" } - } else if $in < 6wk { - "#0f9cfd" - } else if $in < 52wk { - "#2931df" - } else { "dark_gray" } - } - range: "#515151" - float: "#515151" - string: "#515151" - nothing: "#515151" - binary: "#515151" - cellpath: "#515151" - row_index: { fg: "#47f74c" attr: "b" } - record: "#515151" - list: "#515151" - block: "#515151" - hints: "dark_gray" - search_result: { fg: "#fe3e31" bg: "#515151" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#611fce" attr: "b" } - shape_binary: { fg: "#611fce" attr: "b" } - shape_block: { fg: "#2931df" attr: "b" } - shape_bool: "#0f9cfd" - shape_custom: "#47f74c" - shape_datetime: { fg: "#0f9cfd" attr: "b" } - shape_directory: "#0f9cfd" - shape_external: "#0f9cfd" - shape_externalarg: { fg: "#47f74c" attr: "b" } - shape_filepath: "#0f9cfd" - shape_flag: { fg: "#2931df" attr: "b" } - shape_float: { fg: "#611fce" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0f9cfd" attr: "b" } - shape_int: { fg: "#611fce" attr: "b" } - shape_internalcall: { fg: "#0f9cfd" attr: "b" } - shape_list: { fg: "#0f9cfd" attr: "b" } - shape_literal: "#2931df" - shape_match_pattern: "#47f74c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0f9cfd" - shape_operator: "#f7e203" - shape_or: { fg: "#611fce" attr: "b" } - shape_pipe: { fg: "#611fce" attr: "b" } - shape_range: { fg: "#f7e203" attr: "b" } - shape_record: { fg: "#0f9cfd" attr: "b" } - shape_redirection: { fg: "#611fce" attr: "b" } - shape_signature: { fg: "#47f74c" attr: "b" } - shape_string: "#47f74c" - shape_string_interpolation: { fg: "#0f9cfd" attr: "b" } - shape_table: { fg: "#2931df" attr: "b" } - shape_variable: "#611fce" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f1ecf1" - foreground: "#515151" - cursor: "#515151" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#515151' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#47f74c' attr: 'b' } + empty: '#2931df' + bool: {|| if $in { '#0f9cfd' } else { 'light_gray' } } + int: '#515151' + filesize: {|e| + if $e == 0b { + '#515151' + } else if $e < 1mb { + '#0f9cfd' + } else {{ fg: '#2931df' }} + } + duration: '#515151' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fe3e31' attr: 'b' } + } else if $in < 6hr { + '#fe3e31' + } else if $in < 1day { + '#f7e203' + } else if $in < 3day { + '#47f74c' + } else if $in < 1wk { + { fg: '#47f74c' attr: 'b' } + } else if $in < 6wk { + '#0f9cfd' + } else if $in < 52wk { + '#2931df' + } else { 'dark_gray' } + } + range: '#515151' + float: '#515151' + string: '#515151' + nothing: '#515151' + binary: '#515151' + cellpath: '#515151' + row_index: { fg: '#47f74c' attr: 'b' } + record: '#515151' + list: '#515151' + block: '#515151' + hints: 'dark_gray' + search_result: { fg: '#fe3e31' bg: '#515151' } + + shape_and: { fg: '#611fce' attr: 'b' } + shape_binary: { fg: '#611fce' attr: 'b' } + shape_block: { fg: '#2931df' attr: 'b' } + shape_bool: '#0f9cfd' + shape_custom: '#47f74c' + shape_datetime: { fg: '#0f9cfd' attr: 'b' } + shape_directory: '#0f9cfd' + shape_external: '#0f9cfd' + shape_externalarg: { fg: '#47f74c' attr: 'b' } + shape_filepath: '#0f9cfd' + shape_flag: { fg: '#2931df' attr: 'b' } + shape_float: { fg: '#611fce' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0f9cfd' attr: 'b' } + shape_int: { fg: '#611fce' attr: 'b' } + shape_internalcall: { fg: '#0f9cfd' attr: 'b' } + shape_list: { fg: '#0f9cfd' attr: 'b' } + shape_literal: '#2931df' + shape_match_pattern: '#47f74c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0f9cfd' + shape_operator: '#f7e203' + shape_or: { fg: '#611fce' attr: 'b' } + shape_pipe: { fg: '#611fce' attr: 'b' } + shape_range: { fg: '#f7e203' attr: 'b' } + shape_record: { fg: '#0f9cfd' attr: 'b' } + shape_redirection: { fg: '#611fce' attr: 'b' } + shape_signature: { fg: '#47f74c' attr: 'b' } + shape_string: '#47f74c' + shape_string_interpolation: { fg: '#0f9cfd' attr: 'b' } + shape_table: { fg: '#2931df' attr: 'b' } + shape_variable: '#611fce' + + background: '#f1ecf1' + foreground: '#515151' + cursor: '#515151' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gigavolt.nu b/themes/nu-themes/gigavolt.nu index 5b27b87..5b97d38 100644 --- a/themes/nu-themes/gigavolt.nu +++ b/themes/nu-themes/gigavolt.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e9e7e1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#f2e6a9" attr: "b" } - empty: "#40bfff" - bool: {|| if $in { "#fb6acb" } else { "light_gray" } } - int: "#e9e7e1" - filesize: {|e| - if $e == 0b { - "#e9e7e1" - } else if $e < 1mb { - "#fb6acb" - } else {{ fg: "#40bfff" }} - } - duration: "#e9e7e1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff661a" attr: "b" } - } else if $in < 6hr { - "#ff661a" - } else if $in < 1day { - "#ffdc2d" - } else if $in < 3day { - "#f2e6a9" - } else if $in < 1wk { - { fg: "#f2e6a9" attr: "b" } - } else if $in < 6wk { - "#fb6acb" - } else if $in < 52wk { - "#40bfff" - } else { "dark_gray" } - } - range: "#e9e7e1" - float: "#e9e7e1" - string: "#e9e7e1" - nothing: "#e9e7e1" - binary: "#e9e7e1" - cellpath: "#e9e7e1" - row_index: { fg: "#f2e6a9" attr: "b" } - record: "#e9e7e1" - list: "#e9e7e1" - block: "#e9e7e1" - hints: "dark_gray" - search_result: { fg: "#ff661a" bg: "#e9e7e1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ae94f9" attr: "b" } - shape_binary: { fg: "#ae94f9" attr: "b" } - shape_block: { fg: "#40bfff" attr: "b" } - shape_bool: "#fb6acb" - shape_custom: "#f2e6a9" - shape_datetime: { fg: "#fb6acb" attr: "b" } - shape_directory: "#fb6acb" - shape_external: "#fb6acb" - shape_externalarg: { fg: "#f2e6a9" attr: "b" } - shape_filepath: "#fb6acb" - shape_flag: { fg: "#40bfff" attr: "b" } - shape_float: { fg: "#ae94f9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#fb6acb" attr: "b" } - shape_int: { fg: "#ae94f9" attr: "b" } - shape_internalcall: { fg: "#fb6acb" attr: "b" } - shape_list: { fg: "#fb6acb" attr: "b" } - shape_literal: "#40bfff" - shape_match_pattern: "#f2e6a9" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#fb6acb" - shape_operator: "#ffdc2d" - shape_or: { fg: "#ae94f9" attr: "b" } - shape_pipe: { fg: "#ae94f9" attr: "b" } - shape_range: { fg: "#ffdc2d" attr: "b" } - shape_record: { fg: "#fb6acb" attr: "b" } - shape_redirection: { fg: "#ae94f9" attr: "b" } - shape_signature: { fg: "#f2e6a9" attr: "b" } - shape_string: "#f2e6a9" - shape_string_interpolation: { fg: "#fb6acb" attr: "b" } - shape_table: { fg: "#40bfff" attr: "b" } - shape_variable: "#ae94f9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#202126" - foreground: "#e9e7e1" - cursor: "#e9e7e1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e9e7e1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#f2e6a9' attr: 'b' } + empty: '#40bfff' + bool: {|| if $in { '#fb6acb' } else { 'light_gray' } } + int: '#e9e7e1' + filesize: {|e| + if $e == 0b { + '#e9e7e1' + } else if $e < 1mb { + '#fb6acb' + } else {{ fg: '#40bfff' }} + } + duration: '#e9e7e1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff661a' attr: 'b' } + } else if $in < 6hr { + '#ff661a' + } else if $in < 1day { + '#ffdc2d' + } else if $in < 3day { + '#f2e6a9' + } else if $in < 1wk { + { fg: '#f2e6a9' attr: 'b' } + } else if $in < 6wk { + '#fb6acb' + } else if $in < 52wk { + '#40bfff' + } else { 'dark_gray' } + } + range: '#e9e7e1' + float: '#e9e7e1' + string: '#e9e7e1' + nothing: '#e9e7e1' + binary: '#e9e7e1' + cellpath: '#e9e7e1' + row_index: { fg: '#f2e6a9' attr: 'b' } + record: '#e9e7e1' + list: '#e9e7e1' + block: '#e9e7e1' + hints: 'dark_gray' + search_result: { fg: '#ff661a' bg: '#e9e7e1' } + + shape_and: { fg: '#ae94f9' attr: 'b' } + shape_binary: { fg: '#ae94f9' attr: 'b' } + shape_block: { fg: '#40bfff' attr: 'b' } + shape_bool: '#fb6acb' + shape_custom: '#f2e6a9' + shape_datetime: { fg: '#fb6acb' attr: 'b' } + shape_directory: '#fb6acb' + shape_external: '#fb6acb' + shape_externalarg: { fg: '#f2e6a9' attr: 'b' } + shape_filepath: '#fb6acb' + shape_flag: { fg: '#40bfff' attr: 'b' } + shape_float: { fg: '#ae94f9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#fb6acb' attr: 'b' } + shape_int: { fg: '#ae94f9' attr: 'b' } + shape_internalcall: { fg: '#fb6acb' attr: 'b' } + shape_list: { fg: '#fb6acb' attr: 'b' } + shape_literal: '#40bfff' + shape_match_pattern: '#f2e6a9' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#fb6acb' + shape_operator: '#ffdc2d' + shape_or: { fg: '#ae94f9' attr: 'b' } + shape_pipe: { fg: '#ae94f9' attr: 'b' } + shape_range: { fg: '#ffdc2d' attr: 'b' } + shape_record: { fg: '#fb6acb' attr: 'b' } + shape_redirection: { fg: '#ae94f9' attr: 'b' } + shape_signature: { fg: '#f2e6a9' attr: 'b' } + shape_string: '#f2e6a9' + shape_string_interpolation: { fg: '#fb6acb' attr: 'b' } + shape_table: { fg: '#40bfff' attr: 'b' } + shape_variable: '#ae94f9' + + background: '#202126' + foreground: '#e9e7e1' + cursor: '#e9e7e1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-dark-colorblind.nu b/themes/nu-themes/github-dark-colorblind.nu index ceb0a28..fe178a4 100644 --- a/themes/nu-themes/github-dark-colorblind.nu +++ b/themes/nu-themes/github-dark-colorblind.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b1bac4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3fb950" attr: "b" } - empty: "#58a6ff" - bool: {|| if $in { "#56d4dd" } else { "light_gray" } } - int: "#b1bac4" - filesize: {|e| - if $e == 0b { - "#b1bac4" - } else if $e < 1mb { - "#39c5cf" - } else {{ fg: "#58a6ff" }} - } - duration: "#b1bac4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff7b72" attr: "b" } - } else if $in < 6hr { - "#ff7b72" - } else if $in < 1day { - "#d29922" - } else if $in < 3day { - "#3fb950" - } else if $in < 1wk { - { fg: "#3fb950" attr: "b" } - } else if $in < 6wk { - "#39c5cf" - } else if $in < 52wk { - "#58a6ff" - } else { "dark_gray" } - } - range: "#b1bac4" - float: "#b1bac4" - string: "#b1bac4" - nothing: "#b1bac4" - binary: "#b1bac4" - cellpath: "#b1bac4" - row_index: { fg: "#3fb950" attr: "b" } - record: "#b1bac4" - list: "#b1bac4" - block: "#b1bac4" - hints: "dark_gray" - search_result: { fg: "#ff7b72" bg: "#b1bac4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bc8cff" attr: "b" } - shape_binary: { fg: "#bc8cff" attr: "b" } - shape_block: { fg: "#58a6ff" attr: "b" } - shape_bool: "#56d4dd" - shape_custom: "#3fb950" - shape_datetime: { fg: "#39c5cf" attr: "b" } - shape_directory: "#39c5cf" - shape_external: "#39c5cf" - shape_externalarg: { fg: "#3fb950" attr: "b" } - shape_filepath: "#39c5cf" - shape_flag: { fg: "#58a6ff" attr: "b" } - shape_float: { fg: "#bc8cff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#39c5cf" attr: "b" } - shape_int: { fg: "#bc8cff" attr: "b" } - shape_internalcall: { fg: "#39c5cf" attr: "b" } - shape_list: { fg: "#39c5cf" attr: "b" } - shape_literal: "#58a6ff" - shape_match_pattern: "#3fb950" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56d4dd" - shape_operator: "#d29922" - shape_or: { fg: "#bc8cff" attr: "b" } - shape_pipe: { fg: "#bc8cff" attr: "b" } - shape_range: { fg: "#d29922" attr: "b" } - shape_record: { fg: "#39c5cf" attr: "b" } - shape_redirection: { fg: "#bc8cff" attr: "b" } - shape_signature: { fg: "#3fb950" attr: "b" } - shape_string: "#3fb950" - shape_string_interpolation: { fg: "#39c5cf" attr: "b" } - shape_table: { fg: "#58a6ff" attr: "b" } - shape_variable: "#bc8cff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0d1117" - foreground: "#b3b1ad" - cursor: "#73b7f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b1bac4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3fb950' attr: 'b' } + empty: '#58a6ff' + bool: {|| if $in { '#56d4dd' } else { 'light_gray' } } + int: '#b1bac4' + filesize: {|e| + if $e == 0b { + '#b1bac4' + } else if $e < 1mb { + '#39c5cf' + } else {{ fg: '#58a6ff' }} + } + duration: '#b1bac4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff7b72' attr: 'b' } + } else if $in < 6hr { + '#ff7b72' + } else if $in < 1day { + '#d29922' + } else if $in < 3day { + '#3fb950' + } else if $in < 1wk { + { fg: '#3fb950' attr: 'b' } + } else if $in < 6wk { + '#39c5cf' + } else if $in < 52wk { + '#58a6ff' + } else { 'dark_gray' } + } + range: '#b1bac4' + float: '#b1bac4' + string: '#b1bac4' + nothing: '#b1bac4' + binary: '#b1bac4' + cellpath: '#b1bac4' + row_index: { fg: '#3fb950' attr: 'b' } + record: '#b1bac4' + list: '#b1bac4' + block: '#b1bac4' + hints: 'dark_gray' + search_result: { fg: '#ff7b72' bg: '#b1bac4' } + + shape_and: { fg: '#bc8cff' attr: 'b' } + shape_binary: { fg: '#bc8cff' attr: 'b' } + shape_block: { fg: '#58a6ff' attr: 'b' } + shape_bool: '#56d4dd' + shape_custom: '#3fb950' + shape_datetime: { fg: '#39c5cf' attr: 'b' } + shape_directory: '#39c5cf' + shape_external: '#39c5cf' + shape_externalarg: { fg: '#3fb950' attr: 'b' } + shape_filepath: '#39c5cf' + shape_flag: { fg: '#58a6ff' attr: 'b' } + shape_float: { fg: '#bc8cff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#39c5cf' attr: 'b' } + shape_int: { fg: '#bc8cff' attr: 'b' } + shape_internalcall: { fg: '#39c5cf' attr: 'b' } + shape_list: { fg: '#39c5cf' attr: 'b' } + shape_literal: '#58a6ff' + shape_match_pattern: '#3fb950' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56d4dd' + shape_operator: '#d29922' + shape_or: { fg: '#bc8cff' attr: 'b' } + shape_pipe: { fg: '#bc8cff' attr: 'b' } + shape_range: { fg: '#d29922' attr: 'b' } + shape_record: { fg: '#39c5cf' attr: 'b' } + shape_redirection: { fg: '#bc8cff' attr: 'b' } + shape_signature: { fg: '#3fb950' attr: 'b' } + shape_string: '#3fb950' + shape_string_interpolation: { fg: '#39c5cf' attr: 'b' } + shape_table: { fg: '#58a6ff' attr: 'b' } + shape_variable: '#bc8cff' + + background: '#0d1117' + foreground: '#b3b1ad' + cursor: '#73b7f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-dark-default.nu b/themes/nu-themes/github-dark-default.nu index ceb0a28..fe178a4 100644 --- a/themes/nu-themes/github-dark-default.nu +++ b/themes/nu-themes/github-dark-default.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b1bac4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3fb950" attr: "b" } - empty: "#58a6ff" - bool: {|| if $in { "#56d4dd" } else { "light_gray" } } - int: "#b1bac4" - filesize: {|e| - if $e == 0b { - "#b1bac4" - } else if $e < 1mb { - "#39c5cf" - } else {{ fg: "#58a6ff" }} - } - duration: "#b1bac4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff7b72" attr: "b" } - } else if $in < 6hr { - "#ff7b72" - } else if $in < 1day { - "#d29922" - } else if $in < 3day { - "#3fb950" - } else if $in < 1wk { - { fg: "#3fb950" attr: "b" } - } else if $in < 6wk { - "#39c5cf" - } else if $in < 52wk { - "#58a6ff" - } else { "dark_gray" } - } - range: "#b1bac4" - float: "#b1bac4" - string: "#b1bac4" - nothing: "#b1bac4" - binary: "#b1bac4" - cellpath: "#b1bac4" - row_index: { fg: "#3fb950" attr: "b" } - record: "#b1bac4" - list: "#b1bac4" - block: "#b1bac4" - hints: "dark_gray" - search_result: { fg: "#ff7b72" bg: "#b1bac4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bc8cff" attr: "b" } - shape_binary: { fg: "#bc8cff" attr: "b" } - shape_block: { fg: "#58a6ff" attr: "b" } - shape_bool: "#56d4dd" - shape_custom: "#3fb950" - shape_datetime: { fg: "#39c5cf" attr: "b" } - shape_directory: "#39c5cf" - shape_external: "#39c5cf" - shape_externalarg: { fg: "#3fb950" attr: "b" } - shape_filepath: "#39c5cf" - shape_flag: { fg: "#58a6ff" attr: "b" } - shape_float: { fg: "#bc8cff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#39c5cf" attr: "b" } - shape_int: { fg: "#bc8cff" attr: "b" } - shape_internalcall: { fg: "#39c5cf" attr: "b" } - shape_list: { fg: "#39c5cf" attr: "b" } - shape_literal: "#58a6ff" - shape_match_pattern: "#3fb950" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56d4dd" - shape_operator: "#d29922" - shape_or: { fg: "#bc8cff" attr: "b" } - shape_pipe: { fg: "#bc8cff" attr: "b" } - shape_range: { fg: "#d29922" attr: "b" } - shape_record: { fg: "#39c5cf" attr: "b" } - shape_redirection: { fg: "#bc8cff" attr: "b" } - shape_signature: { fg: "#3fb950" attr: "b" } - shape_string: "#3fb950" - shape_string_interpolation: { fg: "#39c5cf" attr: "b" } - shape_table: { fg: "#58a6ff" attr: "b" } - shape_variable: "#bc8cff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0d1117" - foreground: "#b3b1ad" - cursor: "#73b7f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b1bac4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3fb950' attr: 'b' } + empty: '#58a6ff' + bool: {|| if $in { '#56d4dd' } else { 'light_gray' } } + int: '#b1bac4' + filesize: {|e| + if $e == 0b { + '#b1bac4' + } else if $e < 1mb { + '#39c5cf' + } else {{ fg: '#58a6ff' }} + } + duration: '#b1bac4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff7b72' attr: 'b' } + } else if $in < 6hr { + '#ff7b72' + } else if $in < 1day { + '#d29922' + } else if $in < 3day { + '#3fb950' + } else if $in < 1wk { + { fg: '#3fb950' attr: 'b' } + } else if $in < 6wk { + '#39c5cf' + } else if $in < 52wk { + '#58a6ff' + } else { 'dark_gray' } + } + range: '#b1bac4' + float: '#b1bac4' + string: '#b1bac4' + nothing: '#b1bac4' + binary: '#b1bac4' + cellpath: '#b1bac4' + row_index: { fg: '#3fb950' attr: 'b' } + record: '#b1bac4' + list: '#b1bac4' + block: '#b1bac4' + hints: 'dark_gray' + search_result: { fg: '#ff7b72' bg: '#b1bac4' } + + shape_and: { fg: '#bc8cff' attr: 'b' } + shape_binary: { fg: '#bc8cff' attr: 'b' } + shape_block: { fg: '#58a6ff' attr: 'b' } + shape_bool: '#56d4dd' + shape_custom: '#3fb950' + shape_datetime: { fg: '#39c5cf' attr: 'b' } + shape_directory: '#39c5cf' + shape_external: '#39c5cf' + shape_externalarg: { fg: '#3fb950' attr: 'b' } + shape_filepath: '#39c5cf' + shape_flag: { fg: '#58a6ff' attr: 'b' } + shape_float: { fg: '#bc8cff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#39c5cf' attr: 'b' } + shape_int: { fg: '#bc8cff' attr: 'b' } + shape_internalcall: { fg: '#39c5cf' attr: 'b' } + shape_list: { fg: '#39c5cf' attr: 'b' } + shape_literal: '#58a6ff' + shape_match_pattern: '#3fb950' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56d4dd' + shape_operator: '#d29922' + shape_or: { fg: '#bc8cff' attr: 'b' } + shape_pipe: { fg: '#bc8cff' attr: 'b' } + shape_range: { fg: '#d29922' attr: 'b' } + shape_record: { fg: '#39c5cf' attr: 'b' } + shape_redirection: { fg: '#bc8cff' attr: 'b' } + shape_signature: { fg: '#3fb950' attr: 'b' } + shape_string: '#3fb950' + shape_string_interpolation: { fg: '#39c5cf' attr: 'b' } + shape_table: { fg: '#58a6ff' attr: 'b' } + shape_variable: '#bc8cff' + + background: '#0d1117' + foreground: '#b3b1ad' + cursor: '#73b7f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-dark.nu b/themes/nu-themes/github-dark.nu index 496c4d2..45d35bb 100644 --- a/themes/nu-themes/github-dark.nu +++ b/themes/nu-themes/github-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d1d5da" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#34d058" attr: "b" } - empty: "#2188ff" - bool: {|| if $in { "#56d4dd" } else { "light_gray" } } - int: "#d1d5da" - filesize: {|e| - if $e == 0b { - "#d1d5da" - } else if $e < 1mb { - "#39c5cf" - } else {{ fg: "#2188ff" }} - } - duration: "#d1d5da" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ea4a5a" attr: "b" } - } else if $in < 6hr { - "#ea4a5a" - } else if $in < 1day { - "#ffea7f" - } else if $in < 3day { - "#34d058" - } else if $in < 1wk { - { fg: "#34d058" attr: "b" } - } else if $in < 6wk { - "#39c5cf" - } else if $in < 52wk { - "#2188ff" - } else { "dark_gray" } - } - range: "#d1d5da" - float: "#d1d5da" - string: "#d1d5da" - nothing: "#d1d5da" - binary: "#d1d5da" - cellpath: "#d1d5da" - row_index: { fg: "#34d058" attr: "b" } - record: "#d1d5da" - list: "#d1d5da" - block: "#d1d5da" - hints: "dark_gray" - search_result: { fg: "#ea4a5a" bg: "#d1d5da" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b392f0" attr: "b" } - shape_binary: { fg: "#b392f0" attr: "b" } - shape_block: { fg: "#2188ff" attr: "b" } - shape_bool: "#56d4dd" - shape_custom: "#34d058" - shape_datetime: { fg: "#39c5cf" attr: "b" } - shape_directory: "#39c5cf" - shape_external: "#39c5cf" - shape_externalarg: { fg: "#34d058" attr: "b" } - shape_filepath: "#39c5cf" - shape_flag: { fg: "#2188ff" attr: "b" } - shape_float: { fg: "#b392f0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#39c5cf" attr: "b" } - shape_int: { fg: "#b392f0" attr: "b" } - shape_internalcall: { fg: "#39c5cf" attr: "b" } - shape_list: { fg: "#39c5cf" attr: "b" } - shape_literal: "#2188ff" - shape_match_pattern: "#34d058" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56d4dd" - shape_operator: "#ffea7f" - shape_or: { fg: "#b392f0" attr: "b" } - shape_pipe: { fg: "#b392f0" attr: "b" } - shape_range: { fg: "#ffea7f" attr: "b" } - shape_record: { fg: "#39c5cf" attr: "b" } - shape_redirection: { fg: "#b392f0" attr: "b" } - shape_signature: { fg: "#34d058" attr: "b" } - shape_string: "#34d058" - shape_string_interpolation: { fg: "#39c5cf" attr: "b" } - shape_table: { fg: "#2188ff" attr: "b" } - shape_variable: "#b392f0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#24292e" - foreground: "#d1d5da" - cursor: "#c8e1ff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d1d5da' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#34d058' attr: 'b' } + empty: '#2188ff' + bool: {|| if $in { '#56d4dd' } else { 'light_gray' } } + int: '#d1d5da' + filesize: {|e| + if $e == 0b { + '#d1d5da' + } else if $e < 1mb { + '#39c5cf' + } else {{ fg: '#2188ff' }} + } + duration: '#d1d5da' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ea4a5a' attr: 'b' } + } else if $in < 6hr { + '#ea4a5a' + } else if $in < 1day { + '#ffea7f' + } else if $in < 3day { + '#34d058' + } else if $in < 1wk { + { fg: '#34d058' attr: 'b' } + } else if $in < 6wk { + '#39c5cf' + } else if $in < 52wk { + '#2188ff' + } else { 'dark_gray' } + } + range: '#d1d5da' + float: '#d1d5da' + string: '#d1d5da' + nothing: '#d1d5da' + binary: '#d1d5da' + cellpath: '#d1d5da' + row_index: { fg: '#34d058' attr: 'b' } + record: '#d1d5da' + list: '#d1d5da' + block: '#d1d5da' + hints: 'dark_gray' + search_result: { fg: '#ea4a5a' bg: '#d1d5da' } + + shape_and: { fg: '#b392f0' attr: 'b' } + shape_binary: { fg: '#b392f0' attr: 'b' } + shape_block: { fg: '#2188ff' attr: 'b' } + shape_bool: '#56d4dd' + shape_custom: '#34d058' + shape_datetime: { fg: '#39c5cf' attr: 'b' } + shape_directory: '#39c5cf' + shape_external: '#39c5cf' + shape_externalarg: { fg: '#34d058' attr: 'b' } + shape_filepath: '#39c5cf' + shape_flag: { fg: '#2188ff' attr: 'b' } + shape_float: { fg: '#b392f0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#39c5cf' attr: 'b' } + shape_int: { fg: '#b392f0' attr: 'b' } + shape_internalcall: { fg: '#39c5cf' attr: 'b' } + shape_list: { fg: '#39c5cf' attr: 'b' } + shape_literal: '#2188ff' + shape_match_pattern: '#34d058' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56d4dd' + shape_operator: '#ffea7f' + shape_or: { fg: '#b392f0' attr: 'b' } + shape_pipe: { fg: '#b392f0' attr: 'b' } + shape_range: { fg: '#ffea7f' attr: 'b' } + shape_record: { fg: '#39c5cf' attr: 'b' } + shape_redirection: { fg: '#b392f0' attr: 'b' } + shape_signature: { fg: '#34d058' attr: 'b' } + shape_string: '#34d058' + shape_string_interpolation: { fg: '#39c5cf' attr: 'b' } + shape_table: { fg: '#2188ff' attr: 'b' } + shape_variable: '#b392f0' + + background: '#24292e' + foreground: '#d1d5da' + cursor: '#c8e1ff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-dimmed.nu b/themes/nu-themes/github-dimmed.nu index 0cd2d8b..3982517 100644 --- a/themes/nu-themes/github-dimmed.nu +++ b/themes/nu-themes/github-dimmed.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#909dab" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#57ab5a" attr: "b" } - empty: "#539bf5" - bool: {|| if $in { "#56d4dd" } else { "light_gray" } } - int: "#909dab" - filesize: {|e| - if $e == 0b { - "#909dab" - } else if $e < 1mb { - "#39c5cf" - } else {{ fg: "#539bf5" }} - } - duration: "#909dab" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f47067" attr: "b" } - } else if $in < 6hr { - "#f47067" - } else if $in < 1day { - "#c69026" - } else if $in < 3day { - "#57ab5a" - } else if $in < 1wk { - { fg: "#57ab5a" attr: "b" } - } else if $in < 6wk { - "#39c5cf" - } else if $in < 52wk { - "#539bf5" - } else { "dark_gray" } - } - range: "#909dab" - float: "#909dab" - string: "#909dab" - nothing: "#909dab" - binary: "#909dab" - cellpath: "#909dab" - row_index: { fg: "#57ab5a" attr: "b" } - record: "#909dab" - list: "#909dab" - block: "#909dab" - hints: "dark_gray" - search_result: { fg: "#f47067" bg: "#909dab" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b083f0" attr: "b" } - shape_binary: { fg: "#b083f0" attr: "b" } - shape_block: { fg: "#539bf5" attr: "b" } - shape_bool: "#56d4dd" - shape_custom: "#57ab5a" - shape_datetime: { fg: "#39c5cf" attr: "b" } - shape_directory: "#39c5cf" - shape_external: "#39c5cf" - shape_externalarg: { fg: "#57ab5a" attr: "b" } - shape_filepath: "#39c5cf" - shape_flag: { fg: "#539bf5" attr: "b" } - shape_float: { fg: "#b083f0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#39c5cf" attr: "b" } - shape_int: { fg: "#b083f0" attr: "b" } - shape_internalcall: { fg: "#39c5cf" attr: "b" } - shape_list: { fg: "#39c5cf" attr: "b" } - shape_literal: "#539bf5" - shape_match_pattern: "#57ab5a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56d4dd" - shape_operator: "#c69026" - shape_or: { fg: "#b083f0" attr: "b" } - shape_pipe: { fg: "#b083f0" attr: "b" } - shape_range: { fg: "#c69026" attr: "b" } - shape_record: { fg: "#39c5cf" attr: "b" } - shape_redirection: { fg: "#b083f0" attr: "b" } - shape_signature: { fg: "#57ab5a" attr: "b" } - shape_string: "#57ab5a" - shape_string_interpolation: { fg: "#39c5cf" attr: "b" } - shape_table: { fg: "#539bf5" attr: "b" } - shape_variable: "#b083f0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#22272e" - foreground: "#768390" - cursor: "#6cb6ff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#909dab' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#57ab5a' attr: 'b' } + empty: '#539bf5' + bool: {|| if $in { '#56d4dd' } else { 'light_gray' } } + int: '#909dab' + filesize: {|e| + if $e == 0b { + '#909dab' + } else if $e < 1mb { + '#39c5cf' + } else {{ fg: '#539bf5' }} + } + duration: '#909dab' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f47067' attr: 'b' } + } else if $in < 6hr { + '#f47067' + } else if $in < 1day { + '#c69026' + } else if $in < 3day { + '#57ab5a' + } else if $in < 1wk { + { fg: '#57ab5a' attr: 'b' } + } else if $in < 6wk { + '#39c5cf' + } else if $in < 52wk { + '#539bf5' + } else { 'dark_gray' } + } + range: '#909dab' + float: '#909dab' + string: '#909dab' + nothing: '#909dab' + binary: '#909dab' + cellpath: '#909dab' + row_index: { fg: '#57ab5a' attr: 'b' } + record: '#909dab' + list: '#909dab' + block: '#909dab' + hints: 'dark_gray' + search_result: { fg: '#f47067' bg: '#909dab' } + + shape_and: { fg: '#b083f0' attr: 'b' } + shape_binary: { fg: '#b083f0' attr: 'b' } + shape_block: { fg: '#539bf5' attr: 'b' } + shape_bool: '#56d4dd' + shape_custom: '#57ab5a' + shape_datetime: { fg: '#39c5cf' attr: 'b' } + shape_directory: '#39c5cf' + shape_external: '#39c5cf' + shape_externalarg: { fg: '#57ab5a' attr: 'b' } + shape_filepath: '#39c5cf' + shape_flag: { fg: '#539bf5' attr: 'b' } + shape_float: { fg: '#b083f0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#39c5cf' attr: 'b' } + shape_int: { fg: '#b083f0' attr: 'b' } + shape_internalcall: { fg: '#39c5cf' attr: 'b' } + shape_list: { fg: '#39c5cf' attr: 'b' } + shape_literal: '#539bf5' + shape_match_pattern: '#57ab5a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56d4dd' + shape_operator: '#c69026' + shape_or: { fg: '#b083f0' attr: 'b' } + shape_pipe: { fg: '#b083f0' attr: 'b' } + shape_range: { fg: '#c69026' attr: 'b' } + shape_record: { fg: '#39c5cf' attr: 'b' } + shape_redirection: { fg: '#b083f0' attr: 'b' } + shape_signature: { fg: '#57ab5a' attr: 'b' } + shape_string: '#57ab5a' + shape_string_interpolation: { fg: '#39c5cf' attr: 'b' } + shape_table: { fg: '#539bf5' attr: 'b' } + shape_variable: '#b083f0' + + background: '#22272e' + foreground: '#768390' + cursor: '#6cb6ff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-light-colorblind.nu b/themes/nu-themes/github-light-colorblind.nu index 91c0d58..4d47d32 100644 --- a/themes/nu-themes/github-light-colorblind.nu +++ b/themes/nu-themes/github-light-colorblind.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6e7781" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#116329" attr: "b" } - empty: "#0969da" - bool: {|| if $in { "#3192aa" } else { "light_gray" } } - int: "#6e7781" - filesize: {|e| - if $e == 0b { - "#6e7781" - } else if $e < 1mb { - "#1b7c83" - } else {{ fg: "#0969da" }} - } - duration: "#6e7781" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf222e" attr: "b" } - } else if $in < 6hr { - "#cf222e" - } else if $in < 1day { - "#4d2d00" - } else if $in < 3day { - "#116329" - } else if $in < 1wk { - { fg: "#116329" attr: "b" } - } else if $in < 6wk { - "#1b7c83" - } else if $in < 52wk { - "#0969da" - } else { "dark_gray" } - } - range: "#6e7781" - float: "#6e7781" - string: "#6e7781" - nothing: "#6e7781" - binary: "#6e7781" - cellpath: "#6e7781" - row_index: { fg: "#116329" attr: "b" } - record: "#6e7781" - list: "#6e7781" - block: "#6e7781" - hints: "dark_gray" - search_result: { fg: "#cf222e" bg: "#6e7781" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8250df" attr: "b" } - shape_binary: { fg: "#8250df" attr: "b" } - shape_block: { fg: "#0969da" attr: "b" } - shape_bool: "#3192aa" - shape_custom: "#116329" - shape_datetime: { fg: "#1b7c83" attr: "b" } - shape_directory: "#1b7c83" - shape_external: "#1b7c83" - shape_externalarg: { fg: "#116329" attr: "b" } - shape_filepath: "#1b7c83" - shape_flag: { fg: "#0969da" attr: "b" } - shape_float: { fg: "#8250df" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1b7c83" attr: "b" } - shape_int: { fg: "#8250df" attr: "b" } - shape_internalcall: { fg: "#1b7c83" attr: "b" } - shape_list: { fg: "#1b7c83" attr: "b" } - shape_literal: "#0969da" - shape_match_pattern: "#116329" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3192aa" - shape_operator: "#4d2d00" - shape_or: { fg: "#8250df" attr: "b" } - shape_pipe: { fg: "#8250df" attr: "b" } - shape_range: { fg: "#4d2d00" attr: "b" } - shape_record: { fg: "#1b7c83" attr: "b" } - shape_redirection: { fg: "#8250df" attr: "b" } - shape_signature: { fg: "#116329" attr: "b" } - shape_string: "#116329" - shape_string_interpolation: { fg: "#1b7c83" attr: "b" } - shape_table: { fg: "#0969da" attr: "b" } - shape_variable: "#8250df" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#0E1116" - cursor: "#0969da" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6e7781' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#116329' attr: 'b' } + empty: '#0969da' + bool: {|| if $in { '#3192aa' } else { 'light_gray' } } + int: '#6e7781' + filesize: {|e| + if $e == 0b { + '#6e7781' + } else if $e < 1mb { + '#1b7c83' + } else {{ fg: '#0969da' }} + } + duration: '#6e7781' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf222e' attr: 'b' } + } else if $in < 6hr { + '#cf222e' + } else if $in < 1day { + '#4d2d00' + } else if $in < 3day { + '#116329' + } else if $in < 1wk { + { fg: '#116329' attr: 'b' } + } else if $in < 6wk { + '#1b7c83' + } else if $in < 52wk { + '#0969da' + } else { 'dark_gray' } + } + range: '#6e7781' + float: '#6e7781' + string: '#6e7781' + nothing: '#6e7781' + binary: '#6e7781' + cellpath: '#6e7781' + row_index: { fg: '#116329' attr: 'b' } + record: '#6e7781' + list: '#6e7781' + block: '#6e7781' + hints: 'dark_gray' + search_result: { fg: '#cf222e' bg: '#6e7781' } + + shape_and: { fg: '#8250df' attr: 'b' } + shape_binary: { fg: '#8250df' attr: 'b' } + shape_block: { fg: '#0969da' attr: 'b' } + shape_bool: '#3192aa' + shape_custom: '#116329' + shape_datetime: { fg: '#1b7c83' attr: 'b' } + shape_directory: '#1b7c83' + shape_external: '#1b7c83' + shape_externalarg: { fg: '#116329' attr: 'b' } + shape_filepath: '#1b7c83' + shape_flag: { fg: '#0969da' attr: 'b' } + shape_float: { fg: '#8250df' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1b7c83' attr: 'b' } + shape_int: { fg: '#8250df' attr: 'b' } + shape_internalcall: { fg: '#1b7c83' attr: 'b' } + shape_list: { fg: '#1b7c83' attr: 'b' } + shape_literal: '#0969da' + shape_match_pattern: '#116329' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3192aa' + shape_operator: '#4d2d00' + shape_or: { fg: '#8250df' attr: 'b' } + shape_pipe: { fg: '#8250df' attr: 'b' } + shape_range: { fg: '#4d2d00' attr: 'b' } + shape_record: { fg: '#1b7c83' attr: 'b' } + shape_redirection: { fg: '#8250df' attr: 'b' } + shape_signature: { fg: '#116329' attr: 'b' } + shape_string: '#116329' + shape_string_interpolation: { fg: '#1b7c83' attr: 'b' } + shape_table: { fg: '#0969da' attr: 'b' } + shape_variable: '#8250df' + + background: '#ffffff' + foreground: '#0E1116' + cursor: '#0969da' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-light-default.nu b/themes/nu-themes/github-light-default.nu index 40e0445..20c7b7e 100644 --- a/themes/nu-themes/github-light-default.nu +++ b/themes/nu-themes/github-light-default.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6e7781" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#116329" attr: "b" } - empty: "#0969da" - bool: {|| if $in { "#3192aa" } else { "light_gray" } } - int: "#6e7781" - filesize: {|e| - if $e == 0b { - "#6e7781" - } else if $e < 1mb { - "#1b7c83" - } else {{ fg: "#0969da" }} - } - duration: "#6e7781" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf222e" attr: "b" } - } else if $in < 6hr { - "#cf222e" - } else if $in < 1day { - "#4d2d00" - } else if $in < 3day { - "#116329" - } else if $in < 1wk { - { fg: "#116329" attr: "b" } - } else if $in < 6wk { - "#1b7c83" - } else if $in < 52wk { - "#0969da" - } else { "dark_gray" } - } - range: "#6e7781" - float: "#6e7781" - string: "#6e7781" - nothing: "#6e7781" - binary: "#6e7781" - cellpath: "#6e7781" - row_index: { fg: "#116329" attr: "b" } - record: "#6e7781" - list: "#6e7781" - block: "#6e7781" - hints: "dark_gray" - search_result: { fg: "#cf222e" bg: "#6e7781" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8250df" attr: "b" } - shape_binary: { fg: "#8250df" attr: "b" } - shape_block: { fg: "#0969da" attr: "b" } - shape_bool: "#3192aa" - shape_custom: "#116329" - shape_datetime: { fg: "#1b7c83" attr: "b" } - shape_directory: "#1b7c83" - shape_external: "#1b7c83" - shape_externalarg: { fg: "#116329" attr: "b" } - shape_filepath: "#1b7c83" - shape_flag: { fg: "#0969da" attr: "b" } - shape_float: { fg: "#8250df" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1b7c83" attr: "b" } - shape_int: { fg: "#8250df" attr: "b" } - shape_internalcall: { fg: "#1b7c83" attr: "b" } - shape_list: { fg: "#1b7c83" attr: "b" } - shape_literal: "#0969da" - shape_match_pattern: "#116329" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3192aa" - shape_operator: "#4d2d00" - shape_or: { fg: "#8250df" attr: "b" } - shape_pipe: { fg: "#8250df" attr: "b" } - shape_range: { fg: "#4d2d00" attr: "b" } - shape_record: { fg: "#1b7c83" attr: "b" } - shape_redirection: { fg: "#8250df" attr: "b" } - shape_signature: { fg: "#116329" attr: "b" } - shape_string: "#116329" - shape_string_interpolation: { fg: "#1b7c83" attr: "b" } - shape_table: { fg: "#0969da" attr: "b" } - shape_variable: "#8250df" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#0E1116" - cursor: "#044289" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6e7781' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#116329' attr: 'b' } + empty: '#0969da' + bool: {|| if $in { '#3192aa' } else { 'light_gray' } } + int: '#6e7781' + filesize: {|e| + if $e == 0b { + '#6e7781' + } else if $e < 1mb { + '#1b7c83' + } else {{ fg: '#0969da' }} + } + duration: '#6e7781' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf222e' attr: 'b' } + } else if $in < 6hr { + '#cf222e' + } else if $in < 1day { + '#4d2d00' + } else if $in < 3day { + '#116329' + } else if $in < 1wk { + { fg: '#116329' attr: 'b' } + } else if $in < 6wk { + '#1b7c83' + } else if $in < 52wk { + '#0969da' + } else { 'dark_gray' } + } + range: '#6e7781' + float: '#6e7781' + string: '#6e7781' + nothing: '#6e7781' + binary: '#6e7781' + cellpath: '#6e7781' + row_index: { fg: '#116329' attr: 'b' } + record: '#6e7781' + list: '#6e7781' + block: '#6e7781' + hints: 'dark_gray' + search_result: { fg: '#cf222e' bg: '#6e7781' } + + shape_and: { fg: '#8250df' attr: 'b' } + shape_binary: { fg: '#8250df' attr: 'b' } + shape_block: { fg: '#0969da' attr: 'b' } + shape_bool: '#3192aa' + shape_custom: '#116329' + shape_datetime: { fg: '#1b7c83' attr: 'b' } + shape_directory: '#1b7c83' + shape_external: '#1b7c83' + shape_externalarg: { fg: '#116329' attr: 'b' } + shape_filepath: '#1b7c83' + shape_flag: { fg: '#0969da' attr: 'b' } + shape_float: { fg: '#8250df' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1b7c83' attr: 'b' } + shape_int: { fg: '#8250df' attr: 'b' } + shape_internalcall: { fg: '#1b7c83' attr: 'b' } + shape_list: { fg: '#1b7c83' attr: 'b' } + shape_literal: '#0969da' + shape_match_pattern: '#116329' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3192aa' + shape_operator: '#4d2d00' + shape_or: { fg: '#8250df' attr: 'b' } + shape_pipe: { fg: '#8250df' attr: 'b' } + shape_range: { fg: '#4d2d00' attr: 'b' } + shape_record: { fg: '#1b7c83' attr: 'b' } + shape_redirection: { fg: '#8250df' attr: 'b' } + shape_signature: { fg: '#116329' attr: 'b' } + shape_string: '#116329' + shape_string_interpolation: { fg: '#1b7c83' attr: 'b' } + shape_table: { fg: '#0969da' attr: 'b' } + shape_variable: '#8250df' + + background: '#ffffff' + foreground: '#0E1116' + cursor: '#044289' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github-light.nu b/themes/nu-themes/github-light.nu index 7cf4c7c..4277c33 100644 --- a/themes/nu-themes/github-light.nu +++ b/themes/nu-themes/github-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6a737d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#28a745" attr: "b" } - empty: "#0366d6" - bool: {|| if $in { "#3192aa" } else { "light_gray" } } - int: "#6a737d" - filesize: {|e| - if $e == 0b { - "#6a737d" - } else if $e < 1mb { - "#0598bc" - } else {{ fg: "#0366d6" }} - } - duration: "#6a737d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d73a49" attr: "b" } - } else if $in < 6hr { - "#d73a49" - } else if $in < 1day { - "#dbab09" - } else if $in < 3day { - "#28a745" - } else if $in < 1wk { - { fg: "#28a745" attr: "b" } - } else if $in < 6wk { - "#0598bc" - } else if $in < 52wk { - "#0366d6" - } else { "dark_gray" } - } - range: "#6a737d" - float: "#6a737d" - string: "#6a737d" - nothing: "#6a737d" - binary: "#6a737d" - cellpath: "#6a737d" - row_index: { fg: "#28a745" attr: "b" } - record: "#6a737d" - list: "#6a737d" - block: "#6a737d" - hints: "dark_gray" - search_result: { fg: "#d73a49" bg: "#6a737d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#5a32a3" attr: "b" } - shape_binary: { fg: "#5a32a3" attr: "b" } - shape_block: { fg: "#0366d6" attr: "b" } - shape_bool: "#3192aa" - shape_custom: "#28a745" - shape_datetime: { fg: "#0598bc" attr: "b" } - shape_directory: "#0598bc" - shape_external: "#0598bc" - shape_externalarg: { fg: "#28a745" attr: "b" } - shape_filepath: "#0598bc" - shape_flag: { fg: "#0366d6" attr: "b" } - shape_float: { fg: "#5a32a3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0598bc" attr: "b" } - shape_int: { fg: "#5a32a3" attr: "b" } - shape_internalcall: { fg: "#0598bc" attr: "b" } - shape_list: { fg: "#0598bc" attr: "b" } - shape_literal: "#0366d6" - shape_match_pattern: "#28a745" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3192aa" - shape_operator: "#dbab09" - shape_or: { fg: "#5a32a3" attr: "b" } - shape_pipe: { fg: "#5a32a3" attr: "b" } - shape_range: { fg: "#dbab09" attr: "b" } - shape_record: { fg: "#0598bc" attr: "b" } - shape_redirection: { fg: "#5a32a3" attr: "b" } - shape_signature: { fg: "#28a745" attr: "b" } - shape_string: "#28a745" - shape_string_interpolation: { fg: "#0598bc" attr: "b" } - shape_table: { fg: "#0366d6" attr: "b" } - shape_variable: "#5a32a3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#24292f" - cursor: "#044289" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6a737d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#28a745' attr: 'b' } + empty: '#0366d6' + bool: {|| if $in { '#3192aa' } else { 'light_gray' } } + int: '#6a737d' + filesize: {|e| + if $e == 0b { + '#6a737d' + } else if $e < 1mb { + '#0598bc' + } else {{ fg: '#0366d6' }} + } + duration: '#6a737d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d73a49' attr: 'b' } + } else if $in < 6hr { + '#d73a49' + } else if $in < 1day { + '#dbab09' + } else if $in < 3day { + '#28a745' + } else if $in < 1wk { + { fg: '#28a745' attr: 'b' } + } else if $in < 6wk { + '#0598bc' + } else if $in < 52wk { + '#0366d6' + } else { 'dark_gray' } + } + range: '#6a737d' + float: '#6a737d' + string: '#6a737d' + nothing: '#6a737d' + binary: '#6a737d' + cellpath: '#6a737d' + row_index: { fg: '#28a745' attr: 'b' } + record: '#6a737d' + list: '#6a737d' + block: '#6a737d' + hints: 'dark_gray' + search_result: { fg: '#d73a49' bg: '#6a737d' } + + shape_and: { fg: '#5a32a3' attr: 'b' } + shape_binary: { fg: '#5a32a3' attr: 'b' } + shape_block: { fg: '#0366d6' attr: 'b' } + shape_bool: '#3192aa' + shape_custom: '#28a745' + shape_datetime: { fg: '#0598bc' attr: 'b' } + shape_directory: '#0598bc' + shape_external: '#0598bc' + shape_externalarg: { fg: '#28a745' attr: 'b' } + shape_filepath: '#0598bc' + shape_flag: { fg: '#0366d6' attr: 'b' } + shape_float: { fg: '#5a32a3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0598bc' attr: 'b' } + shape_int: { fg: '#5a32a3' attr: 'b' } + shape_internalcall: { fg: '#0598bc' attr: 'b' } + shape_list: { fg: '#0598bc' attr: 'b' } + shape_literal: '#0366d6' + shape_match_pattern: '#28a745' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3192aa' + shape_operator: '#dbab09' + shape_or: { fg: '#5a32a3' attr: 'b' } + shape_pipe: { fg: '#5a32a3' attr: 'b' } + shape_range: { fg: '#dbab09' attr: 'b' } + shape_record: { fg: '#0598bc' attr: 'b' } + shape_redirection: { fg: '#5a32a3' attr: 'b' } + shape_signature: { fg: '#28a745' attr: 'b' } + shape_string: '#28a745' + shape_string_interpolation: { fg: '#0598bc' attr: 'b' } + shape_table: { fg: '#0366d6' attr: 'b' } + shape_variable: '#5a32a3' + + background: '#ffffff' + foreground: '#24292f' + cursor: '#044289' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/github.nu b/themes/nu-themes/github.nu index 4422ba9..daecc4a 100644 --- a/themes/nu-themes/github.nu +++ b/themes/nu-themes/github.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#333333" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#183691" attr: "b" } - empty: "#795da3" - bool: {|| if $in { "#183691" } else { "light_gray" } } - int: "#333333" - filesize: {|e| - if $e == 0b { - "#333333" - } else if $e < 1mb { - "#183691" - } else {{ fg: "#795da3" }} - } - duration: "#333333" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ed6a43" attr: "b" } - } else if $in < 6hr { - "#ed6a43" - } else if $in < 1day { - "#795da3" - } else if $in < 3day { - "#183691" - } else if $in < 1wk { - { fg: "#183691" attr: "b" } - } else if $in < 6wk { - "#183691" - } else if $in < 52wk { - "#795da3" - } else { "dark_gray" } - } - range: "#333333" - float: "#333333" - string: "#333333" - nothing: "#333333" - binary: "#333333" - cellpath: "#333333" - row_index: { fg: "#183691" attr: "b" } - record: "#333333" - list: "#333333" - block: "#333333" - hints: "dark_gray" - search_result: { fg: "#ed6a43" bg: "#333333" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a71d5d" attr: "b" } - shape_binary: { fg: "#a71d5d" attr: "b" } - shape_block: { fg: "#795da3" attr: "b" } - shape_bool: "#183691" - shape_custom: "#183691" - shape_datetime: { fg: "#183691" attr: "b" } - shape_directory: "#183691" - shape_external: "#183691" - shape_externalarg: { fg: "#183691" attr: "b" } - shape_filepath: "#183691" - shape_flag: { fg: "#795da3" attr: "b" } - shape_float: { fg: "#a71d5d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#183691" attr: "b" } - shape_int: { fg: "#a71d5d" attr: "b" } - shape_internalcall: { fg: "#183691" attr: "b" } - shape_list: { fg: "#183691" attr: "b" } - shape_literal: "#795da3" - shape_match_pattern: "#183691" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#183691" - shape_operator: "#795da3" - shape_or: { fg: "#a71d5d" attr: "b" } - shape_pipe: { fg: "#a71d5d" attr: "b" } - shape_range: { fg: "#795da3" attr: "b" } - shape_record: { fg: "#183691" attr: "b" } - shape_redirection: { fg: "#a71d5d" attr: "b" } - shape_signature: { fg: "#183691" attr: "b" } - shape_string: "#183691" - shape_string_interpolation: { fg: "#183691" attr: "b" } - shape_table: { fg: "#795da3" attr: "b" } - shape_variable: "#a71d5d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#333333" - cursor: "#333333" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#333333' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#183691' attr: 'b' } + empty: '#795da3' + bool: {|| if $in { '#183691' } else { 'light_gray' } } + int: '#333333' + filesize: {|e| + if $e == 0b { + '#333333' + } else if $e < 1mb { + '#183691' + } else {{ fg: '#795da3' }} + } + duration: '#333333' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ed6a43' attr: 'b' } + } else if $in < 6hr { + '#ed6a43' + } else if $in < 1day { + '#795da3' + } else if $in < 3day { + '#183691' + } else if $in < 1wk { + { fg: '#183691' attr: 'b' } + } else if $in < 6wk { + '#183691' + } else if $in < 52wk { + '#795da3' + } else { 'dark_gray' } + } + range: '#333333' + float: '#333333' + string: '#333333' + nothing: '#333333' + binary: '#333333' + cellpath: '#333333' + row_index: { fg: '#183691' attr: 'b' } + record: '#333333' + list: '#333333' + block: '#333333' + hints: 'dark_gray' + search_result: { fg: '#ed6a43' bg: '#333333' } + + shape_and: { fg: '#a71d5d' attr: 'b' } + shape_binary: { fg: '#a71d5d' attr: 'b' } + shape_block: { fg: '#795da3' attr: 'b' } + shape_bool: '#183691' + shape_custom: '#183691' + shape_datetime: { fg: '#183691' attr: 'b' } + shape_directory: '#183691' + shape_external: '#183691' + shape_externalarg: { fg: '#183691' attr: 'b' } + shape_filepath: '#183691' + shape_flag: { fg: '#795da3' attr: 'b' } + shape_float: { fg: '#a71d5d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#183691' attr: 'b' } + shape_int: { fg: '#a71d5d' attr: 'b' } + shape_internalcall: { fg: '#183691' attr: 'b' } + shape_list: { fg: '#183691' attr: 'b' } + shape_literal: '#795da3' + shape_match_pattern: '#183691' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#183691' + shape_operator: '#795da3' + shape_or: { fg: '#a71d5d' attr: 'b' } + shape_pipe: { fg: '#a71d5d' attr: 'b' } + shape_range: { fg: '#795da3' attr: 'b' } + shape_record: { fg: '#183691' attr: 'b' } + shape_redirection: { fg: '#a71d5d' attr: 'b' } + shape_signature: { fg: '#183691' attr: 'b' } + shape_string: '#183691' + shape_string_interpolation: { fg: '#183691' attr: 'b' } + shape_table: { fg: '#795da3' attr: 'b' } + shape_variable: '#a71d5d' + + background: '#ffffff' + foreground: '#333333' + cursor: '#333333' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/glacier.nu b/themes/nu-themes/glacier.nu index 6c41ab8..38b02da 100644 --- a/themes/nu-themes/glacier.nu +++ b/themes/nu-themes/glacier.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#35a770" attr: "b" } - empty: "#1f5872" - bool: {|| if $in { "#a0b6d3" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#778397" - } else {{ fg: "#1f5872" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bd0f2f" attr: "b" } - } else if $in < 6hr { - "#bd0f2f" - } else if $in < 1day { - "#fb9435" - } else if $in < 3day { - "#35a770" - } else if $in < 1wk { - { fg: "#35a770" attr: "b" } - } else if $in < 6wk { - "#778397" - } else if $in < 52wk { - "#1f5872" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#35a770" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#bd0f2f" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bd2523" attr: "b" } - shape_binary: { fg: "#bd2523" attr: "b" } - shape_block: { fg: "#1f5872" attr: "b" } - shape_bool: "#a0b6d3" - shape_custom: "#35a770" - shape_datetime: { fg: "#778397" attr: "b" } - shape_directory: "#778397" - shape_external: "#778397" - shape_externalarg: { fg: "#35a770" attr: "b" } - shape_filepath: "#778397" - shape_flag: { fg: "#1f5872" attr: "b" } - shape_float: { fg: "#bd2523" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#778397" attr: "b" } - shape_int: { fg: "#bd2523" attr: "b" } - shape_internalcall: { fg: "#778397" attr: "b" } - shape_list: { fg: "#778397" attr: "b" } - shape_literal: "#1f5872" - shape_match_pattern: "#35a770" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a0b6d3" - shape_operator: "#fb9435" - shape_or: { fg: "#bd2523" attr: "b" } - shape_pipe: { fg: "#bd2523" attr: "b" } - shape_range: { fg: "#fb9435" attr: "b" } - shape_record: { fg: "#778397" attr: "b" } - shape_redirection: { fg: "#bd2523" attr: "b" } - shape_signature: { fg: "#35a770" attr: "b" } - shape_string: "#35a770" - shape_string_interpolation: { fg: "#778397" attr: "b" } - shape_table: { fg: "#1f5872" attr: "b" } - shape_variable: "#bd2523" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0c1115" - foreground: "#ffffff" - cursor: "#6c6c6c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#35a770' attr: 'b' } + empty: '#1f5872' + bool: {|| if $in { '#a0b6d3' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#778397' + } else {{ fg: '#1f5872' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bd0f2f' attr: 'b' } + } else if $in < 6hr { + '#bd0f2f' + } else if $in < 1day { + '#fb9435' + } else if $in < 3day { + '#35a770' + } else if $in < 1wk { + { fg: '#35a770' attr: 'b' } + } else if $in < 6wk { + '#778397' + } else if $in < 52wk { + '#1f5872' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#35a770' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#bd0f2f' bg: '#ffffff' } + + shape_and: { fg: '#bd2523' attr: 'b' } + shape_binary: { fg: '#bd2523' attr: 'b' } + shape_block: { fg: '#1f5872' attr: 'b' } + shape_bool: '#a0b6d3' + shape_custom: '#35a770' + shape_datetime: { fg: '#778397' attr: 'b' } + shape_directory: '#778397' + shape_external: '#778397' + shape_externalarg: { fg: '#35a770' attr: 'b' } + shape_filepath: '#778397' + shape_flag: { fg: '#1f5872' attr: 'b' } + shape_float: { fg: '#bd2523' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#778397' attr: 'b' } + shape_int: { fg: '#bd2523' attr: 'b' } + shape_internalcall: { fg: '#778397' attr: 'b' } + shape_list: { fg: '#778397' attr: 'b' } + shape_literal: '#1f5872' + shape_match_pattern: '#35a770' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a0b6d3' + shape_operator: '#fb9435' + shape_or: { fg: '#bd2523' attr: 'b' } + shape_pipe: { fg: '#bd2523' attr: 'b' } + shape_range: { fg: '#fb9435' attr: 'b' } + shape_record: { fg: '#778397' attr: 'b' } + shape_redirection: { fg: '#bd2523' attr: 'b' } + shape_signature: { fg: '#35a770' attr: 'b' } + shape_string: '#35a770' + shape_string_interpolation: { fg: '#778397' attr: 'b' } + shape_table: { fg: '#1f5872' attr: 'b' } + shape_variable: '#bd2523' + + background: '#0c1115' + foreground: '#ffffff' + cursor: '#6c6c6c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/goa-base.nu b/themes/nu-themes/goa-base.nu index fc61ce2..885e1a2 100644 --- a/themes/nu-themes/goa-base.nu +++ b/themes/nu-themes/goa-base.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#000000" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#249000" attr: "b" } - empty: "#000482" - bool: {|| if $in { "#c8f9f3" } else { "light_gray" } } - int: "#000000" - filesize: {|e| - if $e == 0b { - "#000000" - } else if $e < 1mb { - "#3affff" - } else {{ fg: "#000482" }} - } - duration: "#000000" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f78000" attr: "b" } - } else if $in < 6hr { - "#f78000" - } else if $in < 1day { - "#f40000" - } else if $in < 3day { - "#249000" - } else if $in < 1wk { - { fg: "#249000" attr: "b" } - } else if $in < 6wk { - "#3affff" - } else if $in < 52wk { - "#000482" - } else { "dark_gray" } - } - range: "#000000" - float: "#000000" - string: "#000000" - nothing: "#000000" - binary: "#000000" - cellpath: "#000000" - row_index: { fg: "#249000" attr: "b" } - record: "#000000" - list: "#000000" - block: "#000000" - hints: "dark_gray" - search_result: { fg: "#f78000" bg: "#000000" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f43bff" attr: "b" } - shape_binary: { fg: "#f43bff" attr: "b" } - shape_block: { fg: "#000482" attr: "b" } - shape_bool: "#c8f9f3" - shape_custom: "#249000" - shape_datetime: { fg: "#3affff" attr: "b" } - shape_directory: "#3affff" - shape_external: "#3affff" - shape_externalarg: { fg: "#249000" attr: "b" } - shape_filepath: "#3affff" - shape_flag: { fg: "#000482" attr: "b" } - shape_float: { fg: "#f43bff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3affff" attr: "b" } - shape_int: { fg: "#f43bff" attr: "b" } - shape_internalcall: { fg: "#3affff" attr: "b" } - shape_list: { fg: "#3affff" attr: "b" } - shape_literal: "#000482" - shape_match_pattern: "#249000" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c8f9f3" - shape_operator: "#f40000" - shape_or: { fg: "#f43bff" attr: "b" } - shape_pipe: { fg: "#f43bff" attr: "b" } - shape_range: { fg: "#f40000" attr: "b" } - shape_record: { fg: "#3affff" attr: "b" } - shape_redirection: { fg: "#f43bff" attr: "b" } - shape_signature: { fg: "#249000" attr: "b" } - shape_string: "#249000" - shape_string_interpolation: { fg: "#3affff" attr: "b" } - shape_table: { fg: "#000482" attr: "b" } - shape_variable: "#f43bff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2f0033" - foreground: "#f6ed00" - cursor: "#1a6500" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#000000' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#249000' attr: 'b' } + empty: '#000482' + bool: {|| if $in { '#c8f9f3' } else { 'light_gray' } } + int: '#000000' + filesize: {|e| + if $e == 0b { + '#000000' + } else if $e < 1mb { + '#3affff' + } else {{ fg: '#000482' }} + } + duration: '#000000' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f78000' attr: 'b' } + } else if $in < 6hr { + '#f78000' + } else if $in < 1day { + '#f40000' + } else if $in < 3day { + '#249000' + } else if $in < 1wk { + { fg: '#249000' attr: 'b' } + } else if $in < 6wk { + '#3affff' + } else if $in < 52wk { + '#000482' + } else { 'dark_gray' } + } + range: '#000000' + float: '#000000' + string: '#000000' + nothing: '#000000' + binary: '#000000' + cellpath: '#000000' + row_index: { fg: '#249000' attr: 'b' } + record: '#000000' + list: '#000000' + block: '#000000' + hints: 'dark_gray' + search_result: { fg: '#f78000' bg: '#000000' } + + shape_and: { fg: '#f43bff' attr: 'b' } + shape_binary: { fg: '#f43bff' attr: 'b' } + shape_block: { fg: '#000482' attr: 'b' } + shape_bool: '#c8f9f3' + shape_custom: '#249000' + shape_datetime: { fg: '#3affff' attr: 'b' } + shape_directory: '#3affff' + shape_external: '#3affff' + shape_externalarg: { fg: '#249000' attr: 'b' } + shape_filepath: '#3affff' + shape_flag: { fg: '#000482' attr: 'b' } + shape_float: { fg: '#f43bff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3affff' attr: 'b' } + shape_int: { fg: '#f43bff' attr: 'b' } + shape_internalcall: { fg: '#3affff' attr: 'b' } + shape_list: { fg: '#3affff' attr: 'b' } + shape_literal: '#000482' + shape_match_pattern: '#249000' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c8f9f3' + shape_operator: '#f40000' + shape_or: { fg: '#f43bff' attr: 'b' } + shape_pipe: { fg: '#f43bff' attr: 'b' } + shape_range: { fg: '#f40000' attr: 'b' } + shape_record: { fg: '#3affff' attr: 'b' } + shape_redirection: { fg: '#f43bff' attr: 'b' } + shape_signature: { fg: '#249000' attr: 'b' } + shape_string: '#249000' + shape_string_interpolation: { fg: '#3affff' attr: 'b' } + shape_table: { fg: '#000482' attr: 'b' } + shape_variable: '#f43bff' + + background: '#2f0033' + foreground: '#f6ed00' + cursor: '#1a6500' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gooey.nu b/themes/nu-themes/gooey.nu index 24c71fb..7d1ccb4 100644 --- a/themes/nu-themes/gooey.nu +++ b/themes/nu-themes/gooey.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#858893" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#72ccae" attr: "b" } - empty: "#58b6ca" - bool: {|| if $in { "#c0b7f9" } else { "light_gray" } } - int: "#858893" - filesize: {|e| - if $e == 0b { - "#858893" - } else if $e < 1mb { - "#8d84c6" - } else {{ fg: "#58b6ca" }} - } - duration: "#858893" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bb4f6c" attr: "b" } - } else if $in < 6hr { - "#bb4f6c" - } else if $in < 1day { - "#c65e3d" - } else if $in < 3day { - "#72ccae" - } else if $in < 1wk { - { fg: "#72ccae" attr: "b" } - } else if $in < 6wk { - "#8d84c6" - } else if $in < 52wk { - "#58b6ca" - } else { "dark_gray" } - } - range: "#858893" - float: "#858893" - string: "#858893" - nothing: "#858893" - binary: "#858893" - cellpath: "#858893" - row_index: { fg: "#72ccae" attr: "b" } - record: "#858893" - list: "#858893" - block: "#858893" - hints: "dark_gray" - search_result: { fg: "#bb4f6c" bg: "#858893" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6488c4" attr: "b" } - shape_binary: { fg: "#6488c4" attr: "b" } - shape_block: { fg: "#58b6ca" attr: "b" } - shape_bool: "#c0b7f9" - shape_custom: "#72ccae" - shape_datetime: { fg: "#8d84c6" attr: "b" } - shape_directory: "#8d84c6" - shape_external: "#8d84c6" - shape_externalarg: { fg: "#72ccae" attr: "b" } - shape_filepath: "#8d84c6" - shape_flag: { fg: "#58b6ca" attr: "b" } - shape_float: { fg: "#6488c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8d84c6" attr: "b" } - shape_int: { fg: "#6488c4" attr: "b" } - shape_internalcall: { fg: "#8d84c6" attr: "b" } - shape_list: { fg: "#8d84c6" attr: "b" } - shape_literal: "#58b6ca" - shape_match_pattern: "#72ccae" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c0b7f9" - shape_operator: "#c65e3d" - shape_or: { fg: "#6488c4" attr: "b" } - shape_pipe: { fg: "#6488c4" attr: "b" } - shape_range: { fg: "#c65e3d" attr: "b" } - shape_record: { fg: "#8d84c6" attr: "b" } - shape_redirection: { fg: "#6488c4" attr: "b" } - shape_signature: { fg: "#72ccae" attr: "b" } - shape_string: "#72ccae" - shape_string_interpolation: { fg: "#8d84c6" attr: "b" } - shape_table: { fg: "#58b6ca" attr: "b" } - shape_variable: "#6488c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0d101b" - foreground: "#ebeef9" - cursor: "#ebeef9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#858893' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#72ccae' attr: 'b' } + empty: '#58b6ca' + bool: {|| if $in { '#c0b7f9' } else { 'light_gray' } } + int: '#858893' + filesize: {|e| + if $e == 0b { + '#858893' + } else if $e < 1mb { + '#8d84c6' + } else {{ fg: '#58b6ca' }} + } + duration: '#858893' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bb4f6c' attr: 'b' } + } else if $in < 6hr { + '#bb4f6c' + } else if $in < 1day { + '#c65e3d' + } else if $in < 3day { + '#72ccae' + } else if $in < 1wk { + { fg: '#72ccae' attr: 'b' } + } else if $in < 6wk { + '#8d84c6' + } else if $in < 52wk { + '#58b6ca' + } else { 'dark_gray' } + } + range: '#858893' + float: '#858893' + string: '#858893' + nothing: '#858893' + binary: '#858893' + cellpath: '#858893' + row_index: { fg: '#72ccae' attr: 'b' } + record: '#858893' + list: '#858893' + block: '#858893' + hints: 'dark_gray' + search_result: { fg: '#bb4f6c' bg: '#858893' } + + shape_and: { fg: '#6488c4' attr: 'b' } + shape_binary: { fg: '#6488c4' attr: 'b' } + shape_block: { fg: '#58b6ca' attr: 'b' } + shape_bool: '#c0b7f9' + shape_custom: '#72ccae' + shape_datetime: { fg: '#8d84c6' attr: 'b' } + shape_directory: '#8d84c6' + shape_external: '#8d84c6' + shape_externalarg: { fg: '#72ccae' attr: 'b' } + shape_filepath: '#8d84c6' + shape_flag: { fg: '#58b6ca' attr: 'b' } + shape_float: { fg: '#6488c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8d84c6' attr: 'b' } + shape_int: { fg: '#6488c4' attr: 'b' } + shape_internalcall: { fg: '#8d84c6' attr: 'b' } + shape_list: { fg: '#8d84c6' attr: 'b' } + shape_literal: '#58b6ca' + shape_match_pattern: '#72ccae' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c0b7f9' + shape_operator: '#c65e3d' + shape_or: { fg: '#6488c4' attr: 'b' } + shape_pipe: { fg: '#6488c4' attr: 'b' } + shape_range: { fg: '#c65e3d' attr: 'b' } + shape_record: { fg: '#8d84c6' attr: 'b' } + shape_redirection: { fg: '#6488c4' attr: 'b' } + shape_signature: { fg: '#72ccae' attr: 'b' } + shape_string: '#72ccae' + shape_string_interpolation: { fg: '#8d84c6' attr: 'b' } + shape_table: { fg: '#58b6ca' attr: 'b' } + shape_variable: '#6488c4' + + background: '#0d101b' + foreground: '#ebeef9' + cursor: '#ebeef9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/google-dark.nu b/themes/nu-themes/google-dark.nu index 01d10fa..2b0351f 100644 --- a/themes/nu-themes/google-dark.nu +++ b/themes/nu-themes/google-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c5c8c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#198844" attr: "b" } - empty: "#3971ed" - bool: {|| if $in { "#3971ed" } else { "light_gray" } } - int: "#c5c8c6" - filesize: {|e| - if $e == 0b { - "#c5c8c6" - } else if $e < 1mb { - "#3971ed" - } else {{ fg: "#3971ed" }} - } - duration: "#c5c8c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc342b" attr: "b" } - } else if $in < 6hr { - "#cc342b" - } else if $in < 1day { - "#fba922" - } else if $in < 3day { - "#198844" - } else if $in < 1wk { - { fg: "#198844" attr: "b" } - } else if $in < 6wk { - "#3971ed" - } else if $in < 52wk { - "#3971ed" - } else { "dark_gray" } - } - range: "#c5c8c6" - float: "#c5c8c6" - string: "#c5c8c6" - nothing: "#c5c8c6" - binary: "#c5c8c6" - cellpath: "#c5c8c6" - row_index: { fg: "#198844" attr: "b" } - record: "#c5c8c6" - list: "#c5c8c6" - block: "#c5c8c6" - hints: "dark_gray" - search_result: { fg: "#cc342b" bg: "#c5c8c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a36ac7" attr: "b" } - shape_binary: { fg: "#a36ac7" attr: "b" } - shape_block: { fg: "#3971ed" attr: "b" } - shape_bool: "#3971ed" - shape_custom: "#198844" - shape_datetime: { fg: "#3971ed" attr: "b" } - shape_directory: "#3971ed" - shape_external: "#3971ed" - shape_externalarg: { fg: "#198844" attr: "b" } - shape_filepath: "#3971ed" - shape_flag: { fg: "#3971ed" attr: "b" } - shape_float: { fg: "#a36ac7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3971ed" attr: "b" } - shape_int: { fg: "#a36ac7" attr: "b" } - shape_internalcall: { fg: "#3971ed" attr: "b" } - shape_list: { fg: "#3971ed" attr: "b" } - shape_literal: "#3971ed" - shape_match_pattern: "#198844" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3971ed" - shape_operator: "#fba922" - shape_or: { fg: "#a36ac7" attr: "b" } - shape_pipe: { fg: "#a36ac7" attr: "b" } - shape_range: { fg: "#fba922" attr: "b" } - shape_record: { fg: "#3971ed" attr: "b" } - shape_redirection: { fg: "#a36ac7" attr: "b" } - shape_signature: { fg: "#198844" attr: "b" } - shape_string: "#198844" - shape_string_interpolation: { fg: "#3971ed" attr: "b" } - shape_table: { fg: "#3971ed" attr: "b" } - shape_variable: "#a36ac7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d1f21" - foreground: "#c5c8c6" - cursor: "#c5c8c6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c5c8c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#198844' attr: 'b' } + empty: '#3971ed' + bool: {|| if $in { '#3971ed' } else { 'light_gray' } } + int: '#c5c8c6' + filesize: {|e| + if $e == 0b { + '#c5c8c6' + } else if $e < 1mb { + '#3971ed' + } else {{ fg: '#3971ed' }} + } + duration: '#c5c8c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc342b' attr: 'b' } + } else if $in < 6hr { + '#cc342b' + } else if $in < 1day { + '#fba922' + } else if $in < 3day { + '#198844' + } else if $in < 1wk { + { fg: '#198844' attr: 'b' } + } else if $in < 6wk { + '#3971ed' + } else if $in < 52wk { + '#3971ed' + } else { 'dark_gray' } + } + range: '#c5c8c6' + float: '#c5c8c6' + string: '#c5c8c6' + nothing: '#c5c8c6' + binary: '#c5c8c6' + cellpath: '#c5c8c6' + row_index: { fg: '#198844' attr: 'b' } + record: '#c5c8c6' + list: '#c5c8c6' + block: '#c5c8c6' + hints: 'dark_gray' + search_result: { fg: '#cc342b' bg: '#c5c8c6' } + + shape_and: { fg: '#a36ac7' attr: 'b' } + shape_binary: { fg: '#a36ac7' attr: 'b' } + shape_block: { fg: '#3971ed' attr: 'b' } + shape_bool: '#3971ed' + shape_custom: '#198844' + shape_datetime: { fg: '#3971ed' attr: 'b' } + shape_directory: '#3971ed' + shape_external: '#3971ed' + shape_externalarg: { fg: '#198844' attr: 'b' } + shape_filepath: '#3971ed' + shape_flag: { fg: '#3971ed' attr: 'b' } + shape_float: { fg: '#a36ac7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3971ed' attr: 'b' } + shape_int: { fg: '#a36ac7' attr: 'b' } + shape_internalcall: { fg: '#3971ed' attr: 'b' } + shape_list: { fg: '#3971ed' attr: 'b' } + shape_literal: '#3971ed' + shape_match_pattern: '#198844' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3971ed' + shape_operator: '#fba922' + shape_or: { fg: '#a36ac7' attr: 'b' } + shape_pipe: { fg: '#a36ac7' attr: 'b' } + shape_range: { fg: '#fba922' attr: 'b' } + shape_record: { fg: '#3971ed' attr: 'b' } + shape_redirection: { fg: '#a36ac7' attr: 'b' } + shape_signature: { fg: '#198844' attr: 'b' } + shape_string: '#198844' + shape_string_interpolation: { fg: '#3971ed' attr: 'b' } + shape_table: { fg: '#3971ed' attr: 'b' } + shape_variable: '#a36ac7' + + background: '#1d1f21' + foreground: '#c5c8c6' + cursor: '#c5c8c6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/google-light.nu b/themes/nu-themes/google-light.nu index b22a892..3476032 100644 --- a/themes/nu-themes/google-light.nu +++ b/themes/nu-themes/google-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#373b41" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#198844" attr: "b" } - empty: "#3971ed" - bool: {|| if $in { "#3971ed" } else { "light_gray" } } - int: "#373b41" - filesize: {|e| - if $e == 0b { - "#373b41" - } else if $e < 1mb { - "#3971ed" - } else {{ fg: "#3971ed" }} - } - duration: "#373b41" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc342b" attr: "b" } - } else if $in < 6hr { - "#cc342b" - } else if $in < 1day { - "#fba922" - } else if $in < 3day { - "#198844" - } else if $in < 1wk { - { fg: "#198844" attr: "b" } - } else if $in < 6wk { - "#3971ed" - } else if $in < 52wk { - "#3971ed" - } else { "dark_gray" } - } - range: "#373b41" - float: "#373b41" - string: "#373b41" - nothing: "#373b41" - binary: "#373b41" - cellpath: "#373b41" - row_index: { fg: "#198844" attr: "b" } - record: "#373b41" - list: "#373b41" - block: "#373b41" - hints: "dark_gray" - search_result: { fg: "#cc342b" bg: "#373b41" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a36ac7" attr: "b" } - shape_binary: { fg: "#a36ac7" attr: "b" } - shape_block: { fg: "#3971ed" attr: "b" } - shape_bool: "#3971ed" - shape_custom: "#198844" - shape_datetime: { fg: "#3971ed" attr: "b" } - shape_directory: "#3971ed" - shape_external: "#3971ed" - shape_externalarg: { fg: "#198844" attr: "b" } - shape_filepath: "#3971ed" - shape_flag: { fg: "#3971ed" attr: "b" } - shape_float: { fg: "#a36ac7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3971ed" attr: "b" } - shape_int: { fg: "#a36ac7" attr: "b" } - shape_internalcall: { fg: "#3971ed" attr: "b" } - shape_list: { fg: "#3971ed" attr: "b" } - shape_literal: "#3971ed" - shape_match_pattern: "#198844" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3971ed" - shape_operator: "#fba922" - shape_or: { fg: "#a36ac7" attr: "b" } - shape_pipe: { fg: "#a36ac7" attr: "b" } - shape_range: { fg: "#fba922" attr: "b" } - shape_record: { fg: "#3971ed" attr: "b" } - shape_redirection: { fg: "#a36ac7" attr: "b" } - shape_signature: { fg: "#198844" attr: "b" } - shape_string: "#198844" - shape_string_interpolation: { fg: "#3971ed" attr: "b" } - shape_table: { fg: "#3971ed" attr: "b" } - shape_variable: "#a36ac7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#373b41" - cursor: "#373b41" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#373b41' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#198844' attr: 'b' } + empty: '#3971ed' + bool: {|| if $in { '#3971ed' } else { 'light_gray' } } + int: '#373b41' + filesize: {|e| + if $e == 0b { + '#373b41' + } else if $e < 1mb { + '#3971ed' + } else {{ fg: '#3971ed' }} + } + duration: '#373b41' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc342b' attr: 'b' } + } else if $in < 6hr { + '#cc342b' + } else if $in < 1day { + '#fba922' + } else if $in < 3day { + '#198844' + } else if $in < 1wk { + { fg: '#198844' attr: 'b' } + } else if $in < 6wk { + '#3971ed' + } else if $in < 52wk { + '#3971ed' + } else { 'dark_gray' } + } + range: '#373b41' + float: '#373b41' + string: '#373b41' + nothing: '#373b41' + binary: '#373b41' + cellpath: '#373b41' + row_index: { fg: '#198844' attr: 'b' } + record: '#373b41' + list: '#373b41' + block: '#373b41' + hints: 'dark_gray' + search_result: { fg: '#cc342b' bg: '#373b41' } + + shape_and: { fg: '#a36ac7' attr: 'b' } + shape_binary: { fg: '#a36ac7' attr: 'b' } + shape_block: { fg: '#3971ed' attr: 'b' } + shape_bool: '#3971ed' + shape_custom: '#198844' + shape_datetime: { fg: '#3971ed' attr: 'b' } + shape_directory: '#3971ed' + shape_external: '#3971ed' + shape_externalarg: { fg: '#198844' attr: 'b' } + shape_filepath: '#3971ed' + shape_flag: { fg: '#3971ed' attr: 'b' } + shape_float: { fg: '#a36ac7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3971ed' attr: 'b' } + shape_int: { fg: '#a36ac7' attr: 'b' } + shape_internalcall: { fg: '#3971ed' attr: 'b' } + shape_list: { fg: '#3971ed' attr: 'b' } + shape_literal: '#3971ed' + shape_match_pattern: '#198844' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3971ed' + shape_operator: '#fba922' + shape_or: { fg: '#a36ac7' attr: 'b' } + shape_pipe: { fg: '#a36ac7' attr: 'b' } + shape_range: { fg: '#fba922' attr: 'b' } + shape_record: { fg: '#3971ed' attr: 'b' } + shape_redirection: { fg: '#a36ac7' attr: 'b' } + shape_signature: { fg: '#198844' attr: 'b' } + shape_string: '#198844' + shape_string_interpolation: { fg: '#3971ed' attr: 'b' } + shape_table: { fg: '#3971ed' attr: 'b' } + shape_variable: '#a36ac7' + + background: '#ffffff' + foreground: '#373b41' + cursor: '#373b41' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/grape.nu b/themes/nu-themes/grape.nu index 06dc6db..9b6f9ba 100644 --- a/themes/nu-themes/grape.nu +++ b/themes/nu-themes/grape.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#9e9ea0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#1fa91b" attr: "b" } - empty: "#487df4" - bool: {|| if $in { "#9de3eb" } else { "light_gray" } } - int: "#9e9ea0" - filesize: {|e| - if $e == 0b { - "#9e9ea0" - } else if $e < 1mb { - "#3bdeed" - } else {{ fg: "#487df4" }} - } - duration: "#9e9ea0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ed2261" attr: "b" } - } else if $in < 6hr { - "#ed2261" - } else if $in < 1day { - "#8ddc20" - } else if $in < 3day { - "#1fa91b" - } else if $in < 1wk { - { fg: "#1fa91b" attr: "b" } - } else if $in < 6wk { - "#3bdeed" - } else if $in < 52wk { - "#487df4" - } else { "dark_gray" } - } - range: "#9e9ea0" - float: "#9e9ea0" - string: "#9e9ea0" - nothing: "#9e9ea0" - binary: "#9e9ea0" - cellpath: "#9e9ea0" - row_index: { fg: "#1fa91b" attr: "b" } - record: "#9e9ea0" - list: "#9e9ea0" - block: "#9e9ea0" - hints: "dark_gray" - search_result: { fg: "#ed2261" bg: "#9e9ea0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8d35c9" attr: "b" } - shape_binary: { fg: "#8d35c9" attr: "b" } - shape_block: { fg: "#487df4" attr: "b" } - shape_bool: "#9de3eb" - shape_custom: "#1fa91b" - shape_datetime: { fg: "#3bdeed" attr: "b" } - shape_directory: "#3bdeed" - shape_external: "#3bdeed" - shape_externalarg: { fg: "#1fa91b" attr: "b" } - shape_filepath: "#3bdeed" - shape_flag: { fg: "#487df4" attr: "b" } - shape_float: { fg: "#8d35c9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3bdeed" attr: "b" } - shape_int: { fg: "#8d35c9" attr: "b" } - shape_internalcall: { fg: "#3bdeed" attr: "b" } - shape_list: { fg: "#3bdeed" attr: "b" } - shape_literal: "#487df4" - shape_match_pattern: "#1fa91b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#9de3eb" - shape_operator: "#8ddc20" - shape_or: { fg: "#8d35c9" attr: "b" } - shape_pipe: { fg: "#8d35c9" attr: "b" } - shape_range: { fg: "#8ddc20" attr: "b" } - shape_record: { fg: "#3bdeed" attr: "b" } - shape_redirection: { fg: "#8d35c9" attr: "b" } - shape_signature: { fg: "#1fa91b" attr: "b" } - shape_string: "#1fa91b" - shape_string_interpolation: { fg: "#3bdeed" attr: "b" } - shape_table: { fg: "#487df4" attr: "b" } - shape_variable: "#8d35c9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#171423" - foreground: "#9f9fa1" - cursor: "#9f9fa1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#9e9ea0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#1fa91b' attr: 'b' } + empty: '#487df4' + bool: {|| if $in { '#9de3eb' } else { 'light_gray' } } + int: '#9e9ea0' + filesize: {|e| + if $e == 0b { + '#9e9ea0' + } else if $e < 1mb { + '#3bdeed' + } else {{ fg: '#487df4' }} + } + duration: '#9e9ea0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ed2261' attr: 'b' } + } else if $in < 6hr { + '#ed2261' + } else if $in < 1day { + '#8ddc20' + } else if $in < 3day { + '#1fa91b' + } else if $in < 1wk { + { fg: '#1fa91b' attr: 'b' } + } else if $in < 6wk { + '#3bdeed' + } else if $in < 52wk { + '#487df4' + } else { 'dark_gray' } + } + range: '#9e9ea0' + float: '#9e9ea0' + string: '#9e9ea0' + nothing: '#9e9ea0' + binary: '#9e9ea0' + cellpath: '#9e9ea0' + row_index: { fg: '#1fa91b' attr: 'b' } + record: '#9e9ea0' + list: '#9e9ea0' + block: '#9e9ea0' + hints: 'dark_gray' + search_result: { fg: '#ed2261' bg: '#9e9ea0' } + + shape_and: { fg: '#8d35c9' attr: 'b' } + shape_binary: { fg: '#8d35c9' attr: 'b' } + shape_block: { fg: '#487df4' attr: 'b' } + shape_bool: '#9de3eb' + shape_custom: '#1fa91b' + shape_datetime: { fg: '#3bdeed' attr: 'b' } + shape_directory: '#3bdeed' + shape_external: '#3bdeed' + shape_externalarg: { fg: '#1fa91b' attr: 'b' } + shape_filepath: '#3bdeed' + shape_flag: { fg: '#487df4' attr: 'b' } + shape_float: { fg: '#8d35c9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3bdeed' attr: 'b' } + shape_int: { fg: '#8d35c9' attr: 'b' } + shape_internalcall: { fg: '#3bdeed' attr: 'b' } + shape_list: { fg: '#3bdeed' attr: 'b' } + shape_literal: '#487df4' + shape_match_pattern: '#1fa91b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#9de3eb' + shape_operator: '#8ddc20' + shape_or: { fg: '#8d35c9' attr: 'b' } + shape_pipe: { fg: '#8d35c9' attr: 'b' } + shape_range: { fg: '#8ddc20' attr: 'b' } + shape_record: { fg: '#3bdeed' attr: 'b' } + shape_redirection: { fg: '#8d35c9' attr: 'b' } + shape_signature: { fg: '#1fa91b' attr: 'b' } + shape_string: '#1fa91b' + shape_string_interpolation: { fg: '#3bdeed' attr: 'b' } + shape_table: { fg: '#487df4' attr: 'b' } + shape_variable: '#8d35c9' + + background: '#171423' + foreground: '#9f9fa1' + cursor: '#9f9fa1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/grass.nu b/themes/nu-themes/grass.nu index 5dda70b..f7dcc02 100644 --- a/themes/nu-themes/grass.nu +++ b/themes/nu-themes/grass.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00bb00" attr: "b" } - empty: "#0000a3" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#00bbbb" - } else {{ fg: "#0000a3" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bb0000" attr: "b" } - } else if $in < 6hr { - "#bb0000" - } else if $in < 1day { - "#e7b000" - } else if $in < 3day { - "#00bb00" - } else if $in < 1wk { - { fg: "#00bb00" attr: "b" } - } else if $in < 6wk { - "#00bbbb" - } else if $in < 52wk { - "#0000a3" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#00bb00" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#bb0000" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#950062" attr: "b" } - shape_binary: { fg: "#950062" attr: "b" } - shape_block: { fg: "#0000a3" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#00bb00" - shape_datetime: { fg: "#00bbbb" attr: "b" } - shape_directory: "#00bbbb" - shape_external: "#00bbbb" - shape_externalarg: { fg: "#00bb00" attr: "b" } - shape_filepath: "#00bbbb" - shape_flag: { fg: "#0000a3" attr: "b" } - shape_float: { fg: "#950062" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00bbbb" attr: "b" } - shape_int: { fg: "#950062" attr: "b" } - shape_internalcall: { fg: "#00bbbb" attr: "b" } - shape_list: { fg: "#00bbbb" attr: "b" } - shape_literal: "#0000a3" - shape_match_pattern: "#00bb00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#e7b000" - shape_or: { fg: "#950062" attr: "b" } - shape_pipe: { fg: "#950062" attr: "b" } - shape_range: { fg: "#e7b000" attr: "b" } - shape_record: { fg: "#00bbbb" attr: "b" } - shape_redirection: { fg: "#950062" attr: "b" } - shape_signature: { fg: "#00bb00" attr: "b" } - shape_string: "#00bb00" - shape_string_interpolation: { fg: "#00bbbb" attr: "b" } - shape_table: { fg: "#0000a3" attr: "b" } - shape_variable: "#950062" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#13773d" - foreground: "#fff0a5" - cursor: "#fff0a5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00bb00' attr: 'b' } + empty: '#0000a3' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#00bbbb' + } else {{ fg: '#0000a3' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bb0000' attr: 'b' } + } else if $in < 6hr { + '#bb0000' + } else if $in < 1day { + '#e7b000' + } else if $in < 3day { + '#00bb00' + } else if $in < 1wk { + { fg: '#00bb00' attr: 'b' } + } else if $in < 6wk { + '#00bbbb' + } else if $in < 52wk { + '#0000a3' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#00bb00' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#bb0000' bg: '#bbbbbb' } + + shape_and: { fg: '#950062' attr: 'b' } + shape_binary: { fg: '#950062' attr: 'b' } + shape_block: { fg: '#0000a3' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#00bb00' + shape_datetime: { fg: '#00bbbb' attr: 'b' } + shape_directory: '#00bbbb' + shape_external: '#00bbbb' + shape_externalarg: { fg: '#00bb00' attr: 'b' } + shape_filepath: '#00bbbb' + shape_flag: { fg: '#0000a3' attr: 'b' } + shape_float: { fg: '#950062' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00bbbb' attr: 'b' } + shape_int: { fg: '#950062' attr: 'b' } + shape_internalcall: { fg: '#00bbbb' attr: 'b' } + shape_list: { fg: '#00bbbb' attr: 'b' } + shape_literal: '#0000a3' + shape_match_pattern: '#00bb00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#e7b000' + shape_or: { fg: '#950062' attr: 'b' } + shape_pipe: { fg: '#950062' attr: 'b' } + shape_range: { fg: '#e7b000' attr: 'b' } + shape_record: { fg: '#00bbbb' attr: 'b' } + shape_redirection: { fg: '#950062' attr: 'b' } + shape_signature: { fg: '#00bb00' attr: 'b' } + shape_string: '#00bb00' + shape_string_interpolation: { fg: '#00bbbb' attr: 'b' } + shape_table: { fg: '#0000a3' attr: 'b' } + shape_variable: '#950062' + + background: '#13773d' + foreground: '#fff0a5' + cursor: '#fff0a5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/grayscale-dark.nu b/themes/nu-themes/grayscale-dark.nu index 5cfa87c..4c45d3c 100644 --- a/themes/nu-themes/grayscale-dark.nu +++ b/themes/nu-themes/grayscale-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b9b9b9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8e8e8e" attr: "b" } - empty: "#686868" - bool: {|| if $in { "#868686" } else { "light_gray" } } - int: "#b9b9b9" - filesize: {|e| - if $e == 0b { - "#b9b9b9" - } else if $e < 1mb { - "#868686" - } else {{ fg: "#686868" }} - } - duration: "#b9b9b9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#7c7c7c" attr: "b" } - } else if $in < 6hr { - "#7c7c7c" - } else if $in < 1day { - "#a0a0a0" - } else if $in < 3day { - "#8e8e8e" - } else if $in < 1wk { - { fg: "#8e8e8e" attr: "b" } - } else if $in < 6wk { - "#868686" - } else if $in < 52wk { - "#686868" - } else { "dark_gray" } - } - range: "#b9b9b9" - float: "#b9b9b9" - string: "#b9b9b9" - nothing: "#b9b9b9" - binary: "#b9b9b9" - cellpath: "#b9b9b9" - row_index: { fg: "#8e8e8e" attr: "b" } - record: "#b9b9b9" - list: "#b9b9b9" - block: "#b9b9b9" - hints: "dark_gray" - search_result: { fg: "#7c7c7c" bg: "#b9b9b9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#747474" attr: "b" } - shape_binary: { fg: "#747474" attr: "b" } - shape_block: { fg: "#686868" attr: "b" } - shape_bool: "#868686" - shape_custom: "#8e8e8e" - shape_datetime: { fg: "#868686" attr: "b" } - shape_directory: "#868686" - shape_external: "#868686" - shape_externalarg: { fg: "#8e8e8e" attr: "b" } - shape_filepath: "#868686" - shape_flag: { fg: "#686868" attr: "b" } - shape_float: { fg: "#747474" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#868686" attr: "b" } - shape_int: { fg: "#747474" attr: "b" } - shape_internalcall: { fg: "#868686" attr: "b" } - shape_list: { fg: "#868686" attr: "b" } - shape_literal: "#686868" - shape_match_pattern: "#8e8e8e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#868686" - shape_operator: "#a0a0a0" - shape_or: { fg: "#747474" attr: "b" } - shape_pipe: { fg: "#747474" attr: "b" } - shape_range: { fg: "#a0a0a0" attr: "b" } - shape_record: { fg: "#868686" attr: "b" } - shape_redirection: { fg: "#747474" attr: "b" } - shape_signature: { fg: "#8e8e8e" attr: "b" } - shape_string: "#8e8e8e" - shape_string_interpolation: { fg: "#868686" attr: "b" } - shape_table: { fg: "#686868" attr: "b" } - shape_variable: "#747474" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#101010" - foreground: "#b9b9b9" - cursor: "#b9b9b9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b9b9b9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8e8e8e' attr: 'b' } + empty: '#686868' + bool: {|| if $in { '#868686' } else { 'light_gray' } } + int: '#b9b9b9' + filesize: {|e| + if $e == 0b { + '#b9b9b9' + } else if $e < 1mb { + '#868686' + } else {{ fg: '#686868' }} + } + duration: '#b9b9b9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#7c7c7c' attr: 'b' } + } else if $in < 6hr { + '#7c7c7c' + } else if $in < 1day { + '#a0a0a0' + } else if $in < 3day { + '#8e8e8e' + } else if $in < 1wk { + { fg: '#8e8e8e' attr: 'b' } + } else if $in < 6wk { + '#868686' + } else if $in < 52wk { + '#686868' + } else { 'dark_gray' } + } + range: '#b9b9b9' + float: '#b9b9b9' + string: '#b9b9b9' + nothing: '#b9b9b9' + binary: '#b9b9b9' + cellpath: '#b9b9b9' + row_index: { fg: '#8e8e8e' attr: 'b' } + record: '#b9b9b9' + list: '#b9b9b9' + block: '#b9b9b9' + hints: 'dark_gray' + search_result: { fg: '#7c7c7c' bg: '#b9b9b9' } + + shape_and: { fg: '#747474' attr: 'b' } + shape_binary: { fg: '#747474' attr: 'b' } + shape_block: { fg: '#686868' attr: 'b' } + shape_bool: '#868686' + shape_custom: '#8e8e8e' + shape_datetime: { fg: '#868686' attr: 'b' } + shape_directory: '#868686' + shape_external: '#868686' + shape_externalarg: { fg: '#8e8e8e' attr: 'b' } + shape_filepath: '#868686' + shape_flag: { fg: '#686868' attr: 'b' } + shape_float: { fg: '#747474' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#868686' attr: 'b' } + shape_int: { fg: '#747474' attr: 'b' } + shape_internalcall: { fg: '#868686' attr: 'b' } + shape_list: { fg: '#868686' attr: 'b' } + shape_literal: '#686868' + shape_match_pattern: '#8e8e8e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#868686' + shape_operator: '#a0a0a0' + shape_or: { fg: '#747474' attr: 'b' } + shape_pipe: { fg: '#747474' attr: 'b' } + shape_range: { fg: '#a0a0a0' attr: 'b' } + shape_record: { fg: '#868686' attr: 'b' } + shape_redirection: { fg: '#747474' attr: 'b' } + shape_signature: { fg: '#8e8e8e' attr: 'b' } + shape_string: '#8e8e8e' + shape_string_interpolation: { fg: '#868686' attr: 'b' } + shape_table: { fg: '#686868' attr: 'b' } + shape_variable: '#747474' + + background: '#101010' + foreground: '#b9b9b9' + cursor: '#b9b9b9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/grayscale-light.nu b/themes/nu-themes/grayscale-light.nu index 5f24208..3cbcfae 100644 --- a/themes/nu-themes/grayscale-light.nu +++ b/themes/nu-themes/grayscale-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#464646" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8e8e8e" attr: "b" } - empty: "#686868" - bool: {|| if $in { "#868686" } else { "light_gray" } } - int: "#464646" - filesize: {|e| - if $e == 0b { - "#464646" - } else if $e < 1mb { - "#868686" - } else {{ fg: "#686868" }} - } - duration: "#464646" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#7c7c7c" attr: "b" } - } else if $in < 6hr { - "#7c7c7c" - } else if $in < 1day { - "#a0a0a0" - } else if $in < 3day { - "#8e8e8e" - } else if $in < 1wk { - { fg: "#8e8e8e" attr: "b" } - } else if $in < 6wk { - "#868686" - } else if $in < 52wk { - "#686868" - } else { "dark_gray" } - } - range: "#464646" - float: "#464646" - string: "#464646" - nothing: "#464646" - binary: "#464646" - cellpath: "#464646" - row_index: { fg: "#8e8e8e" attr: "b" } - record: "#464646" - list: "#464646" - block: "#464646" - hints: "dark_gray" - search_result: { fg: "#7c7c7c" bg: "#464646" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#747474" attr: "b" } - shape_binary: { fg: "#747474" attr: "b" } - shape_block: { fg: "#686868" attr: "b" } - shape_bool: "#868686" - shape_custom: "#8e8e8e" - shape_datetime: { fg: "#868686" attr: "b" } - shape_directory: "#868686" - shape_external: "#868686" - shape_externalarg: { fg: "#8e8e8e" attr: "b" } - shape_filepath: "#868686" - shape_flag: { fg: "#686868" attr: "b" } - shape_float: { fg: "#747474" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#868686" attr: "b" } - shape_int: { fg: "#747474" attr: "b" } - shape_internalcall: { fg: "#868686" attr: "b" } - shape_list: { fg: "#868686" attr: "b" } - shape_literal: "#686868" - shape_match_pattern: "#8e8e8e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#868686" - shape_operator: "#a0a0a0" - shape_or: { fg: "#747474" attr: "b" } - shape_pipe: { fg: "#747474" attr: "b" } - shape_range: { fg: "#a0a0a0" attr: "b" } - shape_record: { fg: "#868686" attr: "b" } - shape_redirection: { fg: "#747474" attr: "b" } - shape_signature: { fg: "#8e8e8e" attr: "b" } - shape_string: "#8e8e8e" - shape_string_interpolation: { fg: "#868686" attr: "b" } - shape_table: { fg: "#686868" attr: "b" } - shape_variable: "#747474" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f7f7f7" - foreground: "#464646" - cursor: "#464646" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#464646' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8e8e8e' attr: 'b' } + empty: '#686868' + bool: {|| if $in { '#868686' } else { 'light_gray' } } + int: '#464646' + filesize: {|e| + if $e == 0b { + '#464646' + } else if $e < 1mb { + '#868686' + } else {{ fg: '#686868' }} + } + duration: '#464646' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#7c7c7c' attr: 'b' } + } else if $in < 6hr { + '#7c7c7c' + } else if $in < 1day { + '#a0a0a0' + } else if $in < 3day { + '#8e8e8e' + } else if $in < 1wk { + { fg: '#8e8e8e' attr: 'b' } + } else if $in < 6wk { + '#868686' + } else if $in < 52wk { + '#686868' + } else { 'dark_gray' } + } + range: '#464646' + float: '#464646' + string: '#464646' + nothing: '#464646' + binary: '#464646' + cellpath: '#464646' + row_index: { fg: '#8e8e8e' attr: 'b' } + record: '#464646' + list: '#464646' + block: '#464646' + hints: 'dark_gray' + search_result: { fg: '#7c7c7c' bg: '#464646' } + + shape_and: { fg: '#747474' attr: 'b' } + shape_binary: { fg: '#747474' attr: 'b' } + shape_block: { fg: '#686868' attr: 'b' } + shape_bool: '#868686' + shape_custom: '#8e8e8e' + shape_datetime: { fg: '#868686' attr: 'b' } + shape_directory: '#868686' + shape_external: '#868686' + shape_externalarg: { fg: '#8e8e8e' attr: 'b' } + shape_filepath: '#868686' + shape_flag: { fg: '#686868' attr: 'b' } + shape_float: { fg: '#747474' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#868686' attr: 'b' } + shape_int: { fg: '#747474' attr: 'b' } + shape_internalcall: { fg: '#868686' attr: 'b' } + shape_list: { fg: '#868686' attr: 'b' } + shape_literal: '#686868' + shape_match_pattern: '#8e8e8e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#868686' + shape_operator: '#a0a0a0' + shape_or: { fg: '#747474' attr: 'b' } + shape_pipe: { fg: '#747474' attr: 'b' } + shape_range: { fg: '#a0a0a0' attr: 'b' } + shape_record: { fg: '#868686' attr: 'b' } + shape_redirection: { fg: '#747474' attr: 'b' } + shape_signature: { fg: '#8e8e8e' attr: 'b' } + shape_string: '#8e8e8e' + shape_string_interpolation: { fg: '#868686' attr: 'b' } + shape_table: { fg: '#686868' attr: 'b' } + shape_variable: '#747474' + + background: '#f7f7f7' + foreground: '#464646' + cursor: '#464646' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/green-screen.nu b/themes/nu-themes/green-screen.nu index 504a0b1..ca89843 100644 --- a/themes/nu-themes/green-screen.nu +++ b/themes/nu-themes/green-screen.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#00bb00" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00bb00" attr: "b" } - empty: "#009900" - bool: {|| if $in { "#005500" } else { "light_gray" } } - int: "#00bb00" - filesize: {|e| - if $e == 0b { - "#00bb00" - } else if $e < 1mb { - "#005500" - } else {{ fg: "#009900" }} - } - duration: "#00bb00" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#007700" attr: "b" } - } else if $in < 6hr { - "#007700" - } else if $in < 1day { - "#007700" - } else if $in < 3day { - "#00bb00" - } else if $in < 1wk { - { fg: "#00bb00" attr: "b" } - } else if $in < 6wk { - "#005500" - } else if $in < 52wk { - "#009900" - } else { "dark_gray" } - } - range: "#00bb00" - float: "#00bb00" - string: "#00bb00" - nothing: "#00bb00" - binary: "#00bb00" - cellpath: "#00bb00" - row_index: { fg: "#00bb00" attr: "b" } - record: "#00bb00" - list: "#00bb00" - block: "#00bb00" - hints: "dark_gray" - search_result: { fg: "#007700" bg: "#00bb00" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#00bb00" attr: "b" } - shape_binary: { fg: "#00bb00" attr: "b" } - shape_block: { fg: "#009900" attr: "b" } - shape_bool: "#005500" - shape_custom: "#00bb00" - shape_datetime: { fg: "#005500" attr: "b" } - shape_directory: "#005500" - shape_external: "#005500" - shape_externalarg: { fg: "#00bb00" attr: "b" } - shape_filepath: "#005500" - shape_flag: { fg: "#009900" attr: "b" } - shape_float: { fg: "#00bb00" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#005500" attr: "b" } - shape_int: { fg: "#00bb00" attr: "b" } - shape_internalcall: { fg: "#005500" attr: "b" } - shape_list: { fg: "#005500" attr: "b" } - shape_literal: "#009900" - shape_match_pattern: "#00bb00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#005500" - shape_operator: "#007700" - shape_or: { fg: "#00bb00" attr: "b" } - shape_pipe: { fg: "#00bb00" attr: "b" } - shape_range: { fg: "#007700" attr: "b" } - shape_record: { fg: "#005500" attr: "b" } - shape_redirection: { fg: "#00bb00" attr: "b" } - shape_signature: { fg: "#00bb00" attr: "b" } - shape_string: "#00bb00" - shape_string_interpolation: { fg: "#005500" attr: "b" } - shape_table: { fg: "#009900" attr: "b" } - shape_variable: "#00bb00" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#001100" - foreground: "#00bb00" - cursor: "#00bb00" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#00bb00' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00bb00' attr: 'b' } + empty: '#009900' + bool: {|| if $in { '#005500' } else { 'light_gray' } } + int: '#00bb00' + filesize: {|e| + if $e == 0b { + '#00bb00' + } else if $e < 1mb { + '#005500' + } else {{ fg: '#009900' }} + } + duration: '#00bb00' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#007700' attr: 'b' } + } else if $in < 6hr { + '#007700' + } else if $in < 1day { + '#007700' + } else if $in < 3day { + '#00bb00' + } else if $in < 1wk { + { fg: '#00bb00' attr: 'b' } + } else if $in < 6wk { + '#005500' + } else if $in < 52wk { + '#009900' + } else { 'dark_gray' } + } + range: '#00bb00' + float: '#00bb00' + string: '#00bb00' + nothing: '#00bb00' + binary: '#00bb00' + cellpath: '#00bb00' + row_index: { fg: '#00bb00' attr: 'b' } + record: '#00bb00' + list: '#00bb00' + block: '#00bb00' + hints: 'dark_gray' + search_result: { fg: '#007700' bg: '#00bb00' } + + shape_and: { fg: '#00bb00' attr: 'b' } + shape_binary: { fg: '#00bb00' attr: 'b' } + shape_block: { fg: '#009900' attr: 'b' } + shape_bool: '#005500' + shape_custom: '#00bb00' + shape_datetime: { fg: '#005500' attr: 'b' } + shape_directory: '#005500' + shape_external: '#005500' + shape_externalarg: { fg: '#00bb00' attr: 'b' } + shape_filepath: '#005500' + shape_flag: { fg: '#009900' attr: 'b' } + shape_float: { fg: '#00bb00' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#005500' attr: 'b' } + shape_int: { fg: '#00bb00' attr: 'b' } + shape_internalcall: { fg: '#005500' attr: 'b' } + shape_list: { fg: '#005500' attr: 'b' } + shape_literal: '#009900' + shape_match_pattern: '#00bb00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#005500' + shape_operator: '#007700' + shape_or: { fg: '#00bb00' attr: 'b' } + shape_pipe: { fg: '#00bb00' attr: 'b' } + shape_range: { fg: '#007700' attr: 'b' } + shape_record: { fg: '#005500' attr: 'b' } + shape_redirection: { fg: '#00bb00' attr: 'b' } + shape_signature: { fg: '#00bb00' attr: 'b' } + shape_string: '#00bb00' + shape_string_interpolation: { fg: '#005500' attr: 'b' } + shape_table: { fg: '#009900' attr: 'b' } + shape_variable: '#00bb00' + + background: '#001100' + foreground: '#00bb00' + cursor: '#00bb00' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/greenscreen.nu b/themes/nu-themes/greenscreen.nu index 504a0b1..ca89843 100644 --- a/themes/nu-themes/greenscreen.nu +++ b/themes/nu-themes/greenscreen.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#00bb00" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00bb00" attr: "b" } - empty: "#009900" - bool: {|| if $in { "#005500" } else { "light_gray" } } - int: "#00bb00" - filesize: {|e| - if $e == 0b { - "#00bb00" - } else if $e < 1mb { - "#005500" - } else {{ fg: "#009900" }} - } - duration: "#00bb00" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#007700" attr: "b" } - } else if $in < 6hr { - "#007700" - } else if $in < 1day { - "#007700" - } else if $in < 3day { - "#00bb00" - } else if $in < 1wk { - { fg: "#00bb00" attr: "b" } - } else if $in < 6wk { - "#005500" - } else if $in < 52wk { - "#009900" - } else { "dark_gray" } - } - range: "#00bb00" - float: "#00bb00" - string: "#00bb00" - nothing: "#00bb00" - binary: "#00bb00" - cellpath: "#00bb00" - row_index: { fg: "#00bb00" attr: "b" } - record: "#00bb00" - list: "#00bb00" - block: "#00bb00" - hints: "dark_gray" - search_result: { fg: "#007700" bg: "#00bb00" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#00bb00" attr: "b" } - shape_binary: { fg: "#00bb00" attr: "b" } - shape_block: { fg: "#009900" attr: "b" } - shape_bool: "#005500" - shape_custom: "#00bb00" - shape_datetime: { fg: "#005500" attr: "b" } - shape_directory: "#005500" - shape_external: "#005500" - shape_externalarg: { fg: "#00bb00" attr: "b" } - shape_filepath: "#005500" - shape_flag: { fg: "#009900" attr: "b" } - shape_float: { fg: "#00bb00" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#005500" attr: "b" } - shape_int: { fg: "#00bb00" attr: "b" } - shape_internalcall: { fg: "#005500" attr: "b" } - shape_list: { fg: "#005500" attr: "b" } - shape_literal: "#009900" - shape_match_pattern: "#00bb00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#005500" - shape_operator: "#007700" - shape_or: { fg: "#00bb00" attr: "b" } - shape_pipe: { fg: "#00bb00" attr: "b" } - shape_range: { fg: "#007700" attr: "b" } - shape_record: { fg: "#005500" attr: "b" } - shape_redirection: { fg: "#00bb00" attr: "b" } - shape_signature: { fg: "#00bb00" attr: "b" } - shape_string: "#00bb00" - shape_string_interpolation: { fg: "#005500" attr: "b" } - shape_table: { fg: "#009900" attr: "b" } - shape_variable: "#00bb00" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#001100" - foreground: "#00bb00" - cursor: "#00bb00" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#00bb00' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00bb00' attr: 'b' } + empty: '#009900' + bool: {|| if $in { '#005500' } else { 'light_gray' } } + int: '#00bb00' + filesize: {|e| + if $e == 0b { + '#00bb00' + } else if $e < 1mb { + '#005500' + } else {{ fg: '#009900' }} + } + duration: '#00bb00' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#007700' attr: 'b' } + } else if $in < 6hr { + '#007700' + } else if $in < 1day { + '#007700' + } else if $in < 3day { + '#00bb00' + } else if $in < 1wk { + { fg: '#00bb00' attr: 'b' } + } else if $in < 6wk { + '#005500' + } else if $in < 52wk { + '#009900' + } else { 'dark_gray' } + } + range: '#00bb00' + float: '#00bb00' + string: '#00bb00' + nothing: '#00bb00' + binary: '#00bb00' + cellpath: '#00bb00' + row_index: { fg: '#00bb00' attr: 'b' } + record: '#00bb00' + list: '#00bb00' + block: '#00bb00' + hints: 'dark_gray' + search_result: { fg: '#007700' bg: '#00bb00' } + + shape_and: { fg: '#00bb00' attr: 'b' } + shape_binary: { fg: '#00bb00' attr: 'b' } + shape_block: { fg: '#009900' attr: 'b' } + shape_bool: '#005500' + shape_custom: '#00bb00' + shape_datetime: { fg: '#005500' attr: 'b' } + shape_directory: '#005500' + shape_external: '#005500' + shape_externalarg: { fg: '#00bb00' attr: 'b' } + shape_filepath: '#005500' + shape_flag: { fg: '#009900' attr: 'b' } + shape_float: { fg: '#00bb00' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#005500' attr: 'b' } + shape_int: { fg: '#00bb00' attr: 'b' } + shape_internalcall: { fg: '#005500' attr: 'b' } + shape_list: { fg: '#005500' attr: 'b' } + shape_literal: '#009900' + shape_match_pattern: '#00bb00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#005500' + shape_operator: '#007700' + shape_or: { fg: '#00bb00' attr: 'b' } + shape_pipe: { fg: '#00bb00' attr: 'b' } + shape_range: { fg: '#007700' attr: 'b' } + shape_record: { fg: '#005500' attr: 'b' } + shape_redirection: { fg: '#00bb00' attr: 'b' } + shape_signature: { fg: '#00bb00' attr: 'b' } + shape_string: '#00bb00' + shape_string_interpolation: { fg: '#005500' attr: 'b' } + shape_table: { fg: '#009900' attr: 'b' } + shape_variable: '#00bb00' + + background: '#001100' + foreground: '#00bb00' + cursor: '#00bb00' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbit.nu b/themes/nu-themes/gruvbit.nu index a61a535..009f3d1 100644 --- a/themes/nu-themes/gruvbit.nu +++ b/themes/nu-themes/gruvbit.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#504945" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8ec07c" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#e9593d" } else { "light_gray" } } - int: "#504945" - filesize: {|e| - if $e == 0b { - "#504945" - } else if $e < 1mb { - "#e9593d" - } else {{ fg: "#83a598" }} - } - duration: "#504945" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fabd2f" attr: "b" } - } else if $in < 6hr { - "#fabd2f" - } else if $in < 1day { - "#dc9656" - } else if $in < 3day { - "#8ec07c" - } else if $in < 1wk { - { fg: "#8ec07c" attr: "b" } - } else if $in < 6wk { - "#e9593d" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#504945" - float: "#504945" - string: "#504945" - nothing: "#504945" - binary: "#504945" - cellpath: "#504945" - row_index: { fg: "#8ec07c" attr: "b" } - record: "#504945" - list: "#504945" - block: "#504945" - hints: "dark_gray" - search_result: { fg: "#fabd2f" bg: "#504945" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fe8019" attr: "b" } - shape_binary: { fg: "#fe8019" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#e9593d" - shape_custom: "#8ec07c" - shape_datetime: { fg: "#e9593d" attr: "b" } - shape_directory: "#e9593d" - shape_external: "#e9593d" - shape_externalarg: { fg: "#8ec07c" attr: "b" } - shape_filepath: "#e9593d" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#fe8019" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#e9593d" attr: "b" } - shape_int: { fg: "#fe8019" attr: "b" } - shape_internalcall: { fg: "#e9593d" attr: "b" } - shape_list: { fg: "#e9593d" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#8ec07c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#e9593d" - shape_operator: "#dc9656" - shape_or: { fg: "#fe8019" attr: "b" } - shape_pipe: { fg: "#fe8019" attr: "b" } - shape_range: { fg: "#dc9656" attr: "b" } - shape_record: { fg: "#e9593d" attr: "b" } - shape_redirection: { fg: "#fe8019" attr: "b" } - shape_signature: { fg: "#8ec07c" attr: "b" } - shape_string: "#8ec07c" - shape_string_interpolation: { fg: "#e9593d" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#fe8019" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d1f21" - foreground: "#ebdbb2" - cursor: "#ebdbb2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#504945' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8ec07c' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#e9593d' } else { 'light_gray' } } + int: '#504945' + filesize: {|e| + if $e == 0b { + '#504945' + } else if $e < 1mb { + '#e9593d' + } else {{ fg: '#83a598' }} + } + duration: '#504945' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fabd2f' attr: 'b' } + } else if $in < 6hr { + '#fabd2f' + } else if $in < 1day { + '#dc9656' + } else if $in < 3day { + '#8ec07c' + } else if $in < 1wk { + { fg: '#8ec07c' attr: 'b' } + } else if $in < 6wk { + '#e9593d' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#504945' + float: '#504945' + string: '#504945' + nothing: '#504945' + binary: '#504945' + cellpath: '#504945' + row_index: { fg: '#8ec07c' attr: 'b' } + record: '#504945' + list: '#504945' + block: '#504945' + hints: 'dark_gray' + search_result: { fg: '#fabd2f' bg: '#504945' } + + shape_and: { fg: '#fe8019' attr: 'b' } + shape_binary: { fg: '#fe8019' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#e9593d' + shape_custom: '#8ec07c' + shape_datetime: { fg: '#e9593d' attr: 'b' } + shape_directory: '#e9593d' + shape_external: '#e9593d' + shape_externalarg: { fg: '#8ec07c' attr: 'b' } + shape_filepath: '#e9593d' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#fe8019' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#e9593d' attr: 'b' } + shape_int: { fg: '#fe8019' attr: 'b' } + shape_internalcall: { fg: '#e9593d' attr: 'b' } + shape_list: { fg: '#e9593d' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#8ec07c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#e9593d' + shape_operator: '#dc9656' + shape_or: { fg: '#fe8019' attr: 'b' } + shape_pipe: { fg: '#fe8019' attr: 'b' } + shape_range: { fg: '#dc9656' attr: 'b' } + shape_record: { fg: '#e9593d' attr: 'b' } + shape_redirection: { fg: '#fe8019' attr: 'b' } + shape_signature: { fg: '#8ec07c' attr: 'b' } + shape_string: '#8ec07c' + shape_string_interpolation: { fg: '#e9593d' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#fe8019' + + background: '#1d1f21' + foreground: '#ebdbb2' + cursor: '#ebdbb2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-dark-hard.nu b/themes/nu-themes/gruvbox-dark-hard.nu index d2611a2..6154dc9 100644 --- a/themes/nu-themes/gruvbox-dark-hard.nu +++ b/themes/nu-themes/gruvbox-dark-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d5c4a1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8bb26" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#d5c4a1" - filesize: {|e| - if $e == 0b { - "#d5c4a1" - } else if $e < 1mb { - "#8ec07c" - } else {{ fg: "#83a598" }} - } - duration: "#d5c4a1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb4934" attr: "b" } - } else if $in < 6hr { - "#fb4934" - } else if $in < 1day { - "#fabd2f" - } else if $in < 3day { - "#b8bb26" - } else if $in < 1wk { - { fg: "#b8bb26" attr: "b" } - } else if $in < 6wk { - "#8ec07c" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#d5c4a1" - float: "#d5c4a1" - string: "#d5c4a1" - nothing: "#d5c4a1" - binary: "#d5c4a1" - cellpath: "#d5c4a1" - row_index: { fg: "#b8bb26" attr: "b" } - record: "#d5c4a1" - list: "#d5c4a1" - block: "#d5c4a1" - hints: "dark_gray" - search_result: { fg: "#fb4934" bg: "#d5c4a1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#b8bb26" - shape_datetime: { fg: "#8ec07c" attr: "b" } - shape_directory: "#8ec07c" - shape_external: "#8ec07c" - shape_externalarg: { fg: "#b8bb26" attr: "b" } - shape_filepath: "#8ec07c" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ec07c" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8ec07c" attr: "b" } - shape_list: { fg: "#8ec07c" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#b8bb26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#fabd2f" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#fabd2f" attr: "b" } - shape_record: { fg: "#8ec07c" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b8bb26" attr: "b" } - shape_string: "#b8bb26" - shape_string_interpolation: { fg: "#8ec07c" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2021" - foreground: "#d5c4a1" - cursor: "#d5c4a1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d5c4a1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8bb26' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#d5c4a1' + filesize: {|e| + if $e == 0b { + '#d5c4a1' + } else if $e < 1mb { + '#8ec07c' + } else {{ fg: '#83a598' }} + } + duration: '#d5c4a1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb4934' attr: 'b' } + } else if $in < 6hr { + '#fb4934' + } else if $in < 1day { + '#fabd2f' + } else if $in < 3day { + '#b8bb26' + } else if $in < 1wk { + { fg: '#b8bb26' attr: 'b' } + } else if $in < 6wk { + '#8ec07c' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#d5c4a1' + float: '#d5c4a1' + string: '#d5c4a1' + nothing: '#d5c4a1' + binary: '#d5c4a1' + cellpath: '#d5c4a1' + row_index: { fg: '#b8bb26' attr: 'b' } + record: '#d5c4a1' + list: '#d5c4a1' + block: '#d5c4a1' + hints: 'dark_gray' + search_result: { fg: '#fb4934' bg: '#d5c4a1' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#b8bb26' + shape_datetime: { fg: '#8ec07c' attr: 'b' } + shape_directory: '#8ec07c' + shape_external: '#8ec07c' + shape_externalarg: { fg: '#b8bb26' attr: 'b' } + shape_filepath: '#8ec07c' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ec07c' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8ec07c' attr: 'b' } + shape_list: { fg: '#8ec07c' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#b8bb26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#fabd2f' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#fabd2f' attr: 'b' } + shape_record: { fg: '#8ec07c' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b8bb26' attr: 'b' } + shape_string: '#b8bb26' + shape_string_interpolation: { fg: '#8ec07c' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d3869b' + + background: '#1d2021' + foreground: '#d5c4a1' + cursor: '#d5c4a1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-dark-medium.nu b/themes/nu-themes/gruvbox-dark-medium.nu index 55fe249..b0e6e4f 100644 --- a/themes/nu-themes/gruvbox-dark-medium.nu +++ b/themes/nu-themes/gruvbox-dark-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d5c4a1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8bb26" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#d5c4a1" - filesize: {|e| - if $e == 0b { - "#d5c4a1" - } else if $e < 1mb { - "#8ec07c" - } else {{ fg: "#83a598" }} - } - duration: "#d5c4a1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb4934" attr: "b" } - } else if $in < 6hr { - "#fb4934" - } else if $in < 1day { - "#fabd2f" - } else if $in < 3day { - "#b8bb26" - } else if $in < 1wk { - { fg: "#b8bb26" attr: "b" } - } else if $in < 6wk { - "#8ec07c" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#d5c4a1" - float: "#d5c4a1" - string: "#d5c4a1" - nothing: "#d5c4a1" - binary: "#d5c4a1" - cellpath: "#d5c4a1" - row_index: { fg: "#b8bb26" attr: "b" } - record: "#d5c4a1" - list: "#d5c4a1" - block: "#d5c4a1" - hints: "dark_gray" - search_result: { fg: "#fb4934" bg: "#d5c4a1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#b8bb26" - shape_datetime: { fg: "#8ec07c" attr: "b" } - shape_directory: "#8ec07c" - shape_external: "#8ec07c" - shape_externalarg: { fg: "#b8bb26" attr: "b" } - shape_filepath: "#8ec07c" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ec07c" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8ec07c" attr: "b" } - shape_list: { fg: "#8ec07c" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#b8bb26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#fabd2f" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#fabd2f" attr: "b" } - shape_record: { fg: "#8ec07c" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b8bb26" attr: "b" } - shape_string: "#b8bb26" - shape_string_interpolation: { fg: "#8ec07c" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282828" - foreground: "#d5c4a1" - cursor: "#d5c4a1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d5c4a1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8bb26' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#d5c4a1' + filesize: {|e| + if $e == 0b { + '#d5c4a1' + } else if $e < 1mb { + '#8ec07c' + } else {{ fg: '#83a598' }} + } + duration: '#d5c4a1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb4934' attr: 'b' } + } else if $in < 6hr { + '#fb4934' + } else if $in < 1day { + '#fabd2f' + } else if $in < 3day { + '#b8bb26' + } else if $in < 1wk { + { fg: '#b8bb26' attr: 'b' } + } else if $in < 6wk { + '#8ec07c' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#d5c4a1' + float: '#d5c4a1' + string: '#d5c4a1' + nothing: '#d5c4a1' + binary: '#d5c4a1' + cellpath: '#d5c4a1' + row_index: { fg: '#b8bb26' attr: 'b' } + record: '#d5c4a1' + list: '#d5c4a1' + block: '#d5c4a1' + hints: 'dark_gray' + search_result: { fg: '#fb4934' bg: '#d5c4a1' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#b8bb26' + shape_datetime: { fg: '#8ec07c' attr: 'b' } + shape_directory: '#8ec07c' + shape_external: '#8ec07c' + shape_externalarg: { fg: '#b8bb26' attr: 'b' } + shape_filepath: '#8ec07c' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ec07c' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8ec07c' attr: 'b' } + shape_list: { fg: '#8ec07c' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#b8bb26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#fabd2f' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#fabd2f' attr: 'b' } + shape_record: { fg: '#8ec07c' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b8bb26' attr: 'b' } + shape_string: '#b8bb26' + shape_string_interpolation: { fg: '#8ec07c' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d3869b' + + background: '#282828' + foreground: '#d5c4a1' + cursor: '#d5c4a1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-dark-pale.nu b/themes/nu-themes/gruvbox-dark-pale.nu index 9214d4d..2399733 100644 --- a/themes/nu-themes/gruvbox-dark-pale.nu +++ b/themes/nu-themes/gruvbox-dark-pale.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dab997" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#afaf00" attr: "b" } - empty: "#83adad" - bool: {|| if $in { "#85ad85" } else { "light_gray" } } - int: "#dab997" - filesize: {|e| - if $e == 0b { - "#dab997" - } else if $e < 1mb { - "#85ad85" - } else {{ fg: "#83adad" }} - } - duration: "#dab997" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d75f5f" attr: "b" } - } else if $in < 6hr { - "#d75f5f" - } else if $in < 1day { - "#ffaf00" - } else if $in < 3day { - "#afaf00" - } else if $in < 1wk { - { fg: "#afaf00" attr: "b" } - } else if $in < 6wk { - "#85ad85" - } else if $in < 52wk { - "#83adad" - } else { "dark_gray" } - } - range: "#dab997" - float: "#dab997" - string: "#dab997" - nothing: "#dab997" - binary: "#dab997" - cellpath: "#dab997" - row_index: { fg: "#afaf00" attr: "b" } - record: "#dab997" - list: "#dab997" - block: "#dab997" - hints: "dark_gray" - search_result: { fg: "#d75f5f" bg: "#dab997" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d485ad" attr: "b" } - shape_binary: { fg: "#d485ad" attr: "b" } - shape_block: { fg: "#83adad" attr: "b" } - shape_bool: "#85ad85" - shape_custom: "#afaf00" - shape_datetime: { fg: "#85ad85" attr: "b" } - shape_directory: "#85ad85" - shape_external: "#85ad85" - shape_externalarg: { fg: "#afaf00" attr: "b" } - shape_filepath: "#85ad85" - shape_flag: { fg: "#83adad" attr: "b" } - shape_float: { fg: "#d485ad" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#85ad85" attr: "b" } - shape_int: { fg: "#d485ad" attr: "b" } - shape_internalcall: { fg: "#85ad85" attr: "b" } - shape_list: { fg: "#85ad85" attr: "b" } - shape_literal: "#83adad" - shape_match_pattern: "#afaf00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#85ad85" - shape_operator: "#ffaf00" - shape_or: { fg: "#d485ad" attr: "b" } - shape_pipe: { fg: "#d485ad" attr: "b" } - shape_range: { fg: "#ffaf00" attr: "b" } - shape_record: { fg: "#85ad85" attr: "b" } - shape_redirection: { fg: "#d485ad" attr: "b" } - shape_signature: { fg: "#afaf00" attr: "b" } - shape_string: "#afaf00" - shape_string_interpolation: { fg: "#85ad85" attr: "b" } - shape_table: { fg: "#83adad" attr: "b" } - shape_variable: "#d485ad" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262626" - foreground: "#dab997" - cursor: "#dab997" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dab997' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#afaf00' attr: 'b' } + empty: '#83adad' + bool: {|| if $in { '#85ad85' } else { 'light_gray' } } + int: '#dab997' + filesize: {|e| + if $e == 0b { + '#dab997' + } else if $e < 1mb { + '#85ad85' + } else {{ fg: '#83adad' }} + } + duration: '#dab997' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d75f5f' attr: 'b' } + } else if $in < 6hr { + '#d75f5f' + } else if $in < 1day { + '#ffaf00' + } else if $in < 3day { + '#afaf00' + } else if $in < 1wk { + { fg: '#afaf00' attr: 'b' } + } else if $in < 6wk { + '#85ad85' + } else if $in < 52wk { + '#83adad' + } else { 'dark_gray' } + } + range: '#dab997' + float: '#dab997' + string: '#dab997' + nothing: '#dab997' + binary: '#dab997' + cellpath: '#dab997' + row_index: { fg: '#afaf00' attr: 'b' } + record: '#dab997' + list: '#dab997' + block: '#dab997' + hints: 'dark_gray' + search_result: { fg: '#d75f5f' bg: '#dab997' } + + shape_and: { fg: '#d485ad' attr: 'b' } + shape_binary: { fg: '#d485ad' attr: 'b' } + shape_block: { fg: '#83adad' attr: 'b' } + shape_bool: '#85ad85' + shape_custom: '#afaf00' + shape_datetime: { fg: '#85ad85' attr: 'b' } + shape_directory: '#85ad85' + shape_external: '#85ad85' + shape_externalarg: { fg: '#afaf00' attr: 'b' } + shape_filepath: '#85ad85' + shape_flag: { fg: '#83adad' attr: 'b' } + shape_float: { fg: '#d485ad' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#85ad85' attr: 'b' } + shape_int: { fg: '#d485ad' attr: 'b' } + shape_internalcall: { fg: '#85ad85' attr: 'b' } + shape_list: { fg: '#85ad85' attr: 'b' } + shape_literal: '#83adad' + shape_match_pattern: '#afaf00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#85ad85' + shape_operator: '#ffaf00' + shape_or: { fg: '#d485ad' attr: 'b' } + shape_pipe: { fg: '#d485ad' attr: 'b' } + shape_range: { fg: '#ffaf00' attr: 'b' } + shape_record: { fg: '#85ad85' attr: 'b' } + shape_redirection: { fg: '#d485ad' attr: 'b' } + shape_signature: { fg: '#afaf00' attr: 'b' } + shape_string: '#afaf00' + shape_string_interpolation: { fg: '#85ad85' attr: 'b' } + shape_table: { fg: '#83adad' attr: 'b' } + shape_variable: '#d485ad' + + background: '#262626' + foreground: '#dab997' + cursor: '#dab997' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-dark-soft.nu b/themes/nu-themes/gruvbox-dark-soft.nu index 9075fb2..ef91211 100644 --- a/themes/nu-themes/gruvbox-dark-soft.nu +++ b/themes/nu-themes/gruvbox-dark-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d5c4a1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8bb26" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#d5c4a1" - filesize: {|e| - if $e == 0b { - "#d5c4a1" - } else if $e < 1mb { - "#8ec07c" - } else {{ fg: "#83a598" }} - } - duration: "#d5c4a1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb4934" attr: "b" } - } else if $in < 6hr { - "#fb4934" - } else if $in < 1day { - "#fabd2f" - } else if $in < 3day { - "#b8bb26" - } else if $in < 1wk { - { fg: "#b8bb26" attr: "b" } - } else if $in < 6wk { - "#8ec07c" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#d5c4a1" - float: "#d5c4a1" - string: "#d5c4a1" - nothing: "#d5c4a1" - binary: "#d5c4a1" - cellpath: "#d5c4a1" - row_index: { fg: "#b8bb26" attr: "b" } - record: "#d5c4a1" - list: "#d5c4a1" - block: "#d5c4a1" - hints: "dark_gray" - search_result: { fg: "#fb4934" bg: "#d5c4a1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#b8bb26" - shape_datetime: { fg: "#8ec07c" attr: "b" } - shape_directory: "#8ec07c" - shape_external: "#8ec07c" - shape_externalarg: { fg: "#b8bb26" attr: "b" } - shape_filepath: "#8ec07c" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ec07c" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8ec07c" attr: "b" } - shape_list: { fg: "#8ec07c" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#b8bb26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#fabd2f" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#fabd2f" attr: "b" } - shape_record: { fg: "#8ec07c" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b8bb26" attr: "b" } - shape_string: "#b8bb26" - shape_string_interpolation: { fg: "#8ec07c" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#32302f" - foreground: "#d5c4a1" - cursor: "#d5c4a1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d5c4a1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8bb26' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#d5c4a1' + filesize: {|e| + if $e == 0b { + '#d5c4a1' + } else if $e < 1mb { + '#8ec07c' + } else {{ fg: '#83a598' }} + } + duration: '#d5c4a1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb4934' attr: 'b' } + } else if $in < 6hr { + '#fb4934' + } else if $in < 1day { + '#fabd2f' + } else if $in < 3day { + '#b8bb26' + } else if $in < 1wk { + { fg: '#b8bb26' attr: 'b' } + } else if $in < 6wk { + '#8ec07c' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#d5c4a1' + float: '#d5c4a1' + string: '#d5c4a1' + nothing: '#d5c4a1' + binary: '#d5c4a1' + cellpath: '#d5c4a1' + row_index: { fg: '#b8bb26' attr: 'b' } + record: '#d5c4a1' + list: '#d5c4a1' + block: '#d5c4a1' + hints: 'dark_gray' + search_result: { fg: '#fb4934' bg: '#d5c4a1' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#b8bb26' + shape_datetime: { fg: '#8ec07c' attr: 'b' } + shape_directory: '#8ec07c' + shape_external: '#8ec07c' + shape_externalarg: { fg: '#b8bb26' attr: 'b' } + shape_filepath: '#8ec07c' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ec07c' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8ec07c' attr: 'b' } + shape_list: { fg: '#8ec07c' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#b8bb26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#fabd2f' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#fabd2f' attr: 'b' } + shape_record: { fg: '#8ec07c' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b8bb26' attr: 'b' } + shape_string: '#b8bb26' + shape_string_interpolation: { fg: '#8ec07c' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d3869b' + + background: '#32302f' + foreground: '#d5c4a1' + cursor: '#d5c4a1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-dark.nu b/themes/nu-themes/gruvbox-dark.nu index 29847e3..cbfc264 100644 --- a/themes/nu-themes/gruvbox-dark.nu +++ b/themes/nu-themes/gruvbox-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a89984" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98971a" attr: "b" } - empty: "#458588" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#a89984" - filesize: {|e| - if $e == 0b { - "#a89984" - } else if $e < 1mb { - "#689d6a" - } else {{ fg: "#458588" }} - } - duration: "#a89984" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc241d" attr: "b" } - } else if $in < 6hr { - "#cc241d" - } else if $in < 1day { - "#d79921" - } else if $in < 3day { - "#98971a" - } else if $in < 1wk { - { fg: "#98971a" attr: "b" } - } else if $in < 6wk { - "#689d6a" - } else if $in < 52wk { - "#458588" - } else { "dark_gray" } - } - range: "#a89984" - float: "#a89984" - string: "#a89984" - nothing: "#a89984" - binary: "#a89984" - cellpath: "#a89984" - row_index: { fg: "#98971a" attr: "b" } - record: "#a89984" - list: "#a89984" - block: "#a89984" - hints: "dark_gray" - search_result: { fg: "#cc241d" bg: "#a89984" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b16286" attr: "b" } - shape_binary: { fg: "#b16286" attr: "b" } - shape_block: { fg: "#458588" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#98971a" - shape_datetime: { fg: "#689d6a" attr: "b" } - shape_directory: "#689d6a" - shape_external: "#689d6a" - shape_externalarg: { fg: "#98971a" attr: "b" } - shape_filepath: "#689d6a" - shape_flag: { fg: "#458588" attr: "b" } - shape_float: { fg: "#b16286" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#689d6a" attr: "b" } - shape_int: { fg: "#b16286" attr: "b" } - shape_internalcall: { fg: "#689d6a" attr: "b" } - shape_list: { fg: "#689d6a" attr: "b" } - shape_literal: "#458588" - shape_match_pattern: "#98971a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#d79921" - shape_or: { fg: "#b16286" attr: "b" } - shape_pipe: { fg: "#b16286" attr: "b" } - shape_range: { fg: "#d79921" attr: "b" } - shape_record: { fg: "#689d6a" attr: "b" } - shape_redirection: { fg: "#b16286" attr: "b" } - shape_signature: { fg: "#98971a" attr: "b" } - shape_string: "#98971a" - shape_string_interpolation: { fg: "#689d6a" attr: "b" } - shape_table: { fg: "#458588" attr: "b" } - shape_variable: "#b16286" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282828" - foreground: "#ebdbb2" - cursor: "#ebdbb2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a89984' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98971a' attr: 'b' } + empty: '#458588' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#a89984' + filesize: {|e| + if $e == 0b { + '#a89984' + } else if $e < 1mb { + '#689d6a' + } else {{ fg: '#458588' }} + } + duration: '#a89984' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc241d' attr: 'b' } + } else if $in < 6hr { + '#cc241d' + } else if $in < 1day { + '#d79921' + } else if $in < 3day { + '#98971a' + } else if $in < 1wk { + { fg: '#98971a' attr: 'b' } + } else if $in < 6wk { + '#689d6a' + } else if $in < 52wk { + '#458588' + } else { 'dark_gray' } + } + range: '#a89984' + float: '#a89984' + string: '#a89984' + nothing: '#a89984' + binary: '#a89984' + cellpath: '#a89984' + row_index: { fg: '#98971a' attr: 'b' } + record: '#a89984' + list: '#a89984' + block: '#a89984' + hints: 'dark_gray' + search_result: { fg: '#cc241d' bg: '#a89984' } + + shape_and: { fg: '#b16286' attr: 'b' } + shape_binary: { fg: '#b16286' attr: 'b' } + shape_block: { fg: '#458588' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#98971a' + shape_datetime: { fg: '#689d6a' attr: 'b' } + shape_directory: '#689d6a' + shape_external: '#689d6a' + shape_externalarg: { fg: '#98971a' attr: 'b' } + shape_filepath: '#689d6a' + shape_flag: { fg: '#458588' attr: 'b' } + shape_float: { fg: '#b16286' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#689d6a' attr: 'b' } + shape_int: { fg: '#b16286' attr: 'b' } + shape_internalcall: { fg: '#689d6a' attr: 'b' } + shape_list: { fg: '#689d6a' attr: 'b' } + shape_literal: '#458588' + shape_match_pattern: '#98971a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#d79921' + shape_or: { fg: '#b16286' attr: 'b' } + shape_pipe: { fg: '#b16286' attr: 'b' } + shape_range: { fg: '#d79921' attr: 'b' } + shape_record: { fg: '#689d6a' attr: 'b' } + shape_redirection: { fg: '#b16286' attr: 'b' } + shape_signature: { fg: '#98971a' attr: 'b' } + shape_string: '#98971a' + shape_string_interpolation: { fg: '#689d6a' attr: 'b' } + shape_table: { fg: '#458588' attr: 'b' } + shape_variable: '#b16286' + + background: '#282828' + foreground: '#ebdbb2' + cursor: '#ebdbb2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-light-hard.nu b/themes/nu-themes/gruvbox-light-hard.nu index d3f4188..f305c0a 100644 --- a/themes/nu-themes/gruvbox-light-hard.nu +++ b/themes/nu-themes/gruvbox-light-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#504945" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79740e" attr: "b" } - empty: "#076678" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#504945" - filesize: {|e| - if $e == 0b { - "#504945" - } else if $e < 1mb { - "#427b58" - } else {{ fg: "#076678" }} - } - duration: "#504945" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9d0006" attr: "b" } - } else if $in < 6hr { - "#9d0006" - } else if $in < 1day { - "#b57614" - } else if $in < 3day { - "#79740e" - } else if $in < 1wk { - { fg: "#79740e" attr: "b" } - } else if $in < 6wk { - "#427b58" - } else if $in < 52wk { - "#076678" - } else { "dark_gray" } - } - range: "#504945" - float: "#504945" - string: "#504945" - nothing: "#504945" - binary: "#504945" - cellpath: "#504945" - row_index: { fg: "#79740e" attr: "b" } - record: "#504945" - list: "#504945" - block: "#504945" - hints: "dark_gray" - search_result: { fg: "#9d0006" bg: "#504945" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f3f71" attr: "b" } - shape_binary: { fg: "#8f3f71" attr: "b" } - shape_block: { fg: "#076678" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#79740e" - shape_datetime: { fg: "#427b58" attr: "b" } - shape_directory: "#427b58" - shape_external: "#427b58" - shape_externalarg: { fg: "#79740e" attr: "b" } - shape_filepath: "#427b58" - shape_flag: { fg: "#076678" attr: "b" } - shape_float: { fg: "#8f3f71" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#427b58" attr: "b" } - shape_int: { fg: "#8f3f71" attr: "b" } - shape_internalcall: { fg: "#427b58" attr: "b" } - shape_list: { fg: "#427b58" attr: "b" } - shape_literal: "#076678" - shape_match_pattern: "#79740e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#b57614" - shape_or: { fg: "#8f3f71" attr: "b" } - shape_pipe: { fg: "#8f3f71" attr: "b" } - shape_range: { fg: "#b57614" attr: "b" } - shape_record: { fg: "#427b58" attr: "b" } - shape_redirection: { fg: "#8f3f71" attr: "b" } - shape_signature: { fg: "#79740e" attr: "b" } - shape_string: "#79740e" - shape_string_interpolation: { fg: "#427b58" attr: "b" } - shape_table: { fg: "#076678" attr: "b" } - shape_variable: "#8f3f71" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f9f5d7" - foreground: "#504945" - cursor: "#504945" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#504945' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79740e' attr: 'b' } + empty: '#076678' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#504945' + filesize: {|e| + if $e == 0b { + '#504945' + } else if $e < 1mb { + '#427b58' + } else {{ fg: '#076678' }} + } + duration: '#504945' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9d0006' attr: 'b' } + } else if $in < 6hr { + '#9d0006' + } else if $in < 1day { + '#b57614' + } else if $in < 3day { + '#79740e' + } else if $in < 1wk { + { fg: '#79740e' attr: 'b' } + } else if $in < 6wk { + '#427b58' + } else if $in < 52wk { + '#076678' + } else { 'dark_gray' } + } + range: '#504945' + float: '#504945' + string: '#504945' + nothing: '#504945' + binary: '#504945' + cellpath: '#504945' + row_index: { fg: '#79740e' attr: 'b' } + record: '#504945' + list: '#504945' + block: '#504945' + hints: 'dark_gray' + search_result: { fg: '#9d0006' bg: '#504945' } + + shape_and: { fg: '#8f3f71' attr: 'b' } + shape_binary: { fg: '#8f3f71' attr: 'b' } + shape_block: { fg: '#076678' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#79740e' + shape_datetime: { fg: '#427b58' attr: 'b' } + shape_directory: '#427b58' + shape_external: '#427b58' + shape_externalarg: { fg: '#79740e' attr: 'b' } + shape_filepath: '#427b58' + shape_flag: { fg: '#076678' attr: 'b' } + shape_float: { fg: '#8f3f71' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#427b58' attr: 'b' } + shape_int: { fg: '#8f3f71' attr: 'b' } + shape_internalcall: { fg: '#427b58' attr: 'b' } + shape_list: { fg: '#427b58' attr: 'b' } + shape_literal: '#076678' + shape_match_pattern: '#79740e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#b57614' + shape_or: { fg: '#8f3f71' attr: 'b' } + shape_pipe: { fg: '#8f3f71' attr: 'b' } + shape_range: { fg: '#b57614' attr: 'b' } + shape_record: { fg: '#427b58' attr: 'b' } + shape_redirection: { fg: '#8f3f71' attr: 'b' } + shape_signature: { fg: '#79740e' attr: 'b' } + shape_string: '#79740e' + shape_string_interpolation: { fg: '#427b58' attr: 'b' } + shape_table: { fg: '#076678' attr: 'b' } + shape_variable: '#8f3f71' + + background: '#f9f5d7' + foreground: '#504945' + cursor: '#504945' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-light-medium.nu b/themes/nu-themes/gruvbox-light-medium.nu index ec623e8..8f6c3ce 100644 --- a/themes/nu-themes/gruvbox-light-medium.nu +++ b/themes/nu-themes/gruvbox-light-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#504945" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79740e" attr: "b" } - empty: "#076678" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#504945" - filesize: {|e| - if $e == 0b { - "#504945" - } else if $e < 1mb { - "#427b58" - } else {{ fg: "#076678" }} - } - duration: "#504945" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9d0006" attr: "b" } - } else if $in < 6hr { - "#9d0006" - } else if $in < 1day { - "#b57614" - } else if $in < 3day { - "#79740e" - } else if $in < 1wk { - { fg: "#79740e" attr: "b" } - } else if $in < 6wk { - "#427b58" - } else if $in < 52wk { - "#076678" - } else { "dark_gray" } - } - range: "#504945" - float: "#504945" - string: "#504945" - nothing: "#504945" - binary: "#504945" - cellpath: "#504945" - row_index: { fg: "#79740e" attr: "b" } - record: "#504945" - list: "#504945" - block: "#504945" - hints: "dark_gray" - search_result: { fg: "#9d0006" bg: "#504945" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f3f71" attr: "b" } - shape_binary: { fg: "#8f3f71" attr: "b" } - shape_block: { fg: "#076678" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#79740e" - shape_datetime: { fg: "#427b58" attr: "b" } - shape_directory: "#427b58" - shape_external: "#427b58" - shape_externalarg: { fg: "#79740e" attr: "b" } - shape_filepath: "#427b58" - shape_flag: { fg: "#076678" attr: "b" } - shape_float: { fg: "#8f3f71" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#427b58" attr: "b" } - shape_int: { fg: "#8f3f71" attr: "b" } - shape_internalcall: { fg: "#427b58" attr: "b" } - shape_list: { fg: "#427b58" attr: "b" } - shape_literal: "#076678" - shape_match_pattern: "#79740e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#b57614" - shape_or: { fg: "#8f3f71" attr: "b" } - shape_pipe: { fg: "#8f3f71" attr: "b" } - shape_range: { fg: "#b57614" attr: "b" } - shape_record: { fg: "#427b58" attr: "b" } - shape_redirection: { fg: "#8f3f71" attr: "b" } - shape_signature: { fg: "#79740e" attr: "b" } - shape_string: "#79740e" - shape_string_interpolation: { fg: "#427b58" attr: "b" } - shape_table: { fg: "#076678" attr: "b" } - shape_variable: "#8f3f71" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf1c7" - foreground: "#504945" - cursor: "#504945" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#504945' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79740e' attr: 'b' } + empty: '#076678' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#504945' + filesize: {|e| + if $e == 0b { + '#504945' + } else if $e < 1mb { + '#427b58' + } else {{ fg: '#076678' }} + } + duration: '#504945' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9d0006' attr: 'b' } + } else if $in < 6hr { + '#9d0006' + } else if $in < 1day { + '#b57614' + } else if $in < 3day { + '#79740e' + } else if $in < 1wk { + { fg: '#79740e' attr: 'b' } + } else if $in < 6wk { + '#427b58' + } else if $in < 52wk { + '#076678' + } else { 'dark_gray' } + } + range: '#504945' + float: '#504945' + string: '#504945' + nothing: '#504945' + binary: '#504945' + cellpath: '#504945' + row_index: { fg: '#79740e' attr: 'b' } + record: '#504945' + list: '#504945' + block: '#504945' + hints: 'dark_gray' + search_result: { fg: '#9d0006' bg: '#504945' } + + shape_and: { fg: '#8f3f71' attr: 'b' } + shape_binary: { fg: '#8f3f71' attr: 'b' } + shape_block: { fg: '#076678' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#79740e' + shape_datetime: { fg: '#427b58' attr: 'b' } + shape_directory: '#427b58' + shape_external: '#427b58' + shape_externalarg: { fg: '#79740e' attr: 'b' } + shape_filepath: '#427b58' + shape_flag: { fg: '#076678' attr: 'b' } + shape_float: { fg: '#8f3f71' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#427b58' attr: 'b' } + shape_int: { fg: '#8f3f71' attr: 'b' } + shape_internalcall: { fg: '#427b58' attr: 'b' } + shape_list: { fg: '#427b58' attr: 'b' } + shape_literal: '#076678' + shape_match_pattern: '#79740e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#b57614' + shape_or: { fg: '#8f3f71' attr: 'b' } + shape_pipe: { fg: '#8f3f71' attr: 'b' } + shape_range: { fg: '#b57614' attr: 'b' } + shape_record: { fg: '#427b58' attr: 'b' } + shape_redirection: { fg: '#8f3f71' attr: 'b' } + shape_signature: { fg: '#79740e' attr: 'b' } + shape_string: '#79740e' + shape_string_interpolation: { fg: '#427b58' attr: 'b' } + shape_table: { fg: '#076678' attr: 'b' } + shape_variable: '#8f3f71' + + background: '#fbf1c7' + foreground: '#504945' + cursor: '#504945' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-light-soft.nu b/themes/nu-themes/gruvbox-light-soft.nu index e74615e..55e2b2a 100644 --- a/themes/nu-themes/gruvbox-light-soft.nu +++ b/themes/nu-themes/gruvbox-light-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#504945" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79740e" attr: "b" } - empty: "#076678" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#504945" - filesize: {|e| - if $e == 0b { - "#504945" - } else if $e < 1mb { - "#427b58" - } else {{ fg: "#076678" }} - } - duration: "#504945" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9d0006" attr: "b" } - } else if $in < 6hr { - "#9d0006" - } else if $in < 1day { - "#b57614" - } else if $in < 3day { - "#79740e" - } else if $in < 1wk { - { fg: "#79740e" attr: "b" } - } else if $in < 6wk { - "#427b58" - } else if $in < 52wk { - "#076678" - } else { "dark_gray" } - } - range: "#504945" - float: "#504945" - string: "#504945" - nothing: "#504945" - binary: "#504945" - cellpath: "#504945" - row_index: { fg: "#79740e" attr: "b" } - record: "#504945" - list: "#504945" - block: "#504945" - hints: "dark_gray" - search_result: { fg: "#9d0006" bg: "#504945" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f3f71" attr: "b" } - shape_binary: { fg: "#8f3f71" attr: "b" } - shape_block: { fg: "#076678" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#79740e" - shape_datetime: { fg: "#427b58" attr: "b" } - shape_directory: "#427b58" - shape_external: "#427b58" - shape_externalarg: { fg: "#79740e" attr: "b" } - shape_filepath: "#427b58" - shape_flag: { fg: "#076678" attr: "b" } - shape_float: { fg: "#8f3f71" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#427b58" attr: "b" } - shape_int: { fg: "#8f3f71" attr: "b" } - shape_internalcall: { fg: "#427b58" attr: "b" } - shape_list: { fg: "#427b58" attr: "b" } - shape_literal: "#076678" - shape_match_pattern: "#79740e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#b57614" - shape_or: { fg: "#8f3f71" attr: "b" } - shape_pipe: { fg: "#8f3f71" attr: "b" } - shape_range: { fg: "#b57614" attr: "b" } - shape_record: { fg: "#427b58" attr: "b" } - shape_redirection: { fg: "#8f3f71" attr: "b" } - shape_signature: { fg: "#79740e" attr: "b" } - shape_string: "#79740e" - shape_string_interpolation: { fg: "#427b58" attr: "b" } - shape_table: { fg: "#076678" attr: "b" } - shape_variable: "#8f3f71" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f2e5bc" - foreground: "#504945" - cursor: "#504945" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#504945' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79740e' attr: 'b' } + empty: '#076678' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#504945' + filesize: {|e| + if $e == 0b { + '#504945' + } else if $e < 1mb { + '#427b58' + } else {{ fg: '#076678' }} + } + duration: '#504945' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9d0006' attr: 'b' } + } else if $in < 6hr { + '#9d0006' + } else if $in < 1day { + '#b57614' + } else if $in < 3day { + '#79740e' + } else if $in < 1wk { + { fg: '#79740e' attr: 'b' } + } else if $in < 6wk { + '#427b58' + } else if $in < 52wk { + '#076678' + } else { 'dark_gray' } + } + range: '#504945' + float: '#504945' + string: '#504945' + nothing: '#504945' + binary: '#504945' + cellpath: '#504945' + row_index: { fg: '#79740e' attr: 'b' } + record: '#504945' + list: '#504945' + block: '#504945' + hints: 'dark_gray' + search_result: { fg: '#9d0006' bg: '#504945' } + + shape_and: { fg: '#8f3f71' attr: 'b' } + shape_binary: { fg: '#8f3f71' attr: 'b' } + shape_block: { fg: '#076678' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#79740e' + shape_datetime: { fg: '#427b58' attr: 'b' } + shape_directory: '#427b58' + shape_external: '#427b58' + shape_externalarg: { fg: '#79740e' attr: 'b' } + shape_filepath: '#427b58' + shape_flag: { fg: '#076678' attr: 'b' } + shape_float: { fg: '#8f3f71' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#427b58' attr: 'b' } + shape_int: { fg: '#8f3f71' attr: 'b' } + shape_internalcall: { fg: '#427b58' attr: 'b' } + shape_list: { fg: '#427b58' attr: 'b' } + shape_literal: '#076678' + shape_match_pattern: '#79740e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#b57614' + shape_or: { fg: '#8f3f71' attr: 'b' } + shape_pipe: { fg: '#8f3f71' attr: 'b' } + shape_range: { fg: '#b57614' attr: 'b' } + shape_record: { fg: '#427b58' attr: 'b' } + shape_redirection: { fg: '#8f3f71' attr: 'b' } + shape_signature: { fg: '#79740e' attr: 'b' } + shape_string: '#79740e' + shape_string_interpolation: { fg: '#427b58' attr: 'b' } + shape_table: { fg: '#076678' attr: 'b' } + shape_variable: '#8f3f71' + + background: '#f2e5bc' + foreground: '#504945' + cursor: '#504945' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-material-dark-hard.nu b/themes/nu-themes/gruvbox-material-dark-hard.nu index 2292976..52ea0d7 100644 --- a/themes/nu-themes/gruvbox-material-dark-hard.nu +++ b/themes/nu-themes/gruvbox-material-dark-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d4be98" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a9b665" attr: "b" } - empty: "#7daea3" - bool: {|| if $in { "#89b482" } else { "light_gray" } } - int: "#d4be98" - filesize: {|e| - if $e == 0b { - "#d4be98" - } else if $e < 1mb { - "#89b482" - } else {{ fg: "#7daea3" }} - } - duration: "#d4be98" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ea6962" attr: "b" } - } else if $in < 6hr { - "#ea6962" - } else if $in < 1day { - "#d8a657" - } else if $in < 3day { - "#a9b665" - } else if $in < 1wk { - { fg: "#a9b665" attr: "b" } - } else if $in < 6wk { - "#89b482" - } else if $in < 52wk { - "#7daea3" - } else { "dark_gray" } - } - range: "#d4be98" - float: "#d4be98" - string: "#d4be98" - nothing: "#d4be98" - binary: "#d4be98" - cellpath: "#d4be98" - row_index: { fg: "#a9b665" attr: "b" } - record: "#d4be98" - list: "#d4be98" - block: "#d4be98" - hints: "dark_gray" - search_result: { fg: "#ea6962" bg: "#d4be98" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#7daea3" attr: "b" } - shape_bool: "#89b482" - shape_custom: "#a9b665" - shape_datetime: { fg: "#89b482" attr: "b" } - shape_directory: "#89b482" - shape_external: "#89b482" - shape_externalarg: { fg: "#a9b665" attr: "b" } - shape_filepath: "#89b482" - shape_flag: { fg: "#7daea3" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#89b482" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#89b482" attr: "b" } - shape_list: { fg: "#89b482" attr: "b" } - shape_literal: "#7daea3" - shape_match_pattern: "#a9b665" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#89b482" - shape_operator: "#d8a657" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#d8a657" attr: "b" } - shape_record: { fg: "#89b482" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#a9b665" attr: "b" } - shape_string: "#a9b665" - shape_string_interpolation: { fg: "#89b482" attr: "b" } - shape_table: { fg: "#7daea3" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2021" - foreground: "#d4be98" - cursor: "#d4be98" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d4be98' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a9b665' attr: 'b' } + empty: '#7daea3' + bool: {|| if $in { '#89b482' } else { 'light_gray' } } + int: '#d4be98' + filesize: {|e| + if $e == 0b { + '#d4be98' + } else if $e < 1mb { + '#89b482' + } else {{ fg: '#7daea3' }} + } + duration: '#d4be98' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ea6962' attr: 'b' } + } else if $in < 6hr { + '#ea6962' + } else if $in < 1day { + '#d8a657' + } else if $in < 3day { + '#a9b665' + } else if $in < 1wk { + { fg: '#a9b665' attr: 'b' } + } else if $in < 6wk { + '#89b482' + } else if $in < 52wk { + '#7daea3' + } else { 'dark_gray' } + } + range: '#d4be98' + float: '#d4be98' + string: '#d4be98' + nothing: '#d4be98' + binary: '#d4be98' + cellpath: '#d4be98' + row_index: { fg: '#a9b665' attr: 'b' } + record: '#d4be98' + list: '#d4be98' + block: '#d4be98' + hints: 'dark_gray' + search_result: { fg: '#ea6962' bg: '#d4be98' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#7daea3' attr: 'b' } + shape_bool: '#89b482' + shape_custom: '#a9b665' + shape_datetime: { fg: '#89b482' attr: 'b' } + shape_directory: '#89b482' + shape_external: '#89b482' + shape_externalarg: { fg: '#a9b665' attr: 'b' } + shape_filepath: '#89b482' + shape_flag: { fg: '#7daea3' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#89b482' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#89b482' attr: 'b' } + shape_list: { fg: '#89b482' attr: 'b' } + shape_literal: '#7daea3' + shape_match_pattern: '#a9b665' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#89b482' + shape_operator: '#d8a657' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#d8a657' attr: 'b' } + shape_record: { fg: '#89b482' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#a9b665' attr: 'b' } + shape_string: '#a9b665' + shape_string_interpolation: { fg: '#89b482' attr: 'b' } + shape_table: { fg: '#7daea3' attr: 'b' } + shape_variable: '#d3869b' + + background: '#1d2021' + foreground: '#d4be98' + cursor: '#d4be98' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-material-dark-medium.nu b/themes/nu-themes/gruvbox-material-dark-medium.nu index 9c738cc..79f4954 100644 --- a/themes/nu-themes/gruvbox-material-dark-medium.nu +++ b/themes/nu-themes/gruvbox-material-dark-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d4be98" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a9b665" attr: "b" } - empty: "#7daea3" - bool: {|| if $in { "#89b482" } else { "light_gray" } } - int: "#d4be98" - filesize: {|e| - if $e == 0b { - "#d4be98" - } else if $e < 1mb { - "#89b482" - } else {{ fg: "#7daea3" }} - } - duration: "#d4be98" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ea6962" attr: "b" } - } else if $in < 6hr { - "#ea6962" - } else if $in < 1day { - "#d8a657" - } else if $in < 3day { - "#a9b665" - } else if $in < 1wk { - { fg: "#a9b665" attr: "b" } - } else if $in < 6wk { - "#89b482" - } else if $in < 52wk { - "#7daea3" - } else { "dark_gray" } - } - range: "#d4be98" - float: "#d4be98" - string: "#d4be98" - nothing: "#d4be98" - binary: "#d4be98" - cellpath: "#d4be98" - row_index: { fg: "#a9b665" attr: "b" } - record: "#d4be98" - list: "#d4be98" - block: "#d4be98" - hints: "dark_gray" - search_result: { fg: "#ea6962" bg: "#d4be98" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#7daea3" attr: "b" } - shape_bool: "#89b482" - shape_custom: "#a9b665" - shape_datetime: { fg: "#89b482" attr: "b" } - shape_directory: "#89b482" - shape_external: "#89b482" - shape_externalarg: { fg: "#a9b665" attr: "b" } - shape_filepath: "#89b482" - shape_flag: { fg: "#7daea3" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#89b482" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#89b482" attr: "b" } - shape_list: { fg: "#89b482" attr: "b" } - shape_literal: "#7daea3" - shape_match_pattern: "#a9b665" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#89b482" - shape_operator: "#d8a657" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#d8a657" attr: "b" } - shape_record: { fg: "#89b482" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#a9b665" attr: "b" } - shape_string: "#a9b665" - shape_string_interpolation: { fg: "#89b482" attr: "b" } - shape_table: { fg: "#7daea3" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282828" - foreground: "#d4be98" - cursor: "#d4be98" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d4be98' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a9b665' attr: 'b' } + empty: '#7daea3' + bool: {|| if $in { '#89b482' } else { 'light_gray' } } + int: '#d4be98' + filesize: {|e| + if $e == 0b { + '#d4be98' + } else if $e < 1mb { + '#89b482' + } else {{ fg: '#7daea3' }} + } + duration: '#d4be98' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ea6962' attr: 'b' } + } else if $in < 6hr { + '#ea6962' + } else if $in < 1day { + '#d8a657' + } else if $in < 3day { + '#a9b665' + } else if $in < 1wk { + { fg: '#a9b665' attr: 'b' } + } else if $in < 6wk { + '#89b482' + } else if $in < 52wk { + '#7daea3' + } else { 'dark_gray' } + } + range: '#d4be98' + float: '#d4be98' + string: '#d4be98' + nothing: '#d4be98' + binary: '#d4be98' + cellpath: '#d4be98' + row_index: { fg: '#a9b665' attr: 'b' } + record: '#d4be98' + list: '#d4be98' + block: '#d4be98' + hints: 'dark_gray' + search_result: { fg: '#ea6962' bg: '#d4be98' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#7daea3' attr: 'b' } + shape_bool: '#89b482' + shape_custom: '#a9b665' + shape_datetime: { fg: '#89b482' attr: 'b' } + shape_directory: '#89b482' + shape_external: '#89b482' + shape_externalarg: { fg: '#a9b665' attr: 'b' } + shape_filepath: '#89b482' + shape_flag: { fg: '#7daea3' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#89b482' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#89b482' attr: 'b' } + shape_list: { fg: '#89b482' attr: 'b' } + shape_literal: '#7daea3' + shape_match_pattern: '#a9b665' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#89b482' + shape_operator: '#d8a657' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#d8a657' attr: 'b' } + shape_record: { fg: '#89b482' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#a9b665' attr: 'b' } + shape_string: '#a9b665' + shape_string_interpolation: { fg: '#89b482' attr: 'b' } + shape_table: { fg: '#7daea3' attr: 'b' } + shape_variable: '#d3869b' + + background: '#282828' + foreground: '#d4be98' + cursor: '#d4be98' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-material-dark-soft.nu b/themes/nu-themes/gruvbox-material-dark-soft.nu index 7930965..4960af1 100644 --- a/themes/nu-themes/gruvbox-material-dark-soft.nu +++ b/themes/nu-themes/gruvbox-material-dark-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d4be98" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a9b665" attr: "b" } - empty: "#7daea3" - bool: {|| if $in { "#89b482" } else { "light_gray" } } - int: "#d4be98" - filesize: {|e| - if $e == 0b { - "#d4be98" - } else if $e < 1mb { - "#89b482" - } else {{ fg: "#7daea3" }} - } - duration: "#d4be98" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ea6962" attr: "b" } - } else if $in < 6hr { - "#ea6962" - } else if $in < 1day { - "#d8a657" - } else if $in < 3day { - "#a9b665" - } else if $in < 1wk { - { fg: "#a9b665" attr: "b" } - } else if $in < 6wk { - "#89b482" - } else if $in < 52wk { - "#7daea3" - } else { "dark_gray" } - } - range: "#d4be98" - float: "#d4be98" - string: "#d4be98" - nothing: "#d4be98" - binary: "#d4be98" - cellpath: "#d4be98" - row_index: { fg: "#a9b665" attr: "b" } - record: "#d4be98" - list: "#d4be98" - block: "#d4be98" - hints: "dark_gray" - search_result: { fg: "#ea6962" bg: "#d4be98" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#7daea3" attr: "b" } - shape_bool: "#89b482" - shape_custom: "#a9b665" - shape_datetime: { fg: "#89b482" attr: "b" } - shape_directory: "#89b482" - shape_external: "#89b482" - shape_externalarg: { fg: "#a9b665" attr: "b" } - shape_filepath: "#89b482" - shape_flag: { fg: "#7daea3" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#89b482" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#89b482" attr: "b" } - shape_list: { fg: "#89b482" attr: "b" } - shape_literal: "#7daea3" - shape_match_pattern: "#a9b665" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#89b482" - shape_operator: "#d8a657" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#d8a657" attr: "b" } - shape_record: { fg: "#89b482" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#a9b665" attr: "b" } - shape_string: "#a9b665" - shape_string_interpolation: { fg: "#89b482" attr: "b" } - shape_table: { fg: "#7daea3" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#32302f" - foreground: "#d4be98" - cursor: "#d4be98" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d4be98' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a9b665' attr: 'b' } + empty: '#7daea3' + bool: {|| if $in { '#89b482' } else { 'light_gray' } } + int: '#d4be98' + filesize: {|e| + if $e == 0b { + '#d4be98' + } else if $e < 1mb { + '#89b482' + } else {{ fg: '#7daea3' }} + } + duration: '#d4be98' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ea6962' attr: 'b' } + } else if $in < 6hr { + '#ea6962' + } else if $in < 1day { + '#d8a657' + } else if $in < 3day { + '#a9b665' + } else if $in < 1wk { + { fg: '#a9b665' attr: 'b' } + } else if $in < 6wk { + '#89b482' + } else if $in < 52wk { + '#7daea3' + } else { 'dark_gray' } + } + range: '#d4be98' + float: '#d4be98' + string: '#d4be98' + nothing: '#d4be98' + binary: '#d4be98' + cellpath: '#d4be98' + row_index: { fg: '#a9b665' attr: 'b' } + record: '#d4be98' + list: '#d4be98' + block: '#d4be98' + hints: 'dark_gray' + search_result: { fg: '#ea6962' bg: '#d4be98' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#7daea3' attr: 'b' } + shape_bool: '#89b482' + shape_custom: '#a9b665' + shape_datetime: { fg: '#89b482' attr: 'b' } + shape_directory: '#89b482' + shape_external: '#89b482' + shape_externalarg: { fg: '#a9b665' attr: 'b' } + shape_filepath: '#89b482' + shape_flag: { fg: '#7daea3' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#89b482' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#89b482' attr: 'b' } + shape_list: { fg: '#89b482' attr: 'b' } + shape_literal: '#7daea3' + shape_match_pattern: '#a9b665' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#89b482' + shape_operator: '#d8a657' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#d8a657' attr: 'b' } + shape_record: { fg: '#89b482' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#a9b665' attr: 'b' } + shape_string: '#a9b665' + shape_string_interpolation: { fg: '#89b482' attr: 'b' } + shape_table: { fg: '#7daea3' attr: 'b' } + shape_variable: '#d3869b' + + background: '#32302f' + foreground: '#d4be98' + cursor: '#d4be98' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-material-light-hard.nu b/themes/nu-themes/gruvbox-material-light-hard.nu index 373f253..36ada08 100644 --- a/themes/nu-themes/gruvbox-material-light-hard.nu +++ b/themes/nu-themes/gruvbox-material-light-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#654735" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6c782e" attr: "b" } - empty: "#45707a" - bool: {|| if $in { "#4c7a5d" } else { "light_gray" } } - int: "#654735" - filesize: {|e| - if $e == 0b { - "#654735" - } else if $e < 1mb { - "#4c7a5d" - } else {{ fg: "#45707a" }} - } - duration: "#654735" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c14a4a" attr: "b" } - } else if $in < 6hr { - "#c14a4a" - } else if $in < 1day { - "#b47109" - } else if $in < 3day { - "#6c782e" - } else if $in < 1wk { - { fg: "#6c782e" attr: "b" } - } else if $in < 6wk { - "#4c7a5d" - } else if $in < 52wk { - "#45707a" - } else { "dark_gray" } - } - range: "#654735" - float: "#654735" - string: "#654735" - nothing: "#654735" - binary: "#654735" - cellpath: "#654735" - row_index: { fg: "#6c782e" attr: "b" } - record: "#654735" - list: "#654735" - block: "#654735" - hints: "dark_gray" - search_result: { fg: "#c14a4a" bg: "#654735" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#945e80" attr: "b" } - shape_binary: { fg: "#945e80" attr: "b" } - shape_block: { fg: "#45707a" attr: "b" } - shape_bool: "#4c7a5d" - shape_custom: "#6c782e" - shape_datetime: { fg: "#4c7a5d" attr: "b" } - shape_directory: "#4c7a5d" - shape_external: "#4c7a5d" - shape_externalarg: { fg: "#6c782e" attr: "b" } - shape_filepath: "#4c7a5d" - shape_flag: { fg: "#45707a" attr: "b" } - shape_float: { fg: "#945e80" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4c7a5d" attr: "b" } - shape_int: { fg: "#945e80" attr: "b" } - shape_internalcall: { fg: "#4c7a5d" attr: "b" } - shape_list: { fg: "#4c7a5d" attr: "b" } - shape_literal: "#45707a" - shape_match_pattern: "#6c782e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4c7a5d" - shape_operator: "#b47109" - shape_or: { fg: "#945e80" attr: "b" } - shape_pipe: { fg: "#945e80" attr: "b" } - shape_range: { fg: "#b47109" attr: "b" } - shape_record: { fg: "#4c7a5d" attr: "b" } - shape_redirection: { fg: "#945e80" attr: "b" } - shape_signature: { fg: "#6c782e" attr: "b" } - shape_string: "#6c782e" - shape_string_interpolation: { fg: "#4c7a5d" attr: "b" } - shape_table: { fg: "#45707a" attr: "b" } - shape_variable: "#945e80" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f9f5d7" - foreground: "#654735" - cursor: "#654735" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#654735' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6c782e' attr: 'b' } + empty: '#45707a' + bool: {|| if $in { '#4c7a5d' } else { 'light_gray' } } + int: '#654735' + filesize: {|e| + if $e == 0b { + '#654735' + } else if $e < 1mb { + '#4c7a5d' + } else {{ fg: '#45707a' }} + } + duration: '#654735' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c14a4a' attr: 'b' } + } else if $in < 6hr { + '#c14a4a' + } else if $in < 1day { + '#b47109' + } else if $in < 3day { + '#6c782e' + } else if $in < 1wk { + { fg: '#6c782e' attr: 'b' } + } else if $in < 6wk { + '#4c7a5d' + } else if $in < 52wk { + '#45707a' + } else { 'dark_gray' } + } + range: '#654735' + float: '#654735' + string: '#654735' + nothing: '#654735' + binary: '#654735' + cellpath: '#654735' + row_index: { fg: '#6c782e' attr: 'b' } + record: '#654735' + list: '#654735' + block: '#654735' + hints: 'dark_gray' + search_result: { fg: '#c14a4a' bg: '#654735' } + + shape_and: { fg: '#945e80' attr: 'b' } + shape_binary: { fg: '#945e80' attr: 'b' } + shape_block: { fg: '#45707a' attr: 'b' } + shape_bool: '#4c7a5d' + shape_custom: '#6c782e' + shape_datetime: { fg: '#4c7a5d' attr: 'b' } + shape_directory: '#4c7a5d' + shape_external: '#4c7a5d' + shape_externalarg: { fg: '#6c782e' attr: 'b' } + shape_filepath: '#4c7a5d' + shape_flag: { fg: '#45707a' attr: 'b' } + shape_float: { fg: '#945e80' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4c7a5d' attr: 'b' } + shape_int: { fg: '#945e80' attr: 'b' } + shape_internalcall: { fg: '#4c7a5d' attr: 'b' } + shape_list: { fg: '#4c7a5d' attr: 'b' } + shape_literal: '#45707a' + shape_match_pattern: '#6c782e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4c7a5d' + shape_operator: '#b47109' + shape_or: { fg: '#945e80' attr: 'b' } + shape_pipe: { fg: '#945e80' attr: 'b' } + shape_range: { fg: '#b47109' attr: 'b' } + shape_record: { fg: '#4c7a5d' attr: 'b' } + shape_redirection: { fg: '#945e80' attr: 'b' } + shape_signature: { fg: '#6c782e' attr: 'b' } + shape_string: '#6c782e' + shape_string_interpolation: { fg: '#4c7a5d' attr: 'b' } + shape_table: { fg: '#45707a' attr: 'b' } + shape_variable: '#945e80' + + background: '#f9f5d7' + foreground: '#654735' + cursor: '#654735' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-material-light-medium.nu b/themes/nu-themes/gruvbox-material-light-medium.nu index 1d416ca..2254133 100644 --- a/themes/nu-themes/gruvbox-material-light-medium.nu +++ b/themes/nu-themes/gruvbox-material-light-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#654735" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6c782e" attr: "b" } - empty: "#45707a" - bool: {|| if $in { "#4c7a5d" } else { "light_gray" } } - int: "#654735" - filesize: {|e| - if $e == 0b { - "#654735" - } else if $e < 1mb { - "#4c7a5d" - } else {{ fg: "#45707a" }} - } - duration: "#654735" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c14a4a" attr: "b" } - } else if $in < 6hr { - "#c14a4a" - } else if $in < 1day { - "#b47109" - } else if $in < 3day { - "#6c782e" - } else if $in < 1wk { - { fg: "#6c782e" attr: "b" } - } else if $in < 6wk { - "#4c7a5d" - } else if $in < 52wk { - "#45707a" - } else { "dark_gray" } - } - range: "#654735" - float: "#654735" - string: "#654735" - nothing: "#654735" - binary: "#654735" - cellpath: "#654735" - row_index: { fg: "#6c782e" attr: "b" } - record: "#654735" - list: "#654735" - block: "#654735" - hints: "dark_gray" - search_result: { fg: "#c14a4a" bg: "#654735" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#945e80" attr: "b" } - shape_binary: { fg: "#945e80" attr: "b" } - shape_block: { fg: "#45707a" attr: "b" } - shape_bool: "#4c7a5d" - shape_custom: "#6c782e" - shape_datetime: { fg: "#4c7a5d" attr: "b" } - shape_directory: "#4c7a5d" - shape_external: "#4c7a5d" - shape_externalarg: { fg: "#6c782e" attr: "b" } - shape_filepath: "#4c7a5d" - shape_flag: { fg: "#45707a" attr: "b" } - shape_float: { fg: "#945e80" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4c7a5d" attr: "b" } - shape_int: { fg: "#945e80" attr: "b" } - shape_internalcall: { fg: "#4c7a5d" attr: "b" } - shape_list: { fg: "#4c7a5d" attr: "b" } - shape_literal: "#45707a" - shape_match_pattern: "#6c782e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4c7a5d" - shape_operator: "#b47109" - shape_or: { fg: "#945e80" attr: "b" } - shape_pipe: { fg: "#945e80" attr: "b" } - shape_range: { fg: "#b47109" attr: "b" } - shape_record: { fg: "#4c7a5d" attr: "b" } - shape_redirection: { fg: "#945e80" attr: "b" } - shape_signature: { fg: "#6c782e" attr: "b" } - shape_string: "#6c782e" - shape_string_interpolation: { fg: "#4c7a5d" attr: "b" } - shape_table: { fg: "#45707a" attr: "b" } - shape_variable: "#945e80" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf1c7" - foreground: "#654735" - cursor: "#654735" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#654735' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6c782e' attr: 'b' } + empty: '#45707a' + bool: {|| if $in { '#4c7a5d' } else { 'light_gray' } } + int: '#654735' + filesize: {|e| + if $e == 0b { + '#654735' + } else if $e < 1mb { + '#4c7a5d' + } else {{ fg: '#45707a' }} + } + duration: '#654735' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c14a4a' attr: 'b' } + } else if $in < 6hr { + '#c14a4a' + } else if $in < 1day { + '#b47109' + } else if $in < 3day { + '#6c782e' + } else if $in < 1wk { + { fg: '#6c782e' attr: 'b' } + } else if $in < 6wk { + '#4c7a5d' + } else if $in < 52wk { + '#45707a' + } else { 'dark_gray' } + } + range: '#654735' + float: '#654735' + string: '#654735' + nothing: '#654735' + binary: '#654735' + cellpath: '#654735' + row_index: { fg: '#6c782e' attr: 'b' } + record: '#654735' + list: '#654735' + block: '#654735' + hints: 'dark_gray' + search_result: { fg: '#c14a4a' bg: '#654735' } + + shape_and: { fg: '#945e80' attr: 'b' } + shape_binary: { fg: '#945e80' attr: 'b' } + shape_block: { fg: '#45707a' attr: 'b' } + shape_bool: '#4c7a5d' + shape_custom: '#6c782e' + shape_datetime: { fg: '#4c7a5d' attr: 'b' } + shape_directory: '#4c7a5d' + shape_external: '#4c7a5d' + shape_externalarg: { fg: '#6c782e' attr: 'b' } + shape_filepath: '#4c7a5d' + shape_flag: { fg: '#45707a' attr: 'b' } + shape_float: { fg: '#945e80' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4c7a5d' attr: 'b' } + shape_int: { fg: '#945e80' attr: 'b' } + shape_internalcall: { fg: '#4c7a5d' attr: 'b' } + shape_list: { fg: '#4c7a5d' attr: 'b' } + shape_literal: '#45707a' + shape_match_pattern: '#6c782e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4c7a5d' + shape_operator: '#b47109' + shape_or: { fg: '#945e80' attr: 'b' } + shape_pipe: { fg: '#945e80' attr: 'b' } + shape_range: { fg: '#b47109' attr: 'b' } + shape_record: { fg: '#4c7a5d' attr: 'b' } + shape_redirection: { fg: '#945e80' attr: 'b' } + shape_signature: { fg: '#6c782e' attr: 'b' } + shape_string: '#6c782e' + shape_string_interpolation: { fg: '#4c7a5d' attr: 'b' } + shape_table: { fg: '#45707a' attr: 'b' } + shape_variable: '#945e80' + + background: '#fbf1c7' + foreground: '#654735' + cursor: '#654735' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-material-light-soft.nu b/themes/nu-themes/gruvbox-material-light-soft.nu index 9026d63..072e631 100644 --- a/themes/nu-themes/gruvbox-material-light-soft.nu +++ b/themes/nu-themes/gruvbox-material-light-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#654735" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6c782e" attr: "b" } - empty: "#45707a" - bool: {|| if $in { "#4c7a5d" } else { "light_gray" } } - int: "#654735" - filesize: {|e| - if $e == 0b { - "#654735" - } else if $e < 1mb { - "#4c7a5d" - } else {{ fg: "#45707a" }} - } - duration: "#654735" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c14a4a" attr: "b" } - } else if $in < 6hr { - "#c14a4a" - } else if $in < 1day { - "#b47109" - } else if $in < 3day { - "#6c782e" - } else if $in < 1wk { - { fg: "#6c782e" attr: "b" } - } else if $in < 6wk { - "#4c7a5d" - } else if $in < 52wk { - "#45707a" - } else { "dark_gray" } - } - range: "#654735" - float: "#654735" - string: "#654735" - nothing: "#654735" - binary: "#654735" - cellpath: "#654735" - row_index: { fg: "#6c782e" attr: "b" } - record: "#654735" - list: "#654735" - block: "#654735" - hints: "dark_gray" - search_result: { fg: "#c14a4a" bg: "#654735" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#945e80" attr: "b" } - shape_binary: { fg: "#945e80" attr: "b" } - shape_block: { fg: "#45707a" attr: "b" } - shape_bool: "#4c7a5d" - shape_custom: "#6c782e" - shape_datetime: { fg: "#4c7a5d" attr: "b" } - shape_directory: "#4c7a5d" - shape_external: "#4c7a5d" - shape_externalarg: { fg: "#6c782e" attr: "b" } - shape_filepath: "#4c7a5d" - shape_flag: { fg: "#45707a" attr: "b" } - shape_float: { fg: "#945e80" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4c7a5d" attr: "b" } - shape_int: { fg: "#945e80" attr: "b" } - shape_internalcall: { fg: "#4c7a5d" attr: "b" } - shape_list: { fg: "#4c7a5d" attr: "b" } - shape_literal: "#45707a" - shape_match_pattern: "#6c782e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4c7a5d" - shape_operator: "#b47109" - shape_or: { fg: "#945e80" attr: "b" } - shape_pipe: { fg: "#945e80" attr: "b" } - shape_range: { fg: "#b47109" attr: "b" } - shape_record: { fg: "#4c7a5d" attr: "b" } - shape_redirection: { fg: "#945e80" attr: "b" } - shape_signature: { fg: "#6c782e" attr: "b" } - shape_string: "#6c782e" - shape_string_interpolation: { fg: "#4c7a5d" attr: "b" } - shape_table: { fg: "#45707a" attr: "b" } - shape_variable: "#945e80" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f2e5bc" - foreground: "#654735" - cursor: "#654735" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#654735' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6c782e' attr: 'b' } + empty: '#45707a' + bool: {|| if $in { '#4c7a5d' } else { 'light_gray' } } + int: '#654735' + filesize: {|e| + if $e == 0b { + '#654735' + } else if $e < 1mb { + '#4c7a5d' + } else {{ fg: '#45707a' }} + } + duration: '#654735' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c14a4a' attr: 'b' } + } else if $in < 6hr { + '#c14a4a' + } else if $in < 1day { + '#b47109' + } else if $in < 3day { + '#6c782e' + } else if $in < 1wk { + { fg: '#6c782e' attr: 'b' } + } else if $in < 6wk { + '#4c7a5d' + } else if $in < 52wk { + '#45707a' + } else { 'dark_gray' } + } + range: '#654735' + float: '#654735' + string: '#654735' + nothing: '#654735' + binary: '#654735' + cellpath: '#654735' + row_index: { fg: '#6c782e' attr: 'b' } + record: '#654735' + list: '#654735' + block: '#654735' + hints: 'dark_gray' + search_result: { fg: '#c14a4a' bg: '#654735' } + + shape_and: { fg: '#945e80' attr: 'b' } + shape_binary: { fg: '#945e80' attr: 'b' } + shape_block: { fg: '#45707a' attr: 'b' } + shape_bool: '#4c7a5d' + shape_custom: '#6c782e' + shape_datetime: { fg: '#4c7a5d' attr: 'b' } + shape_directory: '#4c7a5d' + shape_external: '#4c7a5d' + shape_externalarg: { fg: '#6c782e' attr: 'b' } + shape_filepath: '#4c7a5d' + shape_flag: { fg: '#45707a' attr: 'b' } + shape_float: { fg: '#945e80' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4c7a5d' attr: 'b' } + shape_int: { fg: '#945e80' attr: 'b' } + shape_internalcall: { fg: '#4c7a5d' attr: 'b' } + shape_list: { fg: '#4c7a5d' attr: 'b' } + shape_literal: '#45707a' + shape_match_pattern: '#6c782e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4c7a5d' + shape_operator: '#b47109' + shape_or: { fg: '#945e80' attr: 'b' } + shape_pipe: { fg: '#945e80' attr: 'b' } + shape_range: { fg: '#b47109' attr: 'b' } + shape_record: { fg: '#4c7a5d' attr: 'b' } + shape_redirection: { fg: '#945e80' attr: 'b' } + shape_signature: { fg: '#6c782e' attr: 'b' } + shape_string: '#6c782e' + shape_string_interpolation: { fg: '#4c7a5d' attr: 'b' } + shape_table: { fg: '#45707a' attr: 'b' } + shape_variable: '#945e80' + + background: '#f2e5bc' + foreground: '#654735' + cursor: '#654735' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-mix-dark-hard.nu b/themes/nu-themes/gruvbox-mix-dark-hard.nu index c4b81e6..f29e789 100644 --- a/themes/nu-themes/gruvbox-mix-dark-hard.nu +++ b/themes/nu-themes/gruvbox-mix-dark-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e2cca9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b0b846" attr: "b" } - empty: "#80aa9e" - bool: {|| if $in { "#8bba7f" } else { "light_gray" } } - int: "#e2cca9" - filesize: {|e| - if $e == 0b { - "#e2cca9" - } else if $e < 1mb { - "#8bba7f" - } else {{ fg: "#80aa9e" }} - } - duration: "#e2cca9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f2594b" attr: "b" } - } else if $in < 6hr { - "#f2594b" - } else if $in < 1day { - "#e9b143" - } else if $in < 3day { - "#b0b846" - } else if $in < 1wk { - { fg: "#b0b846" attr: "b" } - } else if $in < 6wk { - "#8bba7f" - } else if $in < 52wk { - "#80aa9e" - } else { "dark_gray" } - } - range: "#e2cca9" - float: "#e2cca9" - string: "#e2cca9" - nothing: "#e2cca9" - binary: "#e2cca9" - cellpath: "#e2cca9" - row_index: { fg: "#b0b846" attr: "b" } - record: "#e2cca9" - list: "#e2cca9" - block: "#e2cca9" - hints: "dark_gray" - search_result: { fg: "#f2594b" bg: "#e2cca9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#80aa9e" attr: "b" } - shape_bool: "#8bba7f" - shape_custom: "#b0b846" - shape_datetime: { fg: "#8bba7f" attr: "b" } - shape_directory: "#8bba7f" - shape_external: "#8bba7f" - shape_externalarg: { fg: "#b0b846" attr: "b" } - shape_filepath: "#8bba7f" - shape_flag: { fg: "#80aa9e" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8bba7f" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8bba7f" attr: "b" } - shape_list: { fg: "#8bba7f" attr: "b" } - shape_literal: "#80aa9e" - shape_match_pattern: "#b0b846" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8bba7f" - shape_operator: "#e9b143" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#e9b143" attr: "b" } - shape_record: { fg: "#8bba7f" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b0b846" attr: "b" } - shape_string: "#b0b846" - shape_string_interpolation: { fg: "#8bba7f" attr: "b" } - shape_table: { fg: "#80aa9e" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2021" - foreground: "#e2cca9" - cursor: "#e2cca9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e2cca9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b0b846' attr: 'b' } + empty: '#80aa9e' + bool: {|| if $in { '#8bba7f' } else { 'light_gray' } } + int: '#e2cca9' + filesize: {|e| + if $e == 0b { + '#e2cca9' + } else if $e < 1mb { + '#8bba7f' + } else {{ fg: '#80aa9e' }} + } + duration: '#e2cca9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f2594b' attr: 'b' } + } else if $in < 6hr { + '#f2594b' + } else if $in < 1day { + '#e9b143' + } else if $in < 3day { + '#b0b846' + } else if $in < 1wk { + { fg: '#b0b846' attr: 'b' } + } else if $in < 6wk { + '#8bba7f' + } else if $in < 52wk { + '#80aa9e' + } else { 'dark_gray' } + } + range: '#e2cca9' + float: '#e2cca9' + string: '#e2cca9' + nothing: '#e2cca9' + binary: '#e2cca9' + cellpath: '#e2cca9' + row_index: { fg: '#b0b846' attr: 'b' } + record: '#e2cca9' + list: '#e2cca9' + block: '#e2cca9' + hints: 'dark_gray' + search_result: { fg: '#f2594b' bg: '#e2cca9' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#80aa9e' attr: 'b' } + shape_bool: '#8bba7f' + shape_custom: '#b0b846' + shape_datetime: { fg: '#8bba7f' attr: 'b' } + shape_directory: '#8bba7f' + shape_external: '#8bba7f' + shape_externalarg: { fg: '#b0b846' attr: 'b' } + shape_filepath: '#8bba7f' + shape_flag: { fg: '#80aa9e' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8bba7f' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8bba7f' attr: 'b' } + shape_list: { fg: '#8bba7f' attr: 'b' } + shape_literal: '#80aa9e' + shape_match_pattern: '#b0b846' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8bba7f' + shape_operator: '#e9b143' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#e9b143' attr: 'b' } + shape_record: { fg: '#8bba7f' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b0b846' attr: 'b' } + shape_string: '#b0b846' + shape_string_interpolation: { fg: '#8bba7f' attr: 'b' } + shape_table: { fg: '#80aa9e' attr: 'b' } + shape_variable: '#d3869b' + + background: '#1d2021' + foreground: '#e2cca9' + cursor: '#e2cca9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-mix-dark-medium.nu b/themes/nu-themes/gruvbox-mix-dark-medium.nu index a239e8f..e8f92f9 100644 --- a/themes/nu-themes/gruvbox-mix-dark-medium.nu +++ b/themes/nu-themes/gruvbox-mix-dark-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e2cca9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b0b846" attr: "b" } - empty: "#80aa9e" - bool: {|| if $in { "#8bba7f" } else { "light_gray" } } - int: "#e2cca9" - filesize: {|e| - if $e == 0b { - "#e2cca9" - } else if $e < 1mb { - "#8bba7f" - } else {{ fg: "#80aa9e" }} - } - duration: "#e2cca9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f2594b" attr: "b" } - } else if $in < 6hr { - "#f2594b" - } else if $in < 1day { - "#e9b143" - } else if $in < 3day { - "#b0b846" - } else if $in < 1wk { - { fg: "#b0b846" attr: "b" } - } else if $in < 6wk { - "#8bba7f" - } else if $in < 52wk { - "#80aa9e" - } else { "dark_gray" } - } - range: "#e2cca9" - float: "#e2cca9" - string: "#e2cca9" - nothing: "#e2cca9" - binary: "#e2cca9" - cellpath: "#e2cca9" - row_index: { fg: "#b0b846" attr: "b" } - record: "#e2cca9" - list: "#e2cca9" - block: "#e2cca9" - hints: "dark_gray" - search_result: { fg: "#f2594b" bg: "#e2cca9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#80aa9e" attr: "b" } - shape_bool: "#8bba7f" - shape_custom: "#b0b846" - shape_datetime: { fg: "#8bba7f" attr: "b" } - shape_directory: "#8bba7f" - shape_external: "#8bba7f" - shape_externalarg: { fg: "#b0b846" attr: "b" } - shape_filepath: "#8bba7f" - shape_flag: { fg: "#80aa9e" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8bba7f" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8bba7f" attr: "b" } - shape_list: { fg: "#8bba7f" attr: "b" } - shape_literal: "#80aa9e" - shape_match_pattern: "#b0b846" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8bba7f" - shape_operator: "#e9b143" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#e9b143" attr: "b" } - shape_record: { fg: "#8bba7f" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b0b846" attr: "b" } - shape_string: "#b0b846" - shape_string_interpolation: { fg: "#8bba7f" attr: "b" } - shape_table: { fg: "#80aa9e" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282828" - foreground: "#e2cca9" - cursor: "#e2cca9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e2cca9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b0b846' attr: 'b' } + empty: '#80aa9e' + bool: {|| if $in { '#8bba7f' } else { 'light_gray' } } + int: '#e2cca9' + filesize: {|e| + if $e == 0b { + '#e2cca9' + } else if $e < 1mb { + '#8bba7f' + } else {{ fg: '#80aa9e' }} + } + duration: '#e2cca9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f2594b' attr: 'b' } + } else if $in < 6hr { + '#f2594b' + } else if $in < 1day { + '#e9b143' + } else if $in < 3day { + '#b0b846' + } else if $in < 1wk { + { fg: '#b0b846' attr: 'b' } + } else if $in < 6wk { + '#8bba7f' + } else if $in < 52wk { + '#80aa9e' + } else { 'dark_gray' } + } + range: '#e2cca9' + float: '#e2cca9' + string: '#e2cca9' + nothing: '#e2cca9' + binary: '#e2cca9' + cellpath: '#e2cca9' + row_index: { fg: '#b0b846' attr: 'b' } + record: '#e2cca9' + list: '#e2cca9' + block: '#e2cca9' + hints: 'dark_gray' + search_result: { fg: '#f2594b' bg: '#e2cca9' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#80aa9e' attr: 'b' } + shape_bool: '#8bba7f' + shape_custom: '#b0b846' + shape_datetime: { fg: '#8bba7f' attr: 'b' } + shape_directory: '#8bba7f' + shape_external: '#8bba7f' + shape_externalarg: { fg: '#b0b846' attr: 'b' } + shape_filepath: '#8bba7f' + shape_flag: { fg: '#80aa9e' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8bba7f' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8bba7f' attr: 'b' } + shape_list: { fg: '#8bba7f' attr: 'b' } + shape_literal: '#80aa9e' + shape_match_pattern: '#b0b846' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8bba7f' + shape_operator: '#e9b143' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#e9b143' attr: 'b' } + shape_record: { fg: '#8bba7f' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b0b846' attr: 'b' } + shape_string: '#b0b846' + shape_string_interpolation: { fg: '#8bba7f' attr: 'b' } + shape_table: { fg: '#80aa9e' attr: 'b' } + shape_variable: '#d3869b' + + background: '#282828' + foreground: '#e2cca9' + cursor: '#e2cca9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-mix-dark-soft.nu b/themes/nu-themes/gruvbox-mix-dark-soft.nu index b899d41..86693a6 100644 --- a/themes/nu-themes/gruvbox-mix-dark-soft.nu +++ b/themes/nu-themes/gruvbox-mix-dark-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e2cca9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b0b846" attr: "b" } - empty: "#80aa9e" - bool: {|| if $in { "#8bba7f" } else { "light_gray" } } - int: "#e2cca9" - filesize: {|e| - if $e == 0b { - "#e2cca9" - } else if $e < 1mb { - "#8bba7f" - } else {{ fg: "#80aa9e" }} - } - duration: "#e2cca9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f2594b" attr: "b" } - } else if $in < 6hr { - "#f2594b" - } else if $in < 1day { - "#e9b143" - } else if $in < 3day { - "#b0b846" - } else if $in < 1wk { - { fg: "#b0b846" attr: "b" } - } else if $in < 6wk { - "#8bba7f" - } else if $in < 52wk { - "#80aa9e" - } else { "dark_gray" } - } - range: "#e2cca9" - float: "#e2cca9" - string: "#e2cca9" - nothing: "#e2cca9" - binary: "#e2cca9" - cellpath: "#e2cca9" - row_index: { fg: "#b0b846" attr: "b" } - record: "#e2cca9" - list: "#e2cca9" - block: "#e2cca9" - hints: "dark_gray" - search_result: { fg: "#f2594b" bg: "#e2cca9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#80aa9e" attr: "b" } - shape_bool: "#8bba7f" - shape_custom: "#b0b846" - shape_datetime: { fg: "#8bba7f" attr: "b" } - shape_directory: "#8bba7f" - shape_external: "#8bba7f" - shape_externalarg: { fg: "#b0b846" attr: "b" } - shape_filepath: "#8bba7f" - shape_flag: { fg: "#80aa9e" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8bba7f" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8bba7f" attr: "b" } - shape_list: { fg: "#8bba7f" attr: "b" } - shape_literal: "#80aa9e" - shape_match_pattern: "#b0b846" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8bba7f" - shape_operator: "#e9b143" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#e9b143" attr: "b" } - shape_record: { fg: "#8bba7f" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b0b846" attr: "b" } - shape_string: "#b0b846" - shape_string_interpolation: { fg: "#8bba7f" attr: "b" } - shape_table: { fg: "#80aa9e" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#32302f" - foreground: "#e2cca9" - cursor: "#e2cca9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e2cca9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b0b846' attr: 'b' } + empty: '#80aa9e' + bool: {|| if $in { '#8bba7f' } else { 'light_gray' } } + int: '#e2cca9' + filesize: {|e| + if $e == 0b { + '#e2cca9' + } else if $e < 1mb { + '#8bba7f' + } else {{ fg: '#80aa9e' }} + } + duration: '#e2cca9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f2594b' attr: 'b' } + } else if $in < 6hr { + '#f2594b' + } else if $in < 1day { + '#e9b143' + } else if $in < 3day { + '#b0b846' + } else if $in < 1wk { + { fg: '#b0b846' attr: 'b' } + } else if $in < 6wk { + '#8bba7f' + } else if $in < 52wk { + '#80aa9e' + } else { 'dark_gray' } + } + range: '#e2cca9' + float: '#e2cca9' + string: '#e2cca9' + nothing: '#e2cca9' + binary: '#e2cca9' + cellpath: '#e2cca9' + row_index: { fg: '#b0b846' attr: 'b' } + record: '#e2cca9' + list: '#e2cca9' + block: '#e2cca9' + hints: 'dark_gray' + search_result: { fg: '#f2594b' bg: '#e2cca9' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#80aa9e' attr: 'b' } + shape_bool: '#8bba7f' + shape_custom: '#b0b846' + shape_datetime: { fg: '#8bba7f' attr: 'b' } + shape_directory: '#8bba7f' + shape_external: '#8bba7f' + shape_externalarg: { fg: '#b0b846' attr: 'b' } + shape_filepath: '#8bba7f' + shape_flag: { fg: '#80aa9e' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8bba7f' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8bba7f' attr: 'b' } + shape_list: { fg: '#8bba7f' attr: 'b' } + shape_literal: '#80aa9e' + shape_match_pattern: '#b0b846' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8bba7f' + shape_operator: '#e9b143' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#e9b143' attr: 'b' } + shape_record: { fg: '#8bba7f' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b0b846' attr: 'b' } + shape_string: '#b0b846' + shape_string_interpolation: { fg: '#8bba7f' attr: 'b' } + shape_table: { fg: '#80aa9e' attr: 'b' } + shape_variable: '#d3869b' + + background: '#32302f' + foreground: '#e2cca9' + cursor: '#e2cca9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-mix-light-hard.nu b/themes/nu-themes/gruvbox-mix-light-hard.nu index 8b16993..3aad7d0 100644 --- a/themes/nu-themes/gruvbox-mix-light-hard.nu +++ b/themes/nu-themes/gruvbox-mix-light-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#514036" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#72761e" attr: "b" } - empty: "#266b79" - bool: {|| if $in { "#477a5b" } else { "light_gray" } } - int: "#514036" - filesize: {|e| - if $e == 0b { - "#514036" - } else if $e < 1mb { - "#477a5b" - } else {{ fg: "#266b79" }} - } - duration: "#514036" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#af2528" attr: "b" } - } else if $in < 6hr { - "#af2528" - } else if $in < 1day { - "#b4730e" - } else if $in < 3day { - "#72761e" - } else if $in < 1wk { - { fg: "#72761e" attr: "b" } - } else if $in < 6wk { - "#477a5b" - } else if $in < 52wk { - "#266b79" - } else { "dark_gray" } - } - range: "#514036" - float: "#514036" - string: "#514036" - nothing: "#514036" - binary: "#514036" - cellpath: "#514036" - row_index: { fg: "#72761e" attr: "b" } - record: "#514036" - list: "#514036" - block: "#514036" - hints: "dark_gray" - search_result: { fg: "#af2528" bg: "#514036" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#924f79" attr: "b" } - shape_binary: { fg: "#924f79" attr: "b" } - shape_block: { fg: "#266b79" attr: "b" } - shape_bool: "#477a5b" - shape_custom: "#72761e" - shape_datetime: { fg: "#477a5b" attr: "b" } - shape_directory: "#477a5b" - shape_external: "#477a5b" - shape_externalarg: { fg: "#72761e" attr: "b" } - shape_filepath: "#477a5b" - shape_flag: { fg: "#266b79" attr: "b" } - shape_float: { fg: "#924f79" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#477a5b" attr: "b" } - shape_int: { fg: "#924f79" attr: "b" } - shape_internalcall: { fg: "#477a5b" attr: "b" } - shape_list: { fg: "#477a5b" attr: "b" } - shape_literal: "#266b79" - shape_match_pattern: "#72761e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#477a5b" - shape_operator: "#b4730e" - shape_or: { fg: "#924f79" attr: "b" } - shape_pipe: { fg: "#924f79" attr: "b" } - shape_range: { fg: "#b4730e" attr: "b" } - shape_record: { fg: "#477a5b" attr: "b" } - shape_redirection: { fg: "#924f79" attr: "b" } - shape_signature: { fg: "#72761e" attr: "b" } - shape_string: "#72761e" - shape_string_interpolation: { fg: "#477a5b" attr: "b" } - shape_table: { fg: "#266b79" attr: "b" } - shape_variable: "#924f79" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f9f5d7" - foreground: "#514036" - cursor: "#514036" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#514036' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#72761e' attr: 'b' } + empty: '#266b79' + bool: {|| if $in { '#477a5b' } else { 'light_gray' } } + int: '#514036' + filesize: {|e| + if $e == 0b { + '#514036' + } else if $e < 1mb { + '#477a5b' + } else {{ fg: '#266b79' }} + } + duration: '#514036' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#af2528' attr: 'b' } + } else if $in < 6hr { + '#af2528' + } else if $in < 1day { + '#b4730e' + } else if $in < 3day { + '#72761e' + } else if $in < 1wk { + { fg: '#72761e' attr: 'b' } + } else if $in < 6wk { + '#477a5b' + } else if $in < 52wk { + '#266b79' + } else { 'dark_gray' } + } + range: '#514036' + float: '#514036' + string: '#514036' + nothing: '#514036' + binary: '#514036' + cellpath: '#514036' + row_index: { fg: '#72761e' attr: 'b' } + record: '#514036' + list: '#514036' + block: '#514036' + hints: 'dark_gray' + search_result: { fg: '#af2528' bg: '#514036' } + + shape_and: { fg: '#924f79' attr: 'b' } + shape_binary: { fg: '#924f79' attr: 'b' } + shape_block: { fg: '#266b79' attr: 'b' } + shape_bool: '#477a5b' + shape_custom: '#72761e' + shape_datetime: { fg: '#477a5b' attr: 'b' } + shape_directory: '#477a5b' + shape_external: '#477a5b' + shape_externalarg: { fg: '#72761e' attr: 'b' } + shape_filepath: '#477a5b' + shape_flag: { fg: '#266b79' attr: 'b' } + shape_float: { fg: '#924f79' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#477a5b' attr: 'b' } + shape_int: { fg: '#924f79' attr: 'b' } + shape_internalcall: { fg: '#477a5b' attr: 'b' } + shape_list: { fg: '#477a5b' attr: 'b' } + shape_literal: '#266b79' + shape_match_pattern: '#72761e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#477a5b' + shape_operator: '#b4730e' + shape_or: { fg: '#924f79' attr: 'b' } + shape_pipe: { fg: '#924f79' attr: 'b' } + shape_range: { fg: '#b4730e' attr: 'b' } + shape_record: { fg: '#477a5b' attr: 'b' } + shape_redirection: { fg: '#924f79' attr: 'b' } + shape_signature: { fg: '#72761e' attr: 'b' } + shape_string: '#72761e' + shape_string_interpolation: { fg: '#477a5b' attr: 'b' } + shape_table: { fg: '#266b79' attr: 'b' } + shape_variable: '#924f79' + + background: '#f9f5d7' + foreground: '#514036' + cursor: '#514036' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-mix-light-medium.nu b/themes/nu-themes/gruvbox-mix-light-medium.nu index 53ada06..7663dce 100644 --- a/themes/nu-themes/gruvbox-mix-light-medium.nu +++ b/themes/nu-themes/gruvbox-mix-light-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#514036" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#72761e" attr: "b" } - empty: "#266b79" - bool: {|| if $in { "#477a5b" } else { "light_gray" } } - int: "#514036" - filesize: {|e| - if $e == 0b { - "#514036" - } else if $e < 1mb { - "#477a5b" - } else {{ fg: "#266b79" }} - } - duration: "#514036" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#af2528" attr: "b" } - } else if $in < 6hr { - "#af2528" - } else if $in < 1day { - "#b4730e" - } else if $in < 3day { - "#72761e" - } else if $in < 1wk { - { fg: "#72761e" attr: "b" } - } else if $in < 6wk { - "#477a5b" - } else if $in < 52wk { - "#266b79" - } else { "dark_gray" } - } - range: "#514036" - float: "#514036" - string: "#514036" - nothing: "#514036" - binary: "#514036" - cellpath: "#514036" - row_index: { fg: "#72761e" attr: "b" } - record: "#514036" - list: "#514036" - block: "#514036" - hints: "dark_gray" - search_result: { fg: "#af2528" bg: "#514036" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#924f79" attr: "b" } - shape_binary: { fg: "#924f79" attr: "b" } - shape_block: { fg: "#266b79" attr: "b" } - shape_bool: "#477a5b" - shape_custom: "#72761e" - shape_datetime: { fg: "#477a5b" attr: "b" } - shape_directory: "#477a5b" - shape_external: "#477a5b" - shape_externalarg: { fg: "#72761e" attr: "b" } - shape_filepath: "#477a5b" - shape_flag: { fg: "#266b79" attr: "b" } - shape_float: { fg: "#924f79" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#477a5b" attr: "b" } - shape_int: { fg: "#924f79" attr: "b" } - shape_internalcall: { fg: "#477a5b" attr: "b" } - shape_list: { fg: "#477a5b" attr: "b" } - shape_literal: "#266b79" - shape_match_pattern: "#72761e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#477a5b" - shape_operator: "#b4730e" - shape_or: { fg: "#924f79" attr: "b" } - shape_pipe: { fg: "#924f79" attr: "b" } - shape_range: { fg: "#b4730e" attr: "b" } - shape_record: { fg: "#477a5b" attr: "b" } - shape_redirection: { fg: "#924f79" attr: "b" } - shape_signature: { fg: "#72761e" attr: "b" } - shape_string: "#72761e" - shape_string_interpolation: { fg: "#477a5b" attr: "b" } - shape_table: { fg: "#266b79" attr: "b" } - shape_variable: "#924f79" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf1c7" - foreground: "#514036" - cursor: "#514036" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#514036' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#72761e' attr: 'b' } + empty: '#266b79' + bool: {|| if $in { '#477a5b' } else { 'light_gray' } } + int: '#514036' + filesize: {|e| + if $e == 0b { + '#514036' + } else if $e < 1mb { + '#477a5b' + } else {{ fg: '#266b79' }} + } + duration: '#514036' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#af2528' attr: 'b' } + } else if $in < 6hr { + '#af2528' + } else if $in < 1day { + '#b4730e' + } else if $in < 3day { + '#72761e' + } else if $in < 1wk { + { fg: '#72761e' attr: 'b' } + } else if $in < 6wk { + '#477a5b' + } else if $in < 52wk { + '#266b79' + } else { 'dark_gray' } + } + range: '#514036' + float: '#514036' + string: '#514036' + nothing: '#514036' + binary: '#514036' + cellpath: '#514036' + row_index: { fg: '#72761e' attr: 'b' } + record: '#514036' + list: '#514036' + block: '#514036' + hints: 'dark_gray' + search_result: { fg: '#af2528' bg: '#514036' } + + shape_and: { fg: '#924f79' attr: 'b' } + shape_binary: { fg: '#924f79' attr: 'b' } + shape_block: { fg: '#266b79' attr: 'b' } + shape_bool: '#477a5b' + shape_custom: '#72761e' + shape_datetime: { fg: '#477a5b' attr: 'b' } + shape_directory: '#477a5b' + shape_external: '#477a5b' + shape_externalarg: { fg: '#72761e' attr: 'b' } + shape_filepath: '#477a5b' + shape_flag: { fg: '#266b79' attr: 'b' } + shape_float: { fg: '#924f79' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#477a5b' attr: 'b' } + shape_int: { fg: '#924f79' attr: 'b' } + shape_internalcall: { fg: '#477a5b' attr: 'b' } + shape_list: { fg: '#477a5b' attr: 'b' } + shape_literal: '#266b79' + shape_match_pattern: '#72761e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#477a5b' + shape_operator: '#b4730e' + shape_or: { fg: '#924f79' attr: 'b' } + shape_pipe: { fg: '#924f79' attr: 'b' } + shape_range: { fg: '#b4730e' attr: 'b' } + shape_record: { fg: '#477a5b' attr: 'b' } + shape_redirection: { fg: '#924f79' attr: 'b' } + shape_signature: { fg: '#72761e' attr: 'b' } + shape_string: '#72761e' + shape_string_interpolation: { fg: '#477a5b' attr: 'b' } + shape_table: { fg: '#266b79' attr: 'b' } + shape_variable: '#924f79' + + background: '#fbf1c7' + foreground: '#514036' + cursor: '#514036' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-mix-light-soft.nu b/themes/nu-themes/gruvbox-mix-light-soft.nu index 9ee51bc..9ae3fbe 100644 --- a/themes/nu-themes/gruvbox-mix-light-soft.nu +++ b/themes/nu-themes/gruvbox-mix-light-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#514036" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#72761e" attr: "b" } - empty: "#266b79" - bool: {|| if $in { "#477a5b" } else { "light_gray" } } - int: "#514036" - filesize: {|e| - if $e == 0b { - "#514036" - } else if $e < 1mb { - "#477a5b" - } else {{ fg: "#266b79" }} - } - duration: "#514036" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#af2528" attr: "b" } - } else if $in < 6hr { - "#af2528" - } else if $in < 1day { - "#b4730e" - } else if $in < 3day { - "#72761e" - } else if $in < 1wk { - { fg: "#72761e" attr: "b" } - } else if $in < 6wk { - "#477a5b" - } else if $in < 52wk { - "#266b79" - } else { "dark_gray" } - } - range: "#514036" - float: "#514036" - string: "#514036" - nothing: "#514036" - binary: "#514036" - cellpath: "#514036" - row_index: { fg: "#72761e" attr: "b" } - record: "#514036" - list: "#514036" - block: "#514036" - hints: "dark_gray" - search_result: { fg: "#af2528" bg: "#514036" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#924f79" attr: "b" } - shape_binary: { fg: "#924f79" attr: "b" } - shape_block: { fg: "#266b79" attr: "b" } - shape_bool: "#477a5b" - shape_custom: "#72761e" - shape_datetime: { fg: "#477a5b" attr: "b" } - shape_directory: "#477a5b" - shape_external: "#477a5b" - shape_externalarg: { fg: "#72761e" attr: "b" } - shape_filepath: "#477a5b" - shape_flag: { fg: "#266b79" attr: "b" } - shape_float: { fg: "#924f79" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#477a5b" attr: "b" } - shape_int: { fg: "#924f79" attr: "b" } - shape_internalcall: { fg: "#477a5b" attr: "b" } - shape_list: { fg: "#477a5b" attr: "b" } - shape_literal: "#266b79" - shape_match_pattern: "#72761e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#477a5b" - shape_operator: "#b4730e" - shape_or: { fg: "#924f79" attr: "b" } - shape_pipe: { fg: "#924f79" attr: "b" } - shape_range: { fg: "#b4730e" attr: "b" } - shape_record: { fg: "#477a5b" attr: "b" } - shape_redirection: { fg: "#924f79" attr: "b" } - shape_signature: { fg: "#72761e" attr: "b" } - shape_string: "#72761e" - shape_string_interpolation: { fg: "#477a5b" attr: "b" } - shape_table: { fg: "#266b79" attr: "b" } - shape_variable: "#924f79" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f2e5bc" - foreground: "#514036" - cursor: "#514036" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#514036' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#72761e' attr: 'b' } + empty: '#266b79' + bool: {|| if $in { '#477a5b' } else { 'light_gray' } } + int: '#514036' + filesize: {|e| + if $e == 0b { + '#514036' + } else if $e < 1mb { + '#477a5b' + } else {{ fg: '#266b79' }} + } + duration: '#514036' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#af2528' attr: 'b' } + } else if $in < 6hr { + '#af2528' + } else if $in < 1day { + '#b4730e' + } else if $in < 3day { + '#72761e' + } else if $in < 1wk { + { fg: '#72761e' attr: 'b' } + } else if $in < 6wk { + '#477a5b' + } else if $in < 52wk { + '#266b79' + } else { 'dark_gray' } + } + range: '#514036' + float: '#514036' + string: '#514036' + nothing: '#514036' + binary: '#514036' + cellpath: '#514036' + row_index: { fg: '#72761e' attr: 'b' } + record: '#514036' + list: '#514036' + block: '#514036' + hints: 'dark_gray' + search_result: { fg: '#af2528' bg: '#514036' } + + shape_and: { fg: '#924f79' attr: 'b' } + shape_binary: { fg: '#924f79' attr: 'b' } + shape_block: { fg: '#266b79' attr: 'b' } + shape_bool: '#477a5b' + shape_custom: '#72761e' + shape_datetime: { fg: '#477a5b' attr: 'b' } + shape_directory: '#477a5b' + shape_external: '#477a5b' + shape_externalarg: { fg: '#72761e' attr: 'b' } + shape_filepath: '#477a5b' + shape_flag: { fg: '#266b79' attr: 'b' } + shape_float: { fg: '#924f79' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#477a5b' attr: 'b' } + shape_int: { fg: '#924f79' attr: 'b' } + shape_internalcall: { fg: '#477a5b' attr: 'b' } + shape_list: { fg: '#477a5b' attr: 'b' } + shape_literal: '#266b79' + shape_match_pattern: '#72761e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#477a5b' + shape_operator: '#b4730e' + shape_or: { fg: '#924f79' attr: 'b' } + shape_pipe: { fg: '#924f79' attr: 'b' } + shape_range: { fg: '#b4730e' attr: 'b' } + shape_record: { fg: '#477a5b' attr: 'b' } + shape_redirection: { fg: '#924f79' attr: 'b' } + shape_signature: { fg: '#72761e' attr: 'b' } + shape_string: '#72761e' + shape_string_interpolation: { fg: '#477a5b' attr: 'b' } + shape_table: { fg: '#266b79' attr: 'b' } + shape_variable: '#924f79' + + background: '#f2e5bc' + foreground: '#514036' + cursor: '#514036' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-original-dark-hard.nu b/themes/nu-themes/gruvbox-original-dark-hard.nu index a6a6ae5..7609980 100644 --- a/themes/nu-themes/gruvbox-original-dark-hard.nu +++ b/themes/nu-themes/gruvbox-original-dark-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ebdbb2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8bb26" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#ebdbb2" - filesize: {|e| - if $e == 0b { - "#ebdbb2" - } else if $e < 1mb { - "#8ec07c" - } else {{ fg: "#83a598" }} - } - duration: "#ebdbb2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb4934" attr: "b" } - } else if $in < 6hr { - "#fb4934" - } else if $in < 1day { - "#fabd2f" - } else if $in < 3day { - "#b8bb26" - } else if $in < 1wk { - { fg: "#b8bb26" attr: "b" } - } else if $in < 6wk { - "#8ec07c" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#ebdbb2" - float: "#ebdbb2" - string: "#ebdbb2" - nothing: "#ebdbb2" - binary: "#ebdbb2" - cellpath: "#ebdbb2" - row_index: { fg: "#b8bb26" attr: "b" } - record: "#ebdbb2" - list: "#ebdbb2" - block: "#ebdbb2" - hints: "dark_gray" - search_result: { fg: "#fb4934" bg: "#ebdbb2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#b8bb26" - shape_datetime: { fg: "#8ec07c" attr: "b" } - shape_directory: "#8ec07c" - shape_external: "#8ec07c" - shape_externalarg: { fg: "#b8bb26" attr: "b" } - shape_filepath: "#8ec07c" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ec07c" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8ec07c" attr: "b" } - shape_list: { fg: "#8ec07c" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#b8bb26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#fabd2f" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#fabd2f" attr: "b" } - shape_record: { fg: "#8ec07c" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b8bb26" attr: "b" } - shape_string: "#b8bb26" - shape_string_interpolation: { fg: "#8ec07c" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2021" - foreground: "#ebdbb2" - cursor: "#ebdbb2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ebdbb2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8bb26' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#ebdbb2' + filesize: {|e| + if $e == 0b { + '#ebdbb2' + } else if $e < 1mb { + '#8ec07c' + } else {{ fg: '#83a598' }} + } + duration: '#ebdbb2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb4934' attr: 'b' } + } else if $in < 6hr { + '#fb4934' + } else if $in < 1day { + '#fabd2f' + } else if $in < 3day { + '#b8bb26' + } else if $in < 1wk { + { fg: '#b8bb26' attr: 'b' } + } else if $in < 6wk { + '#8ec07c' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#ebdbb2' + float: '#ebdbb2' + string: '#ebdbb2' + nothing: '#ebdbb2' + binary: '#ebdbb2' + cellpath: '#ebdbb2' + row_index: { fg: '#b8bb26' attr: 'b' } + record: '#ebdbb2' + list: '#ebdbb2' + block: '#ebdbb2' + hints: 'dark_gray' + search_result: { fg: '#fb4934' bg: '#ebdbb2' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#b8bb26' + shape_datetime: { fg: '#8ec07c' attr: 'b' } + shape_directory: '#8ec07c' + shape_external: '#8ec07c' + shape_externalarg: { fg: '#b8bb26' attr: 'b' } + shape_filepath: '#8ec07c' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ec07c' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8ec07c' attr: 'b' } + shape_list: { fg: '#8ec07c' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#b8bb26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#fabd2f' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#fabd2f' attr: 'b' } + shape_record: { fg: '#8ec07c' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b8bb26' attr: 'b' } + shape_string: '#b8bb26' + shape_string_interpolation: { fg: '#8ec07c' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d3869b' + + background: '#1d2021' + foreground: '#ebdbb2' + cursor: '#ebdbb2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-original-dark-medium.nu b/themes/nu-themes/gruvbox-original-dark-medium.nu index 8610ef1..15932e1 100644 --- a/themes/nu-themes/gruvbox-original-dark-medium.nu +++ b/themes/nu-themes/gruvbox-original-dark-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ebdbb2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8bb26" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#ebdbb2" - filesize: {|e| - if $e == 0b { - "#ebdbb2" - } else if $e < 1mb { - "#8ec07c" - } else {{ fg: "#83a598" }} - } - duration: "#ebdbb2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb4934" attr: "b" } - } else if $in < 6hr { - "#fb4934" - } else if $in < 1day { - "#fabd2f" - } else if $in < 3day { - "#b8bb26" - } else if $in < 1wk { - { fg: "#b8bb26" attr: "b" } - } else if $in < 6wk { - "#8ec07c" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#ebdbb2" - float: "#ebdbb2" - string: "#ebdbb2" - nothing: "#ebdbb2" - binary: "#ebdbb2" - cellpath: "#ebdbb2" - row_index: { fg: "#b8bb26" attr: "b" } - record: "#ebdbb2" - list: "#ebdbb2" - block: "#ebdbb2" - hints: "dark_gray" - search_result: { fg: "#fb4934" bg: "#ebdbb2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#b8bb26" - shape_datetime: { fg: "#8ec07c" attr: "b" } - shape_directory: "#8ec07c" - shape_external: "#8ec07c" - shape_externalarg: { fg: "#b8bb26" attr: "b" } - shape_filepath: "#8ec07c" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ec07c" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8ec07c" attr: "b" } - shape_list: { fg: "#8ec07c" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#b8bb26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#fabd2f" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#fabd2f" attr: "b" } - shape_record: { fg: "#8ec07c" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b8bb26" attr: "b" } - shape_string: "#b8bb26" - shape_string_interpolation: { fg: "#8ec07c" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282828" - foreground: "#ebdbb2" - cursor: "#ebdbb2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ebdbb2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8bb26' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#ebdbb2' + filesize: {|e| + if $e == 0b { + '#ebdbb2' + } else if $e < 1mb { + '#8ec07c' + } else {{ fg: '#83a598' }} + } + duration: '#ebdbb2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb4934' attr: 'b' } + } else if $in < 6hr { + '#fb4934' + } else if $in < 1day { + '#fabd2f' + } else if $in < 3day { + '#b8bb26' + } else if $in < 1wk { + { fg: '#b8bb26' attr: 'b' } + } else if $in < 6wk { + '#8ec07c' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#ebdbb2' + float: '#ebdbb2' + string: '#ebdbb2' + nothing: '#ebdbb2' + binary: '#ebdbb2' + cellpath: '#ebdbb2' + row_index: { fg: '#b8bb26' attr: 'b' } + record: '#ebdbb2' + list: '#ebdbb2' + block: '#ebdbb2' + hints: 'dark_gray' + search_result: { fg: '#fb4934' bg: '#ebdbb2' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#b8bb26' + shape_datetime: { fg: '#8ec07c' attr: 'b' } + shape_directory: '#8ec07c' + shape_external: '#8ec07c' + shape_externalarg: { fg: '#b8bb26' attr: 'b' } + shape_filepath: '#8ec07c' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ec07c' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8ec07c' attr: 'b' } + shape_list: { fg: '#8ec07c' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#b8bb26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#fabd2f' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#fabd2f' attr: 'b' } + shape_record: { fg: '#8ec07c' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b8bb26' attr: 'b' } + shape_string: '#b8bb26' + shape_string_interpolation: { fg: '#8ec07c' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d3869b' + + background: '#282828' + foreground: '#ebdbb2' + cursor: '#ebdbb2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-original-dark-soft.nu b/themes/nu-themes/gruvbox-original-dark-soft.nu index 78c90d9..1ef84cb 100644 --- a/themes/nu-themes/gruvbox-original-dark-soft.nu +++ b/themes/nu-themes/gruvbox-original-dark-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ebdbb2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b8bb26" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#8ec07c" } else { "light_gray" } } - int: "#ebdbb2" - filesize: {|e| - if $e == 0b { - "#ebdbb2" - } else if $e < 1mb { - "#8ec07c" - } else {{ fg: "#83a598" }} - } - duration: "#ebdbb2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb4934" attr: "b" } - } else if $in < 6hr { - "#fb4934" - } else if $in < 1day { - "#fabd2f" - } else if $in < 3day { - "#b8bb26" - } else if $in < 1wk { - { fg: "#b8bb26" attr: "b" } - } else if $in < 6wk { - "#8ec07c" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#ebdbb2" - float: "#ebdbb2" - string: "#ebdbb2" - nothing: "#ebdbb2" - binary: "#ebdbb2" - cellpath: "#ebdbb2" - row_index: { fg: "#b8bb26" attr: "b" } - record: "#ebdbb2" - list: "#ebdbb2" - block: "#ebdbb2" - hints: "dark_gray" - search_result: { fg: "#fb4934" bg: "#ebdbb2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3869b" attr: "b" } - shape_binary: { fg: "#d3869b" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#8ec07c" - shape_custom: "#b8bb26" - shape_datetime: { fg: "#8ec07c" attr: "b" } - shape_directory: "#8ec07c" - shape_external: "#8ec07c" - shape_externalarg: { fg: "#b8bb26" attr: "b" } - shape_filepath: "#8ec07c" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d3869b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ec07c" attr: "b" } - shape_int: { fg: "#d3869b" attr: "b" } - shape_internalcall: { fg: "#8ec07c" attr: "b" } - shape_list: { fg: "#8ec07c" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#b8bb26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ec07c" - shape_operator: "#fabd2f" - shape_or: { fg: "#d3869b" attr: "b" } - shape_pipe: { fg: "#d3869b" attr: "b" } - shape_range: { fg: "#fabd2f" attr: "b" } - shape_record: { fg: "#8ec07c" attr: "b" } - shape_redirection: { fg: "#d3869b" attr: "b" } - shape_signature: { fg: "#b8bb26" attr: "b" } - shape_string: "#b8bb26" - shape_string_interpolation: { fg: "#8ec07c" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d3869b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#32302f" - foreground: "#ebdbb2" - cursor: "#ebdbb2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ebdbb2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b8bb26' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#8ec07c' } else { 'light_gray' } } + int: '#ebdbb2' + filesize: {|e| + if $e == 0b { + '#ebdbb2' + } else if $e < 1mb { + '#8ec07c' + } else {{ fg: '#83a598' }} + } + duration: '#ebdbb2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb4934' attr: 'b' } + } else if $in < 6hr { + '#fb4934' + } else if $in < 1day { + '#fabd2f' + } else if $in < 3day { + '#b8bb26' + } else if $in < 1wk { + { fg: '#b8bb26' attr: 'b' } + } else if $in < 6wk { + '#8ec07c' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#ebdbb2' + float: '#ebdbb2' + string: '#ebdbb2' + nothing: '#ebdbb2' + binary: '#ebdbb2' + cellpath: '#ebdbb2' + row_index: { fg: '#b8bb26' attr: 'b' } + record: '#ebdbb2' + list: '#ebdbb2' + block: '#ebdbb2' + hints: 'dark_gray' + search_result: { fg: '#fb4934' bg: '#ebdbb2' } + + shape_and: { fg: '#d3869b' attr: 'b' } + shape_binary: { fg: '#d3869b' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#8ec07c' + shape_custom: '#b8bb26' + shape_datetime: { fg: '#8ec07c' attr: 'b' } + shape_directory: '#8ec07c' + shape_external: '#8ec07c' + shape_externalarg: { fg: '#b8bb26' attr: 'b' } + shape_filepath: '#8ec07c' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d3869b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ec07c' attr: 'b' } + shape_int: { fg: '#d3869b' attr: 'b' } + shape_internalcall: { fg: '#8ec07c' attr: 'b' } + shape_list: { fg: '#8ec07c' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#b8bb26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ec07c' + shape_operator: '#fabd2f' + shape_or: { fg: '#d3869b' attr: 'b' } + shape_pipe: { fg: '#d3869b' attr: 'b' } + shape_range: { fg: '#fabd2f' attr: 'b' } + shape_record: { fg: '#8ec07c' attr: 'b' } + shape_redirection: { fg: '#d3869b' attr: 'b' } + shape_signature: { fg: '#b8bb26' attr: 'b' } + shape_string: '#b8bb26' + shape_string_interpolation: { fg: '#8ec07c' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d3869b' + + background: '#32302f' + foreground: '#ebdbb2' + cursor: '#ebdbb2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-original-light-hard.nu b/themes/nu-themes/gruvbox-original-light-hard.nu index 1e163fc..fa4c80c 100644 --- a/themes/nu-themes/gruvbox-original-light-hard.nu +++ b/themes/nu-themes/gruvbox-original-light-hard.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#3c3836" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79740e" attr: "b" } - empty: "#076678" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#3c3836" - filesize: {|e| - if $e == 0b { - "#3c3836" - } else if $e < 1mb { - "#427b58" - } else {{ fg: "#076678" }} - } - duration: "#3c3836" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9d0006" attr: "b" } - } else if $in < 6hr { - "#9d0006" - } else if $in < 1day { - "#b57614" - } else if $in < 3day { - "#79740e" - } else if $in < 1wk { - { fg: "#79740e" attr: "b" } - } else if $in < 6wk { - "#427b58" - } else if $in < 52wk { - "#076678" - } else { "dark_gray" } - } - range: "#3c3836" - float: "#3c3836" - string: "#3c3836" - nothing: "#3c3836" - binary: "#3c3836" - cellpath: "#3c3836" - row_index: { fg: "#79740e" attr: "b" } - record: "#3c3836" - list: "#3c3836" - block: "#3c3836" - hints: "dark_gray" - search_result: { fg: "#9d0006" bg: "#3c3836" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f3f71" attr: "b" } - shape_binary: { fg: "#8f3f71" attr: "b" } - shape_block: { fg: "#076678" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#79740e" - shape_datetime: { fg: "#427b58" attr: "b" } - shape_directory: "#427b58" - shape_external: "#427b58" - shape_externalarg: { fg: "#79740e" attr: "b" } - shape_filepath: "#427b58" - shape_flag: { fg: "#076678" attr: "b" } - shape_float: { fg: "#8f3f71" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#427b58" attr: "b" } - shape_int: { fg: "#8f3f71" attr: "b" } - shape_internalcall: { fg: "#427b58" attr: "b" } - shape_list: { fg: "#427b58" attr: "b" } - shape_literal: "#076678" - shape_match_pattern: "#79740e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#b57614" - shape_or: { fg: "#8f3f71" attr: "b" } - shape_pipe: { fg: "#8f3f71" attr: "b" } - shape_range: { fg: "#b57614" attr: "b" } - shape_record: { fg: "#427b58" attr: "b" } - shape_redirection: { fg: "#8f3f71" attr: "b" } - shape_signature: { fg: "#79740e" attr: "b" } - shape_string: "#79740e" - shape_string_interpolation: { fg: "#427b58" attr: "b" } - shape_table: { fg: "#076678" attr: "b" } - shape_variable: "#8f3f71" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f9f5d7" - foreground: "#3c3836" - cursor: "#3c3836" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#3c3836' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79740e' attr: 'b' } + empty: '#076678' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#3c3836' + filesize: {|e| + if $e == 0b { + '#3c3836' + } else if $e < 1mb { + '#427b58' + } else {{ fg: '#076678' }} + } + duration: '#3c3836' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9d0006' attr: 'b' } + } else if $in < 6hr { + '#9d0006' + } else if $in < 1day { + '#b57614' + } else if $in < 3day { + '#79740e' + } else if $in < 1wk { + { fg: '#79740e' attr: 'b' } + } else if $in < 6wk { + '#427b58' + } else if $in < 52wk { + '#076678' + } else { 'dark_gray' } + } + range: '#3c3836' + float: '#3c3836' + string: '#3c3836' + nothing: '#3c3836' + binary: '#3c3836' + cellpath: '#3c3836' + row_index: { fg: '#79740e' attr: 'b' } + record: '#3c3836' + list: '#3c3836' + block: '#3c3836' + hints: 'dark_gray' + search_result: { fg: '#9d0006' bg: '#3c3836' } + + shape_and: { fg: '#8f3f71' attr: 'b' } + shape_binary: { fg: '#8f3f71' attr: 'b' } + shape_block: { fg: '#076678' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#79740e' + shape_datetime: { fg: '#427b58' attr: 'b' } + shape_directory: '#427b58' + shape_external: '#427b58' + shape_externalarg: { fg: '#79740e' attr: 'b' } + shape_filepath: '#427b58' + shape_flag: { fg: '#076678' attr: 'b' } + shape_float: { fg: '#8f3f71' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#427b58' attr: 'b' } + shape_int: { fg: '#8f3f71' attr: 'b' } + shape_internalcall: { fg: '#427b58' attr: 'b' } + shape_list: { fg: '#427b58' attr: 'b' } + shape_literal: '#076678' + shape_match_pattern: '#79740e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#b57614' + shape_or: { fg: '#8f3f71' attr: 'b' } + shape_pipe: { fg: '#8f3f71' attr: 'b' } + shape_range: { fg: '#b57614' attr: 'b' } + shape_record: { fg: '#427b58' attr: 'b' } + shape_redirection: { fg: '#8f3f71' attr: 'b' } + shape_signature: { fg: '#79740e' attr: 'b' } + shape_string: '#79740e' + shape_string_interpolation: { fg: '#427b58' attr: 'b' } + shape_table: { fg: '#076678' attr: 'b' } + shape_variable: '#8f3f71' + + background: '#f9f5d7' + foreground: '#3c3836' + cursor: '#3c3836' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-original-light-medium.nu b/themes/nu-themes/gruvbox-original-light-medium.nu index 9fca5c3..9f2eb7b 100644 --- a/themes/nu-themes/gruvbox-original-light-medium.nu +++ b/themes/nu-themes/gruvbox-original-light-medium.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#3c3836" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79740e" attr: "b" } - empty: "#076678" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#3c3836" - filesize: {|e| - if $e == 0b { - "#3c3836" - } else if $e < 1mb { - "#427b58" - } else {{ fg: "#076678" }} - } - duration: "#3c3836" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9d0006" attr: "b" } - } else if $in < 6hr { - "#9d0006" - } else if $in < 1day { - "#b57614" - } else if $in < 3day { - "#79740e" - } else if $in < 1wk { - { fg: "#79740e" attr: "b" } - } else if $in < 6wk { - "#427b58" - } else if $in < 52wk { - "#076678" - } else { "dark_gray" } - } - range: "#3c3836" - float: "#3c3836" - string: "#3c3836" - nothing: "#3c3836" - binary: "#3c3836" - cellpath: "#3c3836" - row_index: { fg: "#79740e" attr: "b" } - record: "#3c3836" - list: "#3c3836" - block: "#3c3836" - hints: "dark_gray" - search_result: { fg: "#9d0006" bg: "#3c3836" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f3f71" attr: "b" } - shape_binary: { fg: "#8f3f71" attr: "b" } - shape_block: { fg: "#076678" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#79740e" - shape_datetime: { fg: "#427b58" attr: "b" } - shape_directory: "#427b58" - shape_external: "#427b58" - shape_externalarg: { fg: "#79740e" attr: "b" } - shape_filepath: "#427b58" - shape_flag: { fg: "#076678" attr: "b" } - shape_float: { fg: "#8f3f71" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#427b58" attr: "b" } - shape_int: { fg: "#8f3f71" attr: "b" } - shape_internalcall: { fg: "#427b58" attr: "b" } - shape_list: { fg: "#427b58" attr: "b" } - shape_literal: "#076678" - shape_match_pattern: "#79740e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#b57614" - shape_or: { fg: "#8f3f71" attr: "b" } - shape_pipe: { fg: "#8f3f71" attr: "b" } - shape_range: { fg: "#b57614" attr: "b" } - shape_record: { fg: "#427b58" attr: "b" } - shape_redirection: { fg: "#8f3f71" attr: "b" } - shape_signature: { fg: "#79740e" attr: "b" } - shape_string: "#79740e" - shape_string_interpolation: { fg: "#427b58" attr: "b" } - shape_table: { fg: "#076678" attr: "b" } - shape_variable: "#8f3f71" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf1c7" - foreground: "#3c3836" - cursor: "#3c3836" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#3c3836' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79740e' attr: 'b' } + empty: '#076678' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#3c3836' + filesize: {|e| + if $e == 0b { + '#3c3836' + } else if $e < 1mb { + '#427b58' + } else {{ fg: '#076678' }} + } + duration: '#3c3836' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9d0006' attr: 'b' } + } else if $in < 6hr { + '#9d0006' + } else if $in < 1day { + '#b57614' + } else if $in < 3day { + '#79740e' + } else if $in < 1wk { + { fg: '#79740e' attr: 'b' } + } else if $in < 6wk { + '#427b58' + } else if $in < 52wk { + '#076678' + } else { 'dark_gray' } + } + range: '#3c3836' + float: '#3c3836' + string: '#3c3836' + nothing: '#3c3836' + binary: '#3c3836' + cellpath: '#3c3836' + row_index: { fg: '#79740e' attr: 'b' } + record: '#3c3836' + list: '#3c3836' + block: '#3c3836' + hints: 'dark_gray' + search_result: { fg: '#9d0006' bg: '#3c3836' } + + shape_and: { fg: '#8f3f71' attr: 'b' } + shape_binary: { fg: '#8f3f71' attr: 'b' } + shape_block: { fg: '#076678' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#79740e' + shape_datetime: { fg: '#427b58' attr: 'b' } + shape_directory: '#427b58' + shape_external: '#427b58' + shape_externalarg: { fg: '#79740e' attr: 'b' } + shape_filepath: '#427b58' + shape_flag: { fg: '#076678' attr: 'b' } + shape_float: { fg: '#8f3f71' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#427b58' attr: 'b' } + shape_int: { fg: '#8f3f71' attr: 'b' } + shape_internalcall: { fg: '#427b58' attr: 'b' } + shape_list: { fg: '#427b58' attr: 'b' } + shape_literal: '#076678' + shape_match_pattern: '#79740e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#b57614' + shape_or: { fg: '#8f3f71' attr: 'b' } + shape_pipe: { fg: '#8f3f71' attr: 'b' } + shape_range: { fg: '#b57614' attr: 'b' } + shape_record: { fg: '#427b58' attr: 'b' } + shape_redirection: { fg: '#8f3f71' attr: 'b' } + shape_signature: { fg: '#79740e' attr: 'b' } + shape_string: '#79740e' + shape_string_interpolation: { fg: '#427b58' attr: 'b' } + shape_table: { fg: '#076678' attr: 'b' } + shape_variable: '#8f3f71' + + background: '#fbf1c7' + foreground: '#3c3836' + cursor: '#3c3836' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox-original-light-soft.nu b/themes/nu-themes/gruvbox-original-light-soft.nu index 252d263..dd45b68 100644 --- a/themes/nu-themes/gruvbox-original-light-soft.nu +++ b/themes/nu-themes/gruvbox-original-light-soft.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#3c3836" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79740e" attr: "b" } - empty: "#076678" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#3c3836" - filesize: {|e| - if $e == 0b { - "#3c3836" - } else if $e < 1mb { - "#427b58" - } else {{ fg: "#076678" }} - } - duration: "#3c3836" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9d0006" attr: "b" } - } else if $in < 6hr { - "#9d0006" - } else if $in < 1day { - "#b57614" - } else if $in < 3day { - "#79740e" - } else if $in < 1wk { - { fg: "#79740e" attr: "b" } - } else if $in < 6wk { - "#427b58" - } else if $in < 52wk { - "#076678" - } else { "dark_gray" } - } - range: "#3c3836" - float: "#3c3836" - string: "#3c3836" - nothing: "#3c3836" - binary: "#3c3836" - cellpath: "#3c3836" - row_index: { fg: "#79740e" attr: "b" } - record: "#3c3836" - list: "#3c3836" - block: "#3c3836" - hints: "dark_gray" - search_result: { fg: "#9d0006" bg: "#3c3836" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f3f71" attr: "b" } - shape_binary: { fg: "#8f3f71" attr: "b" } - shape_block: { fg: "#076678" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#79740e" - shape_datetime: { fg: "#427b58" attr: "b" } - shape_directory: "#427b58" - shape_external: "#427b58" - shape_externalarg: { fg: "#79740e" attr: "b" } - shape_filepath: "#427b58" - shape_flag: { fg: "#076678" attr: "b" } - shape_float: { fg: "#8f3f71" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#427b58" attr: "b" } - shape_int: { fg: "#8f3f71" attr: "b" } - shape_internalcall: { fg: "#427b58" attr: "b" } - shape_list: { fg: "#427b58" attr: "b" } - shape_literal: "#076678" - shape_match_pattern: "#79740e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#b57614" - shape_or: { fg: "#8f3f71" attr: "b" } - shape_pipe: { fg: "#8f3f71" attr: "b" } - shape_range: { fg: "#b57614" attr: "b" } - shape_record: { fg: "#427b58" attr: "b" } - shape_redirection: { fg: "#8f3f71" attr: "b" } - shape_signature: { fg: "#79740e" attr: "b" } - shape_string: "#79740e" - shape_string_interpolation: { fg: "#427b58" attr: "b" } - shape_table: { fg: "#076678" attr: "b" } - shape_variable: "#8f3f71" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f2e5bc" - foreground: "#3c3836" - cursor: "#3c3836" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#3c3836' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79740e' attr: 'b' } + empty: '#076678' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#3c3836' + filesize: {|e| + if $e == 0b { + '#3c3836' + } else if $e < 1mb { + '#427b58' + } else {{ fg: '#076678' }} + } + duration: '#3c3836' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9d0006' attr: 'b' } + } else if $in < 6hr { + '#9d0006' + } else if $in < 1day { + '#b57614' + } else if $in < 3day { + '#79740e' + } else if $in < 1wk { + { fg: '#79740e' attr: 'b' } + } else if $in < 6wk { + '#427b58' + } else if $in < 52wk { + '#076678' + } else { 'dark_gray' } + } + range: '#3c3836' + float: '#3c3836' + string: '#3c3836' + nothing: '#3c3836' + binary: '#3c3836' + cellpath: '#3c3836' + row_index: { fg: '#79740e' attr: 'b' } + record: '#3c3836' + list: '#3c3836' + block: '#3c3836' + hints: 'dark_gray' + search_result: { fg: '#9d0006' bg: '#3c3836' } + + shape_and: { fg: '#8f3f71' attr: 'b' } + shape_binary: { fg: '#8f3f71' attr: 'b' } + shape_block: { fg: '#076678' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#79740e' + shape_datetime: { fg: '#427b58' attr: 'b' } + shape_directory: '#427b58' + shape_external: '#427b58' + shape_externalarg: { fg: '#79740e' attr: 'b' } + shape_filepath: '#427b58' + shape_flag: { fg: '#076678' attr: 'b' } + shape_float: { fg: '#8f3f71' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#427b58' attr: 'b' } + shape_int: { fg: '#8f3f71' attr: 'b' } + shape_internalcall: { fg: '#427b58' attr: 'b' } + shape_list: { fg: '#427b58' attr: 'b' } + shape_literal: '#076678' + shape_match_pattern: '#79740e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#b57614' + shape_or: { fg: '#8f3f71' attr: 'b' } + shape_pipe: { fg: '#8f3f71' attr: 'b' } + shape_range: { fg: '#b57614' attr: 'b' } + shape_record: { fg: '#427b58' attr: 'b' } + shape_redirection: { fg: '#8f3f71' attr: 'b' } + shape_signature: { fg: '#79740e' attr: 'b' } + shape_string: '#79740e' + shape_string_interpolation: { fg: '#427b58' attr: 'b' } + shape_table: { fg: '#076678' attr: 'b' } + shape_variable: '#8f3f71' + + background: '#f2e5bc' + foreground: '#3c3836' + cursor: '#3c3836' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/gruvbox.nu b/themes/nu-themes/gruvbox.nu index b1f296c..f3ed850 100644 --- a/themes/nu-themes/gruvbox.nu +++ b/themes/nu-themes/gruvbox.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#7c6f64" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98971a" attr: "b" } - empty: "#458588" - bool: {|| if $in { "#427b58" } else { "light_gray" } } - int: "#7c6f64" - filesize: {|e| - if $e == 0b { - "#7c6f64" - } else if $e < 1mb { - "#689d6a" - } else {{ fg: "#458588" }} - } - duration: "#7c6f64" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc241d" attr: "b" } - } else if $in < 6hr { - "#cc241d" - } else if $in < 1day { - "#d79921" - } else if $in < 3day { - "#98971a" - } else if $in < 1wk { - { fg: "#98971a" attr: "b" } - } else if $in < 6wk { - "#689d6a" - } else if $in < 52wk { - "#458588" - } else { "dark_gray" } - } - range: "#7c6f64" - float: "#7c6f64" - string: "#7c6f64" - nothing: "#7c6f64" - binary: "#7c6f64" - cellpath: "#7c6f64" - row_index: { fg: "#98971a" attr: "b" } - record: "#7c6f64" - list: "#7c6f64" - block: "#7c6f64" - hints: "dark_gray" - search_result: { fg: "#cc241d" bg: "#7c6f64" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b16286" attr: "b" } - shape_binary: { fg: "#b16286" attr: "b" } - shape_block: { fg: "#458588" attr: "b" } - shape_bool: "#427b58" - shape_custom: "#98971a" - shape_datetime: { fg: "#689d6a" attr: "b" } - shape_directory: "#689d6a" - shape_external: "#689d6a" - shape_externalarg: { fg: "#98971a" attr: "b" } - shape_filepath: "#689d6a" - shape_flag: { fg: "#458588" attr: "b" } - shape_float: { fg: "#b16286" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#689d6a" attr: "b" } - shape_int: { fg: "#b16286" attr: "b" } - shape_internalcall: { fg: "#689d6a" attr: "b" } - shape_list: { fg: "#689d6a" attr: "b" } - shape_literal: "#458588" - shape_match_pattern: "#98971a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#427b58" - shape_operator: "#d79921" - shape_or: { fg: "#b16286" attr: "b" } - shape_pipe: { fg: "#b16286" attr: "b" } - shape_range: { fg: "#d79921" attr: "b" } - shape_record: { fg: "#689d6a" attr: "b" } - shape_redirection: { fg: "#b16286" attr: "b" } - shape_signature: { fg: "#98971a" attr: "b" } - shape_string: "#98971a" - shape_string_interpolation: { fg: "#689d6a" attr: "b" } - shape_table: { fg: "#458588" attr: "b" } - shape_variable: "#b16286" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf1c7" - foreground: "#3c3836" - cursor: "#3c3836" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#7c6f64' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98971a' attr: 'b' } + empty: '#458588' + bool: {|| if $in { '#427b58' } else { 'light_gray' } } + int: '#7c6f64' + filesize: {|e| + if $e == 0b { + '#7c6f64' + } else if $e < 1mb { + '#689d6a' + } else {{ fg: '#458588' }} + } + duration: '#7c6f64' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc241d' attr: 'b' } + } else if $in < 6hr { + '#cc241d' + } else if $in < 1day { + '#d79921' + } else if $in < 3day { + '#98971a' + } else if $in < 1wk { + { fg: '#98971a' attr: 'b' } + } else if $in < 6wk { + '#689d6a' + } else if $in < 52wk { + '#458588' + } else { 'dark_gray' } + } + range: '#7c6f64' + float: '#7c6f64' + string: '#7c6f64' + nothing: '#7c6f64' + binary: '#7c6f64' + cellpath: '#7c6f64' + row_index: { fg: '#98971a' attr: 'b' } + record: '#7c6f64' + list: '#7c6f64' + block: '#7c6f64' + hints: 'dark_gray' + search_result: { fg: '#cc241d' bg: '#7c6f64' } + + shape_and: { fg: '#b16286' attr: 'b' } + shape_binary: { fg: '#b16286' attr: 'b' } + shape_block: { fg: '#458588' attr: 'b' } + shape_bool: '#427b58' + shape_custom: '#98971a' + shape_datetime: { fg: '#689d6a' attr: 'b' } + shape_directory: '#689d6a' + shape_external: '#689d6a' + shape_externalarg: { fg: '#98971a' attr: 'b' } + shape_filepath: '#689d6a' + shape_flag: { fg: '#458588' attr: 'b' } + shape_float: { fg: '#b16286' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#689d6a' attr: 'b' } + shape_int: { fg: '#b16286' attr: 'b' } + shape_internalcall: { fg: '#689d6a' attr: 'b' } + shape_list: { fg: '#689d6a' attr: 'b' } + shape_literal: '#458588' + shape_match_pattern: '#98971a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#427b58' + shape_operator: '#d79921' + shape_or: { fg: '#b16286' attr: 'b' } + shape_pipe: { fg: '#b16286' attr: 'b' } + shape_range: { fg: '#d79921' attr: 'b' } + shape_record: { fg: '#689d6a' attr: 'b' } + shape_redirection: { fg: '#b16286' attr: 'b' } + shape_signature: { fg: '#98971a' attr: 'b' } + shape_string: '#98971a' + shape_string_interpolation: { fg: '#689d6a' attr: 'b' } + shape_table: { fg: '#458588' attr: 'b' } + shape_variable: '#b16286' + + background: '#fbf1c7' + foreground: '#3c3836' + cursor: '#3c3836' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hardcore.nu b/themes/nu-themes/hardcore.nu index 6bf94d5..4e6f805 100644 --- a/themes/nu-themes/hardcore.nu +++ b/themes/nu-themes/hardcore.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cdcdcd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a6e22e" attr: "b" } - empty: "#66d9ef" - bool: {|| if $in { "#708387" } else { "light_gray" } } - int: "#cdcdcd" - filesize: {|e| - if $e == 0b { - "#cdcdcd" - } else if $e < 1mb { - "#708387" - } else {{ fg: "#66d9ef" }} - } - duration: "#cdcdcd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f92672" attr: "b" } - } else if $in < 6hr { - "#f92672" - } else if $in < 1day { - "#e6db74" - } else if $in < 3day { - "#a6e22e" - } else if $in < 1wk { - { fg: "#a6e22e" attr: "b" } - } else if $in < 6wk { - "#708387" - } else if $in < 52wk { - "#66d9ef" - } else { "dark_gray" } - } - range: "#cdcdcd" - float: "#cdcdcd" - string: "#cdcdcd" - nothing: "#cdcdcd" - binary: "#cdcdcd" - cellpath: "#cdcdcd" - row_index: { fg: "#a6e22e" attr: "b" } - record: "#cdcdcd" - list: "#cdcdcd" - block: "#cdcdcd" - hints: "dark_gray" - search_result: { fg: "#f92672" bg: "#cdcdcd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9e6ffe" attr: "b" } - shape_binary: { fg: "#9e6ffe" attr: "b" } - shape_block: { fg: "#66d9ef" attr: "b" } - shape_bool: "#708387" - shape_custom: "#a6e22e" - shape_datetime: { fg: "#708387" attr: "b" } - shape_directory: "#708387" - shape_external: "#708387" - shape_externalarg: { fg: "#a6e22e" attr: "b" } - shape_filepath: "#708387" - shape_flag: { fg: "#66d9ef" attr: "b" } - shape_float: { fg: "#9e6ffe" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#708387" attr: "b" } - shape_int: { fg: "#9e6ffe" attr: "b" } - shape_internalcall: { fg: "#708387" attr: "b" } - shape_list: { fg: "#708387" attr: "b" } - shape_literal: "#66d9ef" - shape_match_pattern: "#a6e22e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#708387" - shape_operator: "#e6db74" - shape_or: { fg: "#9e6ffe" attr: "b" } - shape_pipe: { fg: "#9e6ffe" attr: "b" } - shape_range: { fg: "#e6db74" attr: "b" } - shape_record: { fg: "#708387" attr: "b" } - shape_redirection: { fg: "#9e6ffe" attr: "b" } - shape_signature: { fg: "#a6e22e" attr: "b" } - shape_string: "#a6e22e" - shape_string_interpolation: { fg: "#708387" attr: "b" } - shape_table: { fg: "#66d9ef" attr: "b" } - shape_variable: "#9e6ffe" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#212121" - foreground: "#cdcdcd" - cursor: "#cdcdcd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cdcdcd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a6e22e' attr: 'b' } + empty: '#66d9ef' + bool: {|| if $in { '#708387' } else { 'light_gray' } } + int: '#cdcdcd' + filesize: {|e| + if $e == 0b { + '#cdcdcd' + } else if $e < 1mb { + '#708387' + } else {{ fg: '#66d9ef' }} + } + duration: '#cdcdcd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f92672' attr: 'b' } + } else if $in < 6hr { + '#f92672' + } else if $in < 1day { + '#e6db74' + } else if $in < 3day { + '#a6e22e' + } else if $in < 1wk { + { fg: '#a6e22e' attr: 'b' } + } else if $in < 6wk { + '#708387' + } else if $in < 52wk { + '#66d9ef' + } else { 'dark_gray' } + } + range: '#cdcdcd' + float: '#cdcdcd' + string: '#cdcdcd' + nothing: '#cdcdcd' + binary: '#cdcdcd' + cellpath: '#cdcdcd' + row_index: { fg: '#a6e22e' attr: 'b' } + record: '#cdcdcd' + list: '#cdcdcd' + block: '#cdcdcd' + hints: 'dark_gray' + search_result: { fg: '#f92672' bg: '#cdcdcd' } + + shape_and: { fg: '#9e6ffe' attr: 'b' } + shape_binary: { fg: '#9e6ffe' attr: 'b' } + shape_block: { fg: '#66d9ef' attr: 'b' } + shape_bool: '#708387' + shape_custom: '#a6e22e' + shape_datetime: { fg: '#708387' attr: 'b' } + shape_directory: '#708387' + shape_external: '#708387' + shape_externalarg: { fg: '#a6e22e' attr: 'b' } + shape_filepath: '#708387' + shape_flag: { fg: '#66d9ef' attr: 'b' } + shape_float: { fg: '#9e6ffe' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#708387' attr: 'b' } + shape_int: { fg: '#9e6ffe' attr: 'b' } + shape_internalcall: { fg: '#708387' attr: 'b' } + shape_list: { fg: '#708387' attr: 'b' } + shape_literal: '#66d9ef' + shape_match_pattern: '#a6e22e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#708387' + shape_operator: '#e6db74' + shape_or: { fg: '#9e6ffe' attr: 'b' } + shape_pipe: { fg: '#9e6ffe' attr: 'b' } + shape_range: { fg: '#e6db74' attr: 'b' } + shape_record: { fg: '#708387' attr: 'b' } + shape_redirection: { fg: '#9e6ffe' attr: 'b' } + shape_signature: { fg: '#a6e22e' attr: 'b' } + shape_string: '#a6e22e' + shape_string_interpolation: { fg: '#708387' attr: 'b' } + shape_table: { fg: '#66d9ef' attr: 'b' } + shape_variable: '#9e6ffe' + + background: '#212121' + foreground: '#cdcdcd' + cursor: '#cdcdcd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/harmonic-dark.nu b/themes/nu-themes/harmonic-dark.nu index 0f7c131..4a5388d 100644 --- a/themes/nu-themes/harmonic-dark.nu +++ b/themes/nu-themes/harmonic-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbd6e2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#56bf8b" attr: "b" } - empty: "#8b56bf" - bool: {|| if $in { "#568bbf" } else { "light_gray" } } - int: "#cbd6e2" - filesize: {|e| - if $e == 0b { - "#cbd6e2" - } else if $e < 1mb { - "#568bbf" - } else {{ fg: "#8b56bf" }} - } - duration: "#cbd6e2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf8b56" attr: "b" } - } else if $in < 6hr { - "#bf8b56" - } else if $in < 1day { - "#8bbf56" - } else if $in < 3day { - "#56bf8b" - } else if $in < 1wk { - { fg: "#56bf8b" attr: "b" } - } else if $in < 6wk { - "#568bbf" - } else if $in < 52wk { - "#8b56bf" - } else { "dark_gray" } - } - range: "#cbd6e2" - float: "#cbd6e2" - string: "#cbd6e2" - nothing: "#cbd6e2" - binary: "#cbd6e2" - cellpath: "#cbd6e2" - row_index: { fg: "#56bf8b" attr: "b" } - record: "#cbd6e2" - list: "#cbd6e2" - block: "#cbd6e2" - hints: "dark_gray" - search_result: { fg: "#bf8b56" bg: "#cbd6e2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bf568b" attr: "b" } - shape_binary: { fg: "#bf568b" attr: "b" } - shape_block: { fg: "#8b56bf" attr: "b" } - shape_bool: "#568bbf" - shape_custom: "#56bf8b" - shape_datetime: { fg: "#568bbf" attr: "b" } - shape_directory: "#568bbf" - shape_external: "#568bbf" - shape_externalarg: { fg: "#56bf8b" attr: "b" } - shape_filepath: "#568bbf" - shape_flag: { fg: "#8b56bf" attr: "b" } - shape_float: { fg: "#bf568b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#568bbf" attr: "b" } - shape_int: { fg: "#bf568b" attr: "b" } - shape_internalcall: { fg: "#568bbf" attr: "b" } - shape_list: { fg: "#568bbf" attr: "b" } - shape_literal: "#8b56bf" - shape_match_pattern: "#56bf8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#568bbf" - shape_operator: "#8bbf56" - shape_or: { fg: "#bf568b" attr: "b" } - shape_pipe: { fg: "#bf568b" attr: "b" } - shape_range: { fg: "#8bbf56" attr: "b" } - shape_record: { fg: "#568bbf" attr: "b" } - shape_redirection: { fg: "#bf568b" attr: "b" } - shape_signature: { fg: "#56bf8b" attr: "b" } - shape_string: "#56bf8b" - shape_string_interpolation: { fg: "#568bbf" attr: "b" } - shape_table: { fg: "#8b56bf" attr: "b" } - shape_variable: "#bf568b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0b1c2c" - foreground: "#cbd6e2" - cursor: "#cbd6e2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbd6e2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#56bf8b' attr: 'b' } + empty: '#8b56bf' + bool: {|| if $in { '#568bbf' } else { 'light_gray' } } + int: '#cbd6e2' + filesize: {|e| + if $e == 0b { + '#cbd6e2' + } else if $e < 1mb { + '#568bbf' + } else {{ fg: '#8b56bf' }} + } + duration: '#cbd6e2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf8b56' attr: 'b' } + } else if $in < 6hr { + '#bf8b56' + } else if $in < 1day { + '#8bbf56' + } else if $in < 3day { + '#56bf8b' + } else if $in < 1wk { + { fg: '#56bf8b' attr: 'b' } + } else if $in < 6wk { + '#568bbf' + } else if $in < 52wk { + '#8b56bf' + } else { 'dark_gray' } + } + range: '#cbd6e2' + float: '#cbd6e2' + string: '#cbd6e2' + nothing: '#cbd6e2' + binary: '#cbd6e2' + cellpath: '#cbd6e2' + row_index: { fg: '#56bf8b' attr: 'b' } + record: '#cbd6e2' + list: '#cbd6e2' + block: '#cbd6e2' + hints: 'dark_gray' + search_result: { fg: '#bf8b56' bg: '#cbd6e2' } + + shape_and: { fg: '#bf568b' attr: 'b' } + shape_binary: { fg: '#bf568b' attr: 'b' } + shape_block: { fg: '#8b56bf' attr: 'b' } + shape_bool: '#568bbf' + shape_custom: '#56bf8b' + shape_datetime: { fg: '#568bbf' attr: 'b' } + shape_directory: '#568bbf' + shape_external: '#568bbf' + shape_externalarg: { fg: '#56bf8b' attr: 'b' } + shape_filepath: '#568bbf' + shape_flag: { fg: '#8b56bf' attr: 'b' } + shape_float: { fg: '#bf568b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#568bbf' attr: 'b' } + shape_int: { fg: '#bf568b' attr: 'b' } + shape_internalcall: { fg: '#568bbf' attr: 'b' } + shape_list: { fg: '#568bbf' attr: 'b' } + shape_literal: '#8b56bf' + shape_match_pattern: '#56bf8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#568bbf' + shape_operator: '#8bbf56' + shape_or: { fg: '#bf568b' attr: 'b' } + shape_pipe: { fg: '#bf568b' attr: 'b' } + shape_range: { fg: '#8bbf56' attr: 'b' } + shape_record: { fg: '#568bbf' attr: 'b' } + shape_redirection: { fg: '#bf568b' attr: 'b' } + shape_signature: { fg: '#56bf8b' attr: 'b' } + shape_string: '#56bf8b' + shape_string_interpolation: { fg: '#568bbf' attr: 'b' } + shape_table: { fg: '#8b56bf' attr: 'b' } + shape_variable: '#bf568b' + + background: '#0b1c2c' + foreground: '#cbd6e2' + cursor: '#cbd6e2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/harmonic-light.nu b/themes/nu-themes/harmonic-light.nu index 0cd8682..878d37e 100644 --- a/themes/nu-themes/harmonic-light.nu +++ b/themes/nu-themes/harmonic-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#405c79" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#56bf8b" attr: "b" } - empty: "#8b56bf" - bool: {|| if $in { "#568bbf" } else { "light_gray" } } - int: "#405c79" - filesize: {|e| - if $e == 0b { - "#405c79" - } else if $e < 1mb { - "#568bbf" - } else {{ fg: "#8b56bf" }} - } - duration: "#405c79" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf8b56" attr: "b" } - } else if $in < 6hr { - "#bf8b56" - } else if $in < 1day { - "#8bbf56" - } else if $in < 3day { - "#56bf8b" - } else if $in < 1wk { - { fg: "#56bf8b" attr: "b" } - } else if $in < 6wk { - "#568bbf" - } else if $in < 52wk { - "#8b56bf" - } else { "dark_gray" } - } - range: "#405c79" - float: "#405c79" - string: "#405c79" - nothing: "#405c79" - binary: "#405c79" - cellpath: "#405c79" - row_index: { fg: "#56bf8b" attr: "b" } - record: "#405c79" - list: "#405c79" - block: "#405c79" - hints: "dark_gray" - search_result: { fg: "#bf8b56" bg: "#405c79" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bf568b" attr: "b" } - shape_binary: { fg: "#bf568b" attr: "b" } - shape_block: { fg: "#8b56bf" attr: "b" } - shape_bool: "#568bbf" - shape_custom: "#56bf8b" - shape_datetime: { fg: "#568bbf" attr: "b" } - shape_directory: "#568bbf" - shape_external: "#568bbf" - shape_externalarg: { fg: "#56bf8b" attr: "b" } - shape_filepath: "#568bbf" - shape_flag: { fg: "#8b56bf" attr: "b" } - shape_float: { fg: "#bf568b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#568bbf" attr: "b" } - shape_int: { fg: "#bf568b" attr: "b" } - shape_internalcall: { fg: "#568bbf" attr: "b" } - shape_list: { fg: "#568bbf" attr: "b" } - shape_literal: "#8b56bf" - shape_match_pattern: "#56bf8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#568bbf" - shape_operator: "#8bbf56" - shape_or: { fg: "#bf568b" attr: "b" } - shape_pipe: { fg: "#bf568b" attr: "b" } - shape_range: { fg: "#8bbf56" attr: "b" } - shape_record: { fg: "#568bbf" attr: "b" } - shape_redirection: { fg: "#bf568b" attr: "b" } - shape_signature: { fg: "#56bf8b" attr: "b" } - shape_string: "#56bf8b" - shape_string_interpolation: { fg: "#568bbf" attr: "b" } - shape_table: { fg: "#8b56bf" attr: "b" } - shape_variable: "#bf568b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f7f9fb" - foreground: "#405c79" - cursor: "#405c79" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#405c79' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#56bf8b' attr: 'b' } + empty: '#8b56bf' + bool: {|| if $in { '#568bbf' } else { 'light_gray' } } + int: '#405c79' + filesize: {|e| + if $e == 0b { + '#405c79' + } else if $e < 1mb { + '#568bbf' + } else {{ fg: '#8b56bf' }} + } + duration: '#405c79' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf8b56' attr: 'b' } + } else if $in < 6hr { + '#bf8b56' + } else if $in < 1day { + '#8bbf56' + } else if $in < 3day { + '#56bf8b' + } else if $in < 1wk { + { fg: '#56bf8b' attr: 'b' } + } else if $in < 6wk { + '#568bbf' + } else if $in < 52wk { + '#8b56bf' + } else { 'dark_gray' } + } + range: '#405c79' + float: '#405c79' + string: '#405c79' + nothing: '#405c79' + binary: '#405c79' + cellpath: '#405c79' + row_index: { fg: '#56bf8b' attr: 'b' } + record: '#405c79' + list: '#405c79' + block: '#405c79' + hints: 'dark_gray' + search_result: { fg: '#bf8b56' bg: '#405c79' } + + shape_and: { fg: '#bf568b' attr: 'b' } + shape_binary: { fg: '#bf568b' attr: 'b' } + shape_block: { fg: '#8b56bf' attr: 'b' } + shape_bool: '#568bbf' + shape_custom: '#56bf8b' + shape_datetime: { fg: '#568bbf' attr: 'b' } + shape_directory: '#568bbf' + shape_external: '#568bbf' + shape_externalarg: { fg: '#56bf8b' attr: 'b' } + shape_filepath: '#568bbf' + shape_flag: { fg: '#8b56bf' attr: 'b' } + shape_float: { fg: '#bf568b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#568bbf' attr: 'b' } + shape_int: { fg: '#bf568b' attr: 'b' } + shape_internalcall: { fg: '#568bbf' attr: 'b' } + shape_list: { fg: '#568bbf' attr: 'b' } + shape_literal: '#8b56bf' + shape_match_pattern: '#56bf8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#568bbf' + shape_operator: '#8bbf56' + shape_or: { fg: '#bf568b' attr: 'b' } + shape_pipe: { fg: '#bf568b' attr: 'b' } + shape_range: { fg: '#8bbf56' attr: 'b' } + shape_record: { fg: '#568bbf' attr: 'b' } + shape_redirection: { fg: '#bf568b' attr: 'b' } + shape_signature: { fg: '#56bf8b' attr: 'b' } + shape_string: '#56bf8b' + shape_string_interpolation: { fg: '#568bbf' attr: 'b' } + shape_table: { fg: '#8b56bf' attr: 'b' } + shape_variable: '#bf568b' + + background: '#f7f9fb' + foreground: '#405c79' + cursor: '#405c79' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/harmonic16-dark.nu b/themes/nu-themes/harmonic16-dark.nu index 0f7c131..4a5388d 100644 --- a/themes/nu-themes/harmonic16-dark.nu +++ b/themes/nu-themes/harmonic16-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbd6e2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#56bf8b" attr: "b" } - empty: "#8b56bf" - bool: {|| if $in { "#568bbf" } else { "light_gray" } } - int: "#cbd6e2" - filesize: {|e| - if $e == 0b { - "#cbd6e2" - } else if $e < 1mb { - "#568bbf" - } else {{ fg: "#8b56bf" }} - } - duration: "#cbd6e2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf8b56" attr: "b" } - } else if $in < 6hr { - "#bf8b56" - } else if $in < 1day { - "#8bbf56" - } else if $in < 3day { - "#56bf8b" - } else if $in < 1wk { - { fg: "#56bf8b" attr: "b" } - } else if $in < 6wk { - "#568bbf" - } else if $in < 52wk { - "#8b56bf" - } else { "dark_gray" } - } - range: "#cbd6e2" - float: "#cbd6e2" - string: "#cbd6e2" - nothing: "#cbd6e2" - binary: "#cbd6e2" - cellpath: "#cbd6e2" - row_index: { fg: "#56bf8b" attr: "b" } - record: "#cbd6e2" - list: "#cbd6e2" - block: "#cbd6e2" - hints: "dark_gray" - search_result: { fg: "#bf8b56" bg: "#cbd6e2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bf568b" attr: "b" } - shape_binary: { fg: "#bf568b" attr: "b" } - shape_block: { fg: "#8b56bf" attr: "b" } - shape_bool: "#568bbf" - shape_custom: "#56bf8b" - shape_datetime: { fg: "#568bbf" attr: "b" } - shape_directory: "#568bbf" - shape_external: "#568bbf" - shape_externalarg: { fg: "#56bf8b" attr: "b" } - shape_filepath: "#568bbf" - shape_flag: { fg: "#8b56bf" attr: "b" } - shape_float: { fg: "#bf568b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#568bbf" attr: "b" } - shape_int: { fg: "#bf568b" attr: "b" } - shape_internalcall: { fg: "#568bbf" attr: "b" } - shape_list: { fg: "#568bbf" attr: "b" } - shape_literal: "#8b56bf" - shape_match_pattern: "#56bf8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#568bbf" - shape_operator: "#8bbf56" - shape_or: { fg: "#bf568b" attr: "b" } - shape_pipe: { fg: "#bf568b" attr: "b" } - shape_range: { fg: "#8bbf56" attr: "b" } - shape_record: { fg: "#568bbf" attr: "b" } - shape_redirection: { fg: "#bf568b" attr: "b" } - shape_signature: { fg: "#56bf8b" attr: "b" } - shape_string: "#56bf8b" - shape_string_interpolation: { fg: "#568bbf" attr: "b" } - shape_table: { fg: "#8b56bf" attr: "b" } - shape_variable: "#bf568b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0b1c2c" - foreground: "#cbd6e2" - cursor: "#cbd6e2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbd6e2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#56bf8b' attr: 'b' } + empty: '#8b56bf' + bool: {|| if $in { '#568bbf' } else { 'light_gray' } } + int: '#cbd6e2' + filesize: {|e| + if $e == 0b { + '#cbd6e2' + } else if $e < 1mb { + '#568bbf' + } else {{ fg: '#8b56bf' }} + } + duration: '#cbd6e2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf8b56' attr: 'b' } + } else if $in < 6hr { + '#bf8b56' + } else if $in < 1day { + '#8bbf56' + } else if $in < 3day { + '#56bf8b' + } else if $in < 1wk { + { fg: '#56bf8b' attr: 'b' } + } else if $in < 6wk { + '#568bbf' + } else if $in < 52wk { + '#8b56bf' + } else { 'dark_gray' } + } + range: '#cbd6e2' + float: '#cbd6e2' + string: '#cbd6e2' + nothing: '#cbd6e2' + binary: '#cbd6e2' + cellpath: '#cbd6e2' + row_index: { fg: '#56bf8b' attr: 'b' } + record: '#cbd6e2' + list: '#cbd6e2' + block: '#cbd6e2' + hints: 'dark_gray' + search_result: { fg: '#bf8b56' bg: '#cbd6e2' } + + shape_and: { fg: '#bf568b' attr: 'b' } + shape_binary: { fg: '#bf568b' attr: 'b' } + shape_block: { fg: '#8b56bf' attr: 'b' } + shape_bool: '#568bbf' + shape_custom: '#56bf8b' + shape_datetime: { fg: '#568bbf' attr: 'b' } + shape_directory: '#568bbf' + shape_external: '#568bbf' + shape_externalarg: { fg: '#56bf8b' attr: 'b' } + shape_filepath: '#568bbf' + shape_flag: { fg: '#8b56bf' attr: 'b' } + shape_float: { fg: '#bf568b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#568bbf' attr: 'b' } + shape_int: { fg: '#bf568b' attr: 'b' } + shape_internalcall: { fg: '#568bbf' attr: 'b' } + shape_list: { fg: '#568bbf' attr: 'b' } + shape_literal: '#8b56bf' + shape_match_pattern: '#56bf8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#568bbf' + shape_operator: '#8bbf56' + shape_or: { fg: '#bf568b' attr: 'b' } + shape_pipe: { fg: '#bf568b' attr: 'b' } + shape_range: { fg: '#8bbf56' attr: 'b' } + shape_record: { fg: '#568bbf' attr: 'b' } + shape_redirection: { fg: '#bf568b' attr: 'b' } + shape_signature: { fg: '#56bf8b' attr: 'b' } + shape_string: '#56bf8b' + shape_string_interpolation: { fg: '#568bbf' attr: 'b' } + shape_table: { fg: '#8b56bf' attr: 'b' } + shape_variable: '#bf568b' + + background: '#0b1c2c' + foreground: '#cbd6e2' + cursor: '#cbd6e2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/harmonic16-light.nu b/themes/nu-themes/harmonic16-light.nu index 0cd8682..878d37e 100644 --- a/themes/nu-themes/harmonic16-light.nu +++ b/themes/nu-themes/harmonic16-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#405c79" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#56bf8b" attr: "b" } - empty: "#8b56bf" - bool: {|| if $in { "#568bbf" } else { "light_gray" } } - int: "#405c79" - filesize: {|e| - if $e == 0b { - "#405c79" - } else if $e < 1mb { - "#568bbf" - } else {{ fg: "#8b56bf" }} - } - duration: "#405c79" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf8b56" attr: "b" } - } else if $in < 6hr { - "#bf8b56" - } else if $in < 1day { - "#8bbf56" - } else if $in < 3day { - "#56bf8b" - } else if $in < 1wk { - { fg: "#56bf8b" attr: "b" } - } else if $in < 6wk { - "#568bbf" - } else if $in < 52wk { - "#8b56bf" - } else { "dark_gray" } - } - range: "#405c79" - float: "#405c79" - string: "#405c79" - nothing: "#405c79" - binary: "#405c79" - cellpath: "#405c79" - row_index: { fg: "#56bf8b" attr: "b" } - record: "#405c79" - list: "#405c79" - block: "#405c79" - hints: "dark_gray" - search_result: { fg: "#bf8b56" bg: "#405c79" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bf568b" attr: "b" } - shape_binary: { fg: "#bf568b" attr: "b" } - shape_block: { fg: "#8b56bf" attr: "b" } - shape_bool: "#568bbf" - shape_custom: "#56bf8b" - shape_datetime: { fg: "#568bbf" attr: "b" } - shape_directory: "#568bbf" - shape_external: "#568bbf" - shape_externalarg: { fg: "#56bf8b" attr: "b" } - shape_filepath: "#568bbf" - shape_flag: { fg: "#8b56bf" attr: "b" } - shape_float: { fg: "#bf568b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#568bbf" attr: "b" } - shape_int: { fg: "#bf568b" attr: "b" } - shape_internalcall: { fg: "#568bbf" attr: "b" } - shape_list: { fg: "#568bbf" attr: "b" } - shape_literal: "#8b56bf" - shape_match_pattern: "#56bf8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#568bbf" - shape_operator: "#8bbf56" - shape_or: { fg: "#bf568b" attr: "b" } - shape_pipe: { fg: "#bf568b" attr: "b" } - shape_range: { fg: "#8bbf56" attr: "b" } - shape_record: { fg: "#568bbf" attr: "b" } - shape_redirection: { fg: "#bf568b" attr: "b" } - shape_signature: { fg: "#56bf8b" attr: "b" } - shape_string: "#56bf8b" - shape_string_interpolation: { fg: "#568bbf" attr: "b" } - shape_table: { fg: "#8b56bf" attr: "b" } - shape_variable: "#bf568b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f7f9fb" - foreground: "#405c79" - cursor: "#405c79" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#405c79' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#56bf8b' attr: 'b' } + empty: '#8b56bf' + bool: {|| if $in { '#568bbf' } else { 'light_gray' } } + int: '#405c79' + filesize: {|e| + if $e == 0b { + '#405c79' + } else if $e < 1mb { + '#568bbf' + } else {{ fg: '#8b56bf' }} + } + duration: '#405c79' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf8b56' attr: 'b' } + } else if $in < 6hr { + '#bf8b56' + } else if $in < 1day { + '#8bbf56' + } else if $in < 3day { + '#56bf8b' + } else if $in < 1wk { + { fg: '#56bf8b' attr: 'b' } + } else if $in < 6wk { + '#568bbf' + } else if $in < 52wk { + '#8b56bf' + } else { 'dark_gray' } + } + range: '#405c79' + float: '#405c79' + string: '#405c79' + nothing: '#405c79' + binary: '#405c79' + cellpath: '#405c79' + row_index: { fg: '#56bf8b' attr: 'b' } + record: '#405c79' + list: '#405c79' + block: '#405c79' + hints: 'dark_gray' + search_result: { fg: '#bf8b56' bg: '#405c79' } + + shape_and: { fg: '#bf568b' attr: 'b' } + shape_binary: { fg: '#bf568b' attr: 'b' } + shape_block: { fg: '#8b56bf' attr: 'b' } + shape_bool: '#568bbf' + shape_custom: '#56bf8b' + shape_datetime: { fg: '#568bbf' attr: 'b' } + shape_directory: '#568bbf' + shape_external: '#568bbf' + shape_externalarg: { fg: '#56bf8b' attr: 'b' } + shape_filepath: '#568bbf' + shape_flag: { fg: '#8b56bf' attr: 'b' } + shape_float: { fg: '#bf568b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#568bbf' attr: 'b' } + shape_int: { fg: '#bf568b' attr: 'b' } + shape_internalcall: { fg: '#568bbf' attr: 'b' } + shape_list: { fg: '#568bbf' attr: 'b' } + shape_literal: '#8b56bf' + shape_match_pattern: '#56bf8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#568bbf' + shape_operator: '#8bbf56' + shape_or: { fg: '#bf568b' attr: 'b' } + shape_pipe: { fg: '#bf568b' attr: 'b' } + shape_range: { fg: '#8bbf56' attr: 'b' } + shape_record: { fg: '#568bbf' attr: 'b' } + shape_redirection: { fg: '#bf568b' attr: 'b' } + shape_signature: { fg: '#56bf8b' attr: 'b' } + shape_string: '#56bf8b' + shape_string_interpolation: { fg: '#568bbf' attr: 'b' } + shape_table: { fg: '#8b56bf' attr: 'b' } + shape_variable: '#bf568b' + + background: '#f7f9fb' + foreground: '#405c79' + cursor: '#405c79' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/harper.nu b/themes/nu-themes/harper.nu index c36c9e9..89056be 100644 --- a/themes/nu-themes/harper.nu +++ b/themes/nu-themes/harper.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a8a49d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7fb5e1" attr: "b" } - empty: "#489e48" - bool: {|| if $in { "#f5bfd7" } else { "light_gray" } } - int: "#a8a49d" - filesize: {|e| - if $e == 0b { - "#a8a49d" - } else if $e < 1mb { - "#f5bfd7" - } else {{ fg: "#489e48" }} - } - duration: "#a8a49d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f8b63f" attr: "b" } - } else if $in < 6hr { - "#f8b63f" - } else if $in < 1day { - "#d6da25" - } else if $in < 3day { - "#7fb5e1" - } else if $in < 1wk { - { fg: "#7fb5e1" attr: "b" } - } else if $in < 6wk { - "#f5bfd7" - } else if $in < 52wk { - "#489e48" - } else { "dark_gray" } - } - range: "#a8a49d" - float: "#a8a49d" - string: "#a8a49d" - nothing: "#a8a49d" - binary: "#a8a49d" - cellpath: "#a8a49d" - row_index: { fg: "#7fb5e1" attr: "b" } - record: "#a8a49d" - list: "#a8a49d" - block: "#a8a49d" - hints: "dark_gray" - search_result: { fg: "#f8b63f" bg: "#a8a49d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b296c6" attr: "b" } - shape_binary: { fg: "#b296c6" attr: "b" } - shape_block: { fg: "#489e48" attr: "b" } - shape_bool: "#f5bfd7" - shape_custom: "#7fb5e1" - shape_datetime: { fg: "#f5bfd7" attr: "b" } - shape_directory: "#f5bfd7" - shape_external: "#f5bfd7" - shape_externalarg: { fg: "#7fb5e1" attr: "b" } - shape_filepath: "#f5bfd7" - shape_flag: { fg: "#489e48" attr: "b" } - shape_float: { fg: "#b296c6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#f5bfd7" attr: "b" } - shape_int: { fg: "#b296c6" attr: "b" } - shape_internalcall: { fg: "#f5bfd7" attr: "b" } - shape_list: { fg: "#f5bfd7" attr: "b" } - shape_literal: "#489e48" - shape_match_pattern: "#7fb5e1" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#f5bfd7" - shape_operator: "#d6da25" - shape_or: { fg: "#b296c6" attr: "b" } - shape_pipe: { fg: "#b296c6" attr: "b" } - shape_range: { fg: "#d6da25" attr: "b" } - shape_record: { fg: "#f5bfd7" attr: "b" } - shape_redirection: { fg: "#b296c6" attr: "b" } - shape_signature: { fg: "#7fb5e1" attr: "b" } - shape_string: "#7fb5e1" - shape_string_interpolation: { fg: "#f5bfd7" attr: "b" } - shape_table: { fg: "#489e48" attr: "b" } - shape_variable: "#b296c6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#010101" - foreground: "#a8a49d" - cursor: "#a8a49d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a8a49d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7fb5e1' attr: 'b' } + empty: '#489e48' + bool: {|| if $in { '#f5bfd7' } else { 'light_gray' } } + int: '#a8a49d' + filesize: {|e| + if $e == 0b { + '#a8a49d' + } else if $e < 1mb { + '#f5bfd7' + } else {{ fg: '#489e48' }} + } + duration: '#a8a49d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f8b63f' attr: 'b' } + } else if $in < 6hr { + '#f8b63f' + } else if $in < 1day { + '#d6da25' + } else if $in < 3day { + '#7fb5e1' + } else if $in < 1wk { + { fg: '#7fb5e1' attr: 'b' } + } else if $in < 6wk { + '#f5bfd7' + } else if $in < 52wk { + '#489e48' + } else { 'dark_gray' } + } + range: '#a8a49d' + float: '#a8a49d' + string: '#a8a49d' + nothing: '#a8a49d' + binary: '#a8a49d' + cellpath: '#a8a49d' + row_index: { fg: '#7fb5e1' attr: 'b' } + record: '#a8a49d' + list: '#a8a49d' + block: '#a8a49d' + hints: 'dark_gray' + search_result: { fg: '#f8b63f' bg: '#a8a49d' } + + shape_and: { fg: '#b296c6' attr: 'b' } + shape_binary: { fg: '#b296c6' attr: 'b' } + shape_block: { fg: '#489e48' attr: 'b' } + shape_bool: '#f5bfd7' + shape_custom: '#7fb5e1' + shape_datetime: { fg: '#f5bfd7' attr: 'b' } + shape_directory: '#f5bfd7' + shape_external: '#f5bfd7' + shape_externalarg: { fg: '#7fb5e1' attr: 'b' } + shape_filepath: '#f5bfd7' + shape_flag: { fg: '#489e48' attr: 'b' } + shape_float: { fg: '#b296c6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#f5bfd7' attr: 'b' } + shape_int: { fg: '#b296c6' attr: 'b' } + shape_internalcall: { fg: '#f5bfd7' attr: 'b' } + shape_list: { fg: '#f5bfd7' attr: 'b' } + shape_literal: '#489e48' + shape_match_pattern: '#7fb5e1' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#f5bfd7' + shape_operator: '#d6da25' + shape_or: { fg: '#b296c6' attr: 'b' } + shape_pipe: { fg: '#b296c6' attr: 'b' } + shape_range: { fg: '#d6da25' attr: 'b' } + shape_record: { fg: '#f5bfd7' attr: 'b' } + shape_redirection: { fg: '#b296c6' attr: 'b' } + shape_signature: { fg: '#7fb5e1' attr: 'b' } + shape_string: '#7fb5e1' + shape_string_interpolation: { fg: '#f5bfd7' attr: 'b' } + shape_table: { fg: '#489e48' attr: 'b' } + shape_variable: '#b296c6' + + background: '#010101' + foreground: '#a8a49d' + cursor: '#a8a49d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/heetch-light.nu b/themes/nu-themes/heetch-light.nu index e6a48a6..74f305c 100644 --- a/themes/nu-themes/heetch-light.nu +++ b/themes/nu-themes/heetch-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5a496e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#f80059" attr: "b" } - empty: "#47f9f5" - bool: {|| if $in { "#c33678" } else { "light_gray" } } - int: "#5a496e" - filesize: {|e| - if $e == 0b { - "#5a496e" - } else if $e < 1mb { - "#c33678" - } else {{ fg: "#47f9f5" }} - } - duration: "#5a496e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#27d9d5" attr: "b" } - } else if $in < 6hr { - "#27d9d5" - } else if $in < 1day { - "#5ba2b6" - } else if $in < 3day { - "#f80059" - } else if $in < 1wk { - { fg: "#f80059" attr: "b" } - } else if $in < 6wk { - "#c33678" - } else if $in < 52wk { - "#47f9f5" - } else { "dark_gray" } - } - range: "#5a496e" - float: "#5a496e" - string: "#5a496e" - nothing: "#5a496e" - binary: "#5a496e" - cellpath: "#5a496e" - row_index: { fg: "#f80059" attr: "b" } - record: "#5a496e" - list: "#5a496e" - block: "#5a496e" - hints: "dark_gray" - search_result: { fg: "#27d9d5" bg: "#5a496e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bd0152" attr: "b" } - shape_binary: { fg: "#bd0152" attr: "b" } - shape_block: { fg: "#47f9f5" attr: "b" } - shape_bool: "#c33678" - shape_custom: "#f80059" - shape_datetime: { fg: "#c33678" attr: "b" } - shape_directory: "#c33678" - shape_external: "#c33678" - shape_externalarg: { fg: "#f80059" attr: "b" } - shape_filepath: "#c33678" - shape_flag: { fg: "#47f9f5" attr: "b" } - shape_float: { fg: "#bd0152" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c33678" attr: "b" } - shape_int: { fg: "#bd0152" attr: "b" } - shape_internalcall: { fg: "#c33678" attr: "b" } - shape_list: { fg: "#c33678" attr: "b" } - shape_literal: "#47f9f5" - shape_match_pattern: "#f80059" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c33678" - shape_operator: "#5ba2b6" - shape_or: { fg: "#bd0152" attr: "b" } - shape_pipe: { fg: "#bd0152" attr: "b" } - shape_range: { fg: "#5ba2b6" attr: "b" } - shape_record: { fg: "#c33678" attr: "b" } - shape_redirection: { fg: "#bd0152" attr: "b" } - shape_signature: { fg: "#f80059" attr: "b" } - shape_string: "#f80059" - shape_string_interpolation: { fg: "#c33678" attr: "b" } - shape_table: { fg: "#47f9f5" attr: "b" } - shape_variable: "#bd0152" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#feffff" - foreground: "#5a496e" - cursor: "#5a496e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5a496e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#f80059' attr: 'b' } + empty: '#47f9f5' + bool: {|| if $in { '#c33678' } else { 'light_gray' } } + int: '#5a496e' + filesize: {|e| + if $e == 0b { + '#5a496e' + } else if $e < 1mb { + '#c33678' + } else {{ fg: '#47f9f5' }} + } + duration: '#5a496e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#27d9d5' attr: 'b' } + } else if $in < 6hr { + '#27d9d5' + } else if $in < 1day { + '#5ba2b6' + } else if $in < 3day { + '#f80059' + } else if $in < 1wk { + { fg: '#f80059' attr: 'b' } + } else if $in < 6wk { + '#c33678' + } else if $in < 52wk { + '#47f9f5' + } else { 'dark_gray' } + } + range: '#5a496e' + float: '#5a496e' + string: '#5a496e' + nothing: '#5a496e' + binary: '#5a496e' + cellpath: '#5a496e' + row_index: { fg: '#f80059' attr: 'b' } + record: '#5a496e' + list: '#5a496e' + block: '#5a496e' + hints: 'dark_gray' + search_result: { fg: '#27d9d5' bg: '#5a496e' } + + shape_and: { fg: '#bd0152' attr: 'b' } + shape_binary: { fg: '#bd0152' attr: 'b' } + shape_block: { fg: '#47f9f5' attr: 'b' } + shape_bool: '#c33678' + shape_custom: '#f80059' + shape_datetime: { fg: '#c33678' attr: 'b' } + shape_directory: '#c33678' + shape_external: '#c33678' + shape_externalarg: { fg: '#f80059' attr: 'b' } + shape_filepath: '#c33678' + shape_flag: { fg: '#47f9f5' attr: 'b' } + shape_float: { fg: '#bd0152' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c33678' attr: 'b' } + shape_int: { fg: '#bd0152' attr: 'b' } + shape_internalcall: { fg: '#c33678' attr: 'b' } + shape_list: { fg: '#c33678' attr: 'b' } + shape_literal: '#47f9f5' + shape_match_pattern: '#f80059' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c33678' + shape_operator: '#5ba2b6' + shape_or: { fg: '#bd0152' attr: 'b' } + shape_pipe: { fg: '#bd0152' attr: 'b' } + shape_range: { fg: '#5ba2b6' attr: 'b' } + shape_record: { fg: '#c33678' attr: 'b' } + shape_redirection: { fg: '#bd0152' attr: 'b' } + shape_signature: { fg: '#f80059' attr: 'b' } + shape_string: '#f80059' + shape_string_interpolation: { fg: '#c33678' attr: 'b' } + shape_table: { fg: '#47f9f5' attr: 'b' } + shape_variable: '#bd0152' + + background: '#feffff' + foreground: '#5a496e' + cursor: '#5a496e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/heetch.nu b/themes/nu-themes/heetch.nu index 4d9f58b..c1bf149 100644 --- a/themes/nu-themes/heetch.nu +++ b/themes/nu-themes/heetch.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bdb6c5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c33678" attr: "b" } - empty: "#bd0152" - bool: {|| if $in { "#f80059" } else { "light_gray" } } - int: "#bdb6c5" - filesize: {|e| - if $e == 0b { - "#bdb6c5" - } else if $e < 1mb { - "#f80059" - } else {{ fg: "#bd0152" }} - } - duration: "#bdb6c5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#27d9d5" attr: "b" } - } else if $in < 6hr { - "#27d9d5" - } else if $in < 1day { - "#8f6c97" - } else if $in < 3day { - "#c33678" - } else if $in < 1wk { - { fg: "#c33678" attr: "b" } - } else if $in < 6wk { - "#f80059" - } else if $in < 52wk { - "#bd0152" - } else { "dark_gray" } - } - range: "#bdb6c5" - float: "#bdb6c5" - string: "#bdb6c5" - nothing: "#bdb6c5" - binary: "#bdb6c5" - cellpath: "#bdb6c5" - row_index: { fg: "#c33678" attr: "b" } - record: "#bdb6c5" - list: "#bdb6c5" - block: "#bdb6c5" - hints: "dark_gray" - search_result: { fg: "#27d9d5" bg: "#bdb6c5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#82034c" attr: "b" } - shape_binary: { fg: "#82034c" attr: "b" } - shape_block: { fg: "#bd0152" attr: "b" } - shape_bool: "#f80059" - shape_custom: "#c33678" - shape_datetime: { fg: "#f80059" attr: "b" } - shape_directory: "#f80059" - shape_external: "#f80059" - shape_externalarg: { fg: "#c33678" attr: "b" } - shape_filepath: "#f80059" - shape_flag: { fg: "#bd0152" attr: "b" } - shape_float: { fg: "#82034c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#f80059" attr: "b" } - shape_int: { fg: "#82034c" attr: "b" } - shape_internalcall: { fg: "#f80059" attr: "b" } - shape_list: { fg: "#f80059" attr: "b" } - shape_literal: "#bd0152" - shape_match_pattern: "#c33678" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#f80059" - shape_operator: "#8f6c97" - shape_or: { fg: "#82034c" attr: "b" } - shape_pipe: { fg: "#82034c" attr: "b" } - shape_range: { fg: "#8f6c97" attr: "b" } - shape_record: { fg: "#f80059" attr: "b" } - shape_redirection: { fg: "#82034c" attr: "b" } - shape_signature: { fg: "#c33678" attr: "b" } - shape_string: "#c33678" - shape_string_interpolation: { fg: "#f80059" attr: "b" } - shape_table: { fg: "#bd0152" attr: "b" } - shape_variable: "#82034c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#190134" - foreground: "#bdb6c5" - cursor: "#bdb6c5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bdb6c5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c33678' attr: 'b' } + empty: '#bd0152' + bool: {|| if $in { '#f80059' } else { 'light_gray' } } + int: '#bdb6c5' + filesize: {|e| + if $e == 0b { + '#bdb6c5' + } else if $e < 1mb { + '#f80059' + } else {{ fg: '#bd0152' }} + } + duration: '#bdb6c5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#27d9d5' attr: 'b' } + } else if $in < 6hr { + '#27d9d5' + } else if $in < 1day { + '#8f6c97' + } else if $in < 3day { + '#c33678' + } else if $in < 1wk { + { fg: '#c33678' attr: 'b' } + } else if $in < 6wk { + '#f80059' + } else if $in < 52wk { + '#bd0152' + } else { 'dark_gray' } + } + range: '#bdb6c5' + float: '#bdb6c5' + string: '#bdb6c5' + nothing: '#bdb6c5' + binary: '#bdb6c5' + cellpath: '#bdb6c5' + row_index: { fg: '#c33678' attr: 'b' } + record: '#bdb6c5' + list: '#bdb6c5' + block: '#bdb6c5' + hints: 'dark_gray' + search_result: { fg: '#27d9d5' bg: '#bdb6c5' } + + shape_and: { fg: '#82034c' attr: 'b' } + shape_binary: { fg: '#82034c' attr: 'b' } + shape_block: { fg: '#bd0152' attr: 'b' } + shape_bool: '#f80059' + shape_custom: '#c33678' + shape_datetime: { fg: '#f80059' attr: 'b' } + shape_directory: '#f80059' + shape_external: '#f80059' + shape_externalarg: { fg: '#c33678' attr: 'b' } + shape_filepath: '#f80059' + shape_flag: { fg: '#bd0152' attr: 'b' } + shape_float: { fg: '#82034c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#f80059' attr: 'b' } + shape_int: { fg: '#82034c' attr: 'b' } + shape_internalcall: { fg: '#f80059' attr: 'b' } + shape_list: { fg: '#f80059' attr: 'b' } + shape_literal: '#bd0152' + shape_match_pattern: '#c33678' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#f80059' + shape_operator: '#8f6c97' + shape_or: { fg: '#82034c' attr: 'b' } + shape_pipe: { fg: '#82034c' attr: 'b' } + shape_range: { fg: '#8f6c97' attr: 'b' } + shape_record: { fg: '#f80059' attr: 'b' } + shape_redirection: { fg: '#82034c' attr: 'b' } + shape_signature: { fg: '#c33678' attr: 'b' } + shape_string: '#c33678' + shape_string_interpolation: { fg: '#f80059' attr: 'b' } + shape_table: { fg: '#bd0152' attr: 'b' } + shape_variable: '#82034c' + + background: '#190134' + foreground: '#bdb6c5' + cursor: '#bdb6c5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/helios.nu b/themes/nu-themes/helios.nu index 9566fb7..1df0f9f 100644 --- a/themes/nu-themes/helios.nu +++ b/themes/nu-themes/helios.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d5d5d5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#88b92d" attr: "b" } - empty: "#1e8bac" - bool: {|| if $in { "#1ba595" } else { "light_gray" } } - int: "#d5d5d5" - filesize: {|e| - if $e == 0b { - "#d5d5d5" - } else if $e < 1mb { - "#1ba595" - } else {{ fg: "#1e8bac" }} - } - duration: "#d5d5d5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d72638" attr: "b" } - } else if $in < 6hr { - "#d72638" - } else if $in < 1day { - "#f19d1a" - } else if $in < 3day { - "#88b92d" - } else if $in < 1wk { - { fg: "#88b92d" attr: "b" } - } else if $in < 6wk { - "#1ba595" - } else if $in < 52wk { - "#1e8bac" - } else { "dark_gray" } - } - range: "#d5d5d5" - float: "#d5d5d5" - string: "#d5d5d5" - nothing: "#d5d5d5" - binary: "#d5d5d5" - cellpath: "#d5d5d5" - row_index: { fg: "#88b92d" attr: "b" } - record: "#d5d5d5" - list: "#d5d5d5" - block: "#d5d5d5" - hints: "dark_gray" - search_result: { fg: "#d72638" bg: "#d5d5d5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#be4264" attr: "b" } - shape_binary: { fg: "#be4264" attr: "b" } - shape_block: { fg: "#1e8bac" attr: "b" } - shape_bool: "#1ba595" - shape_custom: "#88b92d" - shape_datetime: { fg: "#1ba595" attr: "b" } - shape_directory: "#1ba595" - shape_external: "#1ba595" - shape_externalarg: { fg: "#88b92d" attr: "b" } - shape_filepath: "#1ba595" - shape_flag: { fg: "#1e8bac" attr: "b" } - shape_float: { fg: "#be4264" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1ba595" attr: "b" } - shape_int: { fg: "#be4264" attr: "b" } - shape_internalcall: { fg: "#1ba595" attr: "b" } - shape_list: { fg: "#1ba595" attr: "b" } - shape_literal: "#1e8bac" - shape_match_pattern: "#88b92d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1ba595" - shape_operator: "#f19d1a" - shape_or: { fg: "#be4264" attr: "b" } - shape_pipe: { fg: "#be4264" attr: "b" } - shape_range: { fg: "#f19d1a" attr: "b" } - shape_record: { fg: "#1ba595" attr: "b" } - shape_redirection: { fg: "#be4264" attr: "b" } - shape_signature: { fg: "#88b92d" attr: "b" } - shape_string: "#88b92d" - shape_string_interpolation: { fg: "#1ba595" attr: "b" } - shape_table: { fg: "#1e8bac" attr: "b" } - shape_variable: "#be4264" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d2021" - foreground: "#d5d5d5" - cursor: "#d5d5d5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d5d5d5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#88b92d' attr: 'b' } + empty: '#1e8bac' + bool: {|| if $in { '#1ba595' } else { 'light_gray' } } + int: '#d5d5d5' + filesize: {|e| + if $e == 0b { + '#d5d5d5' + } else if $e < 1mb { + '#1ba595' + } else {{ fg: '#1e8bac' }} + } + duration: '#d5d5d5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d72638' attr: 'b' } + } else if $in < 6hr { + '#d72638' + } else if $in < 1day { + '#f19d1a' + } else if $in < 3day { + '#88b92d' + } else if $in < 1wk { + { fg: '#88b92d' attr: 'b' } + } else if $in < 6wk { + '#1ba595' + } else if $in < 52wk { + '#1e8bac' + } else { 'dark_gray' } + } + range: '#d5d5d5' + float: '#d5d5d5' + string: '#d5d5d5' + nothing: '#d5d5d5' + binary: '#d5d5d5' + cellpath: '#d5d5d5' + row_index: { fg: '#88b92d' attr: 'b' } + record: '#d5d5d5' + list: '#d5d5d5' + block: '#d5d5d5' + hints: 'dark_gray' + search_result: { fg: '#d72638' bg: '#d5d5d5' } + + shape_and: { fg: '#be4264' attr: 'b' } + shape_binary: { fg: '#be4264' attr: 'b' } + shape_block: { fg: '#1e8bac' attr: 'b' } + shape_bool: '#1ba595' + shape_custom: '#88b92d' + shape_datetime: { fg: '#1ba595' attr: 'b' } + shape_directory: '#1ba595' + shape_external: '#1ba595' + shape_externalarg: { fg: '#88b92d' attr: 'b' } + shape_filepath: '#1ba595' + shape_flag: { fg: '#1e8bac' attr: 'b' } + shape_float: { fg: '#be4264' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1ba595' attr: 'b' } + shape_int: { fg: '#be4264' attr: 'b' } + shape_internalcall: { fg: '#1ba595' attr: 'b' } + shape_list: { fg: '#1ba595' attr: 'b' } + shape_literal: '#1e8bac' + shape_match_pattern: '#88b92d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1ba595' + shape_operator: '#f19d1a' + shape_or: { fg: '#be4264' attr: 'b' } + shape_pipe: { fg: '#be4264' attr: 'b' } + shape_range: { fg: '#f19d1a' attr: 'b' } + shape_record: { fg: '#1ba595' attr: 'b' } + shape_redirection: { fg: '#be4264' attr: 'b' } + shape_signature: { fg: '#88b92d' attr: 'b' } + shape_string: '#88b92d' + shape_string_interpolation: { fg: '#1ba595' attr: 'b' } + shape_table: { fg: '#1e8bac' attr: 'b' } + shape_variable: '#be4264' + + background: '#1d2021' + foreground: '#d5d5d5' + cursor: '#d5d5d5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hemisu-dark.nu b/themes/nu-themes/hemisu-dark.nu index da56dad..e8b6540 100644 --- a/themes/nu-themes/hemisu-dark.nu +++ b/themes/nu-themes/hemisu-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ededed" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b1d630" attr: "b" } - empty: "#67bee3" - bool: {|| if $in { "#b6e0e5" } else { "light_gray" } } - int: "#ededed" - filesize: {|e| - if $e == 0b { - "#ededed" - } else if $e < 1mb { - "#569a9f" - } else {{ fg: "#67bee3" }} - } - duration: "#ededed" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0054" attr: "b" } - } else if $in < 6hr { - "#ff0054" - } else if $in < 1day { - "#9d895e" - } else if $in < 3day { - "#b1d630" - } else if $in < 1wk { - { fg: "#b1d630" attr: "b" } - } else if $in < 6wk { - "#569a9f" - } else if $in < 52wk { - "#67bee3" - } else { "dark_gray" } - } - range: "#ededed" - float: "#ededed" - string: "#ededed" - nothing: "#ededed" - binary: "#ededed" - cellpath: "#ededed" - row_index: { fg: "#b1d630" attr: "b" } - record: "#ededed" - list: "#ededed" - block: "#ededed" - hints: "dark_gray" - search_result: { fg: "#ff0054" bg: "#ededed" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b576bc" attr: "b" } - shape_binary: { fg: "#b576bc" attr: "b" } - shape_block: { fg: "#67bee3" attr: "b" } - shape_bool: "#b6e0e5" - shape_custom: "#b1d630" - shape_datetime: { fg: "#569a9f" attr: "b" } - shape_directory: "#569a9f" - shape_external: "#569a9f" - shape_externalarg: { fg: "#b1d630" attr: "b" } - shape_filepath: "#569a9f" - shape_flag: { fg: "#67bee3" attr: "b" } - shape_float: { fg: "#b576bc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#569a9f" attr: "b" } - shape_int: { fg: "#b576bc" attr: "b" } - shape_internalcall: { fg: "#569a9f" attr: "b" } - shape_list: { fg: "#569a9f" attr: "b" } - shape_literal: "#67bee3" - shape_match_pattern: "#b1d630" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b6e0e5" - shape_operator: "#9d895e" - shape_or: { fg: "#b576bc" attr: "b" } - shape_pipe: { fg: "#b576bc" attr: "b" } - shape_range: { fg: "#9d895e" attr: "b" } - shape_record: { fg: "#569a9f" attr: "b" } - shape_redirection: { fg: "#b576bc" attr: "b" } - shape_signature: { fg: "#b1d630" attr: "b" } - shape_string: "#b1d630" - shape_string_interpolation: { fg: "#569a9f" attr: "b" } - shape_table: { fg: "#67bee3" attr: "b" } - shape_variable: "#b576bc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#ffffff" - cursor: "#baffaa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ededed' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b1d630' attr: 'b' } + empty: '#67bee3' + bool: {|| if $in { '#b6e0e5' } else { 'light_gray' } } + int: '#ededed' + filesize: {|e| + if $e == 0b { + '#ededed' + } else if $e < 1mb { + '#569a9f' + } else {{ fg: '#67bee3' }} + } + duration: '#ededed' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0054' attr: 'b' } + } else if $in < 6hr { + '#ff0054' + } else if $in < 1day { + '#9d895e' + } else if $in < 3day { + '#b1d630' + } else if $in < 1wk { + { fg: '#b1d630' attr: 'b' } + } else if $in < 6wk { + '#569a9f' + } else if $in < 52wk { + '#67bee3' + } else { 'dark_gray' } + } + range: '#ededed' + float: '#ededed' + string: '#ededed' + nothing: '#ededed' + binary: '#ededed' + cellpath: '#ededed' + row_index: { fg: '#b1d630' attr: 'b' } + record: '#ededed' + list: '#ededed' + block: '#ededed' + hints: 'dark_gray' + search_result: { fg: '#ff0054' bg: '#ededed' } + + shape_and: { fg: '#b576bc' attr: 'b' } + shape_binary: { fg: '#b576bc' attr: 'b' } + shape_block: { fg: '#67bee3' attr: 'b' } + shape_bool: '#b6e0e5' + shape_custom: '#b1d630' + shape_datetime: { fg: '#569a9f' attr: 'b' } + shape_directory: '#569a9f' + shape_external: '#569a9f' + shape_externalarg: { fg: '#b1d630' attr: 'b' } + shape_filepath: '#569a9f' + shape_flag: { fg: '#67bee3' attr: 'b' } + shape_float: { fg: '#b576bc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#569a9f' attr: 'b' } + shape_int: { fg: '#b576bc' attr: 'b' } + shape_internalcall: { fg: '#569a9f' attr: 'b' } + shape_list: { fg: '#569a9f' attr: 'b' } + shape_literal: '#67bee3' + shape_match_pattern: '#b1d630' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b6e0e5' + shape_operator: '#9d895e' + shape_or: { fg: '#b576bc' attr: 'b' } + shape_pipe: { fg: '#b576bc' attr: 'b' } + shape_range: { fg: '#9d895e' attr: 'b' } + shape_record: { fg: '#569a9f' attr: 'b' } + shape_redirection: { fg: '#b576bc' attr: 'b' } + shape_signature: { fg: '#b1d630' attr: 'b' } + shape_string: '#b1d630' + shape_string_interpolation: { fg: '#569a9f' attr: 'b' } + shape_table: { fg: '#67bee3' attr: 'b' } + shape_variable: '#b576bc' + + background: '#000000' + foreground: '#ffffff' + cursor: '#baffaa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hemisu-light.nu b/themes/nu-themes/hemisu-light.nu index 303fab2..41c99dd 100644 --- a/themes/nu-themes/hemisu-light.nu +++ b/themes/nu-themes/hemisu-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#999999" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#739100" attr: "b" } - empty: "#538091" - bool: {|| if $in { "#85b2aa" } else { "light_gray" } } - int: "#999999" - filesize: {|e| - if $e == 0b { - "#999999" - } else if $e < 1mb { - "#538091" - } else {{ fg: "#538091" }} - } - duration: "#999999" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0055" attr: "b" } - } else if $in < 6hr { - "#ff0055" - } else if $in < 1day { - "#503d15" - } else if $in < 3day { - "#739100" - } else if $in < 1wk { - { fg: "#739100" attr: "b" } - } else if $in < 6wk { - "#538091" - } else if $in < 52wk { - "#538091" - } else { "dark_gray" } - } - range: "#999999" - float: "#999999" - string: "#999999" - nothing: "#999999" - binary: "#999999" - cellpath: "#999999" - row_index: { fg: "#739100" attr: "b" } - record: "#999999" - list: "#999999" - block: "#999999" - hints: "dark_gray" - search_result: { fg: "#ff0055" bg: "#999999" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#5b345e" attr: "b" } - shape_binary: { fg: "#5b345e" attr: "b" } - shape_block: { fg: "#538091" attr: "b" } - shape_bool: "#85b2aa" - shape_custom: "#739100" - shape_datetime: { fg: "#538091" attr: "b" } - shape_directory: "#538091" - shape_external: "#538091" - shape_externalarg: { fg: "#739100" attr: "b" } - shape_filepath: "#538091" - shape_flag: { fg: "#538091" attr: "b" } - shape_float: { fg: "#5b345e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#538091" attr: "b" } - shape_int: { fg: "#5b345e" attr: "b" } - shape_internalcall: { fg: "#538091" attr: "b" } - shape_list: { fg: "#538091" attr: "b" } - shape_literal: "#538091" - shape_match_pattern: "#739100" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#85b2aa" - shape_operator: "#503d15" - shape_or: { fg: "#5b345e" attr: "b" } - shape_pipe: { fg: "#5b345e" attr: "b" } - shape_range: { fg: "#503d15" attr: "b" } - shape_record: { fg: "#538091" attr: "b" } - shape_redirection: { fg: "#5b345e" attr: "b" } - shape_signature: { fg: "#739100" attr: "b" } - shape_string: "#739100" - shape_string_interpolation: { fg: "#538091" attr: "b" } - shape_table: { fg: "#538091" attr: "b" } - shape_variable: "#5b345e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#efefef" - foreground: "#444444" - cursor: "#ff0054" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#999999' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#739100' attr: 'b' } + empty: '#538091' + bool: {|| if $in { '#85b2aa' } else { 'light_gray' } } + int: '#999999' + filesize: {|e| + if $e == 0b { + '#999999' + } else if $e < 1mb { + '#538091' + } else {{ fg: '#538091' }} + } + duration: '#999999' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0055' attr: 'b' } + } else if $in < 6hr { + '#ff0055' + } else if $in < 1day { + '#503d15' + } else if $in < 3day { + '#739100' + } else if $in < 1wk { + { fg: '#739100' attr: 'b' } + } else if $in < 6wk { + '#538091' + } else if $in < 52wk { + '#538091' + } else { 'dark_gray' } + } + range: '#999999' + float: '#999999' + string: '#999999' + nothing: '#999999' + binary: '#999999' + cellpath: '#999999' + row_index: { fg: '#739100' attr: 'b' } + record: '#999999' + list: '#999999' + block: '#999999' + hints: 'dark_gray' + search_result: { fg: '#ff0055' bg: '#999999' } + + shape_and: { fg: '#5b345e' attr: 'b' } + shape_binary: { fg: '#5b345e' attr: 'b' } + shape_block: { fg: '#538091' attr: 'b' } + shape_bool: '#85b2aa' + shape_custom: '#739100' + shape_datetime: { fg: '#538091' attr: 'b' } + shape_directory: '#538091' + shape_external: '#538091' + shape_externalarg: { fg: '#739100' attr: 'b' } + shape_filepath: '#538091' + shape_flag: { fg: '#538091' attr: 'b' } + shape_float: { fg: '#5b345e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#538091' attr: 'b' } + shape_int: { fg: '#5b345e' attr: 'b' } + shape_internalcall: { fg: '#538091' attr: 'b' } + shape_list: { fg: '#538091' attr: 'b' } + shape_literal: '#538091' + shape_match_pattern: '#739100' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#85b2aa' + shape_operator: '#503d15' + shape_or: { fg: '#5b345e' attr: 'b' } + shape_pipe: { fg: '#5b345e' attr: 'b' } + shape_range: { fg: '#503d15' attr: 'b' } + shape_record: { fg: '#538091' attr: 'b' } + shape_redirection: { fg: '#5b345e' attr: 'b' } + shape_signature: { fg: '#739100' attr: 'b' } + shape_string: '#739100' + shape_string_interpolation: { fg: '#538091' attr: 'b' } + shape_table: { fg: '#538091' attr: 'b' } + shape_variable: '#5b345e' + + background: '#efefef' + foreground: '#444444' + cursor: '#ff0054' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/highway.nu b/themes/nu-themes/highway.nu index 59f540d..3abea87 100644 --- a/themes/nu-themes/highway.nu +++ b/themes/nu-themes/highway.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ededed" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#138034" attr: "b" } - empty: "#006bb3" - bool: {|| if $in { "#5d504a" } else { "light_gray" } } - int: "#ededed" - filesize: {|e| - if $e == 0b { - "#ededed" - } else if $e < 1mb { - "#384564" - } else {{ fg: "#006bb3" }} - } - duration: "#ededed" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d00e18" attr: "b" } - } else if $in < 6hr { - "#d00e18" - } else if $in < 1day { - "#ffcb3e" - } else if $in < 3day { - "#138034" - } else if $in < 1wk { - { fg: "#138034" attr: "b" } - } else if $in < 6wk { - "#384564" - } else if $in < 52wk { - "#006bb3" - } else { "dark_gray" } - } - range: "#ededed" - float: "#ededed" - string: "#ededed" - nothing: "#ededed" - binary: "#ededed" - cellpath: "#ededed" - row_index: { fg: "#138034" attr: "b" } - record: "#ededed" - list: "#ededed" - block: "#ededed" - hints: "dark_gray" - search_result: { fg: "#d00e18" bg: "#ededed" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6b2775" attr: "b" } - shape_binary: { fg: "#6b2775" attr: "b" } - shape_block: { fg: "#006bb3" attr: "b" } - shape_bool: "#5d504a" - shape_custom: "#138034" - shape_datetime: { fg: "#384564" attr: "b" } - shape_directory: "#384564" - shape_external: "#384564" - shape_externalarg: { fg: "#138034" attr: "b" } - shape_filepath: "#384564" - shape_flag: { fg: "#006bb3" attr: "b" } - shape_float: { fg: "#6b2775" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#384564" attr: "b" } - shape_int: { fg: "#6b2775" attr: "b" } - shape_internalcall: { fg: "#384564" attr: "b" } - shape_list: { fg: "#384564" attr: "b" } - shape_literal: "#006bb3" - shape_match_pattern: "#138034" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5d504a" - shape_operator: "#ffcb3e" - shape_or: { fg: "#6b2775" attr: "b" } - shape_pipe: { fg: "#6b2775" attr: "b" } - shape_range: { fg: "#ffcb3e" attr: "b" } - shape_record: { fg: "#384564" attr: "b" } - shape_redirection: { fg: "#6b2775" attr: "b" } - shape_signature: { fg: "#138034" attr: "b" } - shape_string: "#138034" - shape_string_interpolation: { fg: "#384564" attr: "b" } - shape_table: { fg: "#006bb3" attr: "b" } - shape_variable: "#6b2775" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222225" - foreground: "#ededed" - cursor: "#ededed" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ededed' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#138034' attr: 'b' } + empty: '#006bb3' + bool: {|| if $in { '#5d504a' } else { 'light_gray' } } + int: '#ededed' + filesize: {|e| + if $e == 0b { + '#ededed' + } else if $e < 1mb { + '#384564' + } else {{ fg: '#006bb3' }} + } + duration: '#ededed' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d00e18' attr: 'b' } + } else if $in < 6hr { + '#d00e18' + } else if $in < 1day { + '#ffcb3e' + } else if $in < 3day { + '#138034' + } else if $in < 1wk { + { fg: '#138034' attr: 'b' } + } else if $in < 6wk { + '#384564' + } else if $in < 52wk { + '#006bb3' + } else { 'dark_gray' } + } + range: '#ededed' + float: '#ededed' + string: '#ededed' + nothing: '#ededed' + binary: '#ededed' + cellpath: '#ededed' + row_index: { fg: '#138034' attr: 'b' } + record: '#ededed' + list: '#ededed' + block: '#ededed' + hints: 'dark_gray' + search_result: { fg: '#d00e18' bg: '#ededed' } + + shape_and: { fg: '#6b2775' attr: 'b' } + shape_binary: { fg: '#6b2775' attr: 'b' } + shape_block: { fg: '#006bb3' attr: 'b' } + shape_bool: '#5d504a' + shape_custom: '#138034' + shape_datetime: { fg: '#384564' attr: 'b' } + shape_directory: '#384564' + shape_external: '#384564' + shape_externalarg: { fg: '#138034' attr: 'b' } + shape_filepath: '#384564' + shape_flag: { fg: '#006bb3' attr: 'b' } + shape_float: { fg: '#6b2775' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#384564' attr: 'b' } + shape_int: { fg: '#6b2775' attr: 'b' } + shape_internalcall: { fg: '#384564' attr: 'b' } + shape_list: { fg: '#384564' attr: 'b' } + shape_literal: '#006bb3' + shape_match_pattern: '#138034' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5d504a' + shape_operator: '#ffcb3e' + shape_or: { fg: '#6b2775' attr: 'b' } + shape_pipe: { fg: '#6b2775' attr: 'b' } + shape_range: { fg: '#ffcb3e' attr: 'b' } + shape_record: { fg: '#384564' attr: 'b' } + shape_redirection: { fg: '#6b2775' attr: 'b' } + shape_signature: { fg: '#138034' attr: 'b' } + shape_string: '#138034' + shape_string_interpolation: { fg: '#384564' attr: 'b' } + shape_table: { fg: '#006bb3' attr: 'b' } + shape_variable: '#6b2775' + + background: '#222225' + foreground: '#ededed' + cursor: '#ededed' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hipster-green.nu b/themes/nu-themes/hipster-green.nu index 7340c9e..c1f4a96 100644 --- a/themes/nu-themes/hipster-green.nu +++ b/themes/nu-themes/hipster-green.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a600" attr: "b" } - empty: "#246eb2" - bool: {|| if $in { "#00e5e5" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#00a6b2" - } else {{ fg: "#246eb2" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b6214a" attr: "b" } - } else if $in < 6hr { - "#b6214a" - } else if $in < 1day { - "#bfbf00" - } else if $in < 3day { - "#00a600" - } else if $in < 1wk { - { fg: "#00a600" attr: "b" } - } else if $in < 6wk { - "#00a6b2" - } else if $in < 52wk { - "#246eb2" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#00a600" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#b6214a" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b200b2" attr: "b" } - shape_binary: { fg: "#b200b2" attr: "b" } - shape_block: { fg: "#246eb2" attr: "b" } - shape_bool: "#00e5e5" - shape_custom: "#00a600" - shape_datetime: { fg: "#00a6b2" attr: "b" } - shape_directory: "#00a6b2" - shape_external: "#00a6b2" - shape_externalarg: { fg: "#00a600" attr: "b" } - shape_filepath: "#00a6b2" - shape_flag: { fg: "#246eb2" attr: "b" } - shape_float: { fg: "#b200b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a6b2" attr: "b" } - shape_int: { fg: "#b200b2" attr: "b" } - shape_internalcall: { fg: "#00a6b2" attr: "b" } - shape_list: { fg: "#00a6b2" attr: "b" } - shape_literal: "#246eb2" - shape_match_pattern: "#00a600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e5e5" - shape_operator: "#bfbf00" - shape_or: { fg: "#b200b2" attr: "b" } - shape_pipe: { fg: "#b200b2" attr: "b" } - shape_range: { fg: "#bfbf00" attr: "b" } - shape_record: { fg: "#00a6b2" attr: "b" } - shape_redirection: { fg: "#b200b2" attr: "b" } - shape_signature: { fg: "#00a600" attr: "b" } - shape_string: "#00a600" - shape_string_interpolation: { fg: "#00a6b2" attr: "b" } - shape_table: { fg: "#246eb2" attr: "b" } - shape_variable: "#b200b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#100b05" - foreground: "#84c138" - cursor: "#84c138" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a600' attr: 'b' } + empty: '#246eb2' + bool: {|| if $in { '#00e5e5' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#00a6b2' + } else {{ fg: '#246eb2' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b6214a' attr: 'b' } + } else if $in < 6hr { + '#b6214a' + } else if $in < 1day { + '#bfbf00' + } else if $in < 3day { + '#00a600' + } else if $in < 1wk { + { fg: '#00a600' attr: 'b' } + } else if $in < 6wk { + '#00a6b2' + } else if $in < 52wk { + '#246eb2' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#00a600' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#b6214a' bg: '#bfbfbf' } + + shape_and: { fg: '#b200b2' attr: 'b' } + shape_binary: { fg: '#b200b2' attr: 'b' } + shape_block: { fg: '#246eb2' attr: 'b' } + shape_bool: '#00e5e5' + shape_custom: '#00a600' + shape_datetime: { fg: '#00a6b2' attr: 'b' } + shape_directory: '#00a6b2' + shape_external: '#00a6b2' + shape_externalarg: { fg: '#00a600' attr: 'b' } + shape_filepath: '#00a6b2' + shape_flag: { fg: '#246eb2' attr: 'b' } + shape_float: { fg: '#b200b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a6b2' attr: 'b' } + shape_int: { fg: '#b200b2' attr: 'b' } + shape_internalcall: { fg: '#00a6b2' attr: 'b' } + shape_list: { fg: '#00a6b2' attr: 'b' } + shape_literal: '#246eb2' + shape_match_pattern: '#00a600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e5e5' + shape_operator: '#bfbf00' + shape_or: { fg: '#b200b2' attr: 'b' } + shape_pipe: { fg: '#b200b2' attr: 'b' } + shape_range: { fg: '#bfbf00' attr: 'b' } + shape_record: { fg: '#00a6b2' attr: 'b' } + shape_redirection: { fg: '#b200b2' attr: 'b' } + shape_signature: { fg: '#00a600' attr: 'b' } + shape_string: '#00a600' + shape_string_interpolation: { fg: '#00a6b2' attr: 'b' } + shape_table: { fg: '#246eb2' attr: 'b' } + shape_variable: '#b200b2' + + background: '#100b05' + foreground: '#84c138' + cursor: '#84c138' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/homebrew.nu b/themes/nu-themes/homebrew.nu index 8df3dd5..157e701 100644 --- a/themes/nu-themes/homebrew.nu +++ b/themes/nu-themes/homebrew.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a600" attr: "b" } - empty: "#0000b2" - bool: {|| if $in { "#00e5e5" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#00a6b2" - } else {{ fg: "#0000b2" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#990000" attr: "b" } - } else if $in < 6hr { - "#990000" - } else if $in < 1day { - "#999900" - } else if $in < 3day { - "#00a600" - } else if $in < 1wk { - { fg: "#00a600" attr: "b" } - } else if $in < 6wk { - "#00a6b2" - } else if $in < 52wk { - "#0000b2" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#00a600" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#990000" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b200b2" attr: "b" } - shape_binary: { fg: "#b200b2" attr: "b" } - shape_block: { fg: "#0000b2" attr: "b" } - shape_bool: "#00e5e5" - shape_custom: "#00a600" - shape_datetime: { fg: "#00a6b2" attr: "b" } - shape_directory: "#00a6b2" - shape_external: "#00a6b2" - shape_externalarg: { fg: "#00a600" attr: "b" } - shape_filepath: "#00a6b2" - shape_flag: { fg: "#0000b2" attr: "b" } - shape_float: { fg: "#b200b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a6b2" attr: "b" } - shape_int: { fg: "#b200b2" attr: "b" } - shape_internalcall: { fg: "#00a6b2" attr: "b" } - shape_list: { fg: "#00a6b2" attr: "b" } - shape_literal: "#0000b2" - shape_match_pattern: "#00a600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e5e5" - shape_operator: "#999900" - shape_or: { fg: "#b200b2" attr: "b" } - shape_pipe: { fg: "#b200b2" attr: "b" } - shape_range: { fg: "#999900" attr: "b" } - shape_record: { fg: "#00a6b2" attr: "b" } - shape_redirection: { fg: "#b200b2" attr: "b" } - shape_signature: { fg: "#00a600" attr: "b" } - shape_string: "#00a600" - shape_string_interpolation: { fg: "#00a6b2" attr: "b" } - shape_table: { fg: "#0000b2" attr: "b" } - shape_variable: "#b200b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#00ff00" - cursor: "#00ff00" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a600' attr: 'b' } + empty: '#0000b2' + bool: {|| if $in { '#00e5e5' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#00a6b2' + } else {{ fg: '#0000b2' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#990000' attr: 'b' } + } else if $in < 6hr { + '#990000' + } else if $in < 1day { + '#999900' + } else if $in < 3day { + '#00a600' + } else if $in < 1wk { + { fg: '#00a600' attr: 'b' } + } else if $in < 6wk { + '#00a6b2' + } else if $in < 52wk { + '#0000b2' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#00a600' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#990000' bg: '#bfbfbf' } + + shape_and: { fg: '#b200b2' attr: 'b' } + shape_binary: { fg: '#b200b2' attr: 'b' } + shape_block: { fg: '#0000b2' attr: 'b' } + shape_bool: '#00e5e5' + shape_custom: '#00a600' + shape_datetime: { fg: '#00a6b2' attr: 'b' } + shape_directory: '#00a6b2' + shape_external: '#00a6b2' + shape_externalarg: { fg: '#00a600' attr: 'b' } + shape_filepath: '#00a6b2' + shape_flag: { fg: '#0000b2' attr: 'b' } + shape_float: { fg: '#b200b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a6b2' attr: 'b' } + shape_int: { fg: '#b200b2' attr: 'b' } + shape_internalcall: { fg: '#00a6b2' attr: 'b' } + shape_list: { fg: '#00a6b2' attr: 'b' } + shape_literal: '#0000b2' + shape_match_pattern: '#00a600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e5e5' + shape_operator: '#999900' + shape_or: { fg: '#b200b2' attr: 'b' } + shape_pipe: { fg: '#b200b2' attr: 'b' } + shape_range: { fg: '#999900' attr: 'b' } + shape_record: { fg: '#00a6b2' attr: 'b' } + shape_redirection: { fg: '#b200b2' attr: 'b' } + shape_signature: { fg: '#00a600' attr: 'b' } + shape_string: '#00a600' + shape_string_interpolation: { fg: '#00a6b2' attr: 'b' } + shape_table: { fg: '#0000b2' attr: 'b' } + shape_variable: '#b200b2' + + background: '#000000' + foreground: '#00ff00' + cursor: '#00ff00' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hopscotch.nu b/themes/nu-themes/hopscotch.nu index 4e8de26..5bdd646 100644 --- a/themes/nu-themes/hopscotch.nu +++ b/themes/nu-themes/hopscotch.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b9b5b8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8fc13e" attr: "b" } - empty: "#1290bf" - bool: {|| if $in { "#149b93" } else { "light_gray" } } - int: "#b9b5b8" - filesize: {|e| - if $e == 0b { - "#b9b5b8" - } else if $e < 1mb { - "#149b93" - } else {{ fg: "#1290bf" }} - } - duration: "#b9b5b8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dd464c" attr: "b" } - } else if $in < 6hr { - "#dd464c" - } else if $in < 1day { - "#fdcc59" - } else if $in < 3day { - "#8fc13e" - } else if $in < 1wk { - { fg: "#8fc13e" attr: "b" } - } else if $in < 6wk { - "#149b93" - } else if $in < 52wk { - "#1290bf" - } else { "dark_gray" } - } - range: "#b9b5b8" - float: "#b9b5b8" - string: "#b9b5b8" - nothing: "#b9b5b8" - binary: "#b9b5b8" - cellpath: "#b9b5b8" - row_index: { fg: "#8fc13e" attr: "b" } - record: "#b9b5b8" - list: "#b9b5b8" - block: "#b9b5b8" - hints: "dark_gray" - search_result: { fg: "#dd464c" bg: "#b9b5b8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c85e7c" attr: "b" } - shape_binary: { fg: "#c85e7c" attr: "b" } - shape_block: { fg: "#1290bf" attr: "b" } - shape_bool: "#149b93" - shape_custom: "#8fc13e" - shape_datetime: { fg: "#149b93" attr: "b" } - shape_directory: "#149b93" - shape_external: "#149b93" - shape_externalarg: { fg: "#8fc13e" attr: "b" } - shape_filepath: "#149b93" - shape_flag: { fg: "#1290bf" attr: "b" } - shape_float: { fg: "#c85e7c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#149b93" attr: "b" } - shape_int: { fg: "#c85e7c" attr: "b" } - shape_internalcall: { fg: "#149b93" attr: "b" } - shape_list: { fg: "#149b93" attr: "b" } - shape_literal: "#1290bf" - shape_match_pattern: "#8fc13e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#149b93" - shape_operator: "#fdcc59" - shape_or: { fg: "#c85e7c" attr: "b" } - shape_pipe: { fg: "#c85e7c" attr: "b" } - shape_range: { fg: "#fdcc59" attr: "b" } - shape_record: { fg: "#149b93" attr: "b" } - shape_redirection: { fg: "#c85e7c" attr: "b" } - shape_signature: { fg: "#8fc13e" attr: "b" } - shape_string: "#8fc13e" - shape_string_interpolation: { fg: "#149b93" attr: "b" } - shape_table: { fg: "#1290bf" attr: "b" } - shape_variable: "#c85e7c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#322931" - foreground: "#b9b5b8" - cursor: "#b9b5b8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b9b5b8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8fc13e' attr: 'b' } + empty: '#1290bf' + bool: {|| if $in { '#149b93' } else { 'light_gray' } } + int: '#b9b5b8' + filesize: {|e| + if $e == 0b { + '#b9b5b8' + } else if $e < 1mb { + '#149b93' + } else {{ fg: '#1290bf' }} + } + duration: '#b9b5b8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dd464c' attr: 'b' } + } else if $in < 6hr { + '#dd464c' + } else if $in < 1day { + '#fdcc59' + } else if $in < 3day { + '#8fc13e' + } else if $in < 1wk { + { fg: '#8fc13e' attr: 'b' } + } else if $in < 6wk { + '#149b93' + } else if $in < 52wk { + '#1290bf' + } else { 'dark_gray' } + } + range: '#b9b5b8' + float: '#b9b5b8' + string: '#b9b5b8' + nothing: '#b9b5b8' + binary: '#b9b5b8' + cellpath: '#b9b5b8' + row_index: { fg: '#8fc13e' attr: 'b' } + record: '#b9b5b8' + list: '#b9b5b8' + block: '#b9b5b8' + hints: 'dark_gray' + search_result: { fg: '#dd464c' bg: '#b9b5b8' } + + shape_and: { fg: '#c85e7c' attr: 'b' } + shape_binary: { fg: '#c85e7c' attr: 'b' } + shape_block: { fg: '#1290bf' attr: 'b' } + shape_bool: '#149b93' + shape_custom: '#8fc13e' + shape_datetime: { fg: '#149b93' attr: 'b' } + shape_directory: '#149b93' + shape_external: '#149b93' + shape_externalarg: { fg: '#8fc13e' attr: 'b' } + shape_filepath: '#149b93' + shape_flag: { fg: '#1290bf' attr: 'b' } + shape_float: { fg: '#c85e7c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#149b93' attr: 'b' } + shape_int: { fg: '#c85e7c' attr: 'b' } + shape_internalcall: { fg: '#149b93' attr: 'b' } + shape_list: { fg: '#149b93' attr: 'b' } + shape_literal: '#1290bf' + shape_match_pattern: '#8fc13e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#149b93' + shape_operator: '#fdcc59' + shape_or: { fg: '#c85e7c' attr: 'b' } + shape_pipe: { fg: '#c85e7c' attr: 'b' } + shape_range: { fg: '#fdcc59' attr: 'b' } + shape_record: { fg: '#149b93' attr: 'b' } + shape_redirection: { fg: '#c85e7c' attr: 'b' } + shape_signature: { fg: '#8fc13e' attr: 'b' } + shape_string: '#8fc13e' + shape_string_interpolation: { fg: '#149b93' attr: 'b' } + shape_table: { fg: '#1290bf' attr: 'b' } + shape_variable: '#c85e7c' + + background: '#322931' + foreground: '#b9b5b8' + cursor: '#b9b5b8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/horizon-dark.nu b/themes/nu-themes/horizon-dark.nu index 87c76f9..254015a 100644 --- a/themes/nu-themes/horizon-dark.nu +++ b/themes/nu-themes/horizon-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbced0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#efaf8e" attr: "b" } - empty: "#df5273" - bool: {|| if $in { "#24a8b4" } else { "light_gray" } } - int: "#cbced0" - filesize: {|e| - if $e == 0b { - "#cbced0" - } else if $e < 1mb { - "#24a8b4" - } else {{ fg: "#df5273" }} - } - duration: "#cbced0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e93c58" attr: "b" } - } else if $in < 6hr { - "#e93c58" - } else if $in < 1day { - "#efb993" - } else if $in < 3day { - "#efaf8e" - } else if $in < 1wk { - { fg: "#efaf8e" attr: "b" } - } else if $in < 6wk { - "#24a8b4" - } else if $in < 52wk { - "#df5273" - } else { "dark_gray" } - } - range: "#cbced0" - float: "#cbced0" - string: "#cbced0" - nothing: "#cbced0" - binary: "#cbced0" - cellpath: "#cbced0" - row_index: { fg: "#efaf8e" attr: "b" } - record: "#cbced0" - list: "#cbced0" - block: "#cbced0" - hints: "dark_gray" - search_result: { fg: "#e93c58" bg: "#cbced0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b072d1" attr: "b" } - shape_binary: { fg: "#b072d1" attr: "b" } - shape_block: { fg: "#df5273" attr: "b" } - shape_bool: "#24a8b4" - shape_custom: "#efaf8e" - shape_datetime: { fg: "#24a8b4" attr: "b" } - shape_directory: "#24a8b4" - shape_external: "#24a8b4" - shape_externalarg: { fg: "#efaf8e" attr: "b" } - shape_filepath: "#24a8b4" - shape_flag: { fg: "#df5273" attr: "b" } - shape_float: { fg: "#b072d1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#24a8b4" attr: "b" } - shape_int: { fg: "#b072d1" attr: "b" } - shape_internalcall: { fg: "#24a8b4" attr: "b" } - shape_list: { fg: "#24a8b4" attr: "b" } - shape_literal: "#df5273" - shape_match_pattern: "#efaf8e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#24a8b4" - shape_operator: "#efb993" - shape_or: { fg: "#b072d1" attr: "b" } - shape_pipe: { fg: "#b072d1" attr: "b" } - shape_range: { fg: "#efb993" attr: "b" } - shape_record: { fg: "#24a8b4" attr: "b" } - shape_redirection: { fg: "#b072d1" attr: "b" } - shape_signature: { fg: "#efaf8e" attr: "b" } - shape_string: "#efaf8e" - shape_string_interpolation: { fg: "#24a8b4" attr: "b" } - shape_table: { fg: "#df5273" attr: "b" } - shape_variable: "#b072d1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1e26" - foreground: "#cbced0" - cursor: "#cbced0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbced0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#efaf8e' attr: 'b' } + empty: '#df5273' + bool: {|| if $in { '#24a8b4' } else { 'light_gray' } } + int: '#cbced0' + filesize: {|e| + if $e == 0b { + '#cbced0' + } else if $e < 1mb { + '#24a8b4' + } else {{ fg: '#df5273' }} + } + duration: '#cbced0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e93c58' attr: 'b' } + } else if $in < 6hr { + '#e93c58' + } else if $in < 1day { + '#efb993' + } else if $in < 3day { + '#efaf8e' + } else if $in < 1wk { + { fg: '#efaf8e' attr: 'b' } + } else if $in < 6wk { + '#24a8b4' + } else if $in < 52wk { + '#df5273' + } else { 'dark_gray' } + } + range: '#cbced0' + float: '#cbced0' + string: '#cbced0' + nothing: '#cbced0' + binary: '#cbced0' + cellpath: '#cbced0' + row_index: { fg: '#efaf8e' attr: 'b' } + record: '#cbced0' + list: '#cbced0' + block: '#cbced0' + hints: 'dark_gray' + search_result: { fg: '#e93c58' bg: '#cbced0' } + + shape_and: { fg: '#b072d1' attr: 'b' } + shape_binary: { fg: '#b072d1' attr: 'b' } + shape_block: { fg: '#df5273' attr: 'b' } + shape_bool: '#24a8b4' + shape_custom: '#efaf8e' + shape_datetime: { fg: '#24a8b4' attr: 'b' } + shape_directory: '#24a8b4' + shape_external: '#24a8b4' + shape_externalarg: { fg: '#efaf8e' attr: 'b' } + shape_filepath: '#24a8b4' + shape_flag: { fg: '#df5273' attr: 'b' } + shape_float: { fg: '#b072d1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#24a8b4' attr: 'b' } + shape_int: { fg: '#b072d1' attr: 'b' } + shape_internalcall: { fg: '#24a8b4' attr: 'b' } + shape_list: { fg: '#24a8b4' attr: 'b' } + shape_literal: '#df5273' + shape_match_pattern: '#efaf8e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#24a8b4' + shape_operator: '#efb993' + shape_or: { fg: '#b072d1' attr: 'b' } + shape_pipe: { fg: '#b072d1' attr: 'b' } + shape_range: { fg: '#efb993' attr: 'b' } + shape_record: { fg: '#24a8b4' attr: 'b' } + shape_redirection: { fg: '#b072d1' attr: 'b' } + shape_signature: { fg: '#efaf8e' attr: 'b' } + shape_string: '#efaf8e' + shape_string_interpolation: { fg: '#24a8b4' attr: 'b' } + shape_table: { fg: '#df5273' attr: 'b' } + shape_variable: '#b072d1' + + background: '#1c1e26' + foreground: '#cbced0' + cursor: '#cbced0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/horizon-light.nu b/themes/nu-themes/horizon-light.nu index 5093ec7..978db12 100644 --- a/themes/nu-themes/horizon-light.nu +++ b/themes/nu-themes/horizon-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#403c3d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#94e1b0" attr: "b" } - empty: "#da103f" - bool: {|| if $in { "#dc3318" } else { "light_gray" } } - int: "#403c3d" - filesize: {|e| - if $e == 0b { - "#403c3d" - } else if $e < 1mb { - "#dc3318" - } else {{ fg: "#da103f" }} - } - duration: "#403c3d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f7939b" attr: "b" } - } else if $in < 6hr { - "#f7939b" - } else if $in < 1day { - "#fbe0d9" - } else if $in < 3day { - "#94e1b0" - } else if $in < 1wk { - { fg: "#94e1b0" attr: "b" } - } else if $in < 6wk { - "#dc3318" - } else if $in < 52wk { - "#da103f" - } else { "dark_gray" } - } - range: "#403c3d" - float: "#403c3d" - string: "#403c3d" - nothing: "#403c3d" - binary: "#403c3d" - cellpath: "#403c3d" - row_index: { fg: "#94e1b0" attr: "b" } - record: "#403c3d" - list: "#403c3d" - block: "#403c3d" - hints: "dark_gray" - search_result: { fg: "#f7939b" bg: "#403c3d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#1d8991" attr: "b" } - shape_binary: { fg: "#1d8991" attr: "b" } - shape_block: { fg: "#da103f" attr: "b" } - shape_bool: "#dc3318" - shape_custom: "#94e1b0" - shape_datetime: { fg: "#dc3318" attr: "b" } - shape_directory: "#dc3318" - shape_external: "#dc3318" - shape_externalarg: { fg: "#94e1b0" attr: "b" } - shape_filepath: "#dc3318" - shape_flag: { fg: "#da103f" attr: "b" } - shape_float: { fg: "#1d8991" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#dc3318" attr: "b" } - shape_int: { fg: "#1d8991" attr: "b" } - shape_internalcall: { fg: "#dc3318" attr: "b" } - shape_list: { fg: "#dc3318" attr: "b" } - shape_literal: "#da103f" - shape_match_pattern: "#94e1b0" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#dc3318" - shape_operator: "#fbe0d9" - shape_or: { fg: "#1d8991" attr: "b" } - shape_pipe: { fg: "#1d8991" attr: "b" } - shape_range: { fg: "#fbe0d9" attr: "b" } - shape_record: { fg: "#dc3318" attr: "b" } - shape_redirection: { fg: "#1d8991" attr: "b" } - shape_signature: { fg: "#94e1b0" attr: "b" } - shape_string: "#94e1b0" - shape_string_interpolation: { fg: "#dc3318" attr: "b" } - shape_table: { fg: "#da103f" attr: "b" } - shape_variable: "#1d8991" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fdf0ed" - foreground: "#403c3d" - cursor: "#403c3d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#403c3d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#94e1b0' attr: 'b' } + empty: '#da103f' + bool: {|| if $in { '#dc3318' } else { 'light_gray' } } + int: '#403c3d' + filesize: {|e| + if $e == 0b { + '#403c3d' + } else if $e < 1mb { + '#dc3318' + } else {{ fg: '#da103f' }} + } + duration: '#403c3d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f7939b' attr: 'b' } + } else if $in < 6hr { + '#f7939b' + } else if $in < 1day { + '#fbe0d9' + } else if $in < 3day { + '#94e1b0' + } else if $in < 1wk { + { fg: '#94e1b0' attr: 'b' } + } else if $in < 6wk { + '#dc3318' + } else if $in < 52wk { + '#da103f' + } else { 'dark_gray' } + } + range: '#403c3d' + float: '#403c3d' + string: '#403c3d' + nothing: '#403c3d' + binary: '#403c3d' + cellpath: '#403c3d' + row_index: { fg: '#94e1b0' attr: 'b' } + record: '#403c3d' + list: '#403c3d' + block: '#403c3d' + hints: 'dark_gray' + search_result: { fg: '#f7939b' bg: '#403c3d' } + + shape_and: { fg: '#1d8991' attr: 'b' } + shape_binary: { fg: '#1d8991' attr: 'b' } + shape_block: { fg: '#da103f' attr: 'b' } + shape_bool: '#dc3318' + shape_custom: '#94e1b0' + shape_datetime: { fg: '#dc3318' attr: 'b' } + shape_directory: '#dc3318' + shape_external: '#dc3318' + shape_externalarg: { fg: '#94e1b0' attr: 'b' } + shape_filepath: '#dc3318' + shape_flag: { fg: '#da103f' attr: 'b' } + shape_float: { fg: '#1d8991' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#dc3318' attr: 'b' } + shape_int: { fg: '#1d8991' attr: 'b' } + shape_internalcall: { fg: '#dc3318' attr: 'b' } + shape_list: { fg: '#dc3318' attr: 'b' } + shape_literal: '#da103f' + shape_match_pattern: '#94e1b0' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#dc3318' + shape_operator: '#fbe0d9' + shape_or: { fg: '#1d8991' attr: 'b' } + shape_pipe: { fg: '#1d8991' attr: 'b' } + shape_range: { fg: '#fbe0d9' attr: 'b' } + shape_record: { fg: '#dc3318' attr: 'b' } + shape_redirection: { fg: '#1d8991' attr: 'b' } + shape_signature: { fg: '#94e1b0' attr: 'b' } + shape_string: '#94e1b0' + shape_string_interpolation: { fg: '#dc3318' attr: 'b' } + shape_table: { fg: '#da103f' attr: 'b' } + shape_variable: '#1d8991' + + background: '#fdf0ed' + foreground: '#403c3d' + cursor: '#403c3d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/horizon-terminal-dark.nu b/themes/nu-themes/horizon-terminal-dark.nu index cd77fd0..a7f0547 100644 --- a/themes/nu-themes/horizon-terminal-dark.nu +++ b/themes/nu-themes/horizon-terminal-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbced0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#29d398" attr: "b" } - empty: "#26bbd9" - bool: {|| if $in { "#59e1e3" } else { "light_gray" } } - int: "#cbced0" - filesize: {|e| - if $e == 0b { - "#cbced0" - } else if $e < 1mb { - "#59e1e3" - } else {{ fg: "#26bbd9" }} - } - duration: "#cbced0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e95678" attr: "b" } - } else if $in < 6hr { - "#e95678" - } else if $in < 1day { - "#fac29a" - } else if $in < 3day { - "#29d398" - } else if $in < 1wk { - { fg: "#29d398" attr: "b" } - } else if $in < 6wk { - "#59e1e3" - } else if $in < 52wk { - "#26bbd9" - } else { "dark_gray" } - } - range: "#cbced0" - float: "#cbced0" - string: "#cbced0" - nothing: "#cbced0" - binary: "#cbced0" - cellpath: "#cbced0" - row_index: { fg: "#29d398" attr: "b" } - record: "#cbced0" - list: "#cbced0" - block: "#cbced0" - hints: "dark_gray" - search_result: { fg: "#e95678" bg: "#cbced0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ee64ac" attr: "b" } - shape_binary: { fg: "#ee64ac" attr: "b" } - shape_block: { fg: "#26bbd9" attr: "b" } - shape_bool: "#59e1e3" - shape_custom: "#29d398" - shape_datetime: { fg: "#59e1e3" attr: "b" } - shape_directory: "#59e1e3" - shape_external: "#59e1e3" - shape_externalarg: { fg: "#29d398" attr: "b" } - shape_filepath: "#59e1e3" - shape_flag: { fg: "#26bbd9" attr: "b" } - shape_float: { fg: "#ee64ac" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#59e1e3" attr: "b" } - shape_int: { fg: "#ee64ac" attr: "b" } - shape_internalcall: { fg: "#59e1e3" attr: "b" } - shape_list: { fg: "#59e1e3" attr: "b" } - shape_literal: "#26bbd9" - shape_match_pattern: "#29d398" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#59e1e3" - shape_operator: "#fac29a" - shape_or: { fg: "#ee64ac" attr: "b" } - shape_pipe: { fg: "#ee64ac" attr: "b" } - shape_range: { fg: "#fac29a" attr: "b" } - shape_record: { fg: "#59e1e3" attr: "b" } - shape_redirection: { fg: "#ee64ac" attr: "b" } - shape_signature: { fg: "#29d398" attr: "b" } - shape_string: "#29d398" - shape_string_interpolation: { fg: "#59e1e3" attr: "b" } - shape_table: { fg: "#26bbd9" attr: "b" } - shape_variable: "#ee64ac" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1e26" - foreground: "#cbced0" - cursor: "#cbced0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbced0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#29d398' attr: 'b' } + empty: '#26bbd9' + bool: {|| if $in { '#59e1e3' } else { 'light_gray' } } + int: '#cbced0' + filesize: {|e| + if $e == 0b { + '#cbced0' + } else if $e < 1mb { + '#59e1e3' + } else {{ fg: '#26bbd9' }} + } + duration: '#cbced0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e95678' attr: 'b' } + } else if $in < 6hr { + '#e95678' + } else if $in < 1day { + '#fac29a' + } else if $in < 3day { + '#29d398' + } else if $in < 1wk { + { fg: '#29d398' attr: 'b' } + } else if $in < 6wk { + '#59e1e3' + } else if $in < 52wk { + '#26bbd9' + } else { 'dark_gray' } + } + range: '#cbced0' + float: '#cbced0' + string: '#cbced0' + nothing: '#cbced0' + binary: '#cbced0' + cellpath: '#cbced0' + row_index: { fg: '#29d398' attr: 'b' } + record: '#cbced0' + list: '#cbced0' + block: '#cbced0' + hints: 'dark_gray' + search_result: { fg: '#e95678' bg: '#cbced0' } + + shape_and: { fg: '#ee64ac' attr: 'b' } + shape_binary: { fg: '#ee64ac' attr: 'b' } + shape_block: { fg: '#26bbd9' attr: 'b' } + shape_bool: '#59e1e3' + shape_custom: '#29d398' + shape_datetime: { fg: '#59e1e3' attr: 'b' } + shape_directory: '#59e1e3' + shape_external: '#59e1e3' + shape_externalarg: { fg: '#29d398' attr: 'b' } + shape_filepath: '#59e1e3' + shape_flag: { fg: '#26bbd9' attr: 'b' } + shape_float: { fg: '#ee64ac' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#59e1e3' attr: 'b' } + shape_int: { fg: '#ee64ac' attr: 'b' } + shape_internalcall: { fg: '#59e1e3' attr: 'b' } + shape_list: { fg: '#59e1e3' attr: 'b' } + shape_literal: '#26bbd9' + shape_match_pattern: '#29d398' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#59e1e3' + shape_operator: '#fac29a' + shape_or: { fg: '#ee64ac' attr: 'b' } + shape_pipe: { fg: '#ee64ac' attr: 'b' } + shape_range: { fg: '#fac29a' attr: 'b' } + shape_record: { fg: '#59e1e3' attr: 'b' } + shape_redirection: { fg: '#ee64ac' attr: 'b' } + shape_signature: { fg: '#29d398' attr: 'b' } + shape_string: '#29d398' + shape_string_interpolation: { fg: '#59e1e3' attr: 'b' } + shape_table: { fg: '#26bbd9' attr: 'b' } + shape_variable: '#ee64ac' + + background: '#1c1e26' + foreground: '#cbced0' + cursor: '#cbced0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/horizon-terminal-light.nu b/themes/nu-themes/horizon-terminal-light.nu index c4524fe..032b003 100644 --- a/themes/nu-themes/horizon-terminal-light.nu +++ b/themes/nu-themes/horizon-terminal-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#403c3d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#29d398" attr: "b" } - empty: "#26bbd9" - bool: {|| if $in { "#59e1e3" } else { "light_gray" } } - int: "#403c3d" - filesize: {|e| - if $e == 0b { - "#403c3d" - } else if $e < 1mb { - "#59e1e3" - } else {{ fg: "#26bbd9" }} - } - duration: "#403c3d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e95678" attr: "b" } - } else if $in < 6hr { - "#e95678" - } else if $in < 1day { - "#fadad1" - } else if $in < 3day { - "#29d398" - } else if $in < 1wk { - { fg: "#29d398" attr: "b" } - } else if $in < 6wk { - "#59e1e3" - } else if $in < 52wk { - "#26bbd9" - } else { "dark_gray" } - } - range: "#403c3d" - float: "#403c3d" - string: "#403c3d" - nothing: "#403c3d" - binary: "#403c3d" - cellpath: "#403c3d" - row_index: { fg: "#29d398" attr: "b" } - record: "#403c3d" - list: "#403c3d" - block: "#403c3d" - hints: "dark_gray" - search_result: { fg: "#e95678" bg: "#403c3d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ee64ac" attr: "b" } - shape_binary: { fg: "#ee64ac" attr: "b" } - shape_block: { fg: "#26bbd9" attr: "b" } - shape_bool: "#59e1e3" - shape_custom: "#29d398" - shape_datetime: { fg: "#59e1e3" attr: "b" } - shape_directory: "#59e1e3" - shape_external: "#59e1e3" - shape_externalarg: { fg: "#29d398" attr: "b" } - shape_filepath: "#59e1e3" - shape_flag: { fg: "#26bbd9" attr: "b" } - shape_float: { fg: "#ee64ac" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#59e1e3" attr: "b" } - shape_int: { fg: "#ee64ac" attr: "b" } - shape_internalcall: { fg: "#59e1e3" attr: "b" } - shape_list: { fg: "#59e1e3" attr: "b" } - shape_literal: "#26bbd9" - shape_match_pattern: "#29d398" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#59e1e3" - shape_operator: "#fadad1" - shape_or: { fg: "#ee64ac" attr: "b" } - shape_pipe: { fg: "#ee64ac" attr: "b" } - shape_range: { fg: "#fadad1" attr: "b" } - shape_record: { fg: "#59e1e3" attr: "b" } - shape_redirection: { fg: "#ee64ac" attr: "b" } - shape_signature: { fg: "#29d398" attr: "b" } - shape_string: "#29d398" - shape_string_interpolation: { fg: "#59e1e3" attr: "b" } - shape_table: { fg: "#26bbd9" attr: "b" } - shape_variable: "#ee64ac" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fdf0ed" - foreground: "#403c3d" - cursor: "#403c3d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#403c3d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#29d398' attr: 'b' } + empty: '#26bbd9' + bool: {|| if $in { '#59e1e3' } else { 'light_gray' } } + int: '#403c3d' + filesize: {|e| + if $e == 0b { + '#403c3d' + } else if $e < 1mb { + '#59e1e3' + } else {{ fg: '#26bbd9' }} + } + duration: '#403c3d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e95678' attr: 'b' } + } else if $in < 6hr { + '#e95678' + } else if $in < 1day { + '#fadad1' + } else if $in < 3day { + '#29d398' + } else if $in < 1wk { + { fg: '#29d398' attr: 'b' } + } else if $in < 6wk { + '#59e1e3' + } else if $in < 52wk { + '#26bbd9' + } else { 'dark_gray' } + } + range: '#403c3d' + float: '#403c3d' + string: '#403c3d' + nothing: '#403c3d' + binary: '#403c3d' + cellpath: '#403c3d' + row_index: { fg: '#29d398' attr: 'b' } + record: '#403c3d' + list: '#403c3d' + block: '#403c3d' + hints: 'dark_gray' + search_result: { fg: '#e95678' bg: '#403c3d' } + + shape_and: { fg: '#ee64ac' attr: 'b' } + shape_binary: { fg: '#ee64ac' attr: 'b' } + shape_block: { fg: '#26bbd9' attr: 'b' } + shape_bool: '#59e1e3' + shape_custom: '#29d398' + shape_datetime: { fg: '#59e1e3' attr: 'b' } + shape_directory: '#59e1e3' + shape_external: '#59e1e3' + shape_externalarg: { fg: '#29d398' attr: 'b' } + shape_filepath: '#59e1e3' + shape_flag: { fg: '#26bbd9' attr: 'b' } + shape_float: { fg: '#ee64ac' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#59e1e3' attr: 'b' } + shape_int: { fg: '#ee64ac' attr: 'b' } + shape_internalcall: { fg: '#59e1e3' attr: 'b' } + shape_list: { fg: '#59e1e3' attr: 'b' } + shape_literal: '#26bbd9' + shape_match_pattern: '#29d398' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#59e1e3' + shape_operator: '#fadad1' + shape_or: { fg: '#ee64ac' attr: 'b' } + shape_pipe: { fg: '#ee64ac' attr: 'b' } + shape_range: { fg: '#fadad1' attr: 'b' } + shape_record: { fg: '#59e1e3' attr: 'b' } + shape_redirection: { fg: '#ee64ac' attr: 'b' } + shape_signature: { fg: '#29d398' attr: 'b' } + shape_string: '#29d398' + shape_string_interpolation: { fg: '#59e1e3' attr: 'b' } + shape_table: { fg: '#26bbd9' attr: 'b' } + shape_variable: '#ee64ac' + + background: '#fdf0ed' + foreground: '#403c3d' + cursor: '#403c3d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/humanoid-dark.nu b/themes/nu-themes/humanoid-dark.nu index 8894bd3..4b49cbf 100644 --- a/themes/nu-themes/humanoid-dark.nu +++ b/themes/nu-themes/humanoid-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f8f8f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#02d849" attr: "b" } - empty: "#00a6fb" - bool: {|| if $in { "#0dd9d6" } else { "light_gray" } } - int: "#f8f8f2" - filesize: {|e| - if $e == 0b { - "#f8f8f2" - } else if $e < 1mb { - "#0dd9d6" - } else {{ fg: "#00a6fb" }} - } - duration: "#f8f8f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f11235" attr: "b" } - } else if $in < 6hr { - "#f11235" - } else if $in < 1day { - "#ffb627" - } else if $in < 3day { - "#02d849" - } else if $in < 1wk { - { fg: "#02d849" attr: "b" } - } else if $in < 6wk { - "#0dd9d6" - } else if $in < 52wk { - "#00a6fb" - } else { "dark_gray" } - } - range: "#f8f8f2" - float: "#f8f8f2" - string: "#f8f8f2" - nothing: "#f8f8f2" - binary: "#f8f8f2" - cellpath: "#f8f8f2" - row_index: { fg: "#02d849" attr: "b" } - record: "#f8f8f2" - list: "#f8f8f2" - block: "#f8f8f2" - hints: "dark_gray" - search_result: { fg: "#f11235" bg: "#f8f8f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f15ee3" attr: "b" } - shape_binary: { fg: "#f15ee3" attr: "b" } - shape_block: { fg: "#00a6fb" attr: "b" } - shape_bool: "#0dd9d6" - shape_custom: "#02d849" - shape_datetime: { fg: "#0dd9d6" attr: "b" } - shape_directory: "#0dd9d6" - shape_external: "#0dd9d6" - shape_externalarg: { fg: "#02d849" attr: "b" } - shape_filepath: "#0dd9d6" - shape_flag: { fg: "#00a6fb" attr: "b" } - shape_float: { fg: "#f15ee3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0dd9d6" attr: "b" } - shape_int: { fg: "#f15ee3" attr: "b" } - shape_internalcall: { fg: "#0dd9d6" attr: "b" } - shape_list: { fg: "#0dd9d6" attr: "b" } - shape_literal: "#00a6fb" - shape_match_pattern: "#02d849" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0dd9d6" - shape_operator: "#ffb627" - shape_or: { fg: "#f15ee3" attr: "b" } - shape_pipe: { fg: "#f15ee3" attr: "b" } - shape_range: { fg: "#ffb627" attr: "b" } - shape_record: { fg: "#0dd9d6" attr: "b" } - shape_redirection: { fg: "#f15ee3" attr: "b" } - shape_signature: { fg: "#02d849" attr: "b" } - shape_string: "#02d849" - shape_string_interpolation: { fg: "#0dd9d6" attr: "b" } - shape_table: { fg: "#00a6fb" attr: "b" } - shape_variable: "#f15ee3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232629" - foreground: "#f8f8f2" - cursor: "#f8f8f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f8f8f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#02d849' attr: 'b' } + empty: '#00a6fb' + bool: {|| if $in { '#0dd9d6' } else { 'light_gray' } } + int: '#f8f8f2' + filesize: {|e| + if $e == 0b { + '#f8f8f2' + } else if $e < 1mb { + '#0dd9d6' + } else {{ fg: '#00a6fb' }} + } + duration: '#f8f8f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f11235' attr: 'b' } + } else if $in < 6hr { + '#f11235' + } else if $in < 1day { + '#ffb627' + } else if $in < 3day { + '#02d849' + } else if $in < 1wk { + { fg: '#02d849' attr: 'b' } + } else if $in < 6wk { + '#0dd9d6' + } else if $in < 52wk { + '#00a6fb' + } else { 'dark_gray' } + } + range: '#f8f8f2' + float: '#f8f8f2' + string: '#f8f8f2' + nothing: '#f8f8f2' + binary: '#f8f8f2' + cellpath: '#f8f8f2' + row_index: { fg: '#02d849' attr: 'b' } + record: '#f8f8f2' + list: '#f8f8f2' + block: '#f8f8f2' + hints: 'dark_gray' + search_result: { fg: '#f11235' bg: '#f8f8f2' } + + shape_and: { fg: '#f15ee3' attr: 'b' } + shape_binary: { fg: '#f15ee3' attr: 'b' } + shape_block: { fg: '#00a6fb' attr: 'b' } + shape_bool: '#0dd9d6' + shape_custom: '#02d849' + shape_datetime: { fg: '#0dd9d6' attr: 'b' } + shape_directory: '#0dd9d6' + shape_external: '#0dd9d6' + shape_externalarg: { fg: '#02d849' attr: 'b' } + shape_filepath: '#0dd9d6' + shape_flag: { fg: '#00a6fb' attr: 'b' } + shape_float: { fg: '#f15ee3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0dd9d6' attr: 'b' } + shape_int: { fg: '#f15ee3' attr: 'b' } + shape_internalcall: { fg: '#0dd9d6' attr: 'b' } + shape_list: { fg: '#0dd9d6' attr: 'b' } + shape_literal: '#00a6fb' + shape_match_pattern: '#02d849' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0dd9d6' + shape_operator: '#ffb627' + shape_or: { fg: '#f15ee3' attr: 'b' } + shape_pipe: { fg: '#f15ee3' attr: 'b' } + shape_range: { fg: '#ffb627' attr: 'b' } + shape_record: { fg: '#0dd9d6' attr: 'b' } + shape_redirection: { fg: '#f15ee3' attr: 'b' } + shape_signature: { fg: '#02d849' attr: 'b' } + shape_string: '#02d849' + shape_string_interpolation: { fg: '#0dd9d6' attr: 'b' } + shape_table: { fg: '#00a6fb' attr: 'b' } + shape_variable: '#f15ee3' + + background: '#232629' + foreground: '#f8f8f2' + cursor: '#f8f8f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/humanoid-light.nu b/themes/nu-themes/humanoid-light.nu index 8cdf451..2c10778 100644 --- a/themes/nu-themes/humanoid-light.nu +++ b/themes/nu-themes/humanoid-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#232629" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#388e3c" attr: "b" } - empty: "#0082c9" - bool: {|| if $in { "#008e8e" } else { "light_gray" } } - int: "#232629" - filesize: {|e| - if $e == 0b { - "#232629" - } else if $e < 1mb { - "#008e8e" - } else {{ fg: "#0082c9" }} - } - duration: "#232629" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b0151a" attr: "b" } - } else if $in < 6hr { - "#b0151a" - } else if $in < 1day { - "#ffb627" - } else if $in < 3day { - "#388e3c" - } else if $in < 1wk { - { fg: "#388e3c" attr: "b" } - } else if $in < 6wk { - "#008e8e" - } else if $in < 52wk { - "#0082c9" - } else { "dark_gray" } - } - range: "#232629" - float: "#232629" - string: "#232629" - nothing: "#232629" - binary: "#232629" - cellpath: "#232629" - row_index: { fg: "#388e3c" attr: "b" } - record: "#232629" - list: "#232629" - block: "#232629" - hints: "dark_gray" - search_result: { fg: "#b0151a" bg: "#232629" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#700f98" attr: "b" } - shape_binary: { fg: "#700f98" attr: "b" } - shape_block: { fg: "#0082c9" attr: "b" } - shape_bool: "#008e8e" - shape_custom: "#388e3c" - shape_datetime: { fg: "#008e8e" attr: "b" } - shape_directory: "#008e8e" - shape_external: "#008e8e" - shape_externalarg: { fg: "#388e3c" attr: "b" } - shape_filepath: "#008e8e" - shape_flag: { fg: "#0082c9" attr: "b" } - shape_float: { fg: "#700f98" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#008e8e" attr: "b" } - shape_int: { fg: "#700f98" attr: "b" } - shape_internalcall: { fg: "#008e8e" attr: "b" } - shape_list: { fg: "#008e8e" attr: "b" } - shape_literal: "#0082c9" - shape_match_pattern: "#388e3c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#008e8e" - shape_operator: "#ffb627" - shape_or: { fg: "#700f98" attr: "b" } - shape_pipe: { fg: "#700f98" attr: "b" } - shape_range: { fg: "#ffb627" attr: "b" } - shape_record: { fg: "#008e8e" attr: "b" } - shape_redirection: { fg: "#700f98" attr: "b" } - shape_signature: { fg: "#388e3c" attr: "b" } - shape_string: "#388e3c" - shape_string_interpolation: { fg: "#008e8e" attr: "b" } - shape_table: { fg: "#0082c9" attr: "b" } - shape_variable: "#700f98" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f8f2" - foreground: "#232629" - cursor: "#232629" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#232629' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#388e3c' attr: 'b' } + empty: '#0082c9' + bool: {|| if $in { '#008e8e' } else { 'light_gray' } } + int: '#232629' + filesize: {|e| + if $e == 0b { + '#232629' + } else if $e < 1mb { + '#008e8e' + } else {{ fg: '#0082c9' }} + } + duration: '#232629' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b0151a' attr: 'b' } + } else if $in < 6hr { + '#b0151a' + } else if $in < 1day { + '#ffb627' + } else if $in < 3day { + '#388e3c' + } else if $in < 1wk { + { fg: '#388e3c' attr: 'b' } + } else if $in < 6wk { + '#008e8e' + } else if $in < 52wk { + '#0082c9' + } else { 'dark_gray' } + } + range: '#232629' + float: '#232629' + string: '#232629' + nothing: '#232629' + binary: '#232629' + cellpath: '#232629' + row_index: { fg: '#388e3c' attr: 'b' } + record: '#232629' + list: '#232629' + block: '#232629' + hints: 'dark_gray' + search_result: { fg: '#b0151a' bg: '#232629' } + + shape_and: { fg: '#700f98' attr: 'b' } + shape_binary: { fg: '#700f98' attr: 'b' } + shape_block: { fg: '#0082c9' attr: 'b' } + shape_bool: '#008e8e' + shape_custom: '#388e3c' + shape_datetime: { fg: '#008e8e' attr: 'b' } + shape_directory: '#008e8e' + shape_external: '#008e8e' + shape_externalarg: { fg: '#388e3c' attr: 'b' } + shape_filepath: '#008e8e' + shape_flag: { fg: '#0082c9' attr: 'b' } + shape_float: { fg: '#700f98' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#008e8e' attr: 'b' } + shape_int: { fg: '#700f98' attr: 'b' } + shape_internalcall: { fg: '#008e8e' attr: 'b' } + shape_list: { fg: '#008e8e' attr: 'b' } + shape_literal: '#0082c9' + shape_match_pattern: '#388e3c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#008e8e' + shape_operator: '#ffb627' + shape_or: { fg: '#700f98' attr: 'b' } + shape_pipe: { fg: '#700f98' attr: 'b' } + shape_range: { fg: '#ffb627' attr: 'b' } + shape_record: { fg: '#008e8e' attr: 'b' } + shape_redirection: { fg: '#700f98' attr: 'b' } + shape_signature: { fg: '#388e3c' attr: 'b' } + shape_string: '#388e3c' + shape_string_interpolation: { fg: '#008e8e' attr: 'b' } + shape_table: { fg: '#0082c9' attr: 'b' } + shape_variable: '#700f98' + + background: '#f8f8f2' + foreground: '#232629' + cursor: '#232629' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hurtado.nu b/themes/nu-themes/hurtado.nu index ed5d081..f25270d 100644 --- a/themes/nu-themes/hurtado.nu +++ b/themes/nu-themes/hurtado.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cbcccb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a5e055" attr: "b" } - empty: "#496487" - bool: {|| if $in { "#86eafe" } else { "light_gray" } } - int: "#cbcccb" - filesize: {|e| - if $e == 0b { - "#cbcccb" - } else if $e < 1mb { - "#86e9fe" - } else {{ fg: "#496487" }} - } - duration: "#cbcccb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff1b00" attr: "b" } - } else if $in < 6hr { - "#ff1b00" - } else if $in < 1day { - "#fbe74a" - } else if $in < 3day { - "#a5e055" - } else if $in < 1wk { - { fg: "#a5e055" attr: "b" } - } else if $in < 6wk { - "#86e9fe" - } else if $in < 52wk { - "#496487" - } else { "dark_gray" } - } - range: "#cbcccb" - float: "#cbcccb" - string: "#cbcccb" - nothing: "#cbcccb" - binary: "#cbcccb" - cellpath: "#cbcccb" - row_index: { fg: "#a5e055" attr: "b" } - record: "#cbcccb" - list: "#cbcccb" - block: "#cbcccb" - hints: "dark_gray" - search_result: { fg: "#ff1b00" bg: "#cbcccb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fd5ff1" attr: "b" } - shape_binary: { fg: "#fd5ff1" attr: "b" } - shape_block: { fg: "#496487" attr: "b" } - shape_bool: "#86eafe" - shape_custom: "#a5e055" - shape_datetime: { fg: "#86e9fe" attr: "b" } - shape_directory: "#86e9fe" - shape_external: "#86e9fe" - shape_externalarg: { fg: "#a5e055" attr: "b" } - shape_filepath: "#86e9fe" - shape_flag: { fg: "#496487" attr: "b" } - shape_float: { fg: "#fd5ff1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#86e9fe" attr: "b" } - shape_int: { fg: "#fd5ff1" attr: "b" } - shape_internalcall: { fg: "#86e9fe" attr: "b" } - shape_list: { fg: "#86e9fe" attr: "b" } - shape_literal: "#496487" - shape_match_pattern: "#a5e055" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86eafe" - shape_operator: "#fbe74a" - shape_or: { fg: "#fd5ff1" attr: "b" } - shape_pipe: { fg: "#fd5ff1" attr: "b" } - shape_range: { fg: "#fbe74a" attr: "b" } - shape_record: { fg: "#86e9fe" attr: "b" } - shape_redirection: { fg: "#fd5ff1" attr: "b" } - shape_signature: { fg: "#a5e055" attr: "b" } - shape_string: "#a5e055" - shape_string_interpolation: { fg: "#86e9fe" attr: "b" } - shape_table: { fg: "#496487" attr: "b" } - shape_variable: "#fd5ff1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#dbdbdb" - cursor: "#dbdbdb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cbcccb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a5e055' attr: 'b' } + empty: '#496487' + bool: {|| if $in { '#86eafe' } else { 'light_gray' } } + int: '#cbcccb' + filesize: {|e| + if $e == 0b { + '#cbcccb' + } else if $e < 1mb { + '#86e9fe' + } else {{ fg: '#496487' }} + } + duration: '#cbcccb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff1b00' attr: 'b' } + } else if $in < 6hr { + '#ff1b00' + } else if $in < 1day { + '#fbe74a' + } else if $in < 3day { + '#a5e055' + } else if $in < 1wk { + { fg: '#a5e055' attr: 'b' } + } else if $in < 6wk { + '#86e9fe' + } else if $in < 52wk { + '#496487' + } else { 'dark_gray' } + } + range: '#cbcccb' + float: '#cbcccb' + string: '#cbcccb' + nothing: '#cbcccb' + binary: '#cbcccb' + cellpath: '#cbcccb' + row_index: { fg: '#a5e055' attr: 'b' } + record: '#cbcccb' + list: '#cbcccb' + block: '#cbcccb' + hints: 'dark_gray' + search_result: { fg: '#ff1b00' bg: '#cbcccb' } + + shape_and: { fg: '#fd5ff1' attr: 'b' } + shape_binary: { fg: '#fd5ff1' attr: 'b' } + shape_block: { fg: '#496487' attr: 'b' } + shape_bool: '#86eafe' + shape_custom: '#a5e055' + shape_datetime: { fg: '#86e9fe' attr: 'b' } + shape_directory: '#86e9fe' + shape_external: '#86e9fe' + shape_externalarg: { fg: '#a5e055' attr: 'b' } + shape_filepath: '#86e9fe' + shape_flag: { fg: '#496487' attr: 'b' } + shape_float: { fg: '#fd5ff1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#86e9fe' attr: 'b' } + shape_int: { fg: '#fd5ff1' attr: 'b' } + shape_internalcall: { fg: '#86e9fe' attr: 'b' } + shape_list: { fg: '#86e9fe' attr: 'b' } + shape_literal: '#496487' + shape_match_pattern: '#a5e055' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#86eafe' + shape_operator: '#fbe74a' + shape_or: { fg: '#fd5ff1' attr: 'b' } + shape_pipe: { fg: '#fd5ff1' attr: 'b' } + shape_range: { fg: '#fbe74a' attr: 'b' } + shape_record: { fg: '#86e9fe' attr: 'b' } + shape_redirection: { fg: '#fd5ff1' attr: 'b' } + shape_signature: { fg: '#a5e055' attr: 'b' } + shape_string: '#a5e055' + shape_string_interpolation: { fg: '#86e9fe' attr: 'b' } + shape_table: { fg: '#496487' attr: 'b' } + shape_variable: '#fd5ff1' + + background: '#000000' + foreground: '#dbdbdb' + cursor: '#dbdbdb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/hybrid.nu b/themes/nu-themes/hybrid.nu index b2b56bd..4d19967 100644 --- a/themes/nu-themes/hybrid.nu +++ b/themes/nu-themes/hybrid.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#969896" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8c9440" attr: "b" } - empty: "#5f819d" - bool: {|| if $in { "#8abeb7" } else { "light_gray" } } - int: "#969896" - filesize: {|e| - if $e == 0b { - "#969896" - } else if $e < 1mb { - "#5e8d87" - } else {{ fg: "#5f819d" }} - } - duration: "#969896" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a54242" attr: "b" } - } else if $in < 6hr { - "#a54242" - } else if $in < 1day { - "#de935f" - } else if $in < 3day { - "#8c9440" - } else if $in < 1wk { - { fg: "#8c9440" attr: "b" } - } else if $in < 6wk { - "#5e8d87" - } else if $in < 52wk { - "#5f819d" - } else { "dark_gray" } - } - range: "#969896" - float: "#969896" - string: "#969896" - nothing: "#969896" - binary: "#969896" - cellpath: "#969896" - row_index: { fg: "#8c9440" attr: "b" } - record: "#969896" - list: "#969896" - block: "#969896" - hints: "dark_gray" - search_result: { fg: "#a54242" bg: "#969896" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#85678f" attr: "b" } - shape_binary: { fg: "#85678f" attr: "b" } - shape_block: { fg: "#5f819d" attr: "b" } - shape_bool: "#8abeb7" - shape_custom: "#8c9440" - shape_datetime: { fg: "#5e8d87" attr: "b" } - shape_directory: "#5e8d87" - shape_external: "#5e8d87" - shape_externalarg: { fg: "#8c9440" attr: "b" } - shape_filepath: "#5e8d87" - shape_flag: { fg: "#5f819d" attr: "b" } - shape_float: { fg: "#85678f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5e8d87" attr: "b" } - shape_int: { fg: "#85678f" attr: "b" } - shape_internalcall: { fg: "#5e8d87" attr: "b" } - shape_list: { fg: "#5e8d87" attr: "b" } - shape_literal: "#5f819d" - shape_match_pattern: "#8c9440" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8abeb7" - shape_operator: "#de935f" - shape_or: { fg: "#85678f" attr: "b" } - shape_pipe: { fg: "#85678f" attr: "b" } - shape_range: { fg: "#de935f" attr: "b" } - shape_record: { fg: "#5e8d87" attr: "b" } - shape_redirection: { fg: "#85678f" attr: "b" } - shape_signature: { fg: "#8c9440" attr: "b" } - shape_string: "#8c9440" - shape_string_interpolation: { fg: "#5e8d87" attr: "b" } - shape_table: { fg: "#5f819d" attr: "b" } - shape_variable: "#85678f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#141414" - foreground: "#94a3a5" - cursor: "#94a3a5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#969896' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8c9440' attr: 'b' } + empty: '#5f819d' + bool: {|| if $in { '#8abeb7' } else { 'light_gray' } } + int: '#969896' + filesize: {|e| + if $e == 0b { + '#969896' + } else if $e < 1mb { + '#5e8d87' + } else {{ fg: '#5f819d' }} + } + duration: '#969896' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a54242' attr: 'b' } + } else if $in < 6hr { + '#a54242' + } else if $in < 1day { + '#de935f' + } else if $in < 3day { + '#8c9440' + } else if $in < 1wk { + { fg: '#8c9440' attr: 'b' } + } else if $in < 6wk { + '#5e8d87' + } else if $in < 52wk { + '#5f819d' + } else { 'dark_gray' } + } + range: '#969896' + float: '#969896' + string: '#969896' + nothing: '#969896' + binary: '#969896' + cellpath: '#969896' + row_index: { fg: '#8c9440' attr: 'b' } + record: '#969896' + list: '#969896' + block: '#969896' + hints: 'dark_gray' + search_result: { fg: '#a54242' bg: '#969896' } + + shape_and: { fg: '#85678f' attr: 'b' } + shape_binary: { fg: '#85678f' attr: 'b' } + shape_block: { fg: '#5f819d' attr: 'b' } + shape_bool: '#8abeb7' + shape_custom: '#8c9440' + shape_datetime: { fg: '#5e8d87' attr: 'b' } + shape_directory: '#5e8d87' + shape_external: '#5e8d87' + shape_externalarg: { fg: '#8c9440' attr: 'b' } + shape_filepath: '#5e8d87' + shape_flag: { fg: '#5f819d' attr: 'b' } + shape_float: { fg: '#85678f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5e8d87' attr: 'b' } + shape_int: { fg: '#85678f' attr: 'b' } + shape_internalcall: { fg: '#5e8d87' attr: 'b' } + shape_list: { fg: '#5e8d87' attr: 'b' } + shape_literal: '#5f819d' + shape_match_pattern: '#8c9440' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8abeb7' + shape_operator: '#de935f' + shape_or: { fg: '#85678f' attr: 'b' } + shape_pipe: { fg: '#85678f' attr: 'b' } + shape_range: { fg: '#de935f' attr: 'b' } + shape_record: { fg: '#5e8d87' attr: 'b' } + shape_redirection: { fg: '#85678f' attr: 'b' } + shape_signature: { fg: '#8c9440' attr: 'b' } + shape_string: '#8c9440' + shape_string_interpolation: { fg: '#5e8d87' attr: 'b' } + shape_table: { fg: '#5f819d' attr: 'b' } + shape_variable: '#85678f' + + background: '#141414' + foreground: '#94a3a5' + cursor: '#94a3a5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ia-dark.nu b/themes/nu-themes/ia-dark.nu index 329afa8..ad87374 100644 --- a/themes/nu-themes/ia-dark.nu +++ b/themes/nu-themes/ia-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#83a471" attr: "b" } - empty: "#8eccdd" - bool: {|| if $in { "#7c9cae" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#7c9cae" - } else {{ fg: "#8eccdd" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d88568" attr: "b" } - } else if $in < 6hr { - "#d88568" - } else if $in < 1day { - "#b99353" - } else if $in < 3day { - "#83a471" - } else if $in < 1wk { - { fg: "#83a471" attr: "b" } - } else if $in < 6wk { - "#7c9cae" - } else if $in < 52wk { - "#8eccdd" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#83a471" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#d88568" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b98eb2" attr: "b" } - shape_binary: { fg: "#b98eb2" attr: "b" } - shape_block: { fg: "#8eccdd" attr: "b" } - shape_bool: "#7c9cae" - shape_custom: "#83a471" - shape_datetime: { fg: "#7c9cae" attr: "b" } - shape_directory: "#7c9cae" - shape_external: "#7c9cae" - shape_externalarg: { fg: "#83a471" attr: "b" } - shape_filepath: "#7c9cae" - shape_flag: { fg: "#8eccdd" attr: "b" } - shape_float: { fg: "#b98eb2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7c9cae" attr: "b" } - shape_int: { fg: "#b98eb2" attr: "b" } - shape_internalcall: { fg: "#7c9cae" attr: "b" } - shape_list: { fg: "#7c9cae" attr: "b" } - shape_literal: "#8eccdd" - shape_match_pattern: "#83a471" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7c9cae" - shape_operator: "#b99353" - shape_or: { fg: "#b98eb2" attr: "b" } - shape_pipe: { fg: "#b98eb2" attr: "b" } - shape_range: { fg: "#b99353" attr: "b" } - shape_record: { fg: "#7c9cae" attr: "b" } - shape_redirection: { fg: "#b98eb2" attr: "b" } - shape_signature: { fg: "#83a471" attr: "b" } - shape_string: "#83a471" - shape_string_interpolation: { fg: "#7c9cae" attr: "b" } - shape_table: { fg: "#8eccdd" attr: "b" } - shape_variable: "#b98eb2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1a1a1a" - foreground: "#cccccc" - cursor: "#cccccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#83a471' attr: 'b' } + empty: '#8eccdd' + bool: {|| if $in { '#7c9cae' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#7c9cae' + } else {{ fg: '#8eccdd' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d88568' attr: 'b' } + } else if $in < 6hr { + '#d88568' + } else if $in < 1day { + '#b99353' + } else if $in < 3day { + '#83a471' + } else if $in < 1wk { + { fg: '#83a471' attr: 'b' } + } else if $in < 6wk { + '#7c9cae' + } else if $in < 52wk { + '#8eccdd' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#83a471' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#d88568' bg: '#cccccc' } + + shape_and: { fg: '#b98eb2' attr: 'b' } + shape_binary: { fg: '#b98eb2' attr: 'b' } + shape_block: { fg: '#8eccdd' attr: 'b' } + shape_bool: '#7c9cae' + shape_custom: '#83a471' + shape_datetime: { fg: '#7c9cae' attr: 'b' } + shape_directory: '#7c9cae' + shape_external: '#7c9cae' + shape_externalarg: { fg: '#83a471' attr: 'b' } + shape_filepath: '#7c9cae' + shape_flag: { fg: '#8eccdd' attr: 'b' } + shape_float: { fg: '#b98eb2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7c9cae' attr: 'b' } + shape_int: { fg: '#b98eb2' attr: 'b' } + shape_internalcall: { fg: '#7c9cae' attr: 'b' } + shape_list: { fg: '#7c9cae' attr: 'b' } + shape_literal: '#8eccdd' + shape_match_pattern: '#83a471' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7c9cae' + shape_operator: '#b99353' + shape_or: { fg: '#b98eb2' attr: 'b' } + shape_pipe: { fg: '#b98eb2' attr: 'b' } + shape_range: { fg: '#b99353' attr: 'b' } + shape_record: { fg: '#7c9cae' attr: 'b' } + shape_redirection: { fg: '#b98eb2' attr: 'b' } + shape_signature: { fg: '#83a471' attr: 'b' } + shape_string: '#83a471' + shape_string_interpolation: { fg: '#7c9cae' attr: 'b' } + shape_table: { fg: '#8eccdd' attr: 'b' } + shape_variable: '#b98eb2' + + background: '#1a1a1a' + foreground: '#cccccc' + cursor: '#cccccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ia-light.nu b/themes/nu-themes/ia-light.nu index 5855e82..6d45199 100644 --- a/themes/nu-themes/ia-light.nu +++ b/themes/nu-themes/ia-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#181818" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#38781c" attr: "b" } - empty: "#48bac2" - bool: {|| if $in { "#2d6bb1" } else { "light_gray" } } - int: "#181818" - filesize: {|e| - if $e == 0b { - "#181818" - } else if $e < 1mb { - "#2d6bb1" - } else {{ fg: "#48bac2" }} - } - duration: "#181818" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9c5a02" attr: "b" } - } else if $in < 6hr { - "#9c5a02" - } else if $in < 1day { - "#c48218" - } else if $in < 3day { - "#38781c" - } else if $in < 1wk { - { fg: "#38781c" attr: "b" } - } else if $in < 6wk { - "#2d6bb1" - } else if $in < 52wk { - "#48bac2" - } else { "dark_gray" } - } - range: "#181818" - float: "#181818" - string: "#181818" - nothing: "#181818" - binary: "#181818" - cellpath: "#181818" - row_index: { fg: "#38781c" attr: "b" } - record: "#181818" - list: "#181818" - block: "#181818" - hints: "dark_gray" - search_result: { fg: "#9c5a02" bg: "#181818" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a94598" attr: "b" } - shape_binary: { fg: "#a94598" attr: "b" } - shape_block: { fg: "#48bac2" attr: "b" } - shape_bool: "#2d6bb1" - shape_custom: "#38781c" - shape_datetime: { fg: "#2d6bb1" attr: "b" } - shape_directory: "#2d6bb1" - shape_external: "#2d6bb1" - shape_externalarg: { fg: "#38781c" attr: "b" } - shape_filepath: "#2d6bb1" - shape_flag: { fg: "#48bac2" attr: "b" } - shape_float: { fg: "#a94598" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2d6bb1" attr: "b" } - shape_int: { fg: "#a94598" attr: "b" } - shape_internalcall: { fg: "#2d6bb1" attr: "b" } - shape_list: { fg: "#2d6bb1" attr: "b" } - shape_literal: "#48bac2" - shape_match_pattern: "#38781c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2d6bb1" - shape_operator: "#c48218" - shape_or: { fg: "#a94598" attr: "b" } - shape_pipe: { fg: "#a94598" attr: "b" } - shape_range: { fg: "#c48218" attr: "b" } - shape_record: { fg: "#2d6bb1" attr: "b" } - shape_redirection: { fg: "#a94598" attr: "b" } - shape_signature: { fg: "#38781c" attr: "b" } - shape_string: "#38781c" - shape_string_interpolation: { fg: "#2d6bb1" attr: "b" } - shape_table: { fg: "#48bac2" attr: "b" } - shape_variable: "#a94598" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f6f6f6" - foreground: "#181818" - cursor: "#181818" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#181818' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#38781c' attr: 'b' } + empty: '#48bac2' + bool: {|| if $in { '#2d6bb1' } else { 'light_gray' } } + int: '#181818' + filesize: {|e| + if $e == 0b { + '#181818' + } else if $e < 1mb { + '#2d6bb1' + } else {{ fg: '#48bac2' }} + } + duration: '#181818' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9c5a02' attr: 'b' } + } else if $in < 6hr { + '#9c5a02' + } else if $in < 1day { + '#c48218' + } else if $in < 3day { + '#38781c' + } else if $in < 1wk { + { fg: '#38781c' attr: 'b' } + } else if $in < 6wk { + '#2d6bb1' + } else if $in < 52wk { + '#48bac2' + } else { 'dark_gray' } + } + range: '#181818' + float: '#181818' + string: '#181818' + nothing: '#181818' + binary: '#181818' + cellpath: '#181818' + row_index: { fg: '#38781c' attr: 'b' } + record: '#181818' + list: '#181818' + block: '#181818' + hints: 'dark_gray' + search_result: { fg: '#9c5a02' bg: '#181818' } + + shape_and: { fg: '#a94598' attr: 'b' } + shape_binary: { fg: '#a94598' attr: 'b' } + shape_block: { fg: '#48bac2' attr: 'b' } + shape_bool: '#2d6bb1' + shape_custom: '#38781c' + shape_datetime: { fg: '#2d6bb1' attr: 'b' } + shape_directory: '#2d6bb1' + shape_external: '#2d6bb1' + shape_externalarg: { fg: '#38781c' attr: 'b' } + shape_filepath: '#2d6bb1' + shape_flag: { fg: '#48bac2' attr: 'b' } + shape_float: { fg: '#a94598' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2d6bb1' attr: 'b' } + shape_int: { fg: '#a94598' attr: 'b' } + shape_internalcall: { fg: '#2d6bb1' attr: 'b' } + shape_list: { fg: '#2d6bb1' attr: 'b' } + shape_literal: '#48bac2' + shape_match_pattern: '#38781c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2d6bb1' + shape_operator: '#c48218' + shape_or: { fg: '#a94598' attr: 'b' } + shape_pipe: { fg: '#a94598' attr: 'b' } + shape_range: { fg: '#c48218' attr: 'b' } + shape_record: { fg: '#2d6bb1' attr: 'b' } + shape_redirection: { fg: '#a94598' attr: 'b' } + shape_signature: { fg: '#38781c' attr: 'b' } + shape_string: '#38781c' + shape_string_interpolation: { fg: '#2d6bb1' attr: 'b' } + shape_table: { fg: '#48bac2' attr: 'b' } + shape_variable: '#a94598' + + background: '#f6f6f6' + foreground: '#181818' + cursor: '#181818' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ibm3270.nu b/themes/nu-themes/ibm3270.nu index ed56865..2968b13 100644 --- a/themes/nu-themes/ibm3270.nu +++ b/themes/nu-themes/ibm3270.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a5a5a5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#24d830" attr: "b" } - empty: "#7890f0" - bool: {|| if $in { "#9ce2e2" } else { "light_gray" } } - int: "#a5a5a5" - filesize: {|e| - if $e == 0b { - "#a5a5a5" - } else if $e < 1mb { - "#54e4e4" - } else {{ fg: "#7890f0" }} - } - duration: "#a5a5a5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f01818" attr: "b" } - } else if $in < 6hr { - "#f01818" - } else if $in < 1day { - "#f0d824" - } else if $in < 3day { - "#24d830" - } else if $in < 1wk { - { fg: "#24d830" attr: "b" } - } else if $in < 6wk { - "#54e4e4" - } else if $in < 52wk { - "#7890f0" - } else { "dark_gray" } - } - range: "#a5a5a5" - float: "#a5a5a5" - string: "#a5a5a5" - nothing: "#a5a5a5" - binary: "#a5a5a5" - cellpath: "#a5a5a5" - row_index: { fg: "#24d830" attr: "b" } - record: "#a5a5a5" - list: "#a5a5a5" - block: "#a5a5a5" - hints: "dark_gray" - search_result: { fg: "#f01818" bg: "#a5a5a5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f078d8" attr: "b" } - shape_binary: { fg: "#f078d8" attr: "b" } - shape_block: { fg: "#7890f0" attr: "b" } - shape_bool: "#9ce2e2" - shape_custom: "#24d830" - shape_datetime: { fg: "#54e4e4" attr: "b" } - shape_directory: "#54e4e4" - shape_external: "#54e4e4" - shape_externalarg: { fg: "#24d830" attr: "b" } - shape_filepath: "#54e4e4" - shape_flag: { fg: "#7890f0" attr: "b" } - shape_float: { fg: "#f078d8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#54e4e4" attr: "b" } - shape_int: { fg: "#f078d8" attr: "b" } - shape_internalcall: { fg: "#54e4e4" attr: "b" } - shape_list: { fg: "#54e4e4" attr: "b" } - shape_literal: "#7890f0" - shape_match_pattern: "#24d830" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#9ce2e2" - shape_operator: "#f0d824" - shape_or: { fg: "#f078d8" attr: "b" } - shape_pipe: { fg: "#f078d8" attr: "b" } - shape_range: { fg: "#f0d824" attr: "b" } - shape_record: { fg: "#54e4e4" attr: "b" } - shape_redirection: { fg: "#f078d8" attr: "b" } - shape_signature: { fg: "#24d830" attr: "b" } - shape_string: "#24d830" - shape_string_interpolation: { fg: "#54e4e4" attr: "b" } - shape_table: { fg: "#7890f0" attr: "b" } - shape_variable: "#f078d8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#fdfdfd" - cursor: "#fdfdfd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a5a5a5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#24d830' attr: 'b' } + empty: '#7890f0' + bool: {|| if $in { '#9ce2e2' } else { 'light_gray' } } + int: '#a5a5a5' + filesize: {|e| + if $e == 0b { + '#a5a5a5' + } else if $e < 1mb { + '#54e4e4' + } else {{ fg: '#7890f0' }} + } + duration: '#a5a5a5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f01818' attr: 'b' } + } else if $in < 6hr { + '#f01818' + } else if $in < 1day { + '#f0d824' + } else if $in < 3day { + '#24d830' + } else if $in < 1wk { + { fg: '#24d830' attr: 'b' } + } else if $in < 6wk { + '#54e4e4' + } else if $in < 52wk { + '#7890f0' + } else { 'dark_gray' } + } + range: '#a5a5a5' + float: '#a5a5a5' + string: '#a5a5a5' + nothing: '#a5a5a5' + binary: '#a5a5a5' + cellpath: '#a5a5a5' + row_index: { fg: '#24d830' attr: 'b' } + record: '#a5a5a5' + list: '#a5a5a5' + block: '#a5a5a5' + hints: 'dark_gray' + search_result: { fg: '#f01818' bg: '#a5a5a5' } + + shape_and: { fg: '#f078d8' attr: 'b' } + shape_binary: { fg: '#f078d8' attr: 'b' } + shape_block: { fg: '#7890f0' attr: 'b' } + shape_bool: '#9ce2e2' + shape_custom: '#24d830' + shape_datetime: { fg: '#54e4e4' attr: 'b' } + shape_directory: '#54e4e4' + shape_external: '#54e4e4' + shape_externalarg: { fg: '#24d830' attr: 'b' } + shape_filepath: '#54e4e4' + shape_flag: { fg: '#7890f0' attr: 'b' } + shape_float: { fg: '#f078d8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#54e4e4' attr: 'b' } + shape_int: { fg: '#f078d8' attr: 'b' } + shape_internalcall: { fg: '#54e4e4' attr: 'b' } + shape_list: { fg: '#54e4e4' attr: 'b' } + shape_literal: '#7890f0' + shape_match_pattern: '#24d830' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#9ce2e2' + shape_operator: '#f0d824' + shape_or: { fg: '#f078d8' attr: 'b' } + shape_pipe: { fg: '#f078d8' attr: 'b' } + shape_range: { fg: '#f0d824' attr: 'b' } + shape_record: { fg: '#54e4e4' attr: 'b' } + shape_redirection: { fg: '#f078d8' attr: 'b' } + shape_signature: { fg: '#24d830' attr: 'b' } + shape_string: '#24d830' + shape_string_interpolation: { fg: '#54e4e4' attr: 'b' } + shape_table: { fg: '#7890f0' attr: 'b' } + shape_variable: '#f078d8' + + background: '#000000' + foreground: '#fdfdfd' + cursor: '#fdfdfd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ic-green-ppl.nu b/themes/nu-themes/ic-green-ppl.nu index 1c9c10f..de38e4d 100644 --- a/themes/nu-themes/ic-green-ppl.nu +++ b/themes/nu-themes/ic-green-ppl.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0ffef" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#339c24" attr: "b" } - empty: "#149b45" - bool: {|| if $in { "#22ff71" } else { "light_gray" } } - int: "#e0ffef" - filesize: {|e| - if $e == 0b { - "#e0ffef" - } else if $e < 1mb { - "#2cb868" - } else {{ fg: "#149b45" }} - } - duration: "#e0ffef" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb002a" attr: "b" } - } else if $in < 6hr { - "#fb002a" - } else if $in < 1day { - "#659b25" - } else if $in < 3day { - "#339c24" - } else if $in < 1wk { - { fg: "#339c24" attr: "b" } - } else if $in < 6wk { - "#2cb868" - } else if $in < 52wk { - "#149b45" - } else { "dark_gray" } - } - range: "#e0ffef" - float: "#e0ffef" - string: "#e0ffef" - nothing: "#e0ffef" - binary: "#e0ffef" - cellpath: "#e0ffef" - row_index: { fg: "#339c24" attr: "b" } - record: "#e0ffef" - list: "#e0ffef" - block: "#e0ffef" - hints: "dark_gray" - search_result: { fg: "#fb002a" bg: "#e0ffef" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#53b82c" attr: "b" } - shape_binary: { fg: "#53b82c" attr: "b" } - shape_block: { fg: "#149b45" attr: "b" } - shape_bool: "#22ff71" - shape_custom: "#339c24" - shape_datetime: { fg: "#2cb868" attr: "b" } - shape_directory: "#2cb868" - shape_external: "#2cb868" - shape_externalarg: { fg: "#339c24" attr: "b" } - shape_filepath: "#2cb868" - shape_flag: { fg: "#149b45" attr: "b" } - shape_float: { fg: "#53b82c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2cb868" attr: "b" } - shape_int: { fg: "#53b82c" attr: "b" } - shape_internalcall: { fg: "#2cb868" attr: "b" } - shape_list: { fg: "#2cb868" attr: "b" } - shape_literal: "#149b45" - shape_match_pattern: "#339c24" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#22ff71" - shape_operator: "#659b25" - shape_or: { fg: "#53b82c" attr: "b" } - shape_pipe: { fg: "#53b82c" attr: "b" } - shape_range: { fg: "#659b25" attr: "b" } - shape_record: { fg: "#2cb868" attr: "b" } - shape_redirection: { fg: "#53b82c" attr: "b" } - shape_signature: { fg: "#339c24" attr: "b" } - shape_string: "#339c24" - shape_string_interpolation: { fg: "#2cb868" attr: "b" } - shape_table: { fg: "#149b45" attr: "b" } - shape_variable: "#53b82c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3a3d3f" - foreground: "#d9efd3" - cursor: "#d9efd3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0ffef' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#339c24' attr: 'b' } + empty: '#149b45' + bool: {|| if $in { '#22ff71' } else { 'light_gray' } } + int: '#e0ffef' + filesize: {|e| + if $e == 0b { + '#e0ffef' + } else if $e < 1mb { + '#2cb868' + } else {{ fg: '#149b45' }} + } + duration: '#e0ffef' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb002a' attr: 'b' } + } else if $in < 6hr { + '#fb002a' + } else if $in < 1day { + '#659b25' + } else if $in < 3day { + '#339c24' + } else if $in < 1wk { + { fg: '#339c24' attr: 'b' } + } else if $in < 6wk { + '#2cb868' + } else if $in < 52wk { + '#149b45' + } else { 'dark_gray' } + } + range: '#e0ffef' + float: '#e0ffef' + string: '#e0ffef' + nothing: '#e0ffef' + binary: '#e0ffef' + cellpath: '#e0ffef' + row_index: { fg: '#339c24' attr: 'b' } + record: '#e0ffef' + list: '#e0ffef' + block: '#e0ffef' + hints: 'dark_gray' + search_result: { fg: '#fb002a' bg: '#e0ffef' } + + shape_and: { fg: '#53b82c' attr: 'b' } + shape_binary: { fg: '#53b82c' attr: 'b' } + shape_block: { fg: '#149b45' attr: 'b' } + shape_bool: '#22ff71' + shape_custom: '#339c24' + shape_datetime: { fg: '#2cb868' attr: 'b' } + shape_directory: '#2cb868' + shape_external: '#2cb868' + shape_externalarg: { fg: '#339c24' attr: 'b' } + shape_filepath: '#2cb868' + shape_flag: { fg: '#149b45' attr: 'b' } + shape_float: { fg: '#53b82c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2cb868' attr: 'b' } + shape_int: { fg: '#53b82c' attr: 'b' } + shape_internalcall: { fg: '#2cb868' attr: 'b' } + shape_list: { fg: '#2cb868' attr: 'b' } + shape_literal: '#149b45' + shape_match_pattern: '#339c24' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#22ff71' + shape_operator: '#659b25' + shape_or: { fg: '#53b82c' attr: 'b' } + shape_pipe: { fg: '#53b82c' attr: 'b' } + shape_range: { fg: '#659b25' attr: 'b' } + shape_record: { fg: '#2cb868' attr: 'b' } + shape_redirection: { fg: '#53b82c' attr: 'b' } + shape_signature: { fg: '#339c24' attr: 'b' } + shape_string: '#339c24' + shape_string_interpolation: { fg: '#2cb868' attr: 'b' } + shape_table: { fg: '#149b45' attr: 'b' } + shape_variable: '#53b82c' + + background: '#3a3d3f' + foreground: '#d9efd3' + cursor: '#d9efd3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ic-orange-ppl.nu b/themes/nu-themes/ic-orange-ppl.nu index c6cadb1..164b786 100644 --- a/themes/nu-themes/ic-orange-ppl.nu +++ b/themes/nu-themes/ic-orange-ppl.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffc88a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a4a900" attr: "b" } - empty: "#bd6d00" - bool: {|| if $in { "#c69752" } else { "light_gray" } } - int: "#ffc88a" - filesize: {|e| - if $e == 0b { - "#ffc88a" - } else if $e < 1mb { - "#f79500" - } else {{ fg: "#bd6d00" }} - } - duration: "#ffc88a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c13900" attr: "b" } - } else if $in < 6hr { - "#c13900" - } else if $in < 1day { - "#caaf00" - } else if $in < 3day { - "#a4a900" - } else if $in < 1wk { - { fg: "#a4a900" attr: "b" } - } else if $in < 6wk { - "#f79500" - } else if $in < 52wk { - "#bd6d00" - } else { "dark_gray" } - } - range: "#ffc88a" - float: "#ffc88a" - string: "#ffc88a" - nothing: "#ffc88a" - binary: "#ffc88a" - cellpath: "#ffc88a" - row_index: { fg: "#a4a900" attr: "b" } - record: "#ffc88a" - list: "#ffc88a" - block: "#ffc88a" - hints: "dark_gray" - search_result: { fg: "#c13900" bg: "#ffc88a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fc5e00" attr: "b" } - shape_binary: { fg: "#fc5e00" attr: "b" } - shape_block: { fg: "#bd6d00" attr: "b" } - shape_bool: "#c69752" - shape_custom: "#a4a900" - shape_datetime: { fg: "#f79500" attr: "b" } - shape_directory: "#f79500" - shape_external: "#f79500" - shape_externalarg: { fg: "#a4a900" attr: "b" } - shape_filepath: "#f79500" - shape_flag: { fg: "#bd6d00" attr: "b" } - shape_float: { fg: "#fc5e00" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#f79500" attr: "b" } - shape_int: { fg: "#fc5e00" attr: "b" } - shape_internalcall: { fg: "#f79500" attr: "b" } - shape_list: { fg: "#f79500" attr: "b" } - shape_literal: "#bd6d00" - shape_match_pattern: "#a4a900" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c69752" - shape_operator: "#caaf00" - shape_or: { fg: "#fc5e00" attr: "b" } - shape_pipe: { fg: "#fc5e00" attr: "b" } - shape_range: { fg: "#caaf00" attr: "b" } - shape_record: { fg: "#f79500" attr: "b" } - shape_redirection: { fg: "#fc5e00" attr: "b" } - shape_signature: { fg: "#a4a900" attr: "b" } - shape_string: "#a4a900" - shape_string_interpolation: { fg: "#f79500" attr: "b" } - shape_table: { fg: "#bd6d00" attr: "b" } - shape_variable: "#fc5e00" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262626" - foreground: "#ffcb83" - cursor: "#ffcb83" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffc88a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a4a900' attr: 'b' } + empty: '#bd6d00' + bool: {|| if $in { '#c69752' } else { 'light_gray' } } + int: '#ffc88a' + filesize: {|e| + if $e == 0b { + '#ffc88a' + } else if $e < 1mb { + '#f79500' + } else {{ fg: '#bd6d00' }} + } + duration: '#ffc88a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c13900' attr: 'b' } + } else if $in < 6hr { + '#c13900' + } else if $in < 1day { + '#caaf00' + } else if $in < 3day { + '#a4a900' + } else if $in < 1wk { + { fg: '#a4a900' attr: 'b' } + } else if $in < 6wk { + '#f79500' + } else if $in < 52wk { + '#bd6d00' + } else { 'dark_gray' } + } + range: '#ffc88a' + float: '#ffc88a' + string: '#ffc88a' + nothing: '#ffc88a' + binary: '#ffc88a' + cellpath: '#ffc88a' + row_index: { fg: '#a4a900' attr: 'b' } + record: '#ffc88a' + list: '#ffc88a' + block: '#ffc88a' + hints: 'dark_gray' + search_result: { fg: '#c13900' bg: '#ffc88a' } + + shape_and: { fg: '#fc5e00' attr: 'b' } + shape_binary: { fg: '#fc5e00' attr: 'b' } + shape_block: { fg: '#bd6d00' attr: 'b' } + shape_bool: '#c69752' + shape_custom: '#a4a900' + shape_datetime: { fg: '#f79500' attr: 'b' } + shape_directory: '#f79500' + shape_external: '#f79500' + shape_externalarg: { fg: '#a4a900' attr: 'b' } + shape_filepath: '#f79500' + shape_flag: { fg: '#bd6d00' attr: 'b' } + shape_float: { fg: '#fc5e00' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#f79500' attr: 'b' } + shape_int: { fg: '#fc5e00' attr: 'b' } + shape_internalcall: { fg: '#f79500' attr: 'b' } + shape_list: { fg: '#f79500' attr: 'b' } + shape_literal: '#bd6d00' + shape_match_pattern: '#a4a900' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c69752' + shape_operator: '#caaf00' + shape_or: { fg: '#fc5e00' attr: 'b' } + shape_pipe: { fg: '#fc5e00' attr: 'b' } + shape_range: { fg: '#caaf00' attr: 'b' } + shape_record: { fg: '#f79500' attr: 'b' } + shape_redirection: { fg: '#fc5e00' attr: 'b' } + shape_signature: { fg: '#a4a900' attr: 'b' } + shape_string: '#a4a900' + shape_string_interpolation: { fg: '#f79500' attr: 'b' } + shape_table: { fg: '#bd6d00' attr: 'b' } + shape_variable: '#fc5e00' + + background: '#262626' + foreground: '#ffcb83' + cursor: '#ffcb83' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/iceberg-light.nu b/themes/nu-themes/iceberg-light.nu index 08b063c..e6d1fcc 100644 --- a/themes/nu-themes/iceberg-light.nu +++ b/themes/nu-themes/iceberg-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#33374c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#668e3d" attr: "b" } - empty: "#2d539e" - bool: {|| if $in { "#327698" } else { "light_gray" } } - int: "#33374c" - filesize: {|e| - if $e == 0b { - "#33374c" - } else if $e < 1mb { - "#3f83a6" - } else {{ fg: "#2d539e" }} - } - duration: "#33374c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc517a" attr: "b" } - } else if $in < 6hr { - "#cc517a" - } else if $in < 1day { - "#c57339" - } else if $in < 3day { - "#668e3d" - } else if $in < 1wk { - { fg: "#668e3d" attr: "b" } - } else if $in < 6wk { - "#3f83a6" - } else if $in < 52wk { - "#2d539e" - } else { "dark_gray" } - } - range: "#33374c" - float: "#33374c" - string: "#33374c" - nothing: "#33374c" - binary: "#33374c" - cellpath: "#33374c" - row_index: { fg: "#668e3d" attr: "b" } - record: "#33374c" - list: "#33374c" - block: "#33374c" - hints: "dark_gray" - search_result: { fg: "#cc517a" bg: "#33374c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7759b4" attr: "b" } - shape_binary: { fg: "#7759b4" attr: "b" } - shape_block: { fg: "#2d539e" attr: "b" } - shape_bool: "#327698" - shape_custom: "#668e3d" - shape_datetime: { fg: "#3f83a6" attr: "b" } - shape_directory: "#3f83a6" - shape_external: "#3f83a6" - shape_externalarg: { fg: "#668e3d" attr: "b" } - shape_filepath: "#3f83a6" - shape_flag: { fg: "#2d539e" attr: "b" } - shape_float: { fg: "#7759b4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3f83a6" attr: "b" } - shape_int: { fg: "#7759b4" attr: "b" } - shape_internalcall: { fg: "#3f83a6" attr: "b" } - shape_list: { fg: "#3f83a6" attr: "b" } - shape_literal: "#2d539e" - shape_match_pattern: "#668e3d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#327698" - shape_operator: "#c57339" - shape_or: { fg: "#7759b4" attr: "b" } - shape_pipe: { fg: "#7759b4" attr: "b" } - shape_range: { fg: "#c57339" attr: "b" } - shape_record: { fg: "#3f83a6" attr: "b" } - shape_redirection: { fg: "#7759b4" attr: "b" } - shape_signature: { fg: "#668e3d" attr: "b" } - shape_string: "#668e3d" - shape_string_interpolation: { fg: "#3f83a6" attr: "b" } - shape_table: { fg: "#2d539e" attr: "b" } - shape_variable: "#7759b4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#e8e9ec" - foreground: "#33374c" - cursor: "#33374c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#33374c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#668e3d' attr: 'b' } + empty: '#2d539e' + bool: {|| if $in { '#327698' } else { 'light_gray' } } + int: '#33374c' + filesize: {|e| + if $e == 0b { + '#33374c' + } else if $e < 1mb { + '#3f83a6' + } else {{ fg: '#2d539e' }} + } + duration: '#33374c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc517a' attr: 'b' } + } else if $in < 6hr { + '#cc517a' + } else if $in < 1day { + '#c57339' + } else if $in < 3day { + '#668e3d' + } else if $in < 1wk { + { fg: '#668e3d' attr: 'b' } + } else if $in < 6wk { + '#3f83a6' + } else if $in < 52wk { + '#2d539e' + } else { 'dark_gray' } + } + range: '#33374c' + float: '#33374c' + string: '#33374c' + nothing: '#33374c' + binary: '#33374c' + cellpath: '#33374c' + row_index: { fg: '#668e3d' attr: 'b' } + record: '#33374c' + list: '#33374c' + block: '#33374c' + hints: 'dark_gray' + search_result: { fg: '#cc517a' bg: '#33374c' } + + shape_and: { fg: '#7759b4' attr: 'b' } + shape_binary: { fg: '#7759b4' attr: 'b' } + shape_block: { fg: '#2d539e' attr: 'b' } + shape_bool: '#327698' + shape_custom: '#668e3d' + shape_datetime: { fg: '#3f83a6' attr: 'b' } + shape_directory: '#3f83a6' + shape_external: '#3f83a6' + shape_externalarg: { fg: '#668e3d' attr: 'b' } + shape_filepath: '#3f83a6' + shape_flag: { fg: '#2d539e' attr: 'b' } + shape_float: { fg: '#7759b4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3f83a6' attr: 'b' } + shape_int: { fg: '#7759b4' attr: 'b' } + shape_internalcall: { fg: '#3f83a6' attr: 'b' } + shape_list: { fg: '#3f83a6' attr: 'b' } + shape_literal: '#2d539e' + shape_match_pattern: '#668e3d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#327698' + shape_operator: '#c57339' + shape_or: { fg: '#7759b4' attr: 'b' } + shape_pipe: { fg: '#7759b4' attr: 'b' } + shape_range: { fg: '#c57339' attr: 'b' } + shape_record: { fg: '#3f83a6' attr: 'b' } + shape_redirection: { fg: '#7759b4' attr: 'b' } + shape_signature: { fg: '#668e3d' attr: 'b' } + shape_string: '#668e3d' + shape_string_interpolation: { fg: '#3f83a6' attr: 'b' } + shape_table: { fg: '#2d539e' attr: 'b' } + shape_variable: '#7759b4' + + background: '#e8e9ec' + foreground: '#33374c' + cursor: '#33374c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/icy.nu b/themes/nu-themes/icy.nu index 73d96b9..3181410 100644 --- a/themes/nu-themes/icy.nu +++ b/themes/nu-themes/icy.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#095b67" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4dd0e1" attr: "b" } - empty: "#00bcd4" - bool: {|| if $in { "#26c6da" } else { "light_gray" } } - int: "#095b67" - filesize: {|e| - if $e == 0b { - "#095b67" - } else if $e < 1mb { - "#26c6da" - } else {{ fg: "#00bcd4" }} - } - duration: "#095b67" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#16c1d9" attr: "b" } - } else if $in < 6hr { - "#16c1d9" - } else if $in < 1day { - "#80deea" - } else if $in < 3day { - "#4dd0e1" - } else if $in < 1wk { - { fg: "#4dd0e1" attr: "b" } - } else if $in < 6wk { - "#26c6da" - } else if $in < 52wk { - "#00bcd4" - } else { "dark_gray" } - } - range: "#095b67" - float: "#095b67" - string: "#095b67" - nothing: "#095b67" - binary: "#095b67" - cellpath: "#095b67" - row_index: { fg: "#4dd0e1" attr: "b" } - record: "#095b67" - list: "#095b67" - block: "#095b67" - hints: "dark_gray" - search_result: { fg: "#16c1d9" bg: "#095b67" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#00acc1" attr: "b" } - shape_binary: { fg: "#00acc1" attr: "b" } - shape_block: { fg: "#00bcd4" attr: "b" } - shape_bool: "#26c6da" - shape_custom: "#4dd0e1" - shape_datetime: { fg: "#26c6da" attr: "b" } - shape_directory: "#26c6da" - shape_external: "#26c6da" - shape_externalarg: { fg: "#4dd0e1" attr: "b" } - shape_filepath: "#26c6da" - shape_flag: { fg: "#00bcd4" attr: "b" } - shape_float: { fg: "#00acc1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#26c6da" attr: "b" } - shape_int: { fg: "#00acc1" attr: "b" } - shape_internalcall: { fg: "#26c6da" attr: "b" } - shape_list: { fg: "#26c6da" attr: "b" } - shape_literal: "#00bcd4" - shape_match_pattern: "#4dd0e1" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#26c6da" - shape_operator: "#80deea" - shape_or: { fg: "#00acc1" attr: "b" } - shape_pipe: { fg: "#00acc1" attr: "b" } - shape_range: { fg: "#80deea" attr: "b" } - shape_record: { fg: "#26c6da" attr: "b" } - shape_redirection: { fg: "#00acc1" attr: "b" } - shape_signature: { fg: "#4dd0e1" attr: "b" } - shape_string: "#4dd0e1" - shape_string_interpolation: { fg: "#26c6da" attr: "b" } - shape_table: { fg: "#00bcd4" attr: "b" } - shape_variable: "#00acc1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#021012" - foreground: "#095b67" - cursor: "#095b67" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#095b67' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4dd0e1' attr: 'b' } + empty: '#00bcd4' + bool: {|| if $in { '#26c6da' } else { 'light_gray' } } + int: '#095b67' + filesize: {|e| + if $e == 0b { + '#095b67' + } else if $e < 1mb { + '#26c6da' + } else {{ fg: '#00bcd4' }} + } + duration: '#095b67' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#16c1d9' attr: 'b' } + } else if $in < 6hr { + '#16c1d9' + } else if $in < 1day { + '#80deea' + } else if $in < 3day { + '#4dd0e1' + } else if $in < 1wk { + { fg: '#4dd0e1' attr: 'b' } + } else if $in < 6wk { + '#26c6da' + } else if $in < 52wk { + '#00bcd4' + } else { 'dark_gray' } + } + range: '#095b67' + float: '#095b67' + string: '#095b67' + nothing: '#095b67' + binary: '#095b67' + cellpath: '#095b67' + row_index: { fg: '#4dd0e1' attr: 'b' } + record: '#095b67' + list: '#095b67' + block: '#095b67' + hints: 'dark_gray' + search_result: { fg: '#16c1d9' bg: '#095b67' } + + shape_and: { fg: '#00acc1' attr: 'b' } + shape_binary: { fg: '#00acc1' attr: 'b' } + shape_block: { fg: '#00bcd4' attr: 'b' } + shape_bool: '#26c6da' + shape_custom: '#4dd0e1' + shape_datetime: { fg: '#26c6da' attr: 'b' } + shape_directory: '#26c6da' + shape_external: '#26c6da' + shape_externalarg: { fg: '#4dd0e1' attr: 'b' } + shape_filepath: '#26c6da' + shape_flag: { fg: '#00bcd4' attr: 'b' } + shape_float: { fg: '#00acc1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#26c6da' attr: 'b' } + shape_int: { fg: '#00acc1' attr: 'b' } + shape_internalcall: { fg: '#26c6da' attr: 'b' } + shape_list: { fg: '#26c6da' attr: 'b' } + shape_literal: '#00bcd4' + shape_match_pattern: '#4dd0e1' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#26c6da' + shape_operator: '#80deea' + shape_or: { fg: '#00acc1' attr: 'b' } + shape_pipe: { fg: '#00acc1' attr: 'b' } + shape_range: { fg: '#80deea' attr: 'b' } + shape_record: { fg: '#26c6da' attr: 'b' } + shape_redirection: { fg: '#00acc1' attr: 'b' } + shape_signature: { fg: '#4dd0e1' attr: 'b' } + shape_string: '#4dd0e1' + shape_string_interpolation: { fg: '#26c6da' attr: 'b' } + shape_table: { fg: '#00bcd4' attr: 'b' } + shape_variable: '#00acc1' + + background: '#021012' + foreground: '#095b67' + cursor: '#095b67' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/idle-toes.nu b/themes/nu-themes/idle-toes.nu index a64c0ca..516e583 100644 --- a/themes/nu-themes/idle-toes.nu +++ b/themes/nu-themes/idle-toes.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeeeec" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7fe173" attr: "b" } - empty: "#4099ff" - bool: {|| if $in { "#dcf4ff" } else { "light_gray" } } - int: "#eeeeec" - filesize: {|e| - if $e == 0b { - "#eeeeec" - } else if $e < 1mb { - "#bed6ff" - } else {{ fg: "#4099ff" }} - } - duration: "#eeeeec" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d25252" attr: "b" } - } else if $in < 6hr { - "#d25252" - } else if $in < 1day { - "#ffc66d" - } else if $in < 3day { - "#7fe173" - } else if $in < 1wk { - { fg: "#7fe173" attr: "b" } - } else if $in < 6wk { - "#bed6ff" - } else if $in < 52wk { - "#4099ff" - } else { "dark_gray" } - } - range: "#eeeeec" - float: "#eeeeec" - string: "#eeeeec" - nothing: "#eeeeec" - binary: "#eeeeec" - cellpath: "#eeeeec" - row_index: { fg: "#7fe173" attr: "b" } - record: "#eeeeec" - list: "#eeeeec" - block: "#eeeeec" - hints: "dark_gray" - search_result: { fg: "#d25252" bg: "#eeeeec" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f680ff" attr: "b" } - shape_binary: { fg: "#f680ff" attr: "b" } - shape_block: { fg: "#4099ff" attr: "b" } - shape_bool: "#dcf4ff" - shape_custom: "#7fe173" - shape_datetime: { fg: "#bed6ff" attr: "b" } - shape_directory: "#bed6ff" - shape_external: "#bed6ff" - shape_externalarg: { fg: "#7fe173" attr: "b" } - shape_filepath: "#bed6ff" - shape_flag: { fg: "#4099ff" attr: "b" } - shape_float: { fg: "#f680ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#bed6ff" attr: "b" } - shape_int: { fg: "#f680ff" attr: "b" } - shape_internalcall: { fg: "#bed6ff" attr: "b" } - shape_list: { fg: "#bed6ff" attr: "b" } - shape_literal: "#4099ff" - shape_match_pattern: "#7fe173" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#dcf4ff" - shape_operator: "#ffc66d" - shape_or: { fg: "#f680ff" attr: "b" } - shape_pipe: { fg: "#f680ff" attr: "b" } - shape_range: { fg: "#ffc66d" attr: "b" } - shape_record: { fg: "#bed6ff" attr: "b" } - shape_redirection: { fg: "#f680ff" attr: "b" } - shape_signature: { fg: "#7fe173" attr: "b" } - shape_string: "#7fe173" - shape_string_interpolation: { fg: "#bed6ff" attr: "b" } - shape_table: { fg: "#4099ff" attr: "b" } - shape_variable: "#f680ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#323232" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeeeec' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7fe173' attr: 'b' } + empty: '#4099ff' + bool: {|| if $in { '#dcf4ff' } else { 'light_gray' } } + int: '#eeeeec' + filesize: {|e| + if $e == 0b { + '#eeeeec' + } else if $e < 1mb { + '#bed6ff' + } else {{ fg: '#4099ff' }} + } + duration: '#eeeeec' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d25252' attr: 'b' } + } else if $in < 6hr { + '#d25252' + } else if $in < 1day { + '#ffc66d' + } else if $in < 3day { + '#7fe173' + } else if $in < 1wk { + { fg: '#7fe173' attr: 'b' } + } else if $in < 6wk { + '#bed6ff' + } else if $in < 52wk { + '#4099ff' + } else { 'dark_gray' } + } + range: '#eeeeec' + float: '#eeeeec' + string: '#eeeeec' + nothing: '#eeeeec' + binary: '#eeeeec' + cellpath: '#eeeeec' + row_index: { fg: '#7fe173' attr: 'b' } + record: '#eeeeec' + list: '#eeeeec' + block: '#eeeeec' + hints: 'dark_gray' + search_result: { fg: '#d25252' bg: '#eeeeec' } + + shape_and: { fg: '#f680ff' attr: 'b' } + shape_binary: { fg: '#f680ff' attr: 'b' } + shape_block: { fg: '#4099ff' attr: 'b' } + shape_bool: '#dcf4ff' + shape_custom: '#7fe173' + shape_datetime: { fg: '#bed6ff' attr: 'b' } + shape_directory: '#bed6ff' + shape_external: '#bed6ff' + shape_externalarg: { fg: '#7fe173' attr: 'b' } + shape_filepath: '#bed6ff' + shape_flag: { fg: '#4099ff' attr: 'b' } + shape_float: { fg: '#f680ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#bed6ff' attr: 'b' } + shape_int: { fg: '#f680ff' attr: 'b' } + shape_internalcall: { fg: '#bed6ff' attr: 'b' } + shape_list: { fg: '#bed6ff' attr: 'b' } + shape_literal: '#4099ff' + shape_match_pattern: '#7fe173' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#dcf4ff' + shape_operator: '#ffc66d' + shape_or: { fg: '#f680ff' attr: 'b' } + shape_pipe: { fg: '#f680ff' attr: 'b' } + shape_range: { fg: '#ffc66d' attr: 'b' } + shape_record: { fg: '#bed6ff' attr: 'b' } + shape_redirection: { fg: '#f680ff' attr: 'b' } + shape_signature: { fg: '#7fe173' attr: 'b' } + shape_string: '#7fe173' + shape_string_interpolation: { fg: '#bed6ff' attr: 'b' } + shape_table: { fg: '#4099ff' attr: 'b' } + shape_variable: '#f680ff' + + background: '#323232' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/idm_3b.nu b/themes/nu-themes/idm_3b.nu index 1b9aac4..1011a6e 100644 --- a/themes/nu-themes/idm_3b.nu +++ b/themes/nu-themes/idm_3b.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#606060" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#70d0a0" attr: "b" } - empty: "#408aca" - bool: {|| if $in { "#caa0f0" } else { "light_gray" } } - int: "#606060" - filesize: {|e| - if $e == 0b { - "#606060" - } else if $e < 1mb { - "#a070e0" - } else {{ fg: "#408aca" }} - } - duration: "#606060" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b04060" attr: "b" } - } else if $in < 6hr { - "#b04060" - } else if $in < 1day { - "#ffb060" - } else if $in < 3day { - "#70d0a0" - } else if $in < 1wk { - { fg: "#70d0a0" attr: "b" } - } else if $in < 6wk { - "#a070e0" - } else if $in < 52wk { - "#408aca" - } else { "dark_gray" } - } - range: "#606060" - float: "#606060" - string: "#606060" - nothing: "#606060" - binary: "#606060" - cellpath: "#606060" - row_index: { fg: "#70d0a0" attr: "b" } - record: "#606060" - list: "#606060" - block: "#606060" - hints: "dark_gray" - search_result: { fg: "#b04060" bg: "#606060" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ba5aba" attr: "b" } - shape_binary: { fg: "#ba5aba" attr: "b" } - shape_block: { fg: "#408aca" attr: "b" } - shape_bool: "#caa0f0" - shape_custom: "#70d0a0" - shape_datetime: { fg: "#a070e0" attr: "b" } - shape_directory: "#a070e0" - shape_external: "#a070e0" - shape_externalarg: { fg: "#70d0a0" attr: "b" } - shape_filepath: "#a070e0" - shape_flag: { fg: "#408aca" attr: "b" } - shape_float: { fg: "#ba5aba" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#a070e0" attr: "b" } - shape_int: { fg: "#ba5aba" attr: "b" } - shape_internalcall: { fg: "#a070e0" attr: "b" } - shape_list: { fg: "#a070e0" attr: "b" } - shape_literal: "#408aca" - shape_match_pattern: "#70d0a0" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#caa0f0" - shape_operator: "#ffb060" - shape_or: { fg: "#ba5aba" attr: "b" } - shape_pipe: { fg: "#ba5aba" attr: "b" } - shape_range: { fg: "#ffb060" attr: "b" } - shape_record: { fg: "#a070e0" attr: "b" } - shape_redirection: { fg: "#ba5aba" attr: "b" } - shape_signature: { fg: "#70d0a0" attr: "b" } - shape_string: "#70d0a0" - shape_string_interpolation: { fg: "#a070e0" attr: "b" } - shape_table: { fg: "#408aca" attr: "b" } - shape_variable: "#ba5aba" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#200a28" - foreground: "#ffcada" - cursor: "#ffa0a0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#606060' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#70d0a0' attr: 'b' } + empty: '#408aca' + bool: {|| if $in { '#caa0f0' } else { 'light_gray' } } + int: '#606060' + filesize: {|e| + if $e == 0b { + '#606060' + } else if $e < 1mb { + '#a070e0' + } else {{ fg: '#408aca' }} + } + duration: '#606060' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b04060' attr: 'b' } + } else if $in < 6hr { + '#b04060' + } else if $in < 1day { + '#ffb060' + } else if $in < 3day { + '#70d0a0' + } else if $in < 1wk { + { fg: '#70d0a0' attr: 'b' } + } else if $in < 6wk { + '#a070e0' + } else if $in < 52wk { + '#408aca' + } else { 'dark_gray' } + } + range: '#606060' + float: '#606060' + string: '#606060' + nothing: '#606060' + binary: '#606060' + cellpath: '#606060' + row_index: { fg: '#70d0a0' attr: 'b' } + record: '#606060' + list: '#606060' + block: '#606060' + hints: 'dark_gray' + search_result: { fg: '#b04060' bg: '#606060' } + + shape_and: { fg: '#ba5aba' attr: 'b' } + shape_binary: { fg: '#ba5aba' attr: 'b' } + shape_block: { fg: '#408aca' attr: 'b' } + shape_bool: '#caa0f0' + shape_custom: '#70d0a0' + shape_datetime: { fg: '#a070e0' attr: 'b' } + shape_directory: '#a070e0' + shape_external: '#a070e0' + shape_externalarg: { fg: '#70d0a0' attr: 'b' } + shape_filepath: '#a070e0' + shape_flag: { fg: '#408aca' attr: 'b' } + shape_float: { fg: '#ba5aba' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#a070e0' attr: 'b' } + shape_int: { fg: '#ba5aba' attr: 'b' } + shape_internalcall: { fg: '#a070e0' attr: 'b' } + shape_list: { fg: '#a070e0' attr: 'b' } + shape_literal: '#408aca' + shape_match_pattern: '#70d0a0' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#caa0f0' + shape_operator: '#ffb060' + shape_or: { fg: '#ba5aba' attr: 'b' } + shape_pipe: { fg: '#ba5aba' attr: 'b' } + shape_range: { fg: '#ffb060' attr: 'b' } + shape_record: { fg: '#a070e0' attr: 'b' } + shape_redirection: { fg: '#ba5aba' attr: 'b' } + shape_signature: { fg: '#70d0a0' attr: 'b' } + shape_string: '#70d0a0' + shape_string_interpolation: { fg: '#a070e0' attr: 'b' } + shape_table: { fg: '#408aca' attr: 'b' } + shape_variable: '#ba5aba' + + background: '#200a28' + foreground: '#ffcada' + cursor: '#ffa0a0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ir-black.nu b/themes/nu-themes/ir-black.nu index 018fe8b..0cc3f61 100644 --- a/themes/nu-themes/ir-black.nu +++ b/themes/nu-themes/ir-black.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b5b3aa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a8ff60" attr: "b" } - empty: "#96cbfe" - bool: {|| if $in { "#c6c5fe" } else { "light_gray" } } - int: "#b5b3aa" - filesize: {|e| - if $e == 0b { - "#b5b3aa" - } else if $e < 1mb { - "#c6c5fe" - } else {{ fg: "#96cbfe" }} - } - duration: "#b5b3aa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff6c60" attr: "b" } - } else if $in < 6hr { - "#ff6c60" - } else if $in < 1day { - "#ffffb6" - } else if $in < 3day { - "#a8ff60" - } else if $in < 1wk { - { fg: "#a8ff60" attr: "b" } - } else if $in < 6wk { - "#c6c5fe" - } else if $in < 52wk { - "#96cbfe" - } else { "dark_gray" } - } - range: "#b5b3aa" - float: "#b5b3aa" - string: "#b5b3aa" - nothing: "#b5b3aa" - binary: "#b5b3aa" - cellpath: "#b5b3aa" - row_index: { fg: "#a8ff60" attr: "b" } - record: "#b5b3aa" - list: "#b5b3aa" - block: "#b5b3aa" - hints: "dark_gray" - search_result: { fg: "#ff6c60" bg: "#b5b3aa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff73fd" attr: "b" } - shape_binary: { fg: "#ff73fd" attr: "b" } - shape_block: { fg: "#96cbfe" attr: "b" } - shape_bool: "#c6c5fe" - shape_custom: "#a8ff60" - shape_datetime: { fg: "#c6c5fe" attr: "b" } - shape_directory: "#c6c5fe" - shape_external: "#c6c5fe" - shape_externalarg: { fg: "#a8ff60" attr: "b" } - shape_filepath: "#c6c5fe" - shape_flag: { fg: "#96cbfe" attr: "b" } - shape_float: { fg: "#ff73fd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c6c5fe" attr: "b" } - shape_int: { fg: "#ff73fd" attr: "b" } - shape_internalcall: { fg: "#c6c5fe" attr: "b" } - shape_list: { fg: "#c6c5fe" attr: "b" } - shape_literal: "#96cbfe" - shape_match_pattern: "#a8ff60" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c6c5fe" - shape_operator: "#ffffb6" - shape_or: { fg: "#ff73fd" attr: "b" } - shape_pipe: { fg: "#ff73fd" attr: "b" } - shape_range: { fg: "#ffffb6" attr: "b" } - shape_record: { fg: "#c6c5fe" attr: "b" } - shape_redirection: { fg: "#ff73fd" attr: "b" } - shape_signature: { fg: "#a8ff60" attr: "b" } - shape_string: "#a8ff60" - shape_string_interpolation: { fg: "#c6c5fe" attr: "b" } - shape_table: { fg: "#96cbfe" attr: "b" } - shape_variable: "#ff73fd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#b5b3aa" - cursor: "#b5b3aa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b5b3aa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a8ff60' attr: 'b' } + empty: '#96cbfe' + bool: {|| if $in { '#c6c5fe' } else { 'light_gray' } } + int: '#b5b3aa' + filesize: {|e| + if $e == 0b { + '#b5b3aa' + } else if $e < 1mb { + '#c6c5fe' + } else {{ fg: '#96cbfe' }} + } + duration: '#b5b3aa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff6c60' attr: 'b' } + } else if $in < 6hr { + '#ff6c60' + } else if $in < 1day { + '#ffffb6' + } else if $in < 3day { + '#a8ff60' + } else if $in < 1wk { + { fg: '#a8ff60' attr: 'b' } + } else if $in < 6wk { + '#c6c5fe' + } else if $in < 52wk { + '#96cbfe' + } else { 'dark_gray' } + } + range: '#b5b3aa' + float: '#b5b3aa' + string: '#b5b3aa' + nothing: '#b5b3aa' + binary: '#b5b3aa' + cellpath: '#b5b3aa' + row_index: { fg: '#a8ff60' attr: 'b' } + record: '#b5b3aa' + list: '#b5b3aa' + block: '#b5b3aa' + hints: 'dark_gray' + search_result: { fg: '#ff6c60' bg: '#b5b3aa' } + + shape_and: { fg: '#ff73fd' attr: 'b' } + shape_binary: { fg: '#ff73fd' attr: 'b' } + shape_block: { fg: '#96cbfe' attr: 'b' } + shape_bool: '#c6c5fe' + shape_custom: '#a8ff60' + shape_datetime: { fg: '#c6c5fe' attr: 'b' } + shape_directory: '#c6c5fe' + shape_external: '#c6c5fe' + shape_externalarg: { fg: '#a8ff60' attr: 'b' } + shape_filepath: '#c6c5fe' + shape_flag: { fg: '#96cbfe' attr: 'b' } + shape_float: { fg: '#ff73fd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c6c5fe' attr: 'b' } + shape_int: { fg: '#ff73fd' attr: 'b' } + shape_internalcall: { fg: '#c6c5fe' attr: 'b' } + shape_list: { fg: '#c6c5fe' attr: 'b' } + shape_literal: '#96cbfe' + shape_match_pattern: '#a8ff60' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c6c5fe' + shape_operator: '#ffffb6' + shape_or: { fg: '#ff73fd' attr: 'b' } + shape_pipe: { fg: '#ff73fd' attr: 'b' } + shape_range: { fg: '#ffffb6' attr: 'b' } + shape_record: { fg: '#c6c5fe' attr: 'b' } + shape_redirection: { fg: '#ff73fd' attr: 'b' } + shape_signature: { fg: '#a8ff60' attr: 'b' } + shape_string: '#a8ff60' + shape_string_interpolation: { fg: '#c6c5fe' attr: 'b' } + shape_table: { fg: '#96cbfe' attr: 'b' } + shape_variable: '#ff73fd' + + background: '#000000' + foreground: '#b5b3aa' + cursor: '#b5b3aa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/irblack.nu b/themes/nu-themes/irblack.nu index 018fe8b..0cc3f61 100644 --- a/themes/nu-themes/irblack.nu +++ b/themes/nu-themes/irblack.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b5b3aa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a8ff60" attr: "b" } - empty: "#96cbfe" - bool: {|| if $in { "#c6c5fe" } else { "light_gray" } } - int: "#b5b3aa" - filesize: {|e| - if $e == 0b { - "#b5b3aa" - } else if $e < 1mb { - "#c6c5fe" - } else {{ fg: "#96cbfe" }} - } - duration: "#b5b3aa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff6c60" attr: "b" } - } else if $in < 6hr { - "#ff6c60" - } else if $in < 1day { - "#ffffb6" - } else if $in < 3day { - "#a8ff60" - } else if $in < 1wk { - { fg: "#a8ff60" attr: "b" } - } else if $in < 6wk { - "#c6c5fe" - } else if $in < 52wk { - "#96cbfe" - } else { "dark_gray" } - } - range: "#b5b3aa" - float: "#b5b3aa" - string: "#b5b3aa" - nothing: "#b5b3aa" - binary: "#b5b3aa" - cellpath: "#b5b3aa" - row_index: { fg: "#a8ff60" attr: "b" } - record: "#b5b3aa" - list: "#b5b3aa" - block: "#b5b3aa" - hints: "dark_gray" - search_result: { fg: "#ff6c60" bg: "#b5b3aa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff73fd" attr: "b" } - shape_binary: { fg: "#ff73fd" attr: "b" } - shape_block: { fg: "#96cbfe" attr: "b" } - shape_bool: "#c6c5fe" - shape_custom: "#a8ff60" - shape_datetime: { fg: "#c6c5fe" attr: "b" } - shape_directory: "#c6c5fe" - shape_external: "#c6c5fe" - shape_externalarg: { fg: "#a8ff60" attr: "b" } - shape_filepath: "#c6c5fe" - shape_flag: { fg: "#96cbfe" attr: "b" } - shape_float: { fg: "#ff73fd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c6c5fe" attr: "b" } - shape_int: { fg: "#ff73fd" attr: "b" } - shape_internalcall: { fg: "#c6c5fe" attr: "b" } - shape_list: { fg: "#c6c5fe" attr: "b" } - shape_literal: "#96cbfe" - shape_match_pattern: "#a8ff60" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#c6c5fe" - shape_operator: "#ffffb6" - shape_or: { fg: "#ff73fd" attr: "b" } - shape_pipe: { fg: "#ff73fd" attr: "b" } - shape_range: { fg: "#ffffb6" attr: "b" } - shape_record: { fg: "#c6c5fe" attr: "b" } - shape_redirection: { fg: "#ff73fd" attr: "b" } - shape_signature: { fg: "#a8ff60" attr: "b" } - shape_string: "#a8ff60" - shape_string_interpolation: { fg: "#c6c5fe" attr: "b" } - shape_table: { fg: "#96cbfe" attr: "b" } - shape_variable: "#ff73fd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#b5b3aa" - cursor: "#b5b3aa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b5b3aa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a8ff60' attr: 'b' } + empty: '#96cbfe' + bool: {|| if $in { '#c6c5fe' } else { 'light_gray' } } + int: '#b5b3aa' + filesize: {|e| + if $e == 0b { + '#b5b3aa' + } else if $e < 1mb { + '#c6c5fe' + } else {{ fg: '#96cbfe' }} + } + duration: '#b5b3aa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff6c60' attr: 'b' } + } else if $in < 6hr { + '#ff6c60' + } else if $in < 1day { + '#ffffb6' + } else if $in < 3day { + '#a8ff60' + } else if $in < 1wk { + { fg: '#a8ff60' attr: 'b' } + } else if $in < 6wk { + '#c6c5fe' + } else if $in < 52wk { + '#96cbfe' + } else { 'dark_gray' } + } + range: '#b5b3aa' + float: '#b5b3aa' + string: '#b5b3aa' + nothing: '#b5b3aa' + binary: '#b5b3aa' + cellpath: '#b5b3aa' + row_index: { fg: '#a8ff60' attr: 'b' } + record: '#b5b3aa' + list: '#b5b3aa' + block: '#b5b3aa' + hints: 'dark_gray' + search_result: { fg: '#ff6c60' bg: '#b5b3aa' } + + shape_and: { fg: '#ff73fd' attr: 'b' } + shape_binary: { fg: '#ff73fd' attr: 'b' } + shape_block: { fg: '#96cbfe' attr: 'b' } + shape_bool: '#c6c5fe' + shape_custom: '#a8ff60' + shape_datetime: { fg: '#c6c5fe' attr: 'b' } + shape_directory: '#c6c5fe' + shape_external: '#c6c5fe' + shape_externalarg: { fg: '#a8ff60' attr: 'b' } + shape_filepath: '#c6c5fe' + shape_flag: { fg: '#96cbfe' attr: 'b' } + shape_float: { fg: '#ff73fd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c6c5fe' attr: 'b' } + shape_int: { fg: '#ff73fd' attr: 'b' } + shape_internalcall: { fg: '#c6c5fe' attr: 'b' } + shape_list: { fg: '#c6c5fe' attr: 'b' } + shape_literal: '#96cbfe' + shape_match_pattern: '#a8ff60' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#c6c5fe' + shape_operator: '#ffffb6' + shape_or: { fg: '#ff73fd' attr: 'b' } + shape_pipe: { fg: '#ff73fd' attr: 'b' } + shape_range: { fg: '#ffffb6' attr: 'b' } + shape_record: { fg: '#c6c5fe' attr: 'b' } + shape_redirection: { fg: '#ff73fd' attr: 'b' } + shape_signature: { fg: '#a8ff60' attr: 'b' } + shape_string: '#a8ff60' + shape_string_interpolation: { fg: '#c6c5fe' attr: 'b' } + shape_table: { fg: '#96cbfe' attr: 'b' } + shape_variable: '#ff73fd' + + background: '#000000' + foreground: '#b5b3aa' + cursor: '#b5b3aa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/isotope.nu b/themes/nu-themes/isotope.nu index f17067f..dcb71ad 100644 --- a/themes/nu-themes/isotope.nu +++ b/themes/nu-themes/isotope.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#33ff00" attr: "b" } - empty: "#0066ff" - bool: {|| if $in { "#00ffff" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#00ffff" - } else {{ fg: "#0066ff" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0000" attr: "b" } - } else if $in < 6hr { - "#ff0000" - } else if $in < 1day { - "#ff0099" - } else if $in < 3day { - "#33ff00" - } else if $in < 1wk { - { fg: "#33ff00" attr: "b" } - } else if $in < 6wk { - "#00ffff" - } else if $in < 52wk { - "#0066ff" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#33ff00" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#ff0000" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc00ff" attr: "b" } - shape_binary: { fg: "#cc00ff" attr: "b" } - shape_block: { fg: "#0066ff" attr: "b" } - shape_bool: "#00ffff" - shape_custom: "#33ff00" - shape_datetime: { fg: "#00ffff" attr: "b" } - shape_directory: "#00ffff" - shape_external: "#00ffff" - shape_externalarg: { fg: "#33ff00" attr: "b" } - shape_filepath: "#00ffff" - shape_flag: { fg: "#0066ff" attr: "b" } - shape_float: { fg: "#cc00ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00ffff" attr: "b" } - shape_int: { fg: "#cc00ff" attr: "b" } - shape_internalcall: { fg: "#00ffff" attr: "b" } - shape_list: { fg: "#00ffff" attr: "b" } - shape_literal: "#0066ff" - shape_match_pattern: "#33ff00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ffff" - shape_operator: "#ff0099" - shape_or: { fg: "#cc00ff" attr: "b" } - shape_pipe: { fg: "#cc00ff" attr: "b" } - shape_range: { fg: "#ff0099" attr: "b" } - shape_record: { fg: "#00ffff" attr: "b" } - shape_redirection: { fg: "#cc00ff" attr: "b" } - shape_signature: { fg: "#33ff00" attr: "b" } - shape_string: "#33ff00" - shape_string_interpolation: { fg: "#00ffff" attr: "b" } - shape_table: { fg: "#0066ff" attr: "b" } - shape_variable: "#cc00ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#33ff00' attr: 'b' } + empty: '#0066ff' + bool: {|| if $in { '#00ffff' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#00ffff' + } else {{ fg: '#0066ff' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0000' attr: 'b' } + } else if $in < 6hr { + '#ff0000' + } else if $in < 1day { + '#ff0099' + } else if $in < 3day { + '#33ff00' + } else if $in < 1wk { + { fg: '#33ff00' attr: 'b' } + } else if $in < 6wk { + '#00ffff' + } else if $in < 52wk { + '#0066ff' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#33ff00' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#ff0000' bg: '#d0d0d0' } + + shape_and: { fg: '#cc00ff' attr: 'b' } + shape_binary: { fg: '#cc00ff' attr: 'b' } + shape_block: { fg: '#0066ff' attr: 'b' } + shape_bool: '#00ffff' + shape_custom: '#33ff00' + shape_datetime: { fg: '#00ffff' attr: 'b' } + shape_directory: '#00ffff' + shape_external: '#00ffff' + shape_externalarg: { fg: '#33ff00' attr: 'b' } + shape_filepath: '#00ffff' + shape_flag: { fg: '#0066ff' attr: 'b' } + shape_float: { fg: '#cc00ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00ffff' attr: 'b' } + shape_int: { fg: '#cc00ff' attr: 'b' } + shape_internalcall: { fg: '#00ffff' attr: 'b' } + shape_list: { fg: '#00ffff' attr: 'b' } + shape_literal: '#0066ff' + shape_match_pattern: '#33ff00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ffff' + shape_operator: '#ff0099' + shape_or: { fg: '#cc00ff' attr: 'b' } + shape_pipe: { fg: '#cc00ff' attr: 'b' } + shape_range: { fg: '#ff0099' attr: 'b' } + shape_record: { fg: '#00ffff' attr: 'b' } + shape_redirection: { fg: '#cc00ff' attr: 'b' } + shape_signature: { fg: '#33ff00' attr: 'b' } + shape_string: '#33ff00' + shape_string_interpolation: { fg: '#00ffff' attr: 'b' } + shape_table: { fg: '#0066ff' attr: 'b' } + shape_variable: '#cc00ff' + + background: '#000000' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/jackie-brown.nu b/themes/nu-themes/jackie-brown.nu index bd857cb..e3042bb 100644 --- a/themes/nu-themes/jackie-brown.nu +++ b/themes/nu-themes/jackie-brown.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2baf2b" attr: "b" } - empty: "#246eb2" - bool: {|| if $in { "#00e5e5" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#00acee" - } else {{ fg: "#246eb2" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ef5734" attr: "b" } - } else if $in < 6hr { - "#ef5734" - } else if $in < 1day { - "#bebf00" - } else if $in < 3day { - "#2baf2b" - } else if $in < 1wk { - { fg: "#2baf2b" attr: "b" } - } else if $in < 6wk { - "#00acee" - } else if $in < 52wk { - "#246eb2" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#2baf2b" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#ef5734" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d05ec1" attr: "b" } - shape_binary: { fg: "#d05ec1" attr: "b" } - shape_block: { fg: "#246eb2" attr: "b" } - shape_bool: "#00e5e5" - shape_custom: "#2baf2b" - shape_datetime: { fg: "#00acee" attr: "b" } - shape_directory: "#00acee" - shape_external: "#00acee" - shape_externalarg: { fg: "#2baf2b" attr: "b" } - shape_filepath: "#00acee" - shape_flag: { fg: "#246eb2" attr: "b" } - shape_float: { fg: "#d05ec1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00acee" attr: "b" } - shape_int: { fg: "#d05ec1" attr: "b" } - shape_internalcall: { fg: "#00acee" attr: "b" } - shape_list: { fg: "#00acee" attr: "b" } - shape_literal: "#246eb2" - shape_match_pattern: "#2baf2b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e5e5" - shape_operator: "#bebf00" - shape_or: { fg: "#d05ec1" attr: "b" } - shape_pipe: { fg: "#d05ec1" attr: "b" } - shape_range: { fg: "#bebf00" attr: "b" } - shape_record: { fg: "#00acee" attr: "b" } - shape_redirection: { fg: "#d05ec1" attr: "b" } - shape_signature: { fg: "#2baf2b" attr: "b" } - shape_string: "#2baf2b" - shape_string_interpolation: { fg: "#00acee" attr: "b" } - shape_table: { fg: "#246eb2" attr: "b" } - shape_variable: "#d05ec1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2c1d16" - foreground: "#ffcc2f" - cursor: "#ffcc2f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2baf2b' attr: 'b' } + empty: '#246eb2' + bool: {|| if $in { '#00e5e5' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#00acee' + } else {{ fg: '#246eb2' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ef5734' attr: 'b' } + } else if $in < 6hr { + '#ef5734' + } else if $in < 1day { + '#bebf00' + } else if $in < 3day { + '#2baf2b' + } else if $in < 1wk { + { fg: '#2baf2b' attr: 'b' } + } else if $in < 6wk { + '#00acee' + } else if $in < 52wk { + '#246eb2' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#2baf2b' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#ef5734' bg: '#bfbfbf' } + + shape_and: { fg: '#d05ec1' attr: 'b' } + shape_binary: { fg: '#d05ec1' attr: 'b' } + shape_block: { fg: '#246eb2' attr: 'b' } + shape_bool: '#00e5e5' + shape_custom: '#2baf2b' + shape_datetime: { fg: '#00acee' attr: 'b' } + shape_directory: '#00acee' + shape_external: '#00acee' + shape_externalarg: { fg: '#2baf2b' attr: 'b' } + shape_filepath: '#00acee' + shape_flag: { fg: '#246eb2' attr: 'b' } + shape_float: { fg: '#d05ec1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00acee' attr: 'b' } + shape_int: { fg: '#d05ec1' attr: 'b' } + shape_internalcall: { fg: '#00acee' attr: 'b' } + shape_list: { fg: '#00acee' attr: 'b' } + shape_literal: '#246eb2' + shape_match_pattern: '#2baf2b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e5e5' + shape_operator: '#bebf00' + shape_or: { fg: '#d05ec1' attr: 'b' } + shape_pipe: { fg: '#d05ec1' attr: 'b' } + shape_range: { fg: '#bebf00' attr: 'b' } + shape_record: { fg: '#00acee' attr: 'b' } + shape_redirection: { fg: '#d05ec1' attr: 'b' } + shape_signature: { fg: '#2baf2b' attr: 'b' } + shape_string: '#2baf2b' + shape_string_interpolation: { fg: '#00acee' attr: 'b' } + shape_table: { fg: '#246eb2' attr: 'b' } + shape_variable: '#d05ec1' + + background: '#2c1d16' + foreground: '#ffcc2f' + cursor: '#ffcc2f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/japanesque.nu b/themes/nu-themes/japanesque.nu index eafbef6..5b637b3 100644 --- a/themes/nu-themes/japanesque.nu +++ b/themes/nu-themes/japanesque.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fafaf6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7bb75b" attr: "b" } - empty: "#4c9ad4" - bool: {|| if $in { "#76bbca" } else { "light_gray" } } - int: "#fafaf6" - filesize: {|e| - if $e == 0b { - "#fafaf6" - } else if $e < 1mb { - "#389aad" - } else {{ fg: "#4c9ad4" }} - } - duration: "#fafaf6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf3f61" attr: "b" } - } else if $in < 6hr { - "#cf3f61" - } else if $in < 1day { - "#e9b32a" - } else if $in < 3day { - "#7bb75b" - } else if $in < 1wk { - { fg: "#7bb75b" attr: "b" } - } else if $in < 6wk { - "#389aad" - } else if $in < 52wk { - "#4c9ad4" - } else { "dark_gray" } - } - range: "#fafaf6" - float: "#fafaf6" - string: "#fafaf6" - nothing: "#fafaf6" - binary: "#fafaf6" - cellpath: "#fafaf6" - row_index: { fg: "#7bb75b" attr: "b" } - record: "#fafaf6" - list: "#fafaf6" - block: "#fafaf6" - hints: "dark_gray" - search_result: { fg: "#cf3f61" bg: "#fafaf6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a57fc4" attr: "b" } - shape_binary: { fg: "#a57fc4" attr: "b" } - shape_block: { fg: "#4c9ad4" attr: "b" } - shape_bool: "#76bbca" - shape_custom: "#7bb75b" - shape_datetime: { fg: "#389aad" attr: "b" } - shape_directory: "#389aad" - shape_external: "#389aad" - shape_externalarg: { fg: "#7bb75b" attr: "b" } - shape_filepath: "#389aad" - shape_flag: { fg: "#4c9ad4" attr: "b" } - shape_float: { fg: "#a57fc4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#389aad" attr: "b" } - shape_int: { fg: "#a57fc4" attr: "b" } - shape_internalcall: { fg: "#389aad" attr: "b" } - shape_list: { fg: "#389aad" attr: "b" } - shape_literal: "#4c9ad4" - shape_match_pattern: "#7bb75b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#76bbca" - shape_operator: "#e9b32a" - shape_or: { fg: "#a57fc4" attr: "b" } - shape_pipe: { fg: "#a57fc4" attr: "b" } - shape_range: { fg: "#e9b32a" attr: "b" } - shape_record: { fg: "#389aad" attr: "b" } - shape_redirection: { fg: "#a57fc4" attr: "b" } - shape_signature: { fg: "#7bb75b" attr: "b" } - shape_string: "#7bb75b" - shape_string_interpolation: { fg: "#389aad" attr: "b" } - shape_table: { fg: "#4c9ad4" attr: "b" } - shape_variable: "#a57fc4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e1e1e" - foreground: "#f7f6ec" - cursor: "#f7f6ec" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fafaf6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7bb75b' attr: 'b' } + empty: '#4c9ad4' + bool: {|| if $in { '#76bbca' } else { 'light_gray' } } + int: '#fafaf6' + filesize: {|e| + if $e == 0b { + '#fafaf6' + } else if $e < 1mb { + '#389aad' + } else {{ fg: '#4c9ad4' }} + } + duration: '#fafaf6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf3f61' attr: 'b' } + } else if $in < 6hr { + '#cf3f61' + } else if $in < 1day { + '#e9b32a' + } else if $in < 3day { + '#7bb75b' + } else if $in < 1wk { + { fg: '#7bb75b' attr: 'b' } + } else if $in < 6wk { + '#389aad' + } else if $in < 52wk { + '#4c9ad4' + } else { 'dark_gray' } + } + range: '#fafaf6' + float: '#fafaf6' + string: '#fafaf6' + nothing: '#fafaf6' + binary: '#fafaf6' + cellpath: '#fafaf6' + row_index: { fg: '#7bb75b' attr: 'b' } + record: '#fafaf6' + list: '#fafaf6' + block: '#fafaf6' + hints: 'dark_gray' + search_result: { fg: '#cf3f61' bg: '#fafaf6' } + + shape_and: { fg: '#a57fc4' attr: 'b' } + shape_binary: { fg: '#a57fc4' attr: 'b' } + shape_block: { fg: '#4c9ad4' attr: 'b' } + shape_bool: '#76bbca' + shape_custom: '#7bb75b' + shape_datetime: { fg: '#389aad' attr: 'b' } + shape_directory: '#389aad' + shape_external: '#389aad' + shape_externalarg: { fg: '#7bb75b' attr: 'b' } + shape_filepath: '#389aad' + shape_flag: { fg: '#4c9ad4' attr: 'b' } + shape_float: { fg: '#a57fc4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#389aad' attr: 'b' } + shape_int: { fg: '#a57fc4' attr: 'b' } + shape_internalcall: { fg: '#389aad' attr: 'b' } + shape_list: { fg: '#389aad' attr: 'b' } + shape_literal: '#4c9ad4' + shape_match_pattern: '#7bb75b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#76bbca' + shape_operator: '#e9b32a' + shape_or: { fg: '#a57fc4' attr: 'b' } + shape_pipe: { fg: '#a57fc4' attr: 'b' } + shape_range: { fg: '#e9b32a' attr: 'b' } + shape_record: { fg: '#389aad' attr: 'b' } + shape_redirection: { fg: '#a57fc4' attr: 'b' } + shape_signature: { fg: '#7bb75b' attr: 'b' } + shape_string: '#7bb75b' + shape_string_interpolation: { fg: '#389aad' attr: 'b' } + shape_table: { fg: '#4c9ad4' attr: 'b' } + shape_variable: '#a57fc4' + + background: '#1e1e1e' + foreground: '#f7f6ec' + cursor: '#f7f6ec' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/jellybeans.nu b/themes/nu-themes/jellybeans.nu index 8f9e183..3f956b0 100644 --- a/themes/nu-themes/jellybeans.nu +++ b/themes/nu-themes/jellybeans.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dedede" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#94b979" attr: "b" } - empty: "#97bedc" - bool: {|| if $in { "#1ab2a8" } else { "light_gray" } } - int: "#dedede" - filesize: {|e| - if $e == 0b { - "#dedede" - } else if $e < 1mb { - "#00988e" - } else {{ fg: "#97bedc" }} - } - duration: "#dedede" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e27373" attr: "b" } - } else if $in < 6hr { - "#e27373" - } else if $in < 1day { - "#ffba7b" - } else if $in < 3day { - "#94b979" - } else if $in < 1wk { - { fg: "#94b979" attr: "b" } - } else if $in < 6wk { - "#00988e" - } else if $in < 52wk { - "#97bedc" - } else { "dark_gray" } - } - range: "#dedede" - float: "#dedede" - string: "#dedede" - nothing: "#dedede" - binary: "#dedede" - cellpath: "#dedede" - row_index: { fg: "#94b979" attr: "b" } - record: "#dedede" - list: "#dedede" - block: "#dedede" - hints: "dark_gray" - search_result: { fg: "#e27373" bg: "#dedede" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e1c0fa" attr: "b" } - shape_binary: { fg: "#e1c0fa" attr: "b" } - shape_block: { fg: "#97bedc" attr: "b" } - shape_bool: "#1ab2a8" - shape_custom: "#94b979" - shape_datetime: { fg: "#00988e" attr: "b" } - shape_directory: "#00988e" - shape_external: "#00988e" - shape_externalarg: { fg: "#94b979" attr: "b" } - shape_filepath: "#00988e" - shape_flag: { fg: "#97bedc" attr: "b" } - shape_float: { fg: "#e1c0fa" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00988e" attr: "b" } - shape_int: { fg: "#e1c0fa" attr: "b" } - shape_internalcall: { fg: "#00988e" attr: "b" } - shape_list: { fg: "#00988e" attr: "b" } - shape_literal: "#97bedc" - shape_match_pattern: "#94b979" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1ab2a8" - shape_operator: "#ffba7b" - shape_or: { fg: "#e1c0fa" attr: "b" } - shape_pipe: { fg: "#e1c0fa" attr: "b" } - shape_range: { fg: "#ffba7b" attr: "b" } - shape_record: { fg: "#00988e" attr: "b" } - shape_redirection: { fg: "#e1c0fa" attr: "b" } - shape_signature: { fg: "#94b979" attr: "b" } - shape_string: "#94b979" - shape_string_interpolation: { fg: "#00988e" attr: "b" } - shape_table: { fg: "#97bedc" attr: "b" } - shape_variable: "#e1c0fa" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#121212" - foreground: "#dedede" - cursor: "#dedede" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dedede' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#94b979' attr: 'b' } + empty: '#97bedc' + bool: {|| if $in { '#1ab2a8' } else { 'light_gray' } } + int: '#dedede' + filesize: {|e| + if $e == 0b { + '#dedede' + } else if $e < 1mb { + '#00988e' + } else {{ fg: '#97bedc' }} + } + duration: '#dedede' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e27373' attr: 'b' } + } else if $in < 6hr { + '#e27373' + } else if $in < 1day { + '#ffba7b' + } else if $in < 3day { + '#94b979' + } else if $in < 1wk { + { fg: '#94b979' attr: 'b' } + } else if $in < 6wk { + '#00988e' + } else if $in < 52wk { + '#97bedc' + } else { 'dark_gray' } + } + range: '#dedede' + float: '#dedede' + string: '#dedede' + nothing: '#dedede' + binary: '#dedede' + cellpath: '#dedede' + row_index: { fg: '#94b979' attr: 'b' } + record: '#dedede' + list: '#dedede' + block: '#dedede' + hints: 'dark_gray' + search_result: { fg: '#e27373' bg: '#dedede' } + + shape_and: { fg: '#e1c0fa' attr: 'b' } + shape_binary: { fg: '#e1c0fa' attr: 'b' } + shape_block: { fg: '#97bedc' attr: 'b' } + shape_bool: '#1ab2a8' + shape_custom: '#94b979' + shape_datetime: { fg: '#00988e' attr: 'b' } + shape_directory: '#00988e' + shape_external: '#00988e' + shape_externalarg: { fg: '#94b979' attr: 'b' } + shape_filepath: '#00988e' + shape_flag: { fg: '#97bedc' attr: 'b' } + shape_float: { fg: '#e1c0fa' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00988e' attr: 'b' } + shape_int: { fg: '#e1c0fa' attr: 'b' } + shape_internalcall: { fg: '#00988e' attr: 'b' } + shape_list: { fg: '#00988e' attr: 'b' } + shape_literal: '#97bedc' + shape_match_pattern: '#94b979' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1ab2a8' + shape_operator: '#ffba7b' + shape_or: { fg: '#e1c0fa' attr: 'b' } + shape_pipe: { fg: '#e1c0fa' attr: 'b' } + shape_range: { fg: '#ffba7b' attr: 'b' } + shape_record: { fg: '#00988e' attr: 'b' } + shape_redirection: { fg: '#e1c0fa' attr: 'b' } + shape_signature: { fg: '#94b979' attr: 'b' } + shape_string: '#94b979' + shape_string_interpolation: { fg: '#00988e' attr: 'b' } + shape_table: { fg: '#97bedc' attr: 'b' } + shape_variable: '#e1c0fa' + + background: '#121212' + foreground: '#dedede' + cursor: '#dedede' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/jet-brains-darcula.nu b/themes/nu-themes/jet-brains-darcula.nu index f088948..c71b92b 100644 --- a/themes/nu-themes/jet-brains-darcula.nu +++ b/themes/nu-themes/jet-brains-darcula.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#adadad" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#126e00" attr: "b" } - empty: "#4581eb" - bool: {|| if $in { "#60d3d1" } else { "light_gray" } } - int: "#adadad" - filesize: {|e| - if $e == 0b { - "#adadad" - } else if $e < 1mb { - "#33c2c1" - } else {{ fg: "#4581eb" }} - } - duration: "#adadad" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fa5355" attr: "b" } - } else if $in < 6hr { - "#fa5355" - } else if $in < 1day { - "#c2c300" - } else if $in < 3day { - "#126e00" - } else if $in < 1wk { - { fg: "#126e00" attr: "b" } - } else if $in < 6wk { - "#33c2c1" - } else if $in < 52wk { - "#4581eb" - } else { "dark_gray" } - } - range: "#adadad" - float: "#adadad" - string: "#adadad" - nothing: "#adadad" - binary: "#adadad" - cellpath: "#adadad" - row_index: { fg: "#126e00" attr: "b" } - record: "#adadad" - list: "#adadad" - block: "#adadad" - hints: "dark_gray" - search_result: { fg: "#fa5355" bg: "#adadad" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fa54ff" attr: "b" } - shape_binary: { fg: "#fa54ff" attr: "b" } - shape_block: { fg: "#4581eb" attr: "b" } - shape_bool: "#60d3d1" - shape_custom: "#126e00" - shape_datetime: { fg: "#33c2c1" attr: "b" } - shape_directory: "#33c2c1" - shape_external: "#33c2c1" - shape_externalarg: { fg: "#126e00" attr: "b" } - shape_filepath: "#33c2c1" - shape_flag: { fg: "#4581eb" attr: "b" } - shape_float: { fg: "#fa54ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#33c2c1" attr: "b" } - shape_int: { fg: "#fa54ff" attr: "b" } - shape_internalcall: { fg: "#33c2c1" attr: "b" } - shape_list: { fg: "#33c2c1" attr: "b" } - shape_literal: "#4581eb" - shape_match_pattern: "#126e00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#60d3d1" - shape_operator: "#c2c300" - shape_or: { fg: "#fa54ff" attr: "b" } - shape_pipe: { fg: "#fa54ff" attr: "b" } - shape_range: { fg: "#c2c300" attr: "b" } - shape_record: { fg: "#33c2c1" attr: "b" } - shape_redirection: { fg: "#fa54ff" attr: "b" } - shape_signature: { fg: "#126e00" attr: "b" } - shape_string: "#126e00" - shape_string_interpolation: { fg: "#33c2c1" attr: "b" } - shape_table: { fg: "#4581eb" attr: "b" } - shape_variable: "#fa54ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#202020" - foreground: "#adadad" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#adadad' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#126e00' attr: 'b' } + empty: '#4581eb' + bool: {|| if $in { '#60d3d1' } else { 'light_gray' } } + int: '#adadad' + filesize: {|e| + if $e == 0b { + '#adadad' + } else if $e < 1mb { + '#33c2c1' + } else {{ fg: '#4581eb' }} + } + duration: '#adadad' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fa5355' attr: 'b' } + } else if $in < 6hr { + '#fa5355' + } else if $in < 1day { + '#c2c300' + } else if $in < 3day { + '#126e00' + } else if $in < 1wk { + { fg: '#126e00' attr: 'b' } + } else if $in < 6wk { + '#33c2c1' + } else if $in < 52wk { + '#4581eb' + } else { 'dark_gray' } + } + range: '#adadad' + float: '#adadad' + string: '#adadad' + nothing: '#adadad' + binary: '#adadad' + cellpath: '#adadad' + row_index: { fg: '#126e00' attr: 'b' } + record: '#adadad' + list: '#adadad' + block: '#adadad' + hints: 'dark_gray' + search_result: { fg: '#fa5355' bg: '#adadad' } + + shape_and: { fg: '#fa54ff' attr: 'b' } + shape_binary: { fg: '#fa54ff' attr: 'b' } + shape_block: { fg: '#4581eb' attr: 'b' } + shape_bool: '#60d3d1' + shape_custom: '#126e00' + shape_datetime: { fg: '#33c2c1' attr: 'b' } + shape_directory: '#33c2c1' + shape_external: '#33c2c1' + shape_externalarg: { fg: '#126e00' attr: 'b' } + shape_filepath: '#33c2c1' + shape_flag: { fg: '#4581eb' attr: 'b' } + shape_float: { fg: '#fa54ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#33c2c1' attr: 'b' } + shape_int: { fg: '#fa54ff' attr: 'b' } + shape_internalcall: { fg: '#33c2c1' attr: 'b' } + shape_list: { fg: '#33c2c1' attr: 'b' } + shape_literal: '#4581eb' + shape_match_pattern: '#126e00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#60d3d1' + shape_operator: '#c2c300' + shape_or: { fg: '#fa54ff' attr: 'b' } + shape_pipe: { fg: '#fa54ff' attr: 'b' } + shape_range: { fg: '#c2c300' attr: 'b' } + shape_record: { fg: '#33c2c1' attr: 'b' } + shape_redirection: { fg: '#fa54ff' attr: 'b' } + shape_signature: { fg: '#126e00' attr: 'b' } + shape_string: '#126e00' + shape_string_interpolation: { fg: '#33c2c1' attr: 'b' } + shape_table: { fg: '#4581eb' attr: 'b' } + shape_variable: '#fa54ff' + + background: '#202020' + foreground: '#adadad' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/jup.nu b/themes/nu-themes/jup.nu index a67bb71..94bdef5 100644 --- a/themes/nu-themes/jup.nu +++ b/themes/nu-themes/jup.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6fdd00" attr: "b" } - empty: "#006fdd" - bool: {|| if $in { "#74ffb9" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#00dd6f" - } else {{ fg: "#006fdd" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dd006f" attr: "b" } - } else if $in < 6hr { - "#dd006f" - } else if $in < 1day { - "#dd6f00" - } else if $in < 3day { - "#6fdd00" - } else if $in < 1wk { - { fg: "#6fdd00" attr: "b" } - } else if $in < 6wk { - "#00dd6f" - } else if $in < 52wk { - "#006fdd" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#6fdd00" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#dd006f" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6f00dd" attr: "b" } - shape_binary: { fg: "#6f00dd" attr: "b" } - shape_block: { fg: "#006fdd" attr: "b" } - shape_bool: "#74ffb9" - shape_custom: "#6fdd00" - shape_datetime: { fg: "#00dd6f" attr: "b" } - shape_directory: "#00dd6f" - shape_external: "#00dd6f" - shape_externalarg: { fg: "#6fdd00" attr: "b" } - shape_filepath: "#00dd6f" - shape_flag: { fg: "#006fdd" attr: "b" } - shape_float: { fg: "#6f00dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00dd6f" attr: "b" } - shape_int: { fg: "#6f00dd" attr: "b" } - shape_internalcall: { fg: "#00dd6f" attr: "b" } - shape_list: { fg: "#00dd6f" attr: "b" } - shape_literal: "#006fdd" - shape_match_pattern: "#6fdd00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#74ffb9" - shape_operator: "#dd6f00" - shape_or: { fg: "#6f00dd" attr: "b" } - shape_pipe: { fg: "#6f00dd" attr: "b" } - shape_range: { fg: "#dd6f00" attr: "b" } - shape_record: { fg: "#00dd6f" attr: "b" } - shape_redirection: { fg: "#6f00dd" attr: "b" } - shape_signature: { fg: "#6fdd00" attr: "b" } - shape_string: "#6fdd00" - shape_string_interpolation: { fg: "#00dd6f" attr: "b" } - shape_table: { fg: "#006fdd" attr: "b" } - shape_variable: "#6f00dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#758480" - foreground: "#23476a" - cursor: "#23476a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6fdd00' attr: 'b' } + empty: '#006fdd' + bool: {|| if $in { '#74ffb9' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#00dd6f' + } else {{ fg: '#006fdd' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dd006f' attr: 'b' } + } else if $in < 6hr { + '#dd006f' + } else if $in < 1day { + '#dd6f00' + } else if $in < 3day { + '#6fdd00' + } else if $in < 1wk { + { fg: '#6fdd00' attr: 'b' } + } else if $in < 6wk { + '#00dd6f' + } else if $in < 52wk { + '#006fdd' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#6fdd00' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#dd006f' bg: '#f2f2f2' } + + shape_and: { fg: '#6f00dd' attr: 'b' } + shape_binary: { fg: '#6f00dd' attr: 'b' } + shape_block: { fg: '#006fdd' attr: 'b' } + shape_bool: '#74ffb9' + shape_custom: '#6fdd00' + shape_datetime: { fg: '#00dd6f' attr: 'b' } + shape_directory: '#00dd6f' + shape_external: '#00dd6f' + shape_externalarg: { fg: '#6fdd00' attr: 'b' } + shape_filepath: '#00dd6f' + shape_flag: { fg: '#006fdd' attr: 'b' } + shape_float: { fg: '#6f00dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00dd6f' attr: 'b' } + shape_int: { fg: '#6f00dd' attr: 'b' } + shape_internalcall: { fg: '#00dd6f' attr: 'b' } + shape_list: { fg: '#00dd6f' attr: 'b' } + shape_literal: '#006fdd' + shape_match_pattern: '#6fdd00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#74ffb9' + shape_operator: '#dd6f00' + shape_or: { fg: '#6f00dd' attr: 'b' } + shape_pipe: { fg: '#6f00dd' attr: 'b' } + shape_range: { fg: '#dd6f00' attr: 'b' } + shape_record: { fg: '#00dd6f' attr: 'b' } + shape_redirection: { fg: '#6f00dd' attr: 'b' } + shape_signature: { fg: '#6fdd00' attr: 'b' } + shape_string: '#6fdd00' + shape_string_interpolation: { fg: '#00dd6f' attr: 'b' } + shape_table: { fg: '#006fdd' attr: 'b' } + shape_variable: '#6f00dd' + + background: '#758480' + foreground: '#23476a' + cursor: '#23476a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/kibble.nu b/themes/nu-themes/kibble.nu index 459b1ba..4a4d165 100644 --- a/themes/nu-themes/kibble.nu +++ b/themes/nu-themes/kibble.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e2d1e3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#29cf13" attr: "b" } - empty: "#3449d1" - bool: {|| if $in { "#68f2e0" } else { "light_gray" } } - int: "#e2d1e3" - filesize: {|e| - if $e == 0b { - "#e2d1e3" - } else if $e < 1mb { - "#0798ab" - } else {{ fg: "#3449d1" }} - } - duration: "#e2d1e3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c70031" attr: "b" } - } else if $in < 6hr { - "#c70031" - } else if $in < 1day { - "#d8e30e" - } else if $in < 3day { - "#29cf13" - } else if $in < 1wk { - { fg: "#29cf13" attr: "b" } - } else if $in < 6wk { - "#0798ab" - } else if $in < 52wk { - "#3449d1" - } else { "dark_gray" } - } - range: "#e2d1e3" - float: "#e2d1e3" - string: "#e2d1e3" - nothing: "#e2d1e3" - binary: "#e2d1e3" - cellpath: "#e2d1e3" - row_index: { fg: "#29cf13" attr: "b" } - record: "#e2d1e3" - list: "#e2d1e3" - block: "#e2d1e3" - hints: "dark_gray" - search_result: { fg: "#c70031" bg: "#e2d1e3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8400ff" attr: "b" } - shape_binary: { fg: "#8400ff" attr: "b" } - shape_block: { fg: "#3449d1" attr: "b" } - shape_bool: "#68f2e0" - shape_custom: "#29cf13" - shape_datetime: { fg: "#0798ab" attr: "b" } - shape_directory: "#0798ab" - shape_external: "#0798ab" - shape_externalarg: { fg: "#29cf13" attr: "b" } - shape_filepath: "#0798ab" - shape_flag: { fg: "#3449d1" attr: "b" } - shape_float: { fg: "#8400ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0798ab" attr: "b" } - shape_int: { fg: "#8400ff" attr: "b" } - shape_internalcall: { fg: "#0798ab" attr: "b" } - shape_list: { fg: "#0798ab" attr: "b" } - shape_literal: "#3449d1" - shape_match_pattern: "#29cf13" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#68f2e0" - shape_operator: "#d8e30e" - shape_or: { fg: "#8400ff" attr: "b" } - shape_pipe: { fg: "#8400ff" attr: "b" } - shape_range: { fg: "#d8e30e" attr: "b" } - shape_record: { fg: "#0798ab" attr: "b" } - shape_redirection: { fg: "#8400ff" attr: "b" } - shape_signature: { fg: "#29cf13" attr: "b" } - shape_string: "#29cf13" - shape_string_interpolation: { fg: "#0798ab" attr: "b" } - shape_table: { fg: "#3449d1" attr: "b" } - shape_variable: "#8400ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0e100a" - foreground: "#f7f7f7" - cursor: "#f7f7f7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e2d1e3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#29cf13' attr: 'b' } + empty: '#3449d1' + bool: {|| if $in { '#68f2e0' } else { 'light_gray' } } + int: '#e2d1e3' + filesize: {|e| + if $e == 0b { + '#e2d1e3' + } else if $e < 1mb { + '#0798ab' + } else {{ fg: '#3449d1' }} + } + duration: '#e2d1e3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c70031' attr: 'b' } + } else if $in < 6hr { + '#c70031' + } else if $in < 1day { + '#d8e30e' + } else if $in < 3day { + '#29cf13' + } else if $in < 1wk { + { fg: '#29cf13' attr: 'b' } + } else if $in < 6wk { + '#0798ab' + } else if $in < 52wk { + '#3449d1' + } else { 'dark_gray' } + } + range: '#e2d1e3' + float: '#e2d1e3' + string: '#e2d1e3' + nothing: '#e2d1e3' + binary: '#e2d1e3' + cellpath: '#e2d1e3' + row_index: { fg: '#29cf13' attr: 'b' } + record: '#e2d1e3' + list: '#e2d1e3' + block: '#e2d1e3' + hints: 'dark_gray' + search_result: { fg: '#c70031' bg: '#e2d1e3' } + + shape_and: { fg: '#8400ff' attr: 'b' } + shape_binary: { fg: '#8400ff' attr: 'b' } + shape_block: { fg: '#3449d1' attr: 'b' } + shape_bool: '#68f2e0' + shape_custom: '#29cf13' + shape_datetime: { fg: '#0798ab' attr: 'b' } + shape_directory: '#0798ab' + shape_external: '#0798ab' + shape_externalarg: { fg: '#29cf13' attr: 'b' } + shape_filepath: '#0798ab' + shape_flag: { fg: '#3449d1' attr: 'b' } + shape_float: { fg: '#8400ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0798ab' attr: 'b' } + shape_int: { fg: '#8400ff' attr: 'b' } + shape_internalcall: { fg: '#0798ab' attr: 'b' } + shape_list: { fg: '#0798ab' attr: 'b' } + shape_literal: '#3449d1' + shape_match_pattern: '#29cf13' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#68f2e0' + shape_operator: '#d8e30e' + shape_or: { fg: '#8400ff' attr: 'b' } + shape_pipe: { fg: '#8400ff' attr: 'b' } + shape_range: { fg: '#d8e30e' attr: 'b' } + shape_record: { fg: '#0798ab' attr: 'b' } + shape_redirection: { fg: '#8400ff' attr: 'b' } + shape_signature: { fg: '#29cf13' attr: 'b' } + shape_string: '#29cf13' + shape_string_interpolation: { fg: '#0798ab' attr: 'b' } + shape_table: { fg: '#3449d1' attr: 'b' } + shape_variable: '#8400ff' + + background: '#0e100a' + foreground: '#f7f7f7' + cursor: '#f7f7f7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/kimber.nu b/themes/nu-themes/kimber.nu index c7539bc..4d7dd29 100644 --- a/themes/nu-themes/kimber.nu +++ b/themes/nu-themes/kimber.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dedee7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#99c899" attr: "b" } - empty: "#537c9c" - bool: {|| if $in { "#78b4b4" } else { "light_gray" } } - int: "#dedee7" - filesize: {|e| - if $e == 0b { - "#dedee7" - } else if $e < 1mb { - "#78b4b4" - } else {{ fg: "#537c9c" }} - } - duration: "#dedee7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c88c8c" attr: "b" } - } else if $in < 6hr { - "#c88c8c" - } else if $in < 1day { - "#d8b56d" - } else if $in < 3day { - "#99c899" - } else if $in < 1wk { - { fg: "#99c899" attr: "b" } - } else if $in < 6wk { - "#78b4b4" - } else if $in < 52wk { - "#537c9c" - } else { "dark_gray" } - } - range: "#dedee7" - float: "#dedee7" - string: "#dedee7" - nothing: "#dedee7" - binary: "#dedee7" - cellpath: "#dedee7" - row_index: { fg: "#99c899" attr: "b" } - record: "#dedee7" - list: "#dedee7" - block: "#dedee7" - hints: "dark_gray" - search_result: { fg: "#c88c8c" bg: "#dedee7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#86cacd" attr: "b" } - shape_binary: { fg: "#86cacd" attr: "b" } - shape_block: { fg: "#537c9c" attr: "b" } - shape_bool: "#78b4b4" - shape_custom: "#99c899" - shape_datetime: { fg: "#78b4b4" attr: "b" } - shape_directory: "#78b4b4" - shape_external: "#78b4b4" - shape_externalarg: { fg: "#99c899" attr: "b" } - shape_filepath: "#78b4b4" - shape_flag: { fg: "#537c9c" attr: "b" } - shape_float: { fg: "#86cacd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#78b4b4" attr: "b" } - shape_int: { fg: "#86cacd" attr: "b" } - shape_internalcall: { fg: "#78b4b4" attr: "b" } - shape_list: { fg: "#78b4b4" attr: "b" } - shape_literal: "#537c9c" - shape_match_pattern: "#99c899" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#78b4b4" - shape_operator: "#d8b56d" - shape_or: { fg: "#86cacd" attr: "b" } - shape_pipe: { fg: "#86cacd" attr: "b" } - shape_range: { fg: "#d8b56d" attr: "b" } - shape_record: { fg: "#78b4b4" attr: "b" } - shape_redirection: { fg: "#86cacd" attr: "b" } - shape_signature: { fg: "#99c899" attr: "b" } - shape_string: "#99c899" - shape_string_interpolation: { fg: "#78b4b4" attr: "b" } - shape_table: { fg: "#537c9c" attr: "b" } - shape_variable: "#86cacd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#dedee7" - cursor: "#dedee7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dedee7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#99c899' attr: 'b' } + empty: '#537c9c' + bool: {|| if $in { '#78b4b4' } else { 'light_gray' } } + int: '#dedee7' + filesize: {|e| + if $e == 0b { + '#dedee7' + } else if $e < 1mb { + '#78b4b4' + } else {{ fg: '#537c9c' }} + } + duration: '#dedee7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c88c8c' attr: 'b' } + } else if $in < 6hr { + '#c88c8c' + } else if $in < 1day { + '#d8b56d' + } else if $in < 3day { + '#99c899' + } else if $in < 1wk { + { fg: '#99c899' attr: 'b' } + } else if $in < 6wk { + '#78b4b4' + } else if $in < 52wk { + '#537c9c' + } else { 'dark_gray' } + } + range: '#dedee7' + float: '#dedee7' + string: '#dedee7' + nothing: '#dedee7' + binary: '#dedee7' + cellpath: '#dedee7' + row_index: { fg: '#99c899' attr: 'b' } + record: '#dedee7' + list: '#dedee7' + block: '#dedee7' + hints: 'dark_gray' + search_result: { fg: '#c88c8c' bg: '#dedee7' } + + shape_and: { fg: '#86cacd' attr: 'b' } + shape_binary: { fg: '#86cacd' attr: 'b' } + shape_block: { fg: '#537c9c' attr: 'b' } + shape_bool: '#78b4b4' + shape_custom: '#99c899' + shape_datetime: { fg: '#78b4b4' attr: 'b' } + shape_directory: '#78b4b4' + shape_external: '#78b4b4' + shape_externalarg: { fg: '#99c899' attr: 'b' } + shape_filepath: '#78b4b4' + shape_flag: { fg: '#537c9c' attr: 'b' } + shape_float: { fg: '#86cacd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#78b4b4' attr: 'b' } + shape_int: { fg: '#86cacd' attr: 'b' } + shape_internalcall: { fg: '#78b4b4' attr: 'b' } + shape_list: { fg: '#78b4b4' attr: 'b' } + shape_literal: '#537c9c' + shape_match_pattern: '#99c899' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#78b4b4' + shape_operator: '#d8b56d' + shape_or: { fg: '#86cacd' attr: 'b' } + shape_pipe: { fg: '#86cacd' attr: 'b' } + shape_range: { fg: '#d8b56d' attr: 'b' } + shape_record: { fg: '#78b4b4' attr: 'b' } + shape_redirection: { fg: '#86cacd' attr: 'b' } + shape_signature: { fg: '#99c899' attr: 'b' } + shape_string: '#99c899' + shape_string_interpolation: { fg: '#78b4b4' attr: 'b' } + shape_table: { fg: '#537c9c' attr: 'b' } + shape_variable: '#86cacd' + + background: '#222222' + foreground: '#dedee7' + cursor: '#dedee7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/later-this-evening.nu b/themes/nu-themes/later-this-evening.nu index db6fa1a..95aa55a 100644 --- a/themes/nu-themes/later-this-evening.nu +++ b/themes/nu-themes/later-this-evening.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#3c3d3d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#afba67" attr: "b" } - empty: "#a0bad6" - bool: {|| if $in { "#5fc0ae" } else { "light_gray" } } - int: "#3c3d3d" - filesize: {|e| - if $e == 0b { - "#3c3d3d" - } else if $e < 1mb { - "#91bfb7" - } else {{ fg: "#a0bad6" }} - } - duration: "#3c3d3d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d45a60" attr: "b" } - } else if $in < 6hr { - "#d45a60" - } else if $in < 1day { - "#e5d289" - } else if $in < 3day { - "#afba67" - } else if $in < 1wk { - { fg: "#afba67" attr: "b" } - } else if $in < 6wk { - "#91bfb7" - } else if $in < 52wk { - "#a0bad6" - } else { "dark_gray" } - } - range: "#3c3d3d" - float: "#3c3d3d" - string: "#3c3d3d" - nothing: "#3c3d3d" - binary: "#3c3d3d" - cellpath: "#3c3d3d" - row_index: { fg: "#afba67" attr: "b" } - record: "#3c3d3d" - list: "#3c3d3d" - block: "#3c3d3d" - hints: "dark_gray" - search_result: { fg: "#d45a60" bg: "#3c3d3d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c092d6" attr: "b" } - shape_binary: { fg: "#c092d6" attr: "b" } - shape_block: { fg: "#a0bad6" attr: "b" } - shape_bool: "#5fc0ae" - shape_custom: "#afba67" - shape_datetime: { fg: "#91bfb7" attr: "b" } - shape_directory: "#91bfb7" - shape_external: "#91bfb7" - shape_externalarg: { fg: "#afba67" attr: "b" } - shape_filepath: "#91bfb7" - shape_flag: { fg: "#a0bad6" attr: "b" } - shape_float: { fg: "#c092d6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#91bfb7" attr: "b" } - shape_int: { fg: "#c092d6" attr: "b" } - shape_internalcall: { fg: "#91bfb7" attr: "b" } - shape_list: { fg: "#91bfb7" attr: "b" } - shape_literal: "#a0bad6" - shape_match_pattern: "#afba67" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5fc0ae" - shape_operator: "#e5d289" - shape_or: { fg: "#c092d6" attr: "b" } - shape_pipe: { fg: "#c092d6" attr: "b" } - shape_range: { fg: "#e5d289" attr: "b" } - shape_record: { fg: "#91bfb7" attr: "b" } - shape_redirection: { fg: "#c092d6" attr: "b" } - shape_signature: { fg: "#afba67" attr: "b" } - shape_string: "#afba67" - shape_string_interpolation: { fg: "#91bfb7" attr: "b" } - shape_table: { fg: "#a0bad6" attr: "b" } - shape_variable: "#c092d6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#959595" - cursor: "#959595" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#3c3d3d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#afba67' attr: 'b' } + empty: '#a0bad6' + bool: {|| if $in { '#5fc0ae' } else { 'light_gray' } } + int: '#3c3d3d' + filesize: {|e| + if $e == 0b { + '#3c3d3d' + } else if $e < 1mb { + '#91bfb7' + } else {{ fg: '#a0bad6' }} + } + duration: '#3c3d3d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d45a60' attr: 'b' } + } else if $in < 6hr { + '#d45a60' + } else if $in < 1day { + '#e5d289' + } else if $in < 3day { + '#afba67' + } else if $in < 1wk { + { fg: '#afba67' attr: 'b' } + } else if $in < 6wk { + '#91bfb7' + } else if $in < 52wk { + '#a0bad6' + } else { 'dark_gray' } + } + range: '#3c3d3d' + float: '#3c3d3d' + string: '#3c3d3d' + nothing: '#3c3d3d' + binary: '#3c3d3d' + cellpath: '#3c3d3d' + row_index: { fg: '#afba67' attr: 'b' } + record: '#3c3d3d' + list: '#3c3d3d' + block: '#3c3d3d' + hints: 'dark_gray' + search_result: { fg: '#d45a60' bg: '#3c3d3d' } + + shape_and: { fg: '#c092d6' attr: 'b' } + shape_binary: { fg: '#c092d6' attr: 'b' } + shape_block: { fg: '#a0bad6' attr: 'b' } + shape_bool: '#5fc0ae' + shape_custom: '#afba67' + shape_datetime: { fg: '#91bfb7' attr: 'b' } + shape_directory: '#91bfb7' + shape_external: '#91bfb7' + shape_externalarg: { fg: '#afba67' attr: 'b' } + shape_filepath: '#91bfb7' + shape_flag: { fg: '#a0bad6' attr: 'b' } + shape_float: { fg: '#c092d6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#91bfb7' attr: 'b' } + shape_int: { fg: '#c092d6' attr: 'b' } + shape_internalcall: { fg: '#91bfb7' attr: 'b' } + shape_list: { fg: '#91bfb7' attr: 'b' } + shape_literal: '#a0bad6' + shape_match_pattern: '#afba67' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5fc0ae' + shape_operator: '#e5d289' + shape_or: { fg: '#c092d6' attr: 'b' } + shape_pipe: { fg: '#c092d6' attr: 'b' } + shape_range: { fg: '#e5d289' attr: 'b' } + shape_record: { fg: '#91bfb7' attr: 'b' } + shape_redirection: { fg: '#c092d6' attr: 'b' } + shape_signature: { fg: '#afba67' attr: 'b' } + shape_string: '#afba67' + shape_string_interpolation: { fg: '#91bfb7' attr: 'b' } + shape_table: { fg: '#a0bad6' attr: 'b' } + shape_variable: '#c092d6' + + background: '#222222' + foreground: '#959595' + cursor: '#959595' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/lavandula.nu b/themes/nu-themes/lavandula.nu index d2f33d8..660606c 100644 --- a/themes/nu-themes/lavandula.nu +++ b/themes/nu-themes/lavandula.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#736e7d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#337e6f" attr: "b" } - empty: "#4f4a7f" - bool: {|| if $in { "#9ad4e0" } else { "light_gray" } } - int: "#736e7d" - filesize: {|e| - if $e == 0b { - "#736e7d" - } else if $e < 1mb { - "#58777f" - } else {{ fg: "#4f4a7f" }} - } - duration: "#736e7d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#7d1625" attr: "b" } - } else if $in < 6hr { - "#7d1625" - } else if $in < 1day { - "#7f6f49" - } else if $in < 3day { - "#337e6f" - } else if $in < 1wk { - { fg: "#337e6f" attr: "b" } - } else if $in < 6wk { - "#58777f" - } else if $in < 52wk { - "#4f4a7f" - } else { "dark_gray" } - } - range: "#736e7d" - float: "#736e7d" - string: "#736e7d" - nothing: "#736e7d" - binary: "#736e7d" - cellpath: "#736e7d" - row_index: { fg: "#337e6f" attr: "b" } - record: "#736e7d" - list: "#736e7d" - block: "#736e7d" - hints: "dark_gray" - search_result: { fg: "#7d1625" bg: "#736e7d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#5a3f7f" attr: "b" } - shape_binary: { fg: "#5a3f7f" attr: "b" } - shape_block: { fg: "#4f4a7f" attr: "b" } - shape_bool: "#9ad4e0" - shape_custom: "#337e6f" - shape_datetime: { fg: "#58777f" attr: "b" } - shape_directory: "#58777f" - shape_external: "#58777f" - shape_externalarg: { fg: "#337e6f" attr: "b" } - shape_filepath: "#58777f" - shape_flag: { fg: "#4f4a7f" attr: "b" } - shape_float: { fg: "#5a3f7f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#58777f" attr: "b" } - shape_int: { fg: "#5a3f7f" attr: "b" } - shape_internalcall: { fg: "#58777f" attr: "b" } - shape_list: { fg: "#58777f" attr: "b" } - shape_literal: "#4f4a7f" - shape_match_pattern: "#337e6f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#9ad4e0" - shape_operator: "#7f6f49" - shape_or: { fg: "#5a3f7f" attr: "b" } - shape_pipe: { fg: "#5a3f7f" attr: "b" } - shape_range: { fg: "#7f6f49" attr: "b" } - shape_record: { fg: "#58777f" attr: "b" } - shape_redirection: { fg: "#5a3f7f" attr: "b" } - shape_signature: { fg: "#337e6f" attr: "b" } - shape_string: "#337e6f" - shape_string_interpolation: { fg: "#58777f" attr: "b" } - shape_table: { fg: "#4f4a7f" attr: "b" } - shape_variable: "#5a3f7f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#050014" - foreground: "#736e7d" - cursor: "#736e7d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#736e7d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#337e6f' attr: 'b' } + empty: '#4f4a7f' + bool: {|| if $in { '#9ad4e0' } else { 'light_gray' } } + int: '#736e7d' + filesize: {|e| + if $e == 0b { + '#736e7d' + } else if $e < 1mb { + '#58777f' + } else {{ fg: '#4f4a7f' }} + } + duration: '#736e7d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#7d1625' attr: 'b' } + } else if $in < 6hr { + '#7d1625' + } else if $in < 1day { + '#7f6f49' + } else if $in < 3day { + '#337e6f' + } else if $in < 1wk { + { fg: '#337e6f' attr: 'b' } + } else if $in < 6wk { + '#58777f' + } else if $in < 52wk { + '#4f4a7f' + } else { 'dark_gray' } + } + range: '#736e7d' + float: '#736e7d' + string: '#736e7d' + nothing: '#736e7d' + binary: '#736e7d' + cellpath: '#736e7d' + row_index: { fg: '#337e6f' attr: 'b' } + record: '#736e7d' + list: '#736e7d' + block: '#736e7d' + hints: 'dark_gray' + search_result: { fg: '#7d1625' bg: '#736e7d' } + + shape_and: { fg: '#5a3f7f' attr: 'b' } + shape_binary: { fg: '#5a3f7f' attr: 'b' } + shape_block: { fg: '#4f4a7f' attr: 'b' } + shape_bool: '#9ad4e0' + shape_custom: '#337e6f' + shape_datetime: { fg: '#58777f' attr: 'b' } + shape_directory: '#58777f' + shape_external: '#58777f' + shape_externalarg: { fg: '#337e6f' attr: 'b' } + shape_filepath: '#58777f' + shape_flag: { fg: '#4f4a7f' attr: 'b' } + shape_float: { fg: '#5a3f7f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#58777f' attr: 'b' } + shape_int: { fg: '#5a3f7f' attr: 'b' } + shape_internalcall: { fg: '#58777f' attr: 'b' } + shape_list: { fg: '#58777f' attr: 'b' } + shape_literal: '#4f4a7f' + shape_match_pattern: '#337e6f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#9ad4e0' + shape_operator: '#7f6f49' + shape_or: { fg: '#5a3f7f' attr: 'b' } + shape_pipe: { fg: '#5a3f7f' attr: 'b' } + shape_range: { fg: '#7f6f49' attr: 'b' } + shape_record: { fg: '#58777f' attr: 'b' } + shape_redirection: { fg: '#5a3f7f' attr: 'b' } + shape_signature: { fg: '#337e6f' attr: 'b' } + shape_string: '#337e6f' + shape_string_interpolation: { fg: '#58777f' attr: 'b' } + shape_table: { fg: '#4f4a7f' attr: 'b' } + shape_variable: '#5a3f7f' + + background: '#050014' + foreground: '#736e7d' + cursor: '#736e7d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/liquid-carbon-transparent.nu b/themes/nu-themes/liquid-carbon-transparent.nu index 292f975..b63ee81 100644 --- a/themes/nu-themes/liquid-carbon-transparent.nu +++ b/themes/nu-themes/liquid-carbon-transparent.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#559a70" attr: "b" } - empty: "#0099cc" - bool: {|| if $in { "#7ac4cc" } else { "light_gray" } } - int: "#bccccc" - filesize: {|e| - if $e == 0b { - "#bccccc" - } else if $e < 1mb { - "#7ac4cc" - } else {{ fg: "#0099cc" }} - } - duration: "#bccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3030" attr: "b" } - } else if $in < 6hr { - "#ff3030" - } else if $in < 1day { - "#ccac00" - } else if $in < 3day { - "#559a70" - } else if $in < 1wk { - { fg: "#559a70" attr: "b" } - } else if $in < 6wk { - "#7ac4cc" - } else if $in < 52wk { - "#0099cc" - } else { "dark_gray" } - } - range: "#bccccc" - float: "#bccccc" - string: "#bccccc" - nothing: "#bccccc" - binary: "#bccccc" - cellpath: "#bccccc" - row_index: { fg: "#559a70" attr: "b" } - record: "#bccccc" - list: "#bccccc" - block: "#bccccc" - hints: "dark_gray" - search_result: { fg: "#ff3030" bg: "#bccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc69c8" attr: "b" } - shape_binary: { fg: "#cc69c8" attr: "b" } - shape_block: { fg: "#0099cc" attr: "b" } - shape_bool: "#7ac4cc" - shape_custom: "#559a70" - shape_datetime: { fg: "#7ac4cc" attr: "b" } - shape_directory: "#7ac4cc" - shape_external: "#7ac4cc" - shape_externalarg: { fg: "#559a70" attr: "b" } - shape_filepath: "#7ac4cc" - shape_flag: { fg: "#0099cc" attr: "b" } - shape_float: { fg: "#cc69c8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7ac4cc" attr: "b" } - shape_int: { fg: "#cc69c8" attr: "b" } - shape_internalcall: { fg: "#7ac4cc" attr: "b" } - shape_list: { fg: "#7ac4cc" attr: "b" } - shape_literal: "#0099cc" - shape_match_pattern: "#559a70" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7ac4cc" - shape_operator: "#ccac00" - shape_or: { fg: "#cc69c8" attr: "b" } - shape_pipe: { fg: "#cc69c8" attr: "b" } - shape_range: { fg: "#ccac00" attr: "b" } - shape_record: { fg: "#7ac4cc" attr: "b" } - shape_redirection: { fg: "#cc69c8" attr: "b" } - shape_signature: { fg: "#559a70" attr: "b" } - shape_string: "#559a70" - shape_string_interpolation: { fg: "#7ac4cc" attr: "b" } - shape_table: { fg: "#0099cc" attr: "b" } - shape_variable: "#cc69c8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#afc2c2" - cursor: "#afc2c2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#559a70' attr: 'b' } + empty: '#0099cc' + bool: {|| if $in { '#7ac4cc' } else { 'light_gray' } } + int: '#bccccc' + filesize: {|e| + if $e == 0b { + '#bccccc' + } else if $e < 1mb { + '#7ac4cc' + } else {{ fg: '#0099cc' }} + } + duration: '#bccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3030' attr: 'b' } + } else if $in < 6hr { + '#ff3030' + } else if $in < 1day { + '#ccac00' + } else if $in < 3day { + '#559a70' + } else if $in < 1wk { + { fg: '#559a70' attr: 'b' } + } else if $in < 6wk { + '#7ac4cc' + } else if $in < 52wk { + '#0099cc' + } else { 'dark_gray' } + } + range: '#bccccc' + float: '#bccccc' + string: '#bccccc' + nothing: '#bccccc' + binary: '#bccccc' + cellpath: '#bccccc' + row_index: { fg: '#559a70' attr: 'b' } + record: '#bccccc' + list: '#bccccc' + block: '#bccccc' + hints: 'dark_gray' + search_result: { fg: '#ff3030' bg: '#bccccc' } + + shape_and: { fg: '#cc69c8' attr: 'b' } + shape_binary: { fg: '#cc69c8' attr: 'b' } + shape_block: { fg: '#0099cc' attr: 'b' } + shape_bool: '#7ac4cc' + shape_custom: '#559a70' + shape_datetime: { fg: '#7ac4cc' attr: 'b' } + shape_directory: '#7ac4cc' + shape_external: '#7ac4cc' + shape_externalarg: { fg: '#559a70' attr: 'b' } + shape_filepath: '#7ac4cc' + shape_flag: { fg: '#0099cc' attr: 'b' } + shape_float: { fg: '#cc69c8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7ac4cc' attr: 'b' } + shape_int: { fg: '#cc69c8' attr: 'b' } + shape_internalcall: { fg: '#7ac4cc' attr: 'b' } + shape_list: { fg: '#7ac4cc' attr: 'b' } + shape_literal: '#0099cc' + shape_match_pattern: '#559a70' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7ac4cc' + shape_operator: '#ccac00' + shape_or: { fg: '#cc69c8' attr: 'b' } + shape_pipe: { fg: '#cc69c8' attr: 'b' } + shape_range: { fg: '#ccac00' attr: 'b' } + shape_record: { fg: '#7ac4cc' attr: 'b' } + shape_redirection: { fg: '#cc69c8' attr: 'b' } + shape_signature: { fg: '#559a70' attr: 'b' } + shape_string: '#559a70' + shape_string_interpolation: { fg: '#7ac4cc' attr: 'b' } + shape_table: { fg: '#0099cc' attr: 'b' } + shape_variable: '#cc69c8' + + background: '#000000' + foreground: '#afc2c2' + cursor: '#afc2c2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/liquid-carbon.nu b/themes/nu-themes/liquid-carbon.nu index 9928527..78de2c9 100644 --- a/themes/nu-themes/liquid-carbon.nu +++ b/themes/nu-themes/liquid-carbon.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#559a70" attr: "b" } - empty: "#0099cc" - bool: {|| if $in { "#7ac4cc" } else { "light_gray" } } - int: "#bccccc" - filesize: {|e| - if $e == 0b { - "#bccccc" - } else if $e < 1mb { - "#7ac4cc" - } else {{ fg: "#0099cc" }} - } - duration: "#bccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3030" attr: "b" } - } else if $in < 6hr { - "#ff3030" - } else if $in < 1day { - "#ccac00" - } else if $in < 3day { - "#559a70" - } else if $in < 1wk { - { fg: "#559a70" attr: "b" } - } else if $in < 6wk { - "#7ac4cc" - } else if $in < 52wk { - "#0099cc" - } else { "dark_gray" } - } - range: "#bccccc" - float: "#bccccc" - string: "#bccccc" - nothing: "#bccccc" - binary: "#bccccc" - cellpath: "#bccccc" - row_index: { fg: "#559a70" attr: "b" } - record: "#bccccc" - list: "#bccccc" - block: "#bccccc" - hints: "dark_gray" - search_result: { fg: "#ff3030" bg: "#bccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc69c8" attr: "b" } - shape_binary: { fg: "#cc69c8" attr: "b" } - shape_block: { fg: "#0099cc" attr: "b" } - shape_bool: "#7ac4cc" - shape_custom: "#559a70" - shape_datetime: { fg: "#7ac4cc" attr: "b" } - shape_directory: "#7ac4cc" - shape_external: "#7ac4cc" - shape_externalarg: { fg: "#559a70" attr: "b" } - shape_filepath: "#7ac4cc" - shape_flag: { fg: "#0099cc" attr: "b" } - shape_float: { fg: "#cc69c8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7ac4cc" attr: "b" } - shape_int: { fg: "#cc69c8" attr: "b" } - shape_internalcall: { fg: "#7ac4cc" attr: "b" } - shape_list: { fg: "#7ac4cc" attr: "b" } - shape_literal: "#0099cc" - shape_match_pattern: "#559a70" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7ac4cc" - shape_operator: "#ccac00" - shape_or: { fg: "#cc69c8" attr: "b" } - shape_pipe: { fg: "#cc69c8" attr: "b" } - shape_range: { fg: "#ccac00" attr: "b" } - shape_record: { fg: "#7ac4cc" attr: "b" } - shape_redirection: { fg: "#cc69c8" attr: "b" } - shape_signature: { fg: "#559a70" attr: "b" } - shape_string: "#559a70" - shape_string_interpolation: { fg: "#7ac4cc" attr: "b" } - shape_table: { fg: "#0099cc" attr: "b" } - shape_variable: "#cc69c8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#303030" - foreground: "#afc2c2" - cursor: "#afc2c2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#559a70' attr: 'b' } + empty: '#0099cc' + bool: {|| if $in { '#7ac4cc' } else { 'light_gray' } } + int: '#bccccc' + filesize: {|e| + if $e == 0b { + '#bccccc' + } else if $e < 1mb { + '#7ac4cc' + } else {{ fg: '#0099cc' }} + } + duration: '#bccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3030' attr: 'b' } + } else if $in < 6hr { + '#ff3030' + } else if $in < 1day { + '#ccac00' + } else if $in < 3day { + '#559a70' + } else if $in < 1wk { + { fg: '#559a70' attr: 'b' } + } else if $in < 6wk { + '#7ac4cc' + } else if $in < 52wk { + '#0099cc' + } else { 'dark_gray' } + } + range: '#bccccc' + float: '#bccccc' + string: '#bccccc' + nothing: '#bccccc' + binary: '#bccccc' + cellpath: '#bccccc' + row_index: { fg: '#559a70' attr: 'b' } + record: '#bccccc' + list: '#bccccc' + block: '#bccccc' + hints: 'dark_gray' + search_result: { fg: '#ff3030' bg: '#bccccc' } + + shape_and: { fg: '#cc69c8' attr: 'b' } + shape_binary: { fg: '#cc69c8' attr: 'b' } + shape_block: { fg: '#0099cc' attr: 'b' } + shape_bool: '#7ac4cc' + shape_custom: '#559a70' + shape_datetime: { fg: '#7ac4cc' attr: 'b' } + shape_directory: '#7ac4cc' + shape_external: '#7ac4cc' + shape_externalarg: { fg: '#559a70' attr: 'b' } + shape_filepath: '#7ac4cc' + shape_flag: { fg: '#0099cc' attr: 'b' } + shape_float: { fg: '#cc69c8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7ac4cc' attr: 'b' } + shape_int: { fg: '#cc69c8' attr: 'b' } + shape_internalcall: { fg: '#7ac4cc' attr: 'b' } + shape_list: { fg: '#7ac4cc' attr: 'b' } + shape_literal: '#0099cc' + shape_match_pattern: '#559a70' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7ac4cc' + shape_operator: '#ccac00' + shape_or: { fg: '#cc69c8' attr: 'b' } + shape_pipe: { fg: '#cc69c8' attr: 'b' } + shape_range: { fg: '#ccac00' attr: 'b' } + shape_record: { fg: '#7ac4cc' attr: 'b' } + shape_redirection: { fg: '#cc69c8' attr: 'b' } + shape_signature: { fg: '#559a70' attr: 'b' } + shape_string: '#559a70' + shape_string_interpolation: { fg: '#7ac4cc' attr: 'b' } + shape_table: { fg: '#0099cc' attr: 'b' } + shape_variable: '#cc69c8' + + background: '#303030' + foreground: '#afc2c2' + cursor: '#afc2c2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/london-tube.nu b/themes/nu-themes/london-tube.nu index 7510db3..f1fa698 100644 --- a/themes/nu-themes/london-tube.nu +++ b/themes/nu-themes/london-tube.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d8d8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00853e" attr: "b" } - empty: "#009ddc" - bool: {|| if $in { "#85cebc" } else { "light_gray" } } - int: "#d9d8d8" - filesize: {|e| - if $e == 0b { - "#d9d8d8" - } else if $e < 1mb { - "#85cebc" - } else {{ fg: "#009ddc" }} - } - duration: "#d9d8d8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ee2e24" attr: "b" } - } else if $in < 6hr { - "#ee2e24" - } else if $in < 1day { - "#ffd204" - } else if $in < 3day { - "#00853e" - } else if $in < 1wk { - { fg: "#00853e" attr: "b" } - } else if $in < 6wk { - "#85cebc" - } else if $in < 52wk { - "#009ddc" - } else { "dark_gray" } - } - range: "#d9d8d8" - float: "#d9d8d8" - string: "#d9d8d8" - nothing: "#d9d8d8" - binary: "#d9d8d8" - cellpath: "#d9d8d8" - row_index: { fg: "#00853e" attr: "b" } - record: "#d9d8d8" - list: "#d9d8d8" - block: "#d9d8d8" - hints: "dark_gray" - search_result: { fg: "#ee2e24" bg: "#d9d8d8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#98005d" attr: "b" } - shape_binary: { fg: "#98005d" attr: "b" } - shape_block: { fg: "#009ddc" attr: "b" } - shape_bool: "#85cebc" - shape_custom: "#00853e" - shape_datetime: { fg: "#85cebc" attr: "b" } - shape_directory: "#85cebc" - shape_external: "#85cebc" - shape_externalarg: { fg: "#00853e" attr: "b" } - shape_filepath: "#85cebc" - shape_flag: { fg: "#009ddc" attr: "b" } - shape_float: { fg: "#98005d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#85cebc" attr: "b" } - shape_int: { fg: "#98005d" attr: "b" } - shape_internalcall: { fg: "#85cebc" attr: "b" } - shape_list: { fg: "#85cebc" attr: "b" } - shape_literal: "#009ddc" - shape_match_pattern: "#00853e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#85cebc" - shape_operator: "#ffd204" - shape_or: { fg: "#98005d" attr: "b" } - shape_pipe: { fg: "#98005d" attr: "b" } - shape_range: { fg: "#ffd204" attr: "b" } - shape_record: { fg: "#85cebc" attr: "b" } - shape_redirection: { fg: "#98005d" attr: "b" } - shape_signature: { fg: "#00853e" attr: "b" } - shape_string: "#00853e" - shape_string_interpolation: { fg: "#85cebc" attr: "b" } - shape_table: { fg: "#009ddc" attr: "b" } - shape_variable: "#98005d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#231f20" - foreground: "#d9d8d8" - cursor: "#d9d8d8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d8d8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00853e' attr: 'b' } + empty: '#009ddc' + bool: {|| if $in { '#85cebc' } else { 'light_gray' } } + int: '#d9d8d8' + filesize: {|e| + if $e == 0b { + '#d9d8d8' + } else if $e < 1mb { + '#85cebc' + } else {{ fg: '#009ddc' }} + } + duration: '#d9d8d8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ee2e24' attr: 'b' } + } else if $in < 6hr { + '#ee2e24' + } else if $in < 1day { + '#ffd204' + } else if $in < 3day { + '#00853e' + } else if $in < 1wk { + { fg: '#00853e' attr: 'b' } + } else if $in < 6wk { + '#85cebc' + } else if $in < 52wk { + '#009ddc' + } else { 'dark_gray' } + } + range: '#d9d8d8' + float: '#d9d8d8' + string: '#d9d8d8' + nothing: '#d9d8d8' + binary: '#d9d8d8' + cellpath: '#d9d8d8' + row_index: { fg: '#00853e' attr: 'b' } + record: '#d9d8d8' + list: '#d9d8d8' + block: '#d9d8d8' + hints: 'dark_gray' + search_result: { fg: '#ee2e24' bg: '#d9d8d8' } + + shape_and: { fg: '#98005d' attr: 'b' } + shape_binary: { fg: '#98005d' attr: 'b' } + shape_block: { fg: '#009ddc' attr: 'b' } + shape_bool: '#85cebc' + shape_custom: '#00853e' + shape_datetime: { fg: '#85cebc' attr: 'b' } + shape_directory: '#85cebc' + shape_external: '#85cebc' + shape_externalarg: { fg: '#00853e' attr: 'b' } + shape_filepath: '#85cebc' + shape_flag: { fg: '#009ddc' attr: 'b' } + shape_float: { fg: '#98005d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#85cebc' attr: 'b' } + shape_int: { fg: '#98005d' attr: 'b' } + shape_internalcall: { fg: '#85cebc' attr: 'b' } + shape_list: { fg: '#85cebc' attr: 'b' } + shape_literal: '#009ddc' + shape_match_pattern: '#00853e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#85cebc' + shape_operator: '#ffd204' + shape_or: { fg: '#98005d' attr: 'b' } + shape_pipe: { fg: '#98005d' attr: 'b' } + shape_range: { fg: '#ffd204' attr: 'b' } + shape_record: { fg: '#85cebc' attr: 'b' } + shape_redirection: { fg: '#98005d' attr: 'b' } + shape_signature: { fg: '#00853e' attr: 'b' } + shape_string: '#00853e' + shape_string_interpolation: { fg: '#85cebc' attr: 'b' } + shape_table: { fg: '#009ddc' attr: 'b' } + shape_variable: '#98005d' + + background: '#231f20' + foreground: '#d9d8d8' + cursor: '#d9d8d8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/macintosh.nu b/themes/nu-themes/macintosh.nu index 5c622b5..ae091da 100644 --- a/themes/nu-themes/macintosh.nu +++ b/themes/nu-themes/macintosh.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c0c0c0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#1fb714" attr: "b" } - empty: "#0000d3" - bool: {|| if $in { "#02abea" } else { "light_gray" } } - int: "#c0c0c0" - filesize: {|e| - if $e == 0b { - "#c0c0c0" - } else if $e < 1mb { - "#02abea" - } else {{ fg: "#0000d3" }} - } - duration: "#c0c0c0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dd0907" attr: "b" } - } else if $in < 6hr { - "#dd0907" - } else if $in < 1day { - "#fbf305" - } else if $in < 3day { - "#1fb714" - } else if $in < 1wk { - { fg: "#1fb714" attr: "b" } - } else if $in < 6wk { - "#02abea" - } else if $in < 52wk { - "#0000d3" - } else { "dark_gray" } - } - range: "#c0c0c0" - float: "#c0c0c0" - string: "#c0c0c0" - nothing: "#c0c0c0" - binary: "#c0c0c0" - cellpath: "#c0c0c0" - row_index: { fg: "#1fb714" attr: "b" } - record: "#c0c0c0" - list: "#c0c0c0" - block: "#c0c0c0" - hints: "dark_gray" - search_result: { fg: "#dd0907" bg: "#c0c0c0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#4700a5" attr: "b" } - shape_binary: { fg: "#4700a5" attr: "b" } - shape_block: { fg: "#0000d3" attr: "b" } - shape_bool: "#02abea" - shape_custom: "#1fb714" - shape_datetime: { fg: "#02abea" attr: "b" } - shape_directory: "#02abea" - shape_external: "#02abea" - shape_externalarg: { fg: "#1fb714" attr: "b" } - shape_filepath: "#02abea" - shape_flag: { fg: "#0000d3" attr: "b" } - shape_float: { fg: "#4700a5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#02abea" attr: "b" } - shape_int: { fg: "#4700a5" attr: "b" } - shape_internalcall: { fg: "#02abea" attr: "b" } - shape_list: { fg: "#02abea" attr: "b" } - shape_literal: "#0000d3" - shape_match_pattern: "#1fb714" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#02abea" - shape_operator: "#fbf305" - shape_or: { fg: "#4700a5" attr: "b" } - shape_pipe: { fg: "#4700a5" attr: "b" } - shape_range: { fg: "#fbf305" attr: "b" } - shape_record: { fg: "#02abea" attr: "b" } - shape_redirection: { fg: "#4700a5" attr: "b" } - shape_signature: { fg: "#1fb714" attr: "b" } - shape_string: "#1fb714" - shape_string_interpolation: { fg: "#02abea" attr: "b" } - shape_table: { fg: "#0000d3" attr: "b" } - shape_variable: "#4700a5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c0c0c0" - cursor: "#c0c0c0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c0c0c0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#1fb714' attr: 'b' } + empty: '#0000d3' + bool: {|| if $in { '#02abea' } else { 'light_gray' } } + int: '#c0c0c0' + filesize: {|e| + if $e == 0b { + '#c0c0c0' + } else if $e < 1mb { + '#02abea' + } else {{ fg: '#0000d3' }} + } + duration: '#c0c0c0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dd0907' attr: 'b' } + } else if $in < 6hr { + '#dd0907' + } else if $in < 1day { + '#fbf305' + } else if $in < 3day { + '#1fb714' + } else if $in < 1wk { + { fg: '#1fb714' attr: 'b' } + } else if $in < 6wk { + '#02abea' + } else if $in < 52wk { + '#0000d3' + } else { 'dark_gray' } + } + range: '#c0c0c0' + float: '#c0c0c0' + string: '#c0c0c0' + nothing: '#c0c0c0' + binary: '#c0c0c0' + cellpath: '#c0c0c0' + row_index: { fg: '#1fb714' attr: 'b' } + record: '#c0c0c0' + list: '#c0c0c0' + block: '#c0c0c0' + hints: 'dark_gray' + search_result: { fg: '#dd0907' bg: '#c0c0c0' } + + shape_and: { fg: '#4700a5' attr: 'b' } + shape_binary: { fg: '#4700a5' attr: 'b' } + shape_block: { fg: '#0000d3' attr: 'b' } + shape_bool: '#02abea' + shape_custom: '#1fb714' + shape_datetime: { fg: '#02abea' attr: 'b' } + shape_directory: '#02abea' + shape_external: '#02abea' + shape_externalarg: { fg: '#1fb714' attr: 'b' } + shape_filepath: '#02abea' + shape_flag: { fg: '#0000d3' attr: 'b' } + shape_float: { fg: '#4700a5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#02abea' attr: 'b' } + shape_int: { fg: '#4700a5' attr: 'b' } + shape_internalcall: { fg: '#02abea' attr: 'b' } + shape_list: { fg: '#02abea' attr: 'b' } + shape_literal: '#0000d3' + shape_match_pattern: '#1fb714' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#02abea' + shape_operator: '#fbf305' + shape_or: { fg: '#4700a5' attr: 'b' } + shape_pipe: { fg: '#4700a5' attr: 'b' } + shape_range: { fg: '#fbf305' attr: 'b' } + shape_record: { fg: '#02abea' attr: 'b' } + shape_redirection: { fg: '#4700a5' attr: 'b' } + shape_signature: { fg: '#1fb714' attr: 'b' } + shape_string: '#1fb714' + shape_string_interpolation: { fg: '#02abea' attr: 'b' } + shape_table: { fg: '#0000d3' attr: 'b' } + shape_variable: '#4700a5' + + background: '#000000' + foreground: '#c0c0c0' + cursor: '#c0c0c0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/maia.nu b/themes/nu-themes/maia.nu index 81d5535..b191ea2 100644 --- a/themes/nu-themes/maia.nu +++ b/themes/nu-themes/maia.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0e0e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7e807e" attr: "b" } - empty: "#16a085" - bool: {|| if $in { "#00d1d1" } else { "light_gray" } } - int: "#e0e0e0" - filesize: {|e| - if $e == 0b { - "#e0e0e0" - } else if $e < 1mb { - "#00cccc" - } else {{ fg: "#16a085" }} - } - duration: "#e0e0e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ba2922" attr: "b" } - } else if $in < 6hr { - "#ba2922" - } else if $in < 1day { - "#4c4f4d" - } else if $in < 3day { - "#7e807e" - } else if $in < 1wk { - { fg: "#7e807e" attr: "b" } - } else if $in < 6wk { - "#00cccc" - } else if $in < 52wk { - "#16a085" - } else { "dark_gray" } - } - range: "#e0e0e0" - float: "#e0e0e0" - string: "#e0e0e0" - nothing: "#e0e0e0" - binary: "#e0e0e0" - cellpath: "#e0e0e0" - row_index: { fg: "#7e807e" attr: "b" } - record: "#e0e0e0" - list: "#e0e0e0" - block: "#e0e0e0" - hints: "dark_gray" - search_result: { fg: "#ba2922" bg: "#e0e0e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#43746a" attr: "b" } - shape_binary: { fg: "#43746a" attr: "b" } - shape_block: { fg: "#16a085" attr: "b" } - shape_bool: "#00d1d1" - shape_custom: "#7e807e" - shape_datetime: { fg: "#00cccc" attr: "b" } - shape_directory: "#00cccc" - shape_external: "#00cccc" - shape_externalarg: { fg: "#7e807e" attr: "b" } - shape_filepath: "#00cccc" - shape_flag: { fg: "#16a085" attr: "b" } - shape_float: { fg: "#43746a" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00cccc" attr: "b" } - shape_int: { fg: "#43746a" attr: "b" } - shape_internalcall: { fg: "#00cccc" attr: "b" } - shape_list: { fg: "#00cccc" attr: "b" } - shape_literal: "#16a085" - shape_match_pattern: "#7e807e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00d1d1" - shape_operator: "#4c4f4d" - shape_or: { fg: "#43746a" attr: "b" } - shape_pipe: { fg: "#43746a" attr: "b" } - shape_range: { fg: "#4c4f4d" attr: "b" } - shape_record: { fg: "#00cccc" attr: "b" } - shape_redirection: { fg: "#43746a" attr: "b" } - shape_signature: { fg: "#7e807e" attr: "b" } - shape_string: "#7e807e" - shape_string_interpolation: { fg: "#00cccc" attr: "b" } - shape_table: { fg: "#16a085" attr: "b" } - shape_variable: "#43746a" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#272827" - foreground: "#fdf6e3" - cursor: "#16a085" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0e0e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7e807e' attr: 'b' } + empty: '#16a085' + bool: {|| if $in { '#00d1d1' } else { 'light_gray' } } + int: '#e0e0e0' + filesize: {|e| + if $e == 0b { + '#e0e0e0' + } else if $e < 1mb { + '#00cccc' + } else {{ fg: '#16a085' }} + } + duration: '#e0e0e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ba2922' attr: 'b' } + } else if $in < 6hr { + '#ba2922' + } else if $in < 1day { + '#4c4f4d' + } else if $in < 3day { + '#7e807e' + } else if $in < 1wk { + { fg: '#7e807e' attr: 'b' } + } else if $in < 6wk { + '#00cccc' + } else if $in < 52wk { + '#16a085' + } else { 'dark_gray' } + } + range: '#e0e0e0' + float: '#e0e0e0' + string: '#e0e0e0' + nothing: '#e0e0e0' + binary: '#e0e0e0' + cellpath: '#e0e0e0' + row_index: { fg: '#7e807e' attr: 'b' } + record: '#e0e0e0' + list: '#e0e0e0' + block: '#e0e0e0' + hints: 'dark_gray' + search_result: { fg: '#ba2922' bg: '#e0e0e0' } + + shape_and: { fg: '#43746a' attr: 'b' } + shape_binary: { fg: '#43746a' attr: 'b' } + shape_block: { fg: '#16a085' attr: 'b' } + shape_bool: '#00d1d1' + shape_custom: '#7e807e' + shape_datetime: { fg: '#00cccc' attr: 'b' } + shape_directory: '#00cccc' + shape_external: '#00cccc' + shape_externalarg: { fg: '#7e807e' attr: 'b' } + shape_filepath: '#00cccc' + shape_flag: { fg: '#16a085' attr: 'b' } + shape_float: { fg: '#43746a' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00cccc' attr: 'b' } + shape_int: { fg: '#43746a' attr: 'b' } + shape_internalcall: { fg: '#00cccc' attr: 'b' } + shape_list: { fg: '#00cccc' attr: 'b' } + shape_literal: '#16a085' + shape_match_pattern: '#7e807e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00d1d1' + shape_operator: '#4c4f4d' + shape_or: { fg: '#43746a' attr: 'b' } + shape_pipe: { fg: '#43746a' attr: 'b' } + shape_range: { fg: '#4c4f4d' attr: 'b' } + shape_record: { fg: '#00cccc' attr: 'b' } + shape_redirection: { fg: '#43746a' attr: 'b' } + shape_signature: { fg: '#7e807e' attr: 'b' } + shape_string: '#7e807e' + shape_string_interpolation: { fg: '#00cccc' attr: 'b' } + shape_table: { fg: '#16a085' attr: 'b' } + shape_variable: '#43746a' + + background: '#272827' + foreground: '#fdf6e3' + cursor: '#16a085' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/man-page.nu b/themes/nu-themes/man-page.nu index d0f4ec5..e577e48 100644 --- a/themes/nu-themes/man-page.nu +++ b/themes/nu-themes/man-page.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a600" attr: "b" } - empty: "#0000b2" - bool: {|| if $in { "#00e5e5" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#00a6b2" - } else {{ fg: "#0000b2" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#999900" - } else if $in < 3day { - "#00a600" - } else if $in < 1wk { - { fg: "#00a600" attr: "b" } - } else if $in < 6wk { - "#00a6b2" - } else if $in < 52wk { - "#0000b2" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#00a600" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b200b2" attr: "b" } - shape_binary: { fg: "#b200b2" attr: "b" } - shape_block: { fg: "#0000b2" attr: "b" } - shape_bool: "#00e5e5" - shape_custom: "#00a600" - shape_datetime: { fg: "#00a6b2" attr: "b" } - shape_directory: "#00a6b2" - shape_external: "#00a6b2" - shape_externalarg: { fg: "#00a600" attr: "b" } - shape_filepath: "#00a6b2" - shape_flag: { fg: "#0000b2" attr: "b" } - shape_float: { fg: "#b200b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a6b2" attr: "b" } - shape_int: { fg: "#b200b2" attr: "b" } - shape_internalcall: { fg: "#00a6b2" attr: "b" } - shape_list: { fg: "#00a6b2" attr: "b" } - shape_literal: "#0000b2" - shape_match_pattern: "#00a600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e5e5" - shape_operator: "#999900" - shape_or: { fg: "#b200b2" attr: "b" } - shape_pipe: { fg: "#b200b2" attr: "b" } - shape_range: { fg: "#999900" attr: "b" } - shape_record: { fg: "#00a6b2" attr: "b" } - shape_redirection: { fg: "#b200b2" attr: "b" } - shape_signature: { fg: "#00a600" attr: "b" } - shape_string: "#00a600" - shape_string_interpolation: { fg: "#00a6b2" attr: "b" } - shape_table: { fg: "#0000b2" attr: "b" } - shape_variable: "#b200b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fef49c" - foreground: "#000000" - cursor: "#000000" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a600' attr: 'b' } + empty: '#0000b2' + bool: {|| if $in { '#00e5e5' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#00a6b2' + } else {{ fg: '#0000b2' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#999900' + } else if $in < 3day { + '#00a600' + } else if $in < 1wk { + { fg: '#00a600' attr: 'b' } + } else if $in < 6wk { + '#00a6b2' + } else if $in < 52wk { + '#0000b2' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#00a600' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#cccccc' } + + shape_and: { fg: '#b200b2' attr: 'b' } + shape_binary: { fg: '#b200b2' attr: 'b' } + shape_block: { fg: '#0000b2' attr: 'b' } + shape_bool: '#00e5e5' + shape_custom: '#00a600' + shape_datetime: { fg: '#00a6b2' attr: 'b' } + shape_directory: '#00a6b2' + shape_external: '#00a6b2' + shape_externalarg: { fg: '#00a600' attr: 'b' } + shape_filepath: '#00a6b2' + shape_flag: { fg: '#0000b2' attr: 'b' } + shape_float: { fg: '#b200b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a6b2' attr: 'b' } + shape_int: { fg: '#b200b2' attr: 'b' } + shape_internalcall: { fg: '#00a6b2' attr: 'b' } + shape_list: { fg: '#00a6b2' attr: 'b' } + shape_literal: '#0000b2' + shape_match_pattern: '#00a600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e5e5' + shape_operator: '#999900' + shape_or: { fg: '#b200b2' attr: 'b' } + shape_pipe: { fg: '#b200b2' attr: 'b' } + shape_range: { fg: '#999900' attr: 'b' } + shape_record: { fg: '#00a6b2' attr: 'b' } + shape_redirection: { fg: '#b200b2' attr: 'b' } + shape_signature: { fg: '#00a600' attr: 'b' } + shape_string: '#00a600' + shape_string_interpolation: { fg: '#00a6b2' attr: 'b' } + shape_table: { fg: '#0000b2' attr: 'b' } + shape_variable: '#b200b2' + + background: '#fef49c' + foreground: '#000000' + cursor: '#000000' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mar.nu b/themes/nu-themes/mar.nu index 75c437b..be80fd7 100644 --- a/themes/nu-themes/mar.nu +++ b/themes/nu-themes/mar.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f8f8f8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7bb540" attr: "b" } - empty: "#407bb5" - bool: {|| if $in { "#73cda0" } else { "light_gray" } } - int: "#f8f8f8" - filesize: {|e| - if $e == 0b { - "#f8f8f8" - } else if $e < 1mb { - "#40b57b" - } else {{ fg: "#407bb5" }} - } - duration: "#f8f8f8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b5407b" attr: "b" } - } else if $in < 6hr { - "#b5407b" - } else if $in < 1day { - "#b57b40" - } else if $in < 3day { - "#7bb540" - } else if $in < 1wk { - { fg: "#7bb540" attr: "b" } - } else if $in < 6wk { - "#40b57b" - } else if $in < 52wk { - "#407bb5" - } else { "dark_gray" } - } - range: "#f8f8f8" - float: "#f8f8f8" - string: "#f8f8f8" - nothing: "#f8f8f8" - binary: "#f8f8f8" - cellpath: "#f8f8f8" - row_index: { fg: "#7bb540" attr: "b" } - record: "#f8f8f8" - list: "#f8f8f8" - block: "#f8f8f8" - hints: "dark_gray" - search_result: { fg: "#b5407b" bg: "#f8f8f8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7b40b5" attr: "b" } - shape_binary: { fg: "#7b40b5" attr: "b" } - shape_block: { fg: "#407bb5" attr: "b" } - shape_bool: "#73cda0" - shape_custom: "#7bb540" - shape_datetime: { fg: "#40b57b" attr: "b" } - shape_directory: "#40b57b" - shape_external: "#40b57b" - shape_externalarg: { fg: "#7bb540" attr: "b" } - shape_filepath: "#40b57b" - shape_flag: { fg: "#407bb5" attr: "b" } - shape_float: { fg: "#7b40b5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#40b57b" attr: "b" } - shape_int: { fg: "#7b40b5" attr: "b" } - shape_internalcall: { fg: "#40b57b" attr: "b" } - shape_list: { fg: "#40b57b" attr: "b" } - shape_literal: "#407bb5" - shape_match_pattern: "#7bb540" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#73cda0" - shape_operator: "#b57b40" - shape_or: { fg: "#7b40b5" attr: "b" } - shape_pipe: { fg: "#7b40b5" attr: "b" } - shape_range: { fg: "#b57b40" attr: "b" } - shape_record: { fg: "#40b57b" attr: "b" } - shape_redirection: { fg: "#7b40b5" attr: "b" } - shape_signature: { fg: "#7bb540" attr: "b" } - shape_string: "#7bb540" - shape_string_interpolation: { fg: "#40b57b" attr: "b" } - shape_table: { fg: "#407bb5" attr: "b" } - shape_variable: "#7b40b5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#23476a" - cursor: "#23476a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f8f8f8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7bb540' attr: 'b' } + empty: '#407bb5' + bool: {|| if $in { '#73cda0' } else { 'light_gray' } } + int: '#f8f8f8' + filesize: {|e| + if $e == 0b { + '#f8f8f8' + } else if $e < 1mb { + '#40b57b' + } else {{ fg: '#407bb5' }} + } + duration: '#f8f8f8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b5407b' attr: 'b' } + } else if $in < 6hr { + '#b5407b' + } else if $in < 1day { + '#b57b40' + } else if $in < 3day { + '#7bb540' + } else if $in < 1wk { + { fg: '#7bb540' attr: 'b' } + } else if $in < 6wk { + '#40b57b' + } else if $in < 52wk { + '#407bb5' + } else { 'dark_gray' } + } + range: '#f8f8f8' + float: '#f8f8f8' + string: '#f8f8f8' + nothing: '#f8f8f8' + binary: '#f8f8f8' + cellpath: '#f8f8f8' + row_index: { fg: '#7bb540' attr: 'b' } + record: '#f8f8f8' + list: '#f8f8f8' + block: '#f8f8f8' + hints: 'dark_gray' + search_result: { fg: '#b5407b' bg: '#f8f8f8' } + + shape_and: { fg: '#7b40b5' attr: 'b' } + shape_binary: { fg: '#7b40b5' attr: 'b' } + shape_block: { fg: '#407bb5' attr: 'b' } + shape_bool: '#73cda0' + shape_custom: '#7bb540' + shape_datetime: { fg: '#40b57b' attr: 'b' } + shape_directory: '#40b57b' + shape_external: '#40b57b' + shape_externalarg: { fg: '#7bb540' attr: 'b' } + shape_filepath: '#40b57b' + shape_flag: { fg: '#407bb5' attr: 'b' } + shape_float: { fg: '#7b40b5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#40b57b' attr: 'b' } + shape_int: { fg: '#7b40b5' attr: 'b' } + shape_internalcall: { fg: '#40b57b' attr: 'b' } + shape_list: { fg: '#40b57b' attr: 'b' } + shape_literal: '#407bb5' + shape_match_pattern: '#7bb540' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#73cda0' + shape_operator: '#b57b40' + shape_or: { fg: '#7b40b5' attr: 'b' } + shape_pipe: { fg: '#7b40b5' attr: 'b' } + shape_range: { fg: '#b57b40' attr: 'b' } + shape_record: { fg: '#40b57b' attr: 'b' } + shape_redirection: { fg: '#7b40b5' attr: 'b' } + shape_signature: { fg: '#7bb540' attr: 'b' } + shape_string: '#7bb540' + shape_string_interpolation: { fg: '#40b57b' attr: 'b' } + shape_table: { fg: '#407bb5' attr: 'b' } + shape_variable: '#7b40b5' + + background: '#ffffff' + foreground: '#23476a' + cursor: '#23476a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/marrakesh.nu b/themes/nu-themes/marrakesh.nu index 7dbded8..0fc584a 100644 --- a/themes/nu-themes/marrakesh.nu +++ b/themes/nu-themes/marrakesh.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#948e48" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#18974e" attr: "b" } - empty: "#477ca1" - bool: {|| if $in { "#75a738" } else { "light_gray" } } - int: "#948e48" - filesize: {|e| - if $e == 0b { - "#948e48" - } else if $e < 1mb { - "#75a738" - } else {{ fg: "#477ca1" }} - } - duration: "#948e48" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c35359" attr: "b" } - } else if $in < 6hr { - "#c35359" - } else if $in < 1day { - "#a88339" - } else if $in < 3day { - "#18974e" - } else if $in < 1wk { - { fg: "#18974e" attr: "b" } - } else if $in < 6wk { - "#75a738" - } else if $in < 52wk { - "#477ca1" - } else { "dark_gray" } - } - range: "#948e48" - float: "#948e48" - string: "#948e48" - nothing: "#948e48" - binary: "#948e48" - cellpath: "#948e48" - row_index: { fg: "#18974e" attr: "b" } - record: "#948e48" - list: "#948e48" - block: "#948e48" - hints: "dark_gray" - search_result: { fg: "#c35359" bg: "#948e48" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8868b3" attr: "b" } - shape_binary: { fg: "#8868b3" attr: "b" } - shape_block: { fg: "#477ca1" attr: "b" } - shape_bool: "#75a738" - shape_custom: "#18974e" - shape_datetime: { fg: "#75a738" attr: "b" } - shape_directory: "#75a738" - shape_external: "#75a738" - shape_externalarg: { fg: "#18974e" attr: "b" } - shape_filepath: "#75a738" - shape_flag: { fg: "#477ca1" attr: "b" } - shape_float: { fg: "#8868b3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#75a738" attr: "b" } - shape_int: { fg: "#8868b3" attr: "b" } - shape_internalcall: { fg: "#75a738" attr: "b" } - shape_list: { fg: "#75a738" attr: "b" } - shape_literal: "#477ca1" - shape_match_pattern: "#18974e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#75a738" - shape_operator: "#a88339" - shape_or: { fg: "#8868b3" attr: "b" } - shape_pipe: { fg: "#8868b3" attr: "b" } - shape_range: { fg: "#a88339" attr: "b" } - shape_record: { fg: "#75a738" attr: "b" } - shape_redirection: { fg: "#8868b3" attr: "b" } - shape_signature: { fg: "#18974e" attr: "b" } - shape_string: "#18974e" - shape_string_interpolation: { fg: "#75a738" attr: "b" } - shape_table: { fg: "#477ca1" attr: "b" } - shape_variable: "#8868b3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#201602" - foreground: "#948e48" - cursor: "#948e48" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#948e48' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#18974e' attr: 'b' } + empty: '#477ca1' + bool: {|| if $in { '#75a738' } else { 'light_gray' } } + int: '#948e48' + filesize: {|e| + if $e == 0b { + '#948e48' + } else if $e < 1mb { + '#75a738' + } else {{ fg: '#477ca1' }} + } + duration: '#948e48' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c35359' attr: 'b' } + } else if $in < 6hr { + '#c35359' + } else if $in < 1day { + '#a88339' + } else if $in < 3day { + '#18974e' + } else if $in < 1wk { + { fg: '#18974e' attr: 'b' } + } else if $in < 6wk { + '#75a738' + } else if $in < 52wk { + '#477ca1' + } else { 'dark_gray' } + } + range: '#948e48' + float: '#948e48' + string: '#948e48' + nothing: '#948e48' + binary: '#948e48' + cellpath: '#948e48' + row_index: { fg: '#18974e' attr: 'b' } + record: '#948e48' + list: '#948e48' + block: '#948e48' + hints: 'dark_gray' + search_result: { fg: '#c35359' bg: '#948e48' } + + shape_and: { fg: '#8868b3' attr: 'b' } + shape_binary: { fg: '#8868b3' attr: 'b' } + shape_block: { fg: '#477ca1' attr: 'b' } + shape_bool: '#75a738' + shape_custom: '#18974e' + shape_datetime: { fg: '#75a738' attr: 'b' } + shape_directory: '#75a738' + shape_external: '#75a738' + shape_externalarg: { fg: '#18974e' attr: 'b' } + shape_filepath: '#75a738' + shape_flag: { fg: '#477ca1' attr: 'b' } + shape_float: { fg: '#8868b3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#75a738' attr: 'b' } + shape_int: { fg: '#8868b3' attr: 'b' } + shape_internalcall: { fg: '#75a738' attr: 'b' } + shape_list: { fg: '#75a738' attr: 'b' } + shape_literal: '#477ca1' + shape_match_pattern: '#18974e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#75a738' + shape_operator: '#a88339' + shape_or: { fg: '#8868b3' attr: 'b' } + shape_pipe: { fg: '#8868b3' attr: 'b' } + shape_range: { fg: '#a88339' attr: 'b' } + shape_record: { fg: '#75a738' attr: 'b' } + shape_redirection: { fg: '#8868b3' attr: 'b' } + shape_signature: { fg: '#18974e' attr: 'b' } + shape_string: '#18974e' + shape_string_interpolation: { fg: '#75a738' attr: 'b' } + shape_table: { fg: '#477ca1' attr: 'b' } + shape_variable: '#8868b3' + + background: '#201602' + foreground: '#948e48' + cursor: '#948e48' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/materia.nu b/themes/nu-themes/materia.nu index dccf57a..a6bb018 100644 --- a/themes/nu-themes/materia.nu +++ b/themes/nu-themes/materia.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cdd3de" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8bd649" attr: "b" } - empty: "#89ddff" - bool: {|| if $in { "#80cbc4" } else { "light_gray" } } - int: "#cdd3de" - filesize: {|e| - if $e == 0b { - "#cdd3de" - } else if $e < 1mb { - "#80cbc4" - } else {{ fg: "#89ddff" }} - } - duration: "#cdd3de" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ec5f67" attr: "b" } - } else if $in < 6hr { - "#ec5f67" - } else if $in < 1day { - "#ffcc00" - } else if $in < 3day { - "#8bd649" - } else if $in < 1wk { - { fg: "#8bd649" attr: "b" } - } else if $in < 6wk { - "#80cbc4" - } else if $in < 52wk { - "#89ddff" - } else { "dark_gray" } - } - range: "#cdd3de" - float: "#cdd3de" - string: "#cdd3de" - nothing: "#cdd3de" - binary: "#cdd3de" - cellpath: "#cdd3de" - row_index: { fg: "#8bd649" attr: "b" } - record: "#cdd3de" - list: "#cdd3de" - block: "#cdd3de" - hints: "dark_gray" - search_result: { fg: "#ec5f67" bg: "#cdd3de" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#82aaff" attr: "b" } - shape_binary: { fg: "#82aaff" attr: "b" } - shape_block: { fg: "#89ddff" attr: "b" } - shape_bool: "#80cbc4" - shape_custom: "#8bd649" - shape_datetime: { fg: "#80cbc4" attr: "b" } - shape_directory: "#80cbc4" - shape_external: "#80cbc4" - shape_externalarg: { fg: "#8bd649" attr: "b" } - shape_filepath: "#80cbc4" - shape_flag: { fg: "#89ddff" attr: "b" } - shape_float: { fg: "#82aaff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#80cbc4" attr: "b" } - shape_int: { fg: "#82aaff" attr: "b" } - shape_internalcall: { fg: "#80cbc4" attr: "b" } - shape_list: { fg: "#80cbc4" attr: "b" } - shape_literal: "#89ddff" - shape_match_pattern: "#8bd649" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#80cbc4" - shape_operator: "#ffcc00" - shape_or: { fg: "#82aaff" attr: "b" } - shape_pipe: { fg: "#82aaff" attr: "b" } - shape_range: { fg: "#ffcc00" attr: "b" } - shape_record: { fg: "#80cbc4" attr: "b" } - shape_redirection: { fg: "#82aaff" attr: "b" } - shape_signature: { fg: "#8bd649" attr: "b" } - shape_string: "#8bd649" - shape_string_interpolation: { fg: "#80cbc4" attr: "b" } - shape_table: { fg: "#89ddff" attr: "b" } - shape_variable: "#82aaff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#263238" - foreground: "#cdd3de" - cursor: "#cdd3de" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cdd3de' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8bd649' attr: 'b' } + empty: '#89ddff' + bool: {|| if $in { '#80cbc4' } else { 'light_gray' } } + int: '#cdd3de' + filesize: {|e| + if $e == 0b { + '#cdd3de' + } else if $e < 1mb { + '#80cbc4' + } else {{ fg: '#89ddff' }} + } + duration: '#cdd3de' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ec5f67' attr: 'b' } + } else if $in < 6hr { + '#ec5f67' + } else if $in < 1day { + '#ffcc00' + } else if $in < 3day { + '#8bd649' + } else if $in < 1wk { + { fg: '#8bd649' attr: 'b' } + } else if $in < 6wk { + '#80cbc4' + } else if $in < 52wk { + '#89ddff' + } else { 'dark_gray' } + } + range: '#cdd3de' + float: '#cdd3de' + string: '#cdd3de' + nothing: '#cdd3de' + binary: '#cdd3de' + cellpath: '#cdd3de' + row_index: { fg: '#8bd649' attr: 'b' } + record: '#cdd3de' + list: '#cdd3de' + block: '#cdd3de' + hints: 'dark_gray' + search_result: { fg: '#ec5f67' bg: '#cdd3de' } + + shape_and: { fg: '#82aaff' attr: 'b' } + shape_binary: { fg: '#82aaff' attr: 'b' } + shape_block: { fg: '#89ddff' attr: 'b' } + shape_bool: '#80cbc4' + shape_custom: '#8bd649' + shape_datetime: { fg: '#80cbc4' attr: 'b' } + shape_directory: '#80cbc4' + shape_external: '#80cbc4' + shape_externalarg: { fg: '#8bd649' attr: 'b' } + shape_filepath: '#80cbc4' + shape_flag: { fg: '#89ddff' attr: 'b' } + shape_float: { fg: '#82aaff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#80cbc4' attr: 'b' } + shape_int: { fg: '#82aaff' attr: 'b' } + shape_internalcall: { fg: '#80cbc4' attr: 'b' } + shape_list: { fg: '#80cbc4' attr: 'b' } + shape_literal: '#89ddff' + shape_match_pattern: '#8bd649' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#80cbc4' + shape_operator: '#ffcc00' + shape_or: { fg: '#82aaff' attr: 'b' } + shape_pipe: { fg: '#82aaff' attr: 'b' } + shape_range: { fg: '#ffcc00' attr: 'b' } + shape_record: { fg: '#80cbc4' attr: 'b' } + shape_redirection: { fg: '#82aaff' attr: 'b' } + shape_signature: { fg: '#8bd649' attr: 'b' } + shape_string: '#8bd649' + shape_string_interpolation: { fg: '#80cbc4' attr: 'b' } + shape_table: { fg: '#89ddff' attr: 'b' } + shape_variable: '#82aaff' + + background: '#263238' + foreground: '#cdd3de' + cursor: '#cdd3de' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/material-dark.nu b/themes/nu-themes/material-dark.nu index d4a171f..6f568b7 100644 --- a/themes/nu-themes/material-dark.nu +++ b/themes/nu-themes/material-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeeeee" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#457b23" attr: "b" } - empty: "#134eb2" - bool: {|| if $in { "#26bad1" } else { "light_gray" } } - int: "#eeeeee" - filesize: {|e| - if $e == 0b { - "#eeeeee" - } else if $e < 1mb { - "#0e707c" - } else {{ fg: "#134eb2" }} - } - duration: "#eeeeee" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b7141e" attr: "b" } - } else if $in < 6hr { - "#b7141e" - } else if $in < 1day { - "#f5971d" - } else if $in < 3day { - "#457b23" - } else if $in < 1wk { - { fg: "#457b23" attr: "b" } - } else if $in < 6wk { - "#0e707c" - } else if $in < 52wk { - "#134eb2" - } else { "dark_gray" } - } - range: "#eeeeee" - float: "#eeeeee" - string: "#eeeeee" - nothing: "#eeeeee" - binary: "#eeeeee" - cellpath: "#eeeeee" - row_index: { fg: "#457b23" attr: "b" } - record: "#eeeeee" - list: "#eeeeee" - block: "#eeeeee" - hints: "dark_gray" - search_result: { fg: "#b7141e" bg: "#eeeeee" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#550087" attr: "b" } - shape_binary: { fg: "#550087" attr: "b" } - shape_block: { fg: "#134eb2" attr: "b" } - shape_bool: "#26bad1" - shape_custom: "#457b23" - shape_datetime: { fg: "#0e707c" attr: "b" } - shape_directory: "#0e707c" - shape_external: "#0e707c" - shape_externalarg: { fg: "#457b23" attr: "b" } - shape_filepath: "#0e707c" - shape_flag: { fg: "#134eb2" attr: "b" } - shape_float: { fg: "#550087" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0e707c" attr: "b" } - shape_int: { fg: "#550087" attr: "b" } - shape_internalcall: { fg: "#0e707c" attr: "b" } - shape_list: { fg: "#0e707c" attr: "b" } - shape_literal: "#134eb2" - shape_match_pattern: "#457b23" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#26bad1" - shape_operator: "#f5971d" - shape_or: { fg: "#550087" attr: "b" } - shape_pipe: { fg: "#550087" attr: "b" } - shape_range: { fg: "#f5971d" attr: "b" } - shape_record: { fg: "#0e707c" attr: "b" } - shape_redirection: { fg: "#550087" attr: "b" } - shape_signature: { fg: "#457b23" attr: "b" } - shape_string: "#457b23" - shape_string_interpolation: { fg: "#0e707c" attr: "b" } - shape_table: { fg: "#134eb2" attr: "b" } - shape_variable: "#550087" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222221" - foreground: "#e4e4e4" - cursor: "#16aec9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeeeee' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#457b23' attr: 'b' } + empty: '#134eb2' + bool: {|| if $in { '#26bad1' } else { 'light_gray' } } + int: '#eeeeee' + filesize: {|e| + if $e == 0b { + '#eeeeee' + } else if $e < 1mb { + '#0e707c' + } else {{ fg: '#134eb2' }} + } + duration: '#eeeeee' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b7141e' attr: 'b' } + } else if $in < 6hr { + '#b7141e' + } else if $in < 1day { + '#f5971d' + } else if $in < 3day { + '#457b23' + } else if $in < 1wk { + { fg: '#457b23' attr: 'b' } + } else if $in < 6wk { + '#0e707c' + } else if $in < 52wk { + '#134eb2' + } else { 'dark_gray' } + } + range: '#eeeeee' + float: '#eeeeee' + string: '#eeeeee' + nothing: '#eeeeee' + binary: '#eeeeee' + cellpath: '#eeeeee' + row_index: { fg: '#457b23' attr: 'b' } + record: '#eeeeee' + list: '#eeeeee' + block: '#eeeeee' + hints: 'dark_gray' + search_result: { fg: '#b7141e' bg: '#eeeeee' } + + shape_and: { fg: '#550087' attr: 'b' } + shape_binary: { fg: '#550087' attr: 'b' } + shape_block: { fg: '#134eb2' attr: 'b' } + shape_bool: '#26bad1' + shape_custom: '#457b23' + shape_datetime: { fg: '#0e707c' attr: 'b' } + shape_directory: '#0e707c' + shape_external: '#0e707c' + shape_externalarg: { fg: '#457b23' attr: 'b' } + shape_filepath: '#0e707c' + shape_flag: { fg: '#134eb2' attr: 'b' } + shape_float: { fg: '#550087' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0e707c' attr: 'b' } + shape_int: { fg: '#550087' attr: 'b' } + shape_internalcall: { fg: '#0e707c' attr: 'b' } + shape_list: { fg: '#0e707c' attr: 'b' } + shape_literal: '#134eb2' + shape_match_pattern: '#457b23' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#26bad1' + shape_operator: '#f5971d' + shape_or: { fg: '#550087' attr: 'b' } + shape_pipe: { fg: '#550087' attr: 'b' } + shape_range: { fg: '#f5971d' attr: 'b' } + shape_record: { fg: '#0e707c' attr: 'b' } + shape_redirection: { fg: '#550087' attr: 'b' } + shape_signature: { fg: '#457b23' attr: 'b' } + shape_string: '#457b23' + shape_string_interpolation: { fg: '#0e707c' attr: 'b' } + shape_table: { fg: '#134eb2' attr: 'b' } + shape_variable: '#550087' + + background: '#222221' + foreground: '#e4e4e4' + cursor: '#16aec9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/material-darker.nu b/themes/nu-themes/material-darker.nu index 0b96830..daa1ff7 100644 --- a/themes/nu-themes/material-darker.nu +++ b/themes/nu-themes/material-darker.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c3e88d" attr: "b" } - empty: "#82aaff" - bool: {|| if $in { "#89ddff" } else { "light_gray" } } - int: "#eeffff" - filesize: {|e| - if $e == 0b { - "#eeffff" - } else if $e < 1mb { - "#89ddff" - } else {{ fg: "#82aaff" }} - } - duration: "#eeffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f07178" attr: "b" } - } else if $in < 6hr { - "#f07178" - } else if $in < 1day { - "#ffcb6b" - } else if $in < 3day { - "#c3e88d" - } else if $in < 1wk { - { fg: "#c3e88d" attr: "b" } - } else if $in < 6wk { - "#89ddff" - } else if $in < 52wk { - "#82aaff" - } else { "dark_gray" } - } - range: "#eeffff" - float: "#eeffff" - string: "#eeffff" - nothing: "#eeffff" - binary: "#eeffff" - cellpath: "#eeffff" - row_index: { fg: "#c3e88d" attr: "b" } - record: "#eeffff" - list: "#eeffff" - block: "#eeffff" - hints: "dark_gray" - search_result: { fg: "#f07178" bg: "#eeffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c792ea" attr: "b" } - shape_binary: { fg: "#c792ea" attr: "b" } - shape_block: { fg: "#82aaff" attr: "b" } - shape_bool: "#89ddff" - shape_custom: "#c3e88d" - shape_datetime: { fg: "#89ddff" attr: "b" } - shape_directory: "#89ddff" - shape_external: "#89ddff" - shape_externalarg: { fg: "#c3e88d" attr: "b" } - shape_filepath: "#89ddff" - shape_flag: { fg: "#82aaff" attr: "b" } - shape_float: { fg: "#c792ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#89ddff" attr: "b" } - shape_int: { fg: "#c792ea" attr: "b" } - shape_internalcall: { fg: "#89ddff" attr: "b" } - shape_list: { fg: "#89ddff" attr: "b" } - shape_literal: "#82aaff" - shape_match_pattern: "#c3e88d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#89ddff" - shape_operator: "#ffcb6b" - shape_or: { fg: "#c792ea" attr: "b" } - shape_pipe: { fg: "#c792ea" attr: "b" } - shape_range: { fg: "#ffcb6b" attr: "b" } - shape_record: { fg: "#89ddff" attr: "b" } - shape_redirection: { fg: "#c792ea" attr: "b" } - shape_signature: { fg: "#c3e88d" attr: "b" } - shape_string: "#c3e88d" - shape_string_interpolation: { fg: "#89ddff" attr: "b" } - shape_table: { fg: "#82aaff" attr: "b" } - shape_variable: "#c792ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#212121" - foreground: "#eeffff" - cursor: "#eeffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c3e88d' attr: 'b' } + empty: '#82aaff' + bool: {|| if $in { '#89ddff' } else { 'light_gray' } } + int: '#eeffff' + filesize: {|e| + if $e == 0b { + '#eeffff' + } else if $e < 1mb { + '#89ddff' + } else {{ fg: '#82aaff' }} + } + duration: '#eeffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f07178' attr: 'b' } + } else if $in < 6hr { + '#f07178' + } else if $in < 1day { + '#ffcb6b' + } else if $in < 3day { + '#c3e88d' + } else if $in < 1wk { + { fg: '#c3e88d' attr: 'b' } + } else if $in < 6wk { + '#89ddff' + } else if $in < 52wk { + '#82aaff' + } else { 'dark_gray' } + } + range: '#eeffff' + float: '#eeffff' + string: '#eeffff' + nothing: '#eeffff' + binary: '#eeffff' + cellpath: '#eeffff' + row_index: { fg: '#c3e88d' attr: 'b' } + record: '#eeffff' + list: '#eeffff' + block: '#eeffff' + hints: 'dark_gray' + search_result: { fg: '#f07178' bg: '#eeffff' } + + shape_and: { fg: '#c792ea' attr: 'b' } + shape_binary: { fg: '#c792ea' attr: 'b' } + shape_block: { fg: '#82aaff' attr: 'b' } + shape_bool: '#89ddff' + shape_custom: '#c3e88d' + shape_datetime: { fg: '#89ddff' attr: 'b' } + shape_directory: '#89ddff' + shape_external: '#89ddff' + shape_externalarg: { fg: '#c3e88d' attr: 'b' } + shape_filepath: '#89ddff' + shape_flag: { fg: '#82aaff' attr: 'b' } + shape_float: { fg: '#c792ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#89ddff' attr: 'b' } + shape_int: { fg: '#c792ea' attr: 'b' } + shape_internalcall: { fg: '#89ddff' attr: 'b' } + shape_list: { fg: '#89ddff' attr: 'b' } + shape_literal: '#82aaff' + shape_match_pattern: '#c3e88d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#89ddff' + shape_operator: '#ffcb6b' + shape_or: { fg: '#c792ea' attr: 'b' } + shape_pipe: { fg: '#c792ea' attr: 'b' } + shape_range: { fg: '#ffcb6b' attr: 'b' } + shape_record: { fg: '#89ddff' attr: 'b' } + shape_redirection: { fg: '#c792ea' attr: 'b' } + shape_signature: { fg: '#c3e88d' attr: 'b' } + shape_string: '#c3e88d' + shape_string_interpolation: { fg: '#89ddff' attr: 'b' } + shape_table: { fg: '#82aaff' attr: 'b' } + shape_variable: '#c792ea' + + background: '#212121' + foreground: '#eeffff' + cursor: '#eeffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/material-lighter.nu b/themes/nu-themes/material-lighter.nu index 639624e..6fada8e 100644 --- a/themes/nu-themes/material-lighter.nu +++ b/themes/nu-themes/material-lighter.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#80cbc4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#91b859" attr: "b" } - empty: "#6182b8" - bool: {|| if $in { "#39adb5" } else { "light_gray" } } - int: "#80cbc4" - filesize: {|e| - if $e == 0b { - "#80cbc4" - } else if $e < 1mb { - "#39adb5" - } else {{ fg: "#6182b8" }} - } - duration: "#80cbc4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff5370" attr: "b" } - } else if $in < 6hr { - "#ff5370" - } else if $in < 1day { - "#ffb62c" - } else if $in < 3day { - "#91b859" - } else if $in < 1wk { - { fg: "#91b859" attr: "b" } - } else if $in < 6wk { - "#39adb5" - } else if $in < 52wk { - "#6182b8" - } else { "dark_gray" } - } - range: "#80cbc4" - float: "#80cbc4" - string: "#80cbc4" - nothing: "#80cbc4" - binary: "#80cbc4" - cellpath: "#80cbc4" - row_index: { fg: "#91b859" attr: "b" } - record: "#80cbc4" - list: "#80cbc4" - block: "#80cbc4" - hints: "dark_gray" - search_result: { fg: "#ff5370" bg: "#80cbc4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7c4dff" attr: "b" } - shape_binary: { fg: "#7c4dff" attr: "b" } - shape_block: { fg: "#6182b8" attr: "b" } - shape_bool: "#39adb5" - shape_custom: "#91b859" - shape_datetime: { fg: "#39adb5" attr: "b" } - shape_directory: "#39adb5" - shape_external: "#39adb5" - shape_externalarg: { fg: "#91b859" attr: "b" } - shape_filepath: "#39adb5" - shape_flag: { fg: "#6182b8" attr: "b" } - shape_float: { fg: "#7c4dff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#39adb5" attr: "b" } - shape_int: { fg: "#7c4dff" attr: "b" } - shape_internalcall: { fg: "#39adb5" attr: "b" } - shape_list: { fg: "#39adb5" attr: "b" } - shape_literal: "#6182b8" - shape_match_pattern: "#91b859" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#39adb5" - shape_operator: "#ffb62c" - shape_or: { fg: "#7c4dff" attr: "b" } - shape_pipe: { fg: "#7c4dff" attr: "b" } - shape_range: { fg: "#ffb62c" attr: "b" } - shape_record: { fg: "#39adb5" attr: "b" } - shape_redirection: { fg: "#7c4dff" attr: "b" } - shape_signature: { fg: "#91b859" attr: "b" } - shape_string: "#91b859" - shape_string_interpolation: { fg: "#39adb5" attr: "b" } - shape_table: { fg: "#6182b8" attr: "b" } - shape_variable: "#7c4dff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fafafa" - foreground: "#80cbc4" - cursor: "#80cbc4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#80cbc4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#91b859' attr: 'b' } + empty: '#6182b8' + bool: {|| if $in { '#39adb5' } else { 'light_gray' } } + int: '#80cbc4' + filesize: {|e| + if $e == 0b { + '#80cbc4' + } else if $e < 1mb { + '#39adb5' + } else {{ fg: '#6182b8' }} + } + duration: '#80cbc4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff5370' attr: 'b' } + } else if $in < 6hr { + '#ff5370' + } else if $in < 1day { + '#ffb62c' + } else if $in < 3day { + '#91b859' + } else if $in < 1wk { + { fg: '#91b859' attr: 'b' } + } else if $in < 6wk { + '#39adb5' + } else if $in < 52wk { + '#6182b8' + } else { 'dark_gray' } + } + range: '#80cbc4' + float: '#80cbc4' + string: '#80cbc4' + nothing: '#80cbc4' + binary: '#80cbc4' + cellpath: '#80cbc4' + row_index: { fg: '#91b859' attr: 'b' } + record: '#80cbc4' + list: '#80cbc4' + block: '#80cbc4' + hints: 'dark_gray' + search_result: { fg: '#ff5370' bg: '#80cbc4' } + + shape_and: { fg: '#7c4dff' attr: 'b' } + shape_binary: { fg: '#7c4dff' attr: 'b' } + shape_block: { fg: '#6182b8' attr: 'b' } + shape_bool: '#39adb5' + shape_custom: '#91b859' + shape_datetime: { fg: '#39adb5' attr: 'b' } + shape_directory: '#39adb5' + shape_external: '#39adb5' + shape_externalarg: { fg: '#91b859' attr: 'b' } + shape_filepath: '#39adb5' + shape_flag: { fg: '#6182b8' attr: 'b' } + shape_float: { fg: '#7c4dff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#39adb5' attr: 'b' } + shape_int: { fg: '#7c4dff' attr: 'b' } + shape_internalcall: { fg: '#39adb5' attr: 'b' } + shape_list: { fg: '#39adb5' attr: 'b' } + shape_literal: '#6182b8' + shape_match_pattern: '#91b859' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#39adb5' + shape_operator: '#ffb62c' + shape_or: { fg: '#7c4dff' attr: 'b' } + shape_pipe: { fg: '#7c4dff' attr: 'b' } + shape_range: { fg: '#ffb62c' attr: 'b' } + shape_record: { fg: '#39adb5' attr: 'b' } + shape_redirection: { fg: '#7c4dff' attr: 'b' } + shape_signature: { fg: '#91b859' attr: 'b' } + shape_string: '#91b859' + shape_string_interpolation: { fg: '#39adb5' attr: 'b' } + shape_table: { fg: '#6182b8' attr: 'b' } + shape_variable: '#7c4dff' + + background: '#fafafa' + foreground: '#80cbc4' + cursor: '#80cbc4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/material-palenight.nu b/themes/nu-themes/material-palenight.nu index b3515cb..5c8611f 100644 --- a/themes/nu-themes/material-palenight.nu +++ b/themes/nu-themes/material-palenight.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#959dcb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c3e88d" attr: "b" } - empty: "#82aaff" - bool: {|| if $in { "#89ddff" } else { "light_gray" } } - int: "#959dcb" - filesize: {|e| - if $e == 0b { - "#959dcb" - } else if $e < 1mb { - "#89ddff" - } else {{ fg: "#82aaff" }} - } - duration: "#959dcb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f07178" attr: "b" } - } else if $in < 6hr { - "#f07178" - } else if $in < 1day { - "#ffcb6b" - } else if $in < 3day { - "#c3e88d" - } else if $in < 1wk { - { fg: "#c3e88d" attr: "b" } - } else if $in < 6wk { - "#89ddff" - } else if $in < 52wk { - "#82aaff" - } else { "dark_gray" } - } - range: "#959dcb" - float: "#959dcb" - string: "#959dcb" - nothing: "#959dcb" - binary: "#959dcb" - cellpath: "#959dcb" - row_index: { fg: "#c3e88d" attr: "b" } - record: "#959dcb" - list: "#959dcb" - block: "#959dcb" - hints: "dark_gray" - search_result: { fg: "#f07178" bg: "#959dcb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c792ea" attr: "b" } - shape_binary: { fg: "#c792ea" attr: "b" } - shape_block: { fg: "#82aaff" attr: "b" } - shape_bool: "#89ddff" - shape_custom: "#c3e88d" - shape_datetime: { fg: "#89ddff" attr: "b" } - shape_directory: "#89ddff" - shape_external: "#89ddff" - shape_externalarg: { fg: "#c3e88d" attr: "b" } - shape_filepath: "#89ddff" - shape_flag: { fg: "#82aaff" attr: "b" } - shape_float: { fg: "#c792ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#89ddff" attr: "b" } - shape_int: { fg: "#c792ea" attr: "b" } - shape_internalcall: { fg: "#89ddff" attr: "b" } - shape_list: { fg: "#89ddff" attr: "b" } - shape_literal: "#82aaff" - shape_match_pattern: "#c3e88d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#89ddff" - shape_operator: "#ffcb6b" - shape_or: { fg: "#c792ea" attr: "b" } - shape_pipe: { fg: "#c792ea" attr: "b" } - shape_range: { fg: "#ffcb6b" attr: "b" } - shape_record: { fg: "#89ddff" attr: "b" } - shape_redirection: { fg: "#c792ea" attr: "b" } - shape_signature: { fg: "#c3e88d" attr: "b" } - shape_string: "#c3e88d" - shape_string_interpolation: { fg: "#89ddff" attr: "b" } - shape_table: { fg: "#82aaff" attr: "b" } - shape_variable: "#c792ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#292d3e" - foreground: "#959dcb" - cursor: "#959dcb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#959dcb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c3e88d' attr: 'b' } + empty: '#82aaff' + bool: {|| if $in { '#89ddff' } else { 'light_gray' } } + int: '#959dcb' + filesize: {|e| + if $e == 0b { + '#959dcb' + } else if $e < 1mb { + '#89ddff' + } else {{ fg: '#82aaff' }} + } + duration: '#959dcb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f07178' attr: 'b' } + } else if $in < 6hr { + '#f07178' + } else if $in < 1day { + '#ffcb6b' + } else if $in < 3day { + '#c3e88d' + } else if $in < 1wk { + { fg: '#c3e88d' attr: 'b' } + } else if $in < 6wk { + '#89ddff' + } else if $in < 52wk { + '#82aaff' + } else { 'dark_gray' } + } + range: '#959dcb' + float: '#959dcb' + string: '#959dcb' + nothing: '#959dcb' + binary: '#959dcb' + cellpath: '#959dcb' + row_index: { fg: '#c3e88d' attr: 'b' } + record: '#959dcb' + list: '#959dcb' + block: '#959dcb' + hints: 'dark_gray' + search_result: { fg: '#f07178' bg: '#959dcb' } + + shape_and: { fg: '#c792ea' attr: 'b' } + shape_binary: { fg: '#c792ea' attr: 'b' } + shape_block: { fg: '#82aaff' attr: 'b' } + shape_bool: '#89ddff' + shape_custom: '#c3e88d' + shape_datetime: { fg: '#89ddff' attr: 'b' } + shape_directory: '#89ddff' + shape_external: '#89ddff' + shape_externalarg: { fg: '#c3e88d' attr: 'b' } + shape_filepath: '#89ddff' + shape_flag: { fg: '#82aaff' attr: 'b' } + shape_float: { fg: '#c792ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#89ddff' attr: 'b' } + shape_int: { fg: '#c792ea' attr: 'b' } + shape_internalcall: { fg: '#89ddff' attr: 'b' } + shape_list: { fg: '#89ddff' attr: 'b' } + shape_literal: '#82aaff' + shape_match_pattern: '#c3e88d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#89ddff' + shape_operator: '#ffcb6b' + shape_or: { fg: '#c792ea' attr: 'b' } + shape_pipe: { fg: '#c792ea' attr: 'b' } + shape_range: { fg: '#ffcb6b' attr: 'b' } + shape_record: { fg: '#89ddff' attr: 'b' } + shape_redirection: { fg: '#c792ea' attr: 'b' } + shape_signature: { fg: '#c3e88d' attr: 'b' } + shape_string: '#c3e88d' + shape_string_interpolation: { fg: '#89ddff' attr: 'b' } + shape_table: { fg: '#82aaff' attr: 'b' } + shape_variable: '#c792ea' + + background: '#292d3e' + foreground: '#959dcb' + cursor: '#959dcb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/material-vivid.nu b/themes/nu-themes/material-vivid.nu index 2f1e180..f9f5367 100644 --- a/themes/nu-themes/material-vivid.nu +++ b/themes/nu-themes/material-vivid.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#80868b" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00e676" attr: "b" } - empty: "#2196f3" - bool: {|| if $in { "#00bcd4" } else { "light_gray" } } - int: "#80868b" - filesize: {|e| - if $e == 0b { - "#80868b" - } else if $e < 1mb { - "#00bcd4" - } else {{ fg: "#2196f3" }} - } - duration: "#80868b" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f44336" attr: "b" } - } else if $in < 6hr { - "#f44336" - } else if $in < 1day { - "#ffeb3b" - } else if $in < 3day { - "#00e676" - } else if $in < 1wk { - { fg: "#00e676" attr: "b" } - } else if $in < 6wk { - "#00bcd4" - } else if $in < 52wk { - "#2196f3" - } else { "dark_gray" } - } - range: "#80868b" - float: "#80868b" - string: "#80868b" - nothing: "#80868b" - binary: "#80868b" - cellpath: "#80868b" - row_index: { fg: "#00e676" attr: "b" } - record: "#80868b" - list: "#80868b" - block: "#80868b" - hints: "dark_gray" - search_result: { fg: "#f44336" bg: "#80868b" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#673ab7" attr: "b" } - shape_binary: { fg: "#673ab7" attr: "b" } - shape_block: { fg: "#2196f3" attr: "b" } - shape_bool: "#00bcd4" - shape_custom: "#00e676" - shape_datetime: { fg: "#00bcd4" attr: "b" } - shape_directory: "#00bcd4" - shape_external: "#00bcd4" - shape_externalarg: { fg: "#00e676" attr: "b" } - shape_filepath: "#00bcd4" - shape_flag: { fg: "#2196f3" attr: "b" } - shape_float: { fg: "#673ab7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00bcd4" attr: "b" } - shape_int: { fg: "#673ab7" attr: "b" } - shape_internalcall: { fg: "#00bcd4" attr: "b" } - shape_list: { fg: "#00bcd4" attr: "b" } - shape_literal: "#2196f3" - shape_match_pattern: "#00e676" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00bcd4" - shape_operator: "#ffeb3b" - shape_or: { fg: "#673ab7" attr: "b" } - shape_pipe: { fg: "#673ab7" attr: "b" } - shape_range: { fg: "#ffeb3b" attr: "b" } - shape_record: { fg: "#00bcd4" attr: "b" } - shape_redirection: { fg: "#673ab7" attr: "b" } - shape_signature: { fg: "#00e676" attr: "b" } - shape_string: "#00e676" - shape_string_interpolation: { fg: "#00bcd4" attr: "b" } - shape_table: { fg: "#2196f3" attr: "b" } - shape_variable: "#673ab7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#202124" - foreground: "#80868b" - cursor: "#80868b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#80868b' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00e676' attr: 'b' } + empty: '#2196f3' + bool: {|| if $in { '#00bcd4' } else { 'light_gray' } } + int: '#80868b' + filesize: {|e| + if $e == 0b { + '#80868b' + } else if $e < 1mb { + '#00bcd4' + } else {{ fg: '#2196f3' }} + } + duration: '#80868b' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f44336' attr: 'b' } + } else if $in < 6hr { + '#f44336' + } else if $in < 1day { + '#ffeb3b' + } else if $in < 3day { + '#00e676' + } else if $in < 1wk { + { fg: '#00e676' attr: 'b' } + } else if $in < 6wk { + '#00bcd4' + } else if $in < 52wk { + '#2196f3' + } else { 'dark_gray' } + } + range: '#80868b' + float: '#80868b' + string: '#80868b' + nothing: '#80868b' + binary: '#80868b' + cellpath: '#80868b' + row_index: { fg: '#00e676' attr: 'b' } + record: '#80868b' + list: '#80868b' + block: '#80868b' + hints: 'dark_gray' + search_result: { fg: '#f44336' bg: '#80868b' } + + shape_and: { fg: '#673ab7' attr: 'b' } + shape_binary: { fg: '#673ab7' attr: 'b' } + shape_block: { fg: '#2196f3' attr: 'b' } + shape_bool: '#00bcd4' + shape_custom: '#00e676' + shape_datetime: { fg: '#00bcd4' attr: 'b' } + shape_directory: '#00bcd4' + shape_external: '#00bcd4' + shape_externalarg: { fg: '#00e676' attr: 'b' } + shape_filepath: '#00bcd4' + shape_flag: { fg: '#2196f3' attr: 'b' } + shape_float: { fg: '#673ab7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00bcd4' attr: 'b' } + shape_int: { fg: '#673ab7' attr: 'b' } + shape_internalcall: { fg: '#00bcd4' attr: 'b' } + shape_list: { fg: '#00bcd4' attr: 'b' } + shape_literal: '#2196f3' + shape_match_pattern: '#00e676' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00bcd4' + shape_operator: '#ffeb3b' + shape_or: { fg: '#673ab7' attr: 'b' } + shape_pipe: { fg: '#673ab7' attr: 'b' } + shape_range: { fg: '#ffeb3b' attr: 'b' } + shape_record: { fg: '#00bcd4' attr: 'b' } + shape_redirection: { fg: '#673ab7' attr: 'b' } + shape_signature: { fg: '#00e676' attr: 'b' } + shape_string: '#00e676' + shape_string_interpolation: { fg: '#00bcd4' attr: 'b' } + shape_table: { fg: '#2196f3' attr: 'b' } + shape_variable: '#673ab7' + + background: '#202124' + foreground: '#80868b' + cursor: '#80868b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/material.nu b/themes/nu-themes/material.nu index 6bda6c7..0b6c14a 100644 --- a/themes/nu-themes/material.nu +++ b/themes/nu-themes/material.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c3e88d" attr: "b" } - empty: "#82aaff" - bool: {|| if $in { "#89ddff" } else { "light_gray" } } - int: "#eeffff" - filesize: {|e| - if $e == 0b { - "#eeffff" - } else if $e < 1mb { - "#89ddff" - } else {{ fg: "#82aaff" }} - } - duration: "#eeffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f07178" attr: "b" } - } else if $in < 6hr { - "#f07178" - } else if $in < 1day { - "#ffcb6b" - } else if $in < 3day { - "#c3e88d" - } else if $in < 1wk { - { fg: "#c3e88d" attr: "b" } - } else if $in < 6wk { - "#89ddff" - } else if $in < 52wk { - "#82aaff" - } else { "dark_gray" } - } - range: "#eeffff" - float: "#eeffff" - string: "#eeffff" - nothing: "#eeffff" - binary: "#eeffff" - cellpath: "#eeffff" - row_index: { fg: "#c3e88d" attr: "b" } - record: "#eeffff" - list: "#eeffff" - block: "#eeffff" - hints: "dark_gray" - search_result: { fg: "#f07178" bg: "#eeffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c792ea" attr: "b" } - shape_binary: { fg: "#c792ea" attr: "b" } - shape_block: { fg: "#82aaff" attr: "b" } - shape_bool: "#89ddff" - shape_custom: "#c3e88d" - shape_datetime: { fg: "#89ddff" attr: "b" } - shape_directory: "#89ddff" - shape_external: "#89ddff" - shape_externalarg: { fg: "#c3e88d" attr: "b" } - shape_filepath: "#89ddff" - shape_flag: { fg: "#82aaff" attr: "b" } - shape_float: { fg: "#c792ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#89ddff" attr: "b" } - shape_int: { fg: "#c792ea" attr: "b" } - shape_internalcall: { fg: "#89ddff" attr: "b" } - shape_list: { fg: "#89ddff" attr: "b" } - shape_literal: "#82aaff" - shape_match_pattern: "#c3e88d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#89ddff" - shape_operator: "#ffcb6b" - shape_or: { fg: "#c792ea" attr: "b" } - shape_pipe: { fg: "#c792ea" attr: "b" } - shape_range: { fg: "#ffcb6b" attr: "b" } - shape_record: { fg: "#89ddff" attr: "b" } - shape_redirection: { fg: "#c792ea" attr: "b" } - shape_signature: { fg: "#c3e88d" attr: "b" } - shape_string: "#c3e88d" - shape_string_interpolation: { fg: "#89ddff" attr: "b" } - shape_table: { fg: "#82aaff" attr: "b" } - shape_variable: "#c792ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#263238" - foreground: "#eeffff" - cursor: "#eeffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c3e88d' attr: 'b' } + empty: '#82aaff' + bool: {|| if $in { '#89ddff' } else { 'light_gray' } } + int: '#eeffff' + filesize: {|e| + if $e == 0b { + '#eeffff' + } else if $e < 1mb { + '#89ddff' + } else {{ fg: '#82aaff' }} + } + duration: '#eeffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f07178' attr: 'b' } + } else if $in < 6hr { + '#f07178' + } else if $in < 1day { + '#ffcb6b' + } else if $in < 3day { + '#c3e88d' + } else if $in < 1wk { + { fg: '#c3e88d' attr: 'b' } + } else if $in < 6wk { + '#89ddff' + } else if $in < 52wk { + '#82aaff' + } else { 'dark_gray' } + } + range: '#eeffff' + float: '#eeffff' + string: '#eeffff' + nothing: '#eeffff' + binary: '#eeffff' + cellpath: '#eeffff' + row_index: { fg: '#c3e88d' attr: 'b' } + record: '#eeffff' + list: '#eeffff' + block: '#eeffff' + hints: 'dark_gray' + search_result: { fg: '#f07178' bg: '#eeffff' } + + shape_and: { fg: '#c792ea' attr: 'b' } + shape_binary: { fg: '#c792ea' attr: 'b' } + shape_block: { fg: '#82aaff' attr: 'b' } + shape_bool: '#89ddff' + shape_custom: '#c3e88d' + shape_datetime: { fg: '#89ddff' attr: 'b' } + shape_directory: '#89ddff' + shape_external: '#89ddff' + shape_externalarg: { fg: '#c3e88d' attr: 'b' } + shape_filepath: '#89ddff' + shape_flag: { fg: '#82aaff' attr: 'b' } + shape_float: { fg: '#c792ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#89ddff' attr: 'b' } + shape_int: { fg: '#c792ea' attr: 'b' } + shape_internalcall: { fg: '#89ddff' attr: 'b' } + shape_list: { fg: '#89ddff' attr: 'b' } + shape_literal: '#82aaff' + shape_match_pattern: '#c3e88d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#89ddff' + shape_operator: '#ffcb6b' + shape_or: { fg: '#c792ea' attr: 'b' } + shape_pipe: { fg: '#c792ea' attr: 'b' } + shape_range: { fg: '#ffcb6b' attr: 'b' } + shape_record: { fg: '#89ddff' attr: 'b' } + shape_redirection: { fg: '#c792ea' attr: 'b' } + shape_signature: { fg: '#c3e88d' attr: 'b' } + shape_string: '#c3e88d' + shape_string_interpolation: { fg: '#89ddff' attr: 'b' } + shape_table: { fg: '#82aaff' attr: 'b' } + shape_variable: '#c792ea' + + background: '#263238' + foreground: '#eeffff' + cursor: '#eeffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mathias.nu b/themes/nu-themes/mathias.nu index 6b03693..cdd444f 100644 --- a/themes/nu-themes/mathias.nu +++ b/themes/nu-themes/mathias.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a6e32d" attr: "b" } - empty: "#c48dff" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#67d9f0" - } else {{ fg: "#c48dff" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e52222" attr: "b" } - } else if $in < 6hr { - "#e52222" - } else if $in < 1day { - "#fc951e" - } else if $in < 3day { - "#a6e32d" - } else if $in < 1wk { - { fg: "#a6e32d" attr: "b" } - } else if $in < 6wk { - "#67d9f0" - } else if $in < 52wk { - "#c48dff" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#a6e32d" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#e52222" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fa2573" attr: "b" } - shape_binary: { fg: "#fa2573" attr: "b" } - shape_block: { fg: "#c48dff" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#a6e32d" - shape_datetime: { fg: "#67d9f0" attr: "b" } - shape_directory: "#67d9f0" - shape_external: "#67d9f0" - shape_externalarg: { fg: "#a6e32d" attr: "b" } - shape_filepath: "#67d9f0" - shape_flag: { fg: "#c48dff" attr: "b" } - shape_float: { fg: "#fa2573" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#67d9f0" attr: "b" } - shape_int: { fg: "#fa2573" attr: "b" } - shape_internalcall: { fg: "#67d9f0" attr: "b" } - shape_list: { fg: "#67d9f0" attr: "b" } - shape_literal: "#c48dff" - shape_match_pattern: "#a6e32d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#fc951e" - shape_or: { fg: "#fa2573" attr: "b" } - shape_pipe: { fg: "#fa2573" attr: "b" } - shape_range: { fg: "#fc951e" attr: "b" } - shape_record: { fg: "#67d9f0" attr: "b" } - shape_redirection: { fg: "#fa2573" attr: "b" } - shape_signature: { fg: "#a6e32d" attr: "b" } - shape_string: "#a6e32d" - shape_string_interpolation: { fg: "#67d9f0" attr: "b" } - shape_table: { fg: "#c48dff" attr: "b" } - shape_variable: "#fa2573" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#bbbbbb" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a6e32d' attr: 'b' } + empty: '#c48dff' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#67d9f0' + } else {{ fg: '#c48dff' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e52222' attr: 'b' } + } else if $in < 6hr { + '#e52222' + } else if $in < 1day { + '#fc951e' + } else if $in < 3day { + '#a6e32d' + } else if $in < 1wk { + { fg: '#a6e32d' attr: 'b' } + } else if $in < 6wk { + '#67d9f0' + } else if $in < 52wk { + '#c48dff' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#a6e32d' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#e52222' bg: '#f2f2f2' } + + shape_and: { fg: '#fa2573' attr: 'b' } + shape_binary: { fg: '#fa2573' attr: 'b' } + shape_block: { fg: '#c48dff' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#a6e32d' + shape_datetime: { fg: '#67d9f0' attr: 'b' } + shape_directory: '#67d9f0' + shape_external: '#67d9f0' + shape_externalarg: { fg: '#a6e32d' attr: 'b' } + shape_filepath: '#67d9f0' + shape_flag: { fg: '#c48dff' attr: 'b' } + shape_float: { fg: '#fa2573' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#67d9f0' attr: 'b' } + shape_int: { fg: '#fa2573' attr: 'b' } + shape_internalcall: { fg: '#67d9f0' attr: 'b' } + shape_list: { fg: '#67d9f0' attr: 'b' } + shape_literal: '#c48dff' + shape_match_pattern: '#a6e32d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#fc951e' + shape_or: { fg: '#fa2573' attr: 'b' } + shape_pipe: { fg: '#fa2573' attr: 'b' } + shape_range: { fg: '#fc951e' attr: 'b' } + shape_record: { fg: '#67d9f0' attr: 'b' } + shape_redirection: { fg: '#fa2573' attr: 'b' } + shape_signature: { fg: '#a6e32d' attr: 'b' } + shape_string: '#a6e32d' + shape_string_interpolation: { fg: '#67d9f0' attr: 'b' } + shape_table: { fg: '#c48dff' attr: 'b' } + shape_variable: '#fa2573' + + background: '#000000' + foreground: '#bbbbbb' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/medallion.nu b/themes/nu-themes/medallion.nu index fa41612..54142f6 100644 --- a/themes/nu-themes/medallion.nu +++ b/themes/nu-themes/medallion.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cac29a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7c8b16" attr: "b" } - empty: "#616bb0" - bool: {|| if $in { "#ffbc51" } else { "light_gray" } } - int: "#cac29a" - filesize: {|e| - if $e == 0b { - "#cac29a" - } else if $e < 1mb { - "#916c25" - } else {{ fg: "#616bb0" }} - } - duration: "#cac29a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b64c00" attr: "b" } - } else if $in < 6hr { - "#b64c00" - } else if $in < 1day { - "#d3bd26" - } else if $in < 3day { - "#7c8b16" - } else if $in < 1wk { - { fg: "#7c8b16" attr: "b" } - } else if $in < 6wk { - "#916c25" - } else if $in < 52wk { - "#616bb0" - } else { "dark_gray" } - } - range: "#cac29a" - float: "#cac29a" - string: "#cac29a" - nothing: "#cac29a" - binary: "#cac29a" - cellpath: "#cac29a" - row_index: { fg: "#7c8b16" attr: "b" } - record: "#cac29a" - list: "#cac29a" - block: "#cac29a" - hints: "dark_gray" - search_result: { fg: "#b64c00" bg: "#cac29a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8c5a90" attr: "b" } - shape_binary: { fg: "#8c5a90" attr: "b" } - shape_block: { fg: "#616bb0" attr: "b" } - shape_bool: "#ffbc51" - shape_custom: "#7c8b16" - shape_datetime: { fg: "#916c25" attr: "b" } - shape_directory: "#916c25" - shape_external: "#916c25" - shape_externalarg: { fg: "#7c8b16" attr: "b" } - shape_filepath: "#916c25" - shape_flag: { fg: "#616bb0" attr: "b" } - shape_float: { fg: "#8c5a90" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#916c25" attr: "b" } - shape_int: { fg: "#8c5a90" attr: "b" } - shape_internalcall: { fg: "#916c25" attr: "b" } - shape_list: { fg: "#916c25" attr: "b" } - shape_literal: "#616bb0" - shape_match_pattern: "#7c8b16" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ffbc51" - shape_operator: "#d3bd26" - shape_or: { fg: "#8c5a90" attr: "b" } - shape_pipe: { fg: "#8c5a90" attr: "b" } - shape_range: { fg: "#d3bd26" attr: "b" } - shape_record: { fg: "#916c25" attr: "b" } - shape_redirection: { fg: "#8c5a90" attr: "b" } - shape_signature: { fg: "#7c8b16" attr: "b" } - shape_string: "#7c8b16" - shape_string_interpolation: { fg: "#916c25" attr: "b" } - shape_table: { fg: "#616bb0" attr: "b" } - shape_variable: "#8c5a90" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d1908" - foreground: "#cac296" - cursor: "#cac296" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cac29a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7c8b16' attr: 'b' } + empty: '#616bb0' + bool: {|| if $in { '#ffbc51' } else { 'light_gray' } } + int: '#cac29a' + filesize: {|e| + if $e == 0b { + '#cac29a' + } else if $e < 1mb { + '#916c25' + } else {{ fg: '#616bb0' }} + } + duration: '#cac29a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b64c00' attr: 'b' } + } else if $in < 6hr { + '#b64c00' + } else if $in < 1day { + '#d3bd26' + } else if $in < 3day { + '#7c8b16' + } else if $in < 1wk { + { fg: '#7c8b16' attr: 'b' } + } else if $in < 6wk { + '#916c25' + } else if $in < 52wk { + '#616bb0' + } else { 'dark_gray' } + } + range: '#cac29a' + float: '#cac29a' + string: '#cac29a' + nothing: '#cac29a' + binary: '#cac29a' + cellpath: '#cac29a' + row_index: { fg: '#7c8b16' attr: 'b' } + record: '#cac29a' + list: '#cac29a' + block: '#cac29a' + hints: 'dark_gray' + search_result: { fg: '#b64c00' bg: '#cac29a' } + + shape_and: { fg: '#8c5a90' attr: 'b' } + shape_binary: { fg: '#8c5a90' attr: 'b' } + shape_block: { fg: '#616bb0' attr: 'b' } + shape_bool: '#ffbc51' + shape_custom: '#7c8b16' + shape_datetime: { fg: '#916c25' attr: 'b' } + shape_directory: '#916c25' + shape_external: '#916c25' + shape_externalarg: { fg: '#7c8b16' attr: 'b' } + shape_filepath: '#916c25' + shape_flag: { fg: '#616bb0' attr: 'b' } + shape_float: { fg: '#8c5a90' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#916c25' attr: 'b' } + shape_int: { fg: '#8c5a90' attr: 'b' } + shape_internalcall: { fg: '#916c25' attr: 'b' } + shape_list: { fg: '#916c25' attr: 'b' } + shape_literal: '#616bb0' + shape_match_pattern: '#7c8b16' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ffbc51' + shape_operator: '#d3bd26' + shape_or: { fg: '#8c5a90' attr: 'b' } + shape_pipe: { fg: '#8c5a90' attr: 'b' } + shape_range: { fg: '#d3bd26' attr: 'b' } + shape_record: { fg: '#916c25' attr: 'b' } + shape_redirection: { fg: '#8c5a90' attr: 'b' } + shape_signature: { fg: '#7c8b16' attr: 'b' } + shape_string: '#7c8b16' + shape_string_interpolation: { fg: '#916c25' attr: 'b' } + shape_table: { fg: '#616bb0' attr: 'b' } + shape_variable: '#8c5a90' + + background: '#1d1908' + foreground: '#cac296' + cursor: '#cac296' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mellow-purple.nu b/themes/nu-themes/mellow-purple.nu index 704ccaa..398edfd 100644 --- a/themes/nu-themes/mellow-purple.nu +++ b/themes/nu-themes/mellow-purple.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffeeff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#05cb0d" attr: "b" } - empty: "#550068" - bool: {|| if $in { "#b900b1" } else { "light_gray" } } - int: "#ffeeff" - filesize: {|e| - if $e == 0b { - "#ffeeff" - } else if $e < 1mb { - "#b900b1" - } else {{ fg: "#550068" }} - } - duration: "#ffeeff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#00d9e9" attr: "b" } - } else if $in < 6hr { - "#00d9e9" - } else if $in < 1day { - "#955ae7" - } else if $in < 3day { - "#05cb0d" - } else if $in < 1wk { - { fg: "#05cb0d" attr: "b" } - } else if $in < 6wk { - "#b900b1" - } else if $in < 52wk { - "#550068" - } else { "dark_gray" } - } - range: "#ffeeff" - float: "#ffeeff" - string: "#ffeeff" - nothing: "#ffeeff" - binary: "#ffeeff" - cellpath: "#ffeeff" - row_index: { fg: "#05cb0d" attr: "b" } - record: "#ffeeff" - list: "#ffeeff" - block: "#ffeeff" - hints: "dark_gray" - search_result: { fg: "#00d9e9" bg: "#ffeeff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8991bb" attr: "b" } - shape_binary: { fg: "#8991bb" attr: "b" } - shape_block: { fg: "#550068" attr: "b" } - shape_bool: "#b900b1" - shape_custom: "#05cb0d" - shape_datetime: { fg: "#b900b1" attr: "b" } - shape_directory: "#b900b1" - shape_external: "#b900b1" - shape_externalarg: { fg: "#05cb0d" attr: "b" } - shape_filepath: "#b900b1" - shape_flag: { fg: "#550068" attr: "b" } - shape_float: { fg: "#8991bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b900b1" attr: "b" } - shape_int: { fg: "#8991bb" attr: "b" } - shape_internalcall: { fg: "#b900b1" attr: "b" } - shape_list: { fg: "#b900b1" attr: "b" } - shape_literal: "#550068" - shape_match_pattern: "#05cb0d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b900b1" - shape_operator: "#955ae7" - shape_or: { fg: "#8991bb" attr: "b" } - shape_pipe: { fg: "#8991bb" attr: "b" } - shape_range: { fg: "#955ae7" attr: "b" } - shape_record: { fg: "#b900b1" attr: "b" } - shape_redirection: { fg: "#8991bb" attr: "b" } - shape_signature: { fg: "#05cb0d" attr: "b" } - shape_string: "#05cb0d" - shape_string_interpolation: { fg: "#b900b1" attr: "b" } - shape_table: { fg: "#550068" attr: "b" } - shape_variable: "#8991bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e0528" - foreground: "#ffeeff" - cursor: "#ffeeff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffeeff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#05cb0d' attr: 'b' } + empty: '#550068' + bool: {|| if $in { '#b900b1' } else { 'light_gray' } } + int: '#ffeeff' + filesize: {|e| + if $e == 0b { + '#ffeeff' + } else if $e < 1mb { + '#b900b1' + } else {{ fg: '#550068' }} + } + duration: '#ffeeff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#00d9e9' attr: 'b' } + } else if $in < 6hr { + '#00d9e9' + } else if $in < 1day { + '#955ae7' + } else if $in < 3day { + '#05cb0d' + } else if $in < 1wk { + { fg: '#05cb0d' attr: 'b' } + } else if $in < 6wk { + '#b900b1' + } else if $in < 52wk { + '#550068' + } else { 'dark_gray' } + } + range: '#ffeeff' + float: '#ffeeff' + string: '#ffeeff' + nothing: '#ffeeff' + binary: '#ffeeff' + cellpath: '#ffeeff' + row_index: { fg: '#05cb0d' attr: 'b' } + record: '#ffeeff' + list: '#ffeeff' + block: '#ffeeff' + hints: 'dark_gray' + search_result: { fg: '#00d9e9' bg: '#ffeeff' } + + shape_and: { fg: '#8991bb' attr: 'b' } + shape_binary: { fg: '#8991bb' attr: 'b' } + shape_block: { fg: '#550068' attr: 'b' } + shape_bool: '#b900b1' + shape_custom: '#05cb0d' + shape_datetime: { fg: '#b900b1' attr: 'b' } + shape_directory: '#b900b1' + shape_external: '#b900b1' + shape_externalarg: { fg: '#05cb0d' attr: 'b' } + shape_filepath: '#b900b1' + shape_flag: { fg: '#550068' attr: 'b' } + shape_float: { fg: '#8991bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b900b1' attr: 'b' } + shape_int: { fg: '#8991bb' attr: 'b' } + shape_internalcall: { fg: '#b900b1' attr: 'b' } + shape_list: { fg: '#b900b1' attr: 'b' } + shape_literal: '#550068' + shape_match_pattern: '#05cb0d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b900b1' + shape_operator: '#955ae7' + shape_or: { fg: '#8991bb' attr: 'b' } + shape_pipe: { fg: '#8991bb' attr: 'b' } + shape_range: { fg: '#955ae7' attr: 'b' } + shape_record: { fg: '#b900b1' attr: 'b' } + shape_redirection: { fg: '#8991bb' attr: 'b' } + shape_signature: { fg: '#05cb0d' attr: 'b' } + shape_string: '#05cb0d' + shape_string_interpolation: { fg: '#b900b1' attr: 'b' } + shape_table: { fg: '#550068' attr: 'b' } + shape_variable: '#8991bb' + + background: '#1e0528' + foreground: '#ffeeff' + cursor: '#ffeeff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mexico-light.nu b/themes/nu-themes/mexico-light.nu index 8ac3405..6f56a17 100644 --- a/themes/nu-themes/mexico-light.nu +++ b/themes/nu-themes/mexico-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#383838" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#538947" attr: "b" } - empty: "#7cafc2" - bool: {|| if $in { "#4b8093" } else { "light_gray" } } - int: "#383838" - filesize: {|e| - if $e == 0b { - "#383838" - } else if $e < 1mb { - "#4b8093" - } else {{ fg: "#7cafc2" }} - } - duration: "#383838" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ab4642" attr: "b" } - } else if $in < 6hr { - "#ab4642" - } else if $in < 1day { - "#f79a0e" - } else if $in < 3day { - "#538947" - } else if $in < 1wk { - { fg: "#538947" attr: "b" } - } else if $in < 6wk { - "#4b8093" - } else if $in < 52wk { - "#7cafc2" - } else { "dark_gray" } - } - range: "#383838" - float: "#383838" - string: "#383838" - nothing: "#383838" - binary: "#383838" - cellpath: "#383838" - row_index: { fg: "#538947" attr: "b" } - record: "#383838" - list: "#383838" - block: "#383838" - hints: "dark_gray" - search_result: { fg: "#ab4642" bg: "#383838" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#96609e" attr: "b" } - shape_binary: { fg: "#96609e" attr: "b" } - shape_block: { fg: "#7cafc2" attr: "b" } - shape_bool: "#4b8093" - shape_custom: "#538947" - shape_datetime: { fg: "#4b8093" attr: "b" } - shape_directory: "#4b8093" - shape_external: "#4b8093" - shape_externalarg: { fg: "#538947" attr: "b" } - shape_filepath: "#4b8093" - shape_flag: { fg: "#7cafc2" attr: "b" } - shape_float: { fg: "#96609e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4b8093" attr: "b" } - shape_int: { fg: "#96609e" attr: "b" } - shape_internalcall: { fg: "#4b8093" attr: "b" } - shape_list: { fg: "#4b8093" attr: "b" } - shape_literal: "#7cafc2" - shape_match_pattern: "#538947" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4b8093" - shape_operator: "#f79a0e" - shape_or: { fg: "#96609e" attr: "b" } - shape_pipe: { fg: "#96609e" attr: "b" } - shape_range: { fg: "#f79a0e" attr: "b" } - shape_record: { fg: "#4b8093" attr: "b" } - shape_redirection: { fg: "#96609e" attr: "b" } - shape_signature: { fg: "#538947" attr: "b" } - shape_string: "#538947" - shape_string_interpolation: { fg: "#4b8093" attr: "b" } - shape_table: { fg: "#7cafc2" attr: "b" } - shape_variable: "#96609e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f8f8" - foreground: "#383838" - cursor: "#383838" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#383838' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#538947' attr: 'b' } + empty: '#7cafc2' + bool: {|| if $in { '#4b8093' } else { 'light_gray' } } + int: '#383838' + filesize: {|e| + if $e == 0b { + '#383838' + } else if $e < 1mb { + '#4b8093' + } else {{ fg: '#7cafc2' }} + } + duration: '#383838' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ab4642' attr: 'b' } + } else if $in < 6hr { + '#ab4642' + } else if $in < 1day { + '#f79a0e' + } else if $in < 3day { + '#538947' + } else if $in < 1wk { + { fg: '#538947' attr: 'b' } + } else if $in < 6wk { + '#4b8093' + } else if $in < 52wk { + '#7cafc2' + } else { 'dark_gray' } + } + range: '#383838' + float: '#383838' + string: '#383838' + nothing: '#383838' + binary: '#383838' + cellpath: '#383838' + row_index: { fg: '#538947' attr: 'b' } + record: '#383838' + list: '#383838' + block: '#383838' + hints: 'dark_gray' + search_result: { fg: '#ab4642' bg: '#383838' } + + shape_and: { fg: '#96609e' attr: 'b' } + shape_binary: { fg: '#96609e' attr: 'b' } + shape_block: { fg: '#7cafc2' attr: 'b' } + shape_bool: '#4b8093' + shape_custom: '#538947' + shape_datetime: { fg: '#4b8093' attr: 'b' } + shape_directory: '#4b8093' + shape_external: '#4b8093' + shape_externalarg: { fg: '#538947' attr: 'b' } + shape_filepath: '#4b8093' + shape_flag: { fg: '#7cafc2' attr: 'b' } + shape_float: { fg: '#96609e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4b8093' attr: 'b' } + shape_int: { fg: '#96609e' attr: 'b' } + shape_internalcall: { fg: '#4b8093' attr: 'b' } + shape_list: { fg: '#4b8093' attr: 'b' } + shape_literal: '#7cafc2' + shape_match_pattern: '#538947' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4b8093' + shape_operator: '#f79a0e' + shape_or: { fg: '#96609e' attr: 'b' } + shape_pipe: { fg: '#96609e' attr: 'b' } + shape_range: { fg: '#f79a0e' attr: 'b' } + shape_record: { fg: '#4b8093' attr: 'b' } + shape_redirection: { fg: '#96609e' attr: 'b' } + shape_signature: { fg: '#538947' attr: 'b' } + shape_string: '#538947' + shape_string_interpolation: { fg: '#4b8093' attr: 'b' } + shape_table: { fg: '#7cafc2' attr: 'b' } + shape_variable: '#96609e' + + background: '#f8f8f8' + foreground: '#383838' + cursor: '#383838' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/miramare.nu b/themes/nu-themes/miramare.nu index 26119b4..05cf62e 100644 --- a/themes/nu-themes/miramare.nu +++ b/themes/nu-themes/miramare.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#444444" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87af87" attr: "b" } - empty: "#89beba" - bool: {|| if $in { "#87c095" } else { "light_gray" } } - int: "#444444" - filesize: {|e| - if $e == 0b { - "#444444" - } else if $e < 1mb { - "#87c095" - } else {{ fg: "#89beba" }} - } - duration: "#444444" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e68183" attr: "b" } - } else if $in < 6hr { - "#e68183" - } else if $in < 1day { - "#d9bb80" - } else if $in < 3day { - "#87af87" - } else if $in < 1wk { - { fg: "#87af87" attr: "b" } - } else if $in < 6wk { - "#87c095" - } else if $in < 52wk { - "#89beba" - } else { "dark_gray" } - } - range: "#444444" - float: "#444444" - string: "#444444" - nothing: "#444444" - binary: "#444444" - cellpath: "#444444" - row_index: { fg: "#87af87" attr: "b" } - record: "#444444" - list: "#444444" - block: "#444444" - hints: "dark_gray" - search_result: { fg: "#e68183" bg: "#444444" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3a0bc" attr: "b" } - shape_binary: { fg: "#d3a0bc" attr: "b" } - shape_block: { fg: "#89beba" attr: "b" } - shape_bool: "#87c095" - shape_custom: "#87af87" - shape_datetime: { fg: "#87c095" attr: "b" } - shape_directory: "#87c095" - shape_external: "#87c095" - shape_externalarg: { fg: "#87af87" attr: "b" } - shape_filepath: "#87c095" - shape_flag: { fg: "#89beba" attr: "b" } - shape_float: { fg: "#d3a0bc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#87c095" attr: "b" } - shape_int: { fg: "#d3a0bc" attr: "b" } - shape_internalcall: { fg: "#87c095" attr: "b" } - shape_list: { fg: "#87c095" attr: "b" } - shape_literal: "#89beba" - shape_match_pattern: "#87af87" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#87c095" - shape_operator: "#d9bb80" - shape_or: { fg: "#d3a0bc" attr: "b" } - shape_pipe: { fg: "#d3a0bc" attr: "b" } - shape_range: { fg: "#d9bb80" attr: "b" } - shape_record: { fg: "#87c095" attr: "b" } - shape_redirection: { fg: "#d3a0bc" attr: "b" } - shape_signature: { fg: "#87af87" attr: "b" } - shape_string: "#87af87" - shape_string_interpolation: { fg: "#87c095" attr: "b" } - shape_table: { fg: "#89beba" attr: "b" } - shape_variable: "#d3a0bc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a2426" - foreground: "#e6d6ac" - cursor: "#d9bb80" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#444444' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87af87' attr: 'b' } + empty: '#89beba' + bool: {|| if $in { '#87c095' } else { 'light_gray' } } + int: '#444444' + filesize: {|e| + if $e == 0b { + '#444444' + } else if $e < 1mb { + '#87c095' + } else {{ fg: '#89beba' }} + } + duration: '#444444' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e68183' attr: 'b' } + } else if $in < 6hr { + '#e68183' + } else if $in < 1day { + '#d9bb80' + } else if $in < 3day { + '#87af87' + } else if $in < 1wk { + { fg: '#87af87' attr: 'b' } + } else if $in < 6wk { + '#87c095' + } else if $in < 52wk { + '#89beba' + } else { 'dark_gray' } + } + range: '#444444' + float: '#444444' + string: '#444444' + nothing: '#444444' + binary: '#444444' + cellpath: '#444444' + row_index: { fg: '#87af87' attr: 'b' } + record: '#444444' + list: '#444444' + block: '#444444' + hints: 'dark_gray' + search_result: { fg: '#e68183' bg: '#444444' } + + shape_and: { fg: '#d3a0bc' attr: 'b' } + shape_binary: { fg: '#d3a0bc' attr: 'b' } + shape_block: { fg: '#89beba' attr: 'b' } + shape_bool: '#87c095' + shape_custom: '#87af87' + shape_datetime: { fg: '#87c095' attr: 'b' } + shape_directory: '#87c095' + shape_external: '#87c095' + shape_externalarg: { fg: '#87af87' attr: 'b' } + shape_filepath: '#87c095' + shape_flag: { fg: '#89beba' attr: 'b' } + shape_float: { fg: '#d3a0bc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#87c095' attr: 'b' } + shape_int: { fg: '#d3a0bc' attr: 'b' } + shape_internalcall: { fg: '#87c095' attr: 'b' } + shape_list: { fg: '#87c095' attr: 'b' } + shape_literal: '#89beba' + shape_match_pattern: '#87af87' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#87c095' + shape_operator: '#d9bb80' + shape_or: { fg: '#d3a0bc' attr: 'b' } + shape_pipe: { fg: '#d3a0bc' attr: 'b' } + shape_range: { fg: '#d9bb80' attr: 'b' } + shape_record: { fg: '#87c095' attr: 'b' } + shape_redirection: { fg: '#d3a0bc' attr: 'b' } + shape_signature: { fg: '#87af87' attr: 'b' } + shape_string: '#87af87' + shape_string_interpolation: { fg: '#87c095' attr: 'b' } + shape_table: { fg: '#89beba' attr: 'b' } + shape_variable: '#d3a0bc' + + background: '#2a2426' + foreground: '#e6d6ac' + cursor: '#d9bb80' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/misterioso.nu b/themes/nu-themes/misterioso.nu index 2772ddf..36e4d47 100644 --- a/themes/nu-themes/misterioso.nu +++ b/themes/nu-themes/misterioso.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e1e1e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#74af68" attr: "b" } - empty: "#338f86" - bool: {|| if $in { "#00ede1" } else { "light_gray" } } - int: "#e1e1e0" - filesize: {|e| - if $e == 0b { - "#e1e1e0" - } else if $e < 1mb { - "#23d7d7" - } else {{ fg: "#338f86" }} - } - duration: "#e1e1e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff4242" attr: "b" } - } else if $in < 6hr { - "#ff4242" - } else if $in < 1day { - "#ffad29" - } else if $in < 3day { - "#74af68" - } else if $in < 1wk { - { fg: "#74af68" attr: "b" } - } else if $in < 6wk { - "#23d7d7" - } else if $in < 52wk { - "#338f86" - } else { "dark_gray" } - } - range: "#e1e1e0" - float: "#e1e1e0" - string: "#e1e1e0" - nothing: "#e1e1e0" - binary: "#e1e1e0" - cellpath: "#e1e1e0" - row_index: { fg: "#74af68" attr: "b" } - record: "#e1e1e0" - list: "#e1e1e0" - block: "#e1e1e0" - hints: "dark_gray" - search_result: { fg: "#ff4242" bg: "#e1e1e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9414e6" attr: "b" } - shape_binary: { fg: "#9414e6" attr: "b" } - shape_block: { fg: "#338f86" attr: "b" } - shape_bool: "#00ede1" - shape_custom: "#74af68" - shape_datetime: { fg: "#23d7d7" attr: "b" } - shape_directory: "#23d7d7" - shape_external: "#23d7d7" - shape_externalarg: { fg: "#74af68" attr: "b" } - shape_filepath: "#23d7d7" - shape_flag: { fg: "#338f86" attr: "b" } - shape_float: { fg: "#9414e6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#23d7d7" attr: "b" } - shape_int: { fg: "#9414e6" attr: "b" } - shape_internalcall: { fg: "#23d7d7" attr: "b" } - shape_list: { fg: "#23d7d7" attr: "b" } - shape_literal: "#338f86" - shape_match_pattern: "#74af68" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ede1" - shape_operator: "#ffad29" - shape_or: { fg: "#9414e6" attr: "b" } - shape_pipe: { fg: "#9414e6" attr: "b" } - shape_range: { fg: "#ffad29" attr: "b" } - shape_record: { fg: "#23d7d7" attr: "b" } - shape_redirection: { fg: "#9414e6" attr: "b" } - shape_signature: { fg: "#74af68" attr: "b" } - shape_string: "#74af68" - shape_string_interpolation: { fg: "#23d7d7" attr: "b" } - shape_table: { fg: "#338f86" attr: "b" } - shape_variable: "#9414e6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2d3743" - foreground: "#e1e1e0" - cursor: "#e1e1e0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e1e1e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#74af68' attr: 'b' } + empty: '#338f86' + bool: {|| if $in { '#00ede1' } else { 'light_gray' } } + int: '#e1e1e0' + filesize: {|e| + if $e == 0b { + '#e1e1e0' + } else if $e < 1mb { + '#23d7d7' + } else {{ fg: '#338f86' }} + } + duration: '#e1e1e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff4242' attr: 'b' } + } else if $in < 6hr { + '#ff4242' + } else if $in < 1day { + '#ffad29' + } else if $in < 3day { + '#74af68' + } else if $in < 1wk { + { fg: '#74af68' attr: 'b' } + } else if $in < 6wk { + '#23d7d7' + } else if $in < 52wk { + '#338f86' + } else { 'dark_gray' } + } + range: '#e1e1e0' + float: '#e1e1e0' + string: '#e1e1e0' + nothing: '#e1e1e0' + binary: '#e1e1e0' + cellpath: '#e1e1e0' + row_index: { fg: '#74af68' attr: 'b' } + record: '#e1e1e0' + list: '#e1e1e0' + block: '#e1e1e0' + hints: 'dark_gray' + search_result: { fg: '#ff4242' bg: '#e1e1e0' } + + shape_and: { fg: '#9414e6' attr: 'b' } + shape_binary: { fg: '#9414e6' attr: 'b' } + shape_block: { fg: '#338f86' attr: 'b' } + shape_bool: '#00ede1' + shape_custom: '#74af68' + shape_datetime: { fg: '#23d7d7' attr: 'b' } + shape_directory: '#23d7d7' + shape_external: '#23d7d7' + shape_externalarg: { fg: '#74af68' attr: 'b' } + shape_filepath: '#23d7d7' + shape_flag: { fg: '#338f86' attr: 'b' } + shape_float: { fg: '#9414e6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#23d7d7' attr: 'b' } + shape_int: { fg: '#9414e6' attr: 'b' } + shape_internalcall: { fg: '#23d7d7' attr: 'b' } + shape_list: { fg: '#23d7d7' attr: 'b' } + shape_literal: '#338f86' + shape_match_pattern: '#74af68' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ede1' + shape_operator: '#ffad29' + shape_or: { fg: '#9414e6' attr: 'b' } + shape_pipe: { fg: '#9414e6' attr: 'b' } + shape_range: { fg: '#ffad29' attr: 'b' } + shape_record: { fg: '#23d7d7' attr: 'b' } + shape_redirection: { fg: '#9414e6' attr: 'b' } + shape_signature: { fg: '#74af68' attr: 'b' } + shape_string: '#74af68' + shape_string_interpolation: { fg: '#23d7d7' attr: 'b' } + shape_table: { fg: '#338f86' attr: 'b' } + shape_variable: '#9414e6' + + background: '#2d3743' + foreground: '#e1e1e0' + cursor: '#e1e1e0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/miu.nu b/themes/nu-themes/miu.nu index 58fb4fa..260bde7 100644 --- a/themes/nu-themes/miu.nu +++ b/themes/nu-themes/miu.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d9d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7ab87a" attr: "b" } - empty: "#7a7ab8" - bool: {|| if $in { "#bddbdb" } else { "light_gray" } } - int: "#d9d9d9" - filesize: {|e| - if $e == 0b { - "#d9d9d9" - } else if $e < 1mb { - "#7ab8b8" - } else {{ fg: "#7a7ab8" }} - } - duration: "#d9d9d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b87a7a" attr: "b" } - } else if $in < 6hr { - "#b87a7a" - } else if $in < 1day { - "#b8b87a" - } else if $in < 3day { - "#7ab87a" - } else if $in < 1wk { - { fg: "#7ab87a" attr: "b" } - } else if $in < 6wk { - "#7ab8b8" - } else if $in < 52wk { - "#7a7ab8" - } else { "dark_gray" } - } - range: "#d9d9d9" - float: "#d9d9d9" - string: "#d9d9d9" - nothing: "#d9d9d9" - binary: "#d9d9d9" - cellpath: "#d9d9d9" - row_index: { fg: "#7ab87a" attr: "b" } - record: "#d9d9d9" - list: "#d9d9d9" - block: "#d9d9d9" - hints: "dark_gray" - search_result: { fg: "#b87a7a" bg: "#d9d9d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b87ab8" attr: "b" } - shape_binary: { fg: "#b87ab8" attr: "b" } - shape_block: { fg: "#7a7ab8" attr: "b" } - shape_bool: "#bddbdb" - shape_custom: "#7ab87a" - shape_datetime: { fg: "#7ab8b8" attr: "b" } - shape_directory: "#7ab8b8" - shape_external: "#7ab8b8" - shape_externalarg: { fg: "#7ab87a" attr: "b" } - shape_filepath: "#7ab8b8" - shape_flag: { fg: "#7a7ab8" attr: "b" } - shape_float: { fg: "#b87ab8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7ab8b8" attr: "b" } - shape_int: { fg: "#b87ab8" attr: "b" } - shape_internalcall: { fg: "#7ab8b8" attr: "b" } - shape_list: { fg: "#7ab8b8" attr: "b" } - shape_literal: "#7a7ab8" - shape_match_pattern: "#7ab87a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#bddbdb" - shape_operator: "#b8b87a" - shape_or: { fg: "#b87ab8" attr: "b" } - shape_pipe: { fg: "#b87ab8" attr: "b" } - shape_range: { fg: "#b8b87a" attr: "b" } - shape_record: { fg: "#7ab8b8" attr: "b" } - shape_redirection: { fg: "#b87ab8" attr: "b" } - shape_signature: { fg: "#7ab87a" attr: "b" } - shape_string: "#7ab87a" - shape_string_interpolation: { fg: "#7ab8b8" attr: "b" } - shape_table: { fg: "#7a7ab8" attr: "b" } - shape_variable: "#b87ab8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0d1926" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d9d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7ab87a' attr: 'b' } + empty: '#7a7ab8' + bool: {|| if $in { '#bddbdb' } else { 'light_gray' } } + int: '#d9d9d9' + filesize: {|e| + if $e == 0b { + '#d9d9d9' + } else if $e < 1mb { + '#7ab8b8' + } else {{ fg: '#7a7ab8' }} + } + duration: '#d9d9d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b87a7a' attr: 'b' } + } else if $in < 6hr { + '#b87a7a' + } else if $in < 1day { + '#b8b87a' + } else if $in < 3day { + '#7ab87a' + } else if $in < 1wk { + { fg: '#7ab87a' attr: 'b' } + } else if $in < 6wk { + '#7ab8b8' + } else if $in < 52wk { + '#7a7ab8' + } else { 'dark_gray' } + } + range: '#d9d9d9' + float: '#d9d9d9' + string: '#d9d9d9' + nothing: '#d9d9d9' + binary: '#d9d9d9' + cellpath: '#d9d9d9' + row_index: { fg: '#7ab87a' attr: 'b' } + record: '#d9d9d9' + list: '#d9d9d9' + block: '#d9d9d9' + hints: 'dark_gray' + search_result: { fg: '#b87a7a' bg: '#d9d9d9' } + + shape_and: { fg: '#b87ab8' attr: 'b' } + shape_binary: { fg: '#b87ab8' attr: 'b' } + shape_block: { fg: '#7a7ab8' attr: 'b' } + shape_bool: '#bddbdb' + shape_custom: '#7ab87a' + shape_datetime: { fg: '#7ab8b8' attr: 'b' } + shape_directory: '#7ab8b8' + shape_external: '#7ab8b8' + shape_externalarg: { fg: '#7ab87a' attr: 'b' } + shape_filepath: '#7ab8b8' + shape_flag: { fg: '#7a7ab8' attr: 'b' } + shape_float: { fg: '#b87ab8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7ab8b8' attr: 'b' } + shape_int: { fg: '#b87ab8' attr: 'b' } + shape_internalcall: { fg: '#7ab8b8' attr: 'b' } + shape_list: { fg: '#7ab8b8' attr: 'b' } + shape_literal: '#7a7ab8' + shape_match_pattern: '#7ab87a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#bddbdb' + shape_operator: '#b8b87a' + shape_or: { fg: '#b87ab8' attr: 'b' } + shape_pipe: { fg: '#b87ab8' attr: 'b' } + shape_range: { fg: '#b8b87a' attr: 'b' } + shape_record: { fg: '#7ab8b8' attr: 'b' } + shape_redirection: { fg: '#b87ab8' attr: 'b' } + shape_signature: { fg: '#7ab87a' attr: 'b' } + shape_string: '#7ab87a' + shape_string_interpolation: { fg: '#7ab8b8' attr: 'b' } + shape_table: { fg: '#7a7ab8' attr: 'b' } + shape_variable: '#b87ab8' + + background: '#0d1926' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mocha.nu b/themes/nu-themes/mocha.nu index 86a987e..90cdf52 100644 --- a/themes/nu-themes/mocha.nu +++ b/themes/nu-themes/mocha.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0c8c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#beb55b" attr: "b" } - empty: "#8ab3b5" - bool: {|| if $in { "#7bbda4" } else { "light_gray" } } - int: "#d0c8c6" - filesize: {|e| - if $e == 0b { - "#d0c8c6" - } else if $e < 1mb { - "#7bbda4" - } else {{ fg: "#8ab3b5" }} - } - duration: "#d0c8c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cb6077" attr: "b" } - } else if $in < 6hr { - "#cb6077" - } else if $in < 1day { - "#f4bc87" - } else if $in < 3day { - "#beb55b" - } else if $in < 1wk { - { fg: "#beb55b" attr: "b" } - } else if $in < 6wk { - "#7bbda4" - } else if $in < 52wk { - "#8ab3b5" - } else { "dark_gray" } - } - range: "#d0c8c6" - float: "#d0c8c6" - string: "#d0c8c6" - nothing: "#d0c8c6" - binary: "#d0c8c6" - cellpath: "#d0c8c6" - row_index: { fg: "#beb55b" attr: "b" } - record: "#d0c8c6" - list: "#d0c8c6" - block: "#d0c8c6" - hints: "dark_gray" - search_result: { fg: "#cb6077" bg: "#d0c8c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a89bb9" attr: "b" } - shape_binary: { fg: "#a89bb9" attr: "b" } - shape_block: { fg: "#8ab3b5" attr: "b" } - shape_bool: "#7bbda4" - shape_custom: "#beb55b" - shape_datetime: { fg: "#7bbda4" attr: "b" } - shape_directory: "#7bbda4" - shape_external: "#7bbda4" - shape_externalarg: { fg: "#beb55b" attr: "b" } - shape_filepath: "#7bbda4" - shape_flag: { fg: "#8ab3b5" attr: "b" } - shape_float: { fg: "#a89bb9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7bbda4" attr: "b" } - shape_int: { fg: "#a89bb9" attr: "b" } - shape_internalcall: { fg: "#7bbda4" attr: "b" } - shape_list: { fg: "#7bbda4" attr: "b" } - shape_literal: "#8ab3b5" - shape_match_pattern: "#beb55b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7bbda4" - shape_operator: "#f4bc87" - shape_or: { fg: "#a89bb9" attr: "b" } - shape_pipe: { fg: "#a89bb9" attr: "b" } - shape_range: { fg: "#f4bc87" attr: "b" } - shape_record: { fg: "#7bbda4" attr: "b" } - shape_redirection: { fg: "#a89bb9" attr: "b" } - shape_signature: { fg: "#beb55b" attr: "b" } - shape_string: "#beb55b" - shape_string_interpolation: { fg: "#7bbda4" attr: "b" } - shape_table: { fg: "#8ab3b5" attr: "b" } - shape_variable: "#a89bb9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3b3228" - foreground: "#d0c8c6" - cursor: "#d0c8c6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0c8c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#beb55b' attr: 'b' } + empty: '#8ab3b5' + bool: {|| if $in { '#7bbda4' } else { 'light_gray' } } + int: '#d0c8c6' + filesize: {|e| + if $e == 0b { + '#d0c8c6' + } else if $e < 1mb { + '#7bbda4' + } else {{ fg: '#8ab3b5' }} + } + duration: '#d0c8c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cb6077' attr: 'b' } + } else if $in < 6hr { + '#cb6077' + } else if $in < 1day { + '#f4bc87' + } else if $in < 3day { + '#beb55b' + } else if $in < 1wk { + { fg: '#beb55b' attr: 'b' } + } else if $in < 6wk { + '#7bbda4' + } else if $in < 52wk { + '#8ab3b5' + } else { 'dark_gray' } + } + range: '#d0c8c6' + float: '#d0c8c6' + string: '#d0c8c6' + nothing: '#d0c8c6' + binary: '#d0c8c6' + cellpath: '#d0c8c6' + row_index: { fg: '#beb55b' attr: 'b' } + record: '#d0c8c6' + list: '#d0c8c6' + block: '#d0c8c6' + hints: 'dark_gray' + search_result: { fg: '#cb6077' bg: '#d0c8c6' } + + shape_and: { fg: '#a89bb9' attr: 'b' } + shape_binary: { fg: '#a89bb9' attr: 'b' } + shape_block: { fg: '#8ab3b5' attr: 'b' } + shape_bool: '#7bbda4' + shape_custom: '#beb55b' + shape_datetime: { fg: '#7bbda4' attr: 'b' } + shape_directory: '#7bbda4' + shape_external: '#7bbda4' + shape_externalarg: { fg: '#beb55b' attr: 'b' } + shape_filepath: '#7bbda4' + shape_flag: { fg: '#8ab3b5' attr: 'b' } + shape_float: { fg: '#a89bb9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7bbda4' attr: 'b' } + shape_int: { fg: '#a89bb9' attr: 'b' } + shape_internalcall: { fg: '#7bbda4' attr: 'b' } + shape_list: { fg: '#7bbda4' attr: 'b' } + shape_literal: '#8ab3b5' + shape_match_pattern: '#beb55b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7bbda4' + shape_operator: '#f4bc87' + shape_or: { fg: '#a89bb9' attr: 'b' } + shape_pipe: { fg: '#a89bb9' attr: 'b' } + shape_range: { fg: '#f4bc87' attr: 'b' } + shape_record: { fg: '#7bbda4' attr: 'b' } + shape_redirection: { fg: '#a89bb9' attr: 'b' } + shape_signature: { fg: '#beb55b' attr: 'b' } + shape_string: '#beb55b' + shape_string_interpolation: { fg: '#7bbda4' attr: 'b' } + shape_table: { fg: '#8ab3b5' attr: 'b' } + shape_variable: '#a89bb9' + + background: '#3b3228' + foreground: '#d0c8c6' + cursor: '#d0c8c6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/molokai.nu b/themes/nu-themes/molokai.nu index ef0f8e6..c4d7d4d 100644 --- a/themes/nu-themes/molokai.nu +++ b/themes/nu-themes/molokai.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#23e298" attr: "b" } - empty: "#d08010" - bool: {|| if $in { "#ffce51" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#d0a843" - } else {{ fg: "#d08010" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#7325fa" attr: "b" } - } else if $in < 6hr { - "#7325fa" - } else if $in < 1day { - "#60d4df" - } else if $in < 3day { - "#23e298" - } else if $in < 1wk { - { fg: "#23e298" attr: "b" } - } else if $in < 6wk { - "#d0a843" - } else if $in < 52wk { - "#d08010" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#23e298" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#7325fa" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff0087" attr: "b" } - shape_binary: { fg: "#ff0087" attr: "b" } - shape_block: { fg: "#d08010" attr: "b" } - shape_bool: "#ffce51" - shape_custom: "#23e298" - shape_datetime: { fg: "#d0a843" attr: "b" } - shape_directory: "#d0a843" - shape_external: "#d0a843" - shape_externalarg: { fg: "#23e298" attr: "b" } - shape_filepath: "#d0a843" - shape_flag: { fg: "#d08010" attr: "b" } - shape_float: { fg: "#ff0087" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#d0a843" attr: "b" } - shape_int: { fg: "#ff0087" attr: "b" } - shape_internalcall: { fg: "#d0a843" attr: "b" } - shape_list: { fg: "#d0a843" attr: "b" } - shape_literal: "#d08010" - shape_match_pattern: "#23e298" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ffce51" - shape_operator: "#60d4df" - shape_or: { fg: "#ff0087" attr: "b" } - shape_pipe: { fg: "#ff0087" attr: "b" } - shape_range: { fg: "#60d4df" attr: "b" } - shape_record: { fg: "#d0a843" attr: "b" } - shape_redirection: { fg: "#ff0087" attr: "b" } - shape_signature: { fg: "#23e298" attr: "b" } - shape_string: "#23e298" - shape_string_interpolation: { fg: "#d0a843" attr: "b" } - shape_table: { fg: "#d08010" attr: "b" } - shape_variable: "#ff0087" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1d1e" - foreground: "#bbbbbb" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#23e298' attr: 'b' } + empty: '#d08010' + bool: {|| if $in { '#ffce51' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#d0a843' + } else {{ fg: '#d08010' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#7325fa' attr: 'b' } + } else if $in < 6hr { + '#7325fa' + } else if $in < 1day { + '#60d4df' + } else if $in < 3day { + '#23e298' + } else if $in < 1wk { + { fg: '#23e298' attr: 'b' } + } else if $in < 6wk { + '#d0a843' + } else if $in < 52wk { + '#d08010' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#23e298' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#7325fa' bg: '#bbbbbb' } + + shape_and: { fg: '#ff0087' attr: 'b' } + shape_binary: { fg: '#ff0087' attr: 'b' } + shape_block: { fg: '#d08010' attr: 'b' } + shape_bool: '#ffce51' + shape_custom: '#23e298' + shape_datetime: { fg: '#d0a843' attr: 'b' } + shape_directory: '#d0a843' + shape_external: '#d0a843' + shape_externalarg: { fg: '#23e298' attr: 'b' } + shape_filepath: '#d0a843' + shape_flag: { fg: '#d08010' attr: 'b' } + shape_float: { fg: '#ff0087' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#d0a843' attr: 'b' } + shape_int: { fg: '#ff0087' attr: 'b' } + shape_internalcall: { fg: '#d0a843' attr: 'b' } + shape_list: { fg: '#d0a843' attr: 'b' } + shape_literal: '#d08010' + shape_match_pattern: '#23e298' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ffce51' + shape_operator: '#60d4df' + shape_or: { fg: '#ff0087' attr: 'b' } + shape_pipe: { fg: '#ff0087' attr: 'b' } + shape_range: { fg: '#60d4df' attr: 'b' } + shape_record: { fg: '#d0a843' attr: 'b' } + shape_redirection: { fg: '#ff0087' attr: 'b' } + shape_signature: { fg: '#23e298' attr: 'b' } + shape_string: '#23e298' + shape_string_interpolation: { fg: '#d0a843' attr: 'b' } + shape_table: { fg: '#d08010' attr: 'b' } + shape_variable: '#ff0087' + + background: '#1b1d1e' + foreground: '#bbbbbb' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mona-lisa.nu b/themes/nu-themes/mona-lisa.nu index e73eea5..9168d6e 100644 --- a/themes/nu-themes/mona-lisa.nu +++ b/themes/nu-themes/mona-lisa.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f7d75c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#636232" attr: "b" } - empty: "#515c5d" - bool: {|| if $in { "#8acd8f" } else { "light_gray" } } - int: "#f7d75c" - filesize: {|e| - if $e == 0b { - "#f7d75c" - } else if $e < 1mb { - "#588056" - } else {{ fg: "#515c5d" }} - } - duration: "#f7d75c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9b291c" attr: "b" } - } else if $in < 6hr { - "#9b291c" - } else if $in < 1day { - "#c36e28" - } else if $in < 3day { - "#636232" - } else if $in < 1wk { - { fg: "#636232" attr: "b" } - } else if $in < 6wk { - "#588056" - } else if $in < 52wk { - "#515c5d" - } else { "dark_gray" } - } - range: "#f7d75c" - float: "#f7d75c" - string: "#f7d75c" - nothing: "#f7d75c" - binary: "#f7d75c" - cellpath: "#f7d75c" - row_index: { fg: "#636232" attr: "b" } - record: "#f7d75c" - list: "#f7d75c" - block: "#f7d75c" - hints: "dark_gray" - search_result: { fg: "#9b291c" bg: "#f7d75c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9b1d29" attr: "b" } - shape_binary: { fg: "#9b1d29" attr: "b" } - shape_block: { fg: "#515c5d" attr: "b" } - shape_bool: "#8acd8f" - shape_custom: "#636232" - shape_datetime: { fg: "#588056" attr: "b" } - shape_directory: "#588056" - shape_external: "#588056" - shape_externalarg: { fg: "#636232" attr: "b" } - shape_filepath: "#588056" - shape_flag: { fg: "#515c5d" attr: "b" } - shape_float: { fg: "#9b1d29" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#588056" attr: "b" } - shape_int: { fg: "#9b1d29" attr: "b" } - shape_internalcall: { fg: "#588056" attr: "b" } - shape_list: { fg: "#588056" attr: "b" } - shape_literal: "#515c5d" - shape_match_pattern: "#636232" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8acd8f" - shape_operator: "#c36e28" - shape_or: { fg: "#9b1d29" attr: "b" } - shape_pipe: { fg: "#9b1d29" attr: "b" } - shape_range: { fg: "#c36e28" attr: "b" } - shape_record: { fg: "#588056" attr: "b" } - shape_redirection: { fg: "#9b1d29" attr: "b" } - shape_signature: { fg: "#636232" attr: "b" } - shape_string: "#636232" - shape_string_interpolation: { fg: "#588056" attr: "b" } - shape_table: { fg: "#515c5d" attr: "b" } - shape_variable: "#9b1d29" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#120b0d" - foreground: "#f7d66a" - cursor: "#f7d66a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f7d75c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#636232' attr: 'b' } + empty: '#515c5d' + bool: {|| if $in { '#8acd8f' } else { 'light_gray' } } + int: '#f7d75c' + filesize: {|e| + if $e == 0b { + '#f7d75c' + } else if $e < 1mb { + '#588056' + } else {{ fg: '#515c5d' }} + } + duration: '#f7d75c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9b291c' attr: 'b' } + } else if $in < 6hr { + '#9b291c' + } else if $in < 1day { + '#c36e28' + } else if $in < 3day { + '#636232' + } else if $in < 1wk { + { fg: '#636232' attr: 'b' } + } else if $in < 6wk { + '#588056' + } else if $in < 52wk { + '#515c5d' + } else { 'dark_gray' } + } + range: '#f7d75c' + float: '#f7d75c' + string: '#f7d75c' + nothing: '#f7d75c' + binary: '#f7d75c' + cellpath: '#f7d75c' + row_index: { fg: '#636232' attr: 'b' } + record: '#f7d75c' + list: '#f7d75c' + block: '#f7d75c' + hints: 'dark_gray' + search_result: { fg: '#9b291c' bg: '#f7d75c' } + + shape_and: { fg: '#9b1d29' attr: 'b' } + shape_binary: { fg: '#9b1d29' attr: 'b' } + shape_block: { fg: '#515c5d' attr: 'b' } + shape_bool: '#8acd8f' + shape_custom: '#636232' + shape_datetime: { fg: '#588056' attr: 'b' } + shape_directory: '#588056' + shape_external: '#588056' + shape_externalarg: { fg: '#636232' attr: 'b' } + shape_filepath: '#588056' + shape_flag: { fg: '#515c5d' attr: 'b' } + shape_float: { fg: '#9b1d29' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#588056' attr: 'b' } + shape_int: { fg: '#9b1d29' attr: 'b' } + shape_internalcall: { fg: '#588056' attr: 'b' } + shape_list: { fg: '#588056' attr: 'b' } + shape_literal: '#515c5d' + shape_match_pattern: '#636232' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8acd8f' + shape_operator: '#c36e28' + shape_or: { fg: '#9b1d29' attr: 'b' } + shape_pipe: { fg: '#9b1d29' attr: 'b' } + shape_range: { fg: '#c36e28' attr: 'b' } + shape_record: { fg: '#588056' attr: 'b' } + shape_redirection: { fg: '#9b1d29' attr: 'b' } + shape_signature: { fg: '#636232' attr: 'b' } + shape_string: '#636232' + shape_string_interpolation: { fg: '#588056' attr: 'b' } + shape_table: { fg: '#515c5d' attr: 'b' } + shape_variable: '#9b1d29' + + background: '#120b0d' + foreground: '#f7d66a' + cursor: '#f7d66a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mono-amber.nu b/themes/nu-themes/mono-amber.nu index eeb66b0..4f8ed4a 100644 --- a/themes/nu-themes/mono-amber.nu +++ b/themes/nu-themes/mono-amber.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ff9400" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ff9400" attr: "b" } - empty: "#ff9400" - bool: {|| if $in { "#ff9400" } else { "light_gray" } } - int: "#ff9400" - filesize: {|e| - if $e == 0b { - "#ff9400" - } else if $e < 1mb { - "#ff9400" - } else {{ fg: "#ff9400" }} - } - duration: "#ff9400" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff9400" attr: "b" } - } else if $in < 6hr { - "#ff9400" - } else if $in < 1day { - "#ff9400" - } else if $in < 3day { - "#ff9400" - } else if $in < 1wk { - { fg: "#ff9400" attr: "b" } - } else if $in < 6wk { - "#ff9400" - } else if $in < 52wk { - "#ff9400" - } else { "dark_gray" } - } - range: "#ff9400" - float: "#ff9400" - string: "#ff9400" - nothing: "#ff9400" - binary: "#ff9400" - cellpath: "#ff9400" - row_index: { fg: "#ff9400" attr: "b" } - record: "#ff9400" - list: "#ff9400" - block: "#ff9400" - hints: "dark_gray" - search_result: { fg: "#ff9400" bg: "#ff9400" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff9400" attr: "b" } - shape_binary: { fg: "#ff9400" attr: "b" } - shape_block: { fg: "#ff9400" attr: "b" } - shape_bool: "#ff9400" - shape_custom: "#ff9400" - shape_datetime: { fg: "#ff9400" attr: "b" } - shape_directory: "#ff9400" - shape_external: "#ff9400" - shape_externalarg: { fg: "#ff9400" attr: "b" } - shape_filepath: "#ff9400" - shape_flag: { fg: "#ff9400" attr: "b" } - shape_float: { fg: "#ff9400" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ff9400" attr: "b" } - shape_int: { fg: "#ff9400" attr: "b" } - shape_internalcall: { fg: "#ff9400" attr: "b" } - shape_list: { fg: "#ff9400" attr: "b" } - shape_literal: "#ff9400" - shape_match_pattern: "#ff9400" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ff9400" - shape_operator: "#ff9400" - shape_or: { fg: "#ff9400" attr: "b" } - shape_pipe: { fg: "#ff9400" attr: "b" } - shape_range: { fg: "#ff9400" attr: "b" } - shape_record: { fg: "#ff9400" attr: "b" } - shape_redirection: { fg: "#ff9400" attr: "b" } - shape_signature: { fg: "#ff9400" attr: "b" } - shape_string: "#ff9400" - shape_string_interpolation: { fg: "#ff9400" attr: "b" } - shape_table: { fg: "#ff9400" attr: "b" } - shape_variable: "#ff9400" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b1900" - foreground: "#ff9400" - cursor: "#ff9400" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ff9400' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ff9400' attr: 'b' } + empty: '#ff9400' + bool: {|| if $in { '#ff9400' } else { 'light_gray' } } + int: '#ff9400' + filesize: {|e| + if $e == 0b { + '#ff9400' + } else if $e < 1mb { + '#ff9400' + } else {{ fg: '#ff9400' }} + } + duration: '#ff9400' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff9400' attr: 'b' } + } else if $in < 6hr { + '#ff9400' + } else if $in < 1day { + '#ff9400' + } else if $in < 3day { + '#ff9400' + } else if $in < 1wk { + { fg: '#ff9400' attr: 'b' } + } else if $in < 6wk { + '#ff9400' + } else if $in < 52wk { + '#ff9400' + } else { 'dark_gray' } + } + range: '#ff9400' + float: '#ff9400' + string: '#ff9400' + nothing: '#ff9400' + binary: '#ff9400' + cellpath: '#ff9400' + row_index: { fg: '#ff9400' attr: 'b' } + record: '#ff9400' + list: '#ff9400' + block: '#ff9400' + hints: 'dark_gray' + search_result: { fg: '#ff9400' bg: '#ff9400' } + + shape_and: { fg: '#ff9400' attr: 'b' } + shape_binary: { fg: '#ff9400' attr: 'b' } + shape_block: { fg: '#ff9400' attr: 'b' } + shape_bool: '#ff9400' + shape_custom: '#ff9400' + shape_datetime: { fg: '#ff9400' attr: 'b' } + shape_directory: '#ff9400' + shape_external: '#ff9400' + shape_externalarg: { fg: '#ff9400' attr: 'b' } + shape_filepath: '#ff9400' + shape_flag: { fg: '#ff9400' attr: 'b' } + shape_float: { fg: '#ff9400' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ff9400' attr: 'b' } + shape_int: { fg: '#ff9400' attr: 'b' } + shape_internalcall: { fg: '#ff9400' attr: 'b' } + shape_list: { fg: '#ff9400' attr: 'b' } + shape_literal: '#ff9400' + shape_match_pattern: '#ff9400' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ff9400' + shape_operator: '#ff9400' + shape_or: { fg: '#ff9400' attr: 'b' } + shape_pipe: { fg: '#ff9400' attr: 'b' } + shape_range: { fg: '#ff9400' attr: 'b' } + shape_record: { fg: '#ff9400' attr: 'b' } + shape_redirection: { fg: '#ff9400' attr: 'b' } + shape_signature: { fg: '#ff9400' attr: 'b' } + shape_string: '#ff9400' + shape_string_interpolation: { fg: '#ff9400' attr: 'b' } + shape_table: { fg: '#ff9400' attr: 'b' } + shape_variable: '#ff9400' + + background: '#2b1900' + foreground: '#ff9400' + cursor: '#ff9400' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mono-cyan.nu b/themes/nu-themes/mono-cyan.nu index 87bc0f4..8566b4b 100644 --- a/themes/nu-themes/mono-cyan.nu +++ b/themes/nu-themes/mono-cyan.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#00ccff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00ccff" attr: "b" } - empty: "#00ccff" - bool: {|| if $in { "#00ccff" } else { "light_gray" } } - int: "#00ccff" - filesize: {|e| - if $e == 0b { - "#00ccff" - } else if $e < 1mb { - "#00ccff" - } else {{ fg: "#00ccff" }} - } - duration: "#00ccff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#00ccff" attr: "b" } - } else if $in < 6hr { - "#00ccff" - } else if $in < 1day { - "#00ccff" - } else if $in < 3day { - "#00ccff" - } else if $in < 1wk { - { fg: "#00ccff" attr: "b" } - } else if $in < 6wk { - "#00ccff" - } else if $in < 52wk { - "#00ccff" - } else { "dark_gray" } - } - range: "#00ccff" - float: "#00ccff" - string: "#00ccff" - nothing: "#00ccff" - binary: "#00ccff" - cellpath: "#00ccff" - row_index: { fg: "#00ccff" attr: "b" } - record: "#00ccff" - list: "#00ccff" - block: "#00ccff" - hints: "dark_gray" - search_result: { fg: "#00ccff" bg: "#00ccff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#00ccff" attr: "b" } - shape_binary: { fg: "#00ccff" attr: "b" } - shape_block: { fg: "#00ccff" attr: "b" } - shape_bool: "#00ccff" - shape_custom: "#00ccff" - shape_datetime: { fg: "#00ccff" attr: "b" } - shape_directory: "#00ccff" - shape_external: "#00ccff" - shape_externalarg: { fg: "#00ccff" attr: "b" } - shape_filepath: "#00ccff" - shape_flag: { fg: "#00ccff" attr: "b" } - shape_float: { fg: "#00ccff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00ccff" attr: "b" } - shape_int: { fg: "#00ccff" attr: "b" } - shape_internalcall: { fg: "#00ccff" attr: "b" } - shape_list: { fg: "#00ccff" attr: "b" } - shape_literal: "#00ccff" - shape_match_pattern: "#00ccff" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ccff" - shape_operator: "#00ccff" - shape_or: { fg: "#00ccff" attr: "b" } - shape_pipe: { fg: "#00ccff" attr: "b" } - shape_range: { fg: "#00ccff" attr: "b" } - shape_record: { fg: "#00ccff" attr: "b" } - shape_redirection: { fg: "#00ccff" attr: "b" } - shape_signature: { fg: "#00ccff" attr: "b" } - shape_string: "#00ccff" - shape_string_interpolation: { fg: "#00ccff" attr: "b" } - shape_table: { fg: "#00ccff" attr: "b" } - shape_variable: "#00ccff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#00222b" - foreground: "#00ccff" - cursor: "#00ccff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#00ccff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00ccff' attr: 'b' } + empty: '#00ccff' + bool: {|| if $in { '#00ccff' } else { 'light_gray' } } + int: '#00ccff' + filesize: {|e| + if $e == 0b { + '#00ccff' + } else if $e < 1mb { + '#00ccff' + } else {{ fg: '#00ccff' }} + } + duration: '#00ccff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#00ccff' attr: 'b' } + } else if $in < 6hr { + '#00ccff' + } else if $in < 1day { + '#00ccff' + } else if $in < 3day { + '#00ccff' + } else if $in < 1wk { + { fg: '#00ccff' attr: 'b' } + } else if $in < 6wk { + '#00ccff' + } else if $in < 52wk { + '#00ccff' + } else { 'dark_gray' } + } + range: '#00ccff' + float: '#00ccff' + string: '#00ccff' + nothing: '#00ccff' + binary: '#00ccff' + cellpath: '#00ccff' + row_index: { fg: '#00ccff' attr: 'b' } + record: '#00ccff' + list: '#00ccff' + block: '#00ccff' + hints: 'dark_gray' + search_result: { fg: '#00ccff' bg: '#00ccff' } + + shape_and: { fg: '#00ccff' attr: 'b' } + shape_binary: { fg: '#00ccff' attr: 'b' } + shape_block: { fg: '#00ccff' attr: 'b' } + shape_bool: '#00ccff' + shape_custom: '#00ccff' + shape_datetime: { fg: '#00ccff' attr: 'b' } + shape_directory: '#00ccff' + shape_external: '#00ccff' + shape_externalarg: { fg: '#00ccff' attr: 'b' } + shape_filepath: '#00ccff' + shape_flag: { fg: '#00ccff' attr: 'b' } + shape_float: { fg: '#00ccff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00ccff' attr: 'b' } + shape_int: { fg: '#00ccff' attr: 'b' } + shape_internalcall: { fg: '#00ccff' attr: 'b' } + shape_list: { fg: '#00ccff' attr: 'b' } + shape_literal: '#00ccff' + shape_match_pattern: '#00ccff' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ccff' + shape_operator: '#00ccff' + shape_or: { fg: '#00ccff' attr: 'b' } + shape_pipe: { fg: '#00ccff' attr: 'b' } + shape_range: { fg: '#00ccff' attr: 'b' } + shape_record: { fg: '#00ccff' attr: 'b' } + shape_redirection: { fg: '#00ccff' attr: 'b' } + shape_signature: { fg: '#00ccff' attr: 'b' } + shape_string: '#00ccff' + shape_string_interpolation: { fg: '#00ccff' attr: 'b' } + shape_table: { fg: '#00ccff' attr: 'b' } + shape_variable: '#00ccff' + + background: '#00222b' + foreground: '#00ccff' + cursor: '#00ccff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mono-green.nu b/themes/nu-themes/mono-green.nu index a300832..48e4a63 100644 --- a/themes/nu-themes/mono-green.nu +++ b/themes/nu-themes/mono-green.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#0bff00" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#0bff00" attr: "b" } - empty: "#0bff00" - bool: {|| if $in { "#0bff00" } else { "light_gray" } } - int: "#0bff00" - filesize: {|e| - if $e == 0b { - "#0bff00" - } else if $e < 1mb { - "#0bff00" - } else {{ fg: "#0bff00" }} - } - duration: "#0bff00" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#0bff00" attr: "b" } - } else if $in < 6hr { - "#0bff00" - } else if $in < 1day { - "#0bff00" - } else if $in < 3day { - "#0bff00" - } else if $in < 1wk { - { fg: "#0bff00" attr: "b" } - } else if $in < 6wk { - "#0bff00" - } else if $in < 52wk { - "#0bff00" - } else { "dark_gray" } - } - range: "#0bff00" - float: "#0bff00" - string: "#0bff00" - nothing: "#0bff00" - binary: "#0bff00" - cellpath: "#0bff00" - row_index: { fg: "#0bff00" attr: "b" } - record: "#0bff00" - list: "#0bff00" - block: "#0bff00" - hints: "dark_gray" - search_result: { fg: "#0bff00" bg: "#0bff00" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#0bff00" attr: "b" } - shape_binary: { fg: "#0bff00" attr: "b" } - shape_block: { fg: "#0bff00" attr: "b" } - shape_bool: "#0bff00" - shape_custom: "#0bff00" - shape_datetime: { fg: "#0bff00" attr: "b" } - shape_directory: "#0bff00" - shape_external: "#0bff00" - shape_externalarg: { fg: "#0bff00" attr: "b" } - shape_filepath: "#0bff00" - shape_flag: { fg: "#0bff00" attr: "b" } - shape_float: { fg: "#0bff00" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0bff00" attr: "b" } - shape_int: { fg: "#0bff00" attr: "b" } - shape_internalcall: { fg: "#0bff00" attr: "b" } - shape_list: { fg: "#0bff00" attr: "b" } - shape_literal: "#0bff00" - shape_match_pattern: "#0bff00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0bff00" - shape_operator: "#0bff00" - shape_or: { fg: "#0bff00" attr: "b" } - shape_pipe: { fg: "#0bff00" attr: "b" } - shape_range: { fg: "#0bff00" attr: "b" } - shape_record: { fg: "#0bff00" attr: "b" } - shape_redirection: { fg: "#0bff00" attr: "b" } - shape_signature: { fg: "#0bff00" attr: "b" } - shape_string: "#0bff00" - shape_string_interpolation: { fg: "#0bff00" attr: "b" } - shape_table: { fg: "#0bff00" attr: "b" } - shape_variable: "#0bff00" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#022b00" - foreground: "#0bff00" - cursor: "#0bff00" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#0bff00' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#0bff00' attr: 'b' } + empty: '#0bff00' + bool: {|| if $in { '#0bff00' } else { 'light_gray' } } + int: '#0bff00' + filesize: {|e| + if $e == 0b { + '#0bff00' + } else if $e < 1mb { + '#0bff00' + } else {{ fg: '#0bff00' }} + } + duration: '#0bff00' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#0bff00' attr: 'b' } + } else if $in < 6hr { + '#0bff00' + } else if $in < 1day { + '#0bff00' + } else if $in < 3day { + '#0bff00' + } else if $in < 1wk { + { fg: '#0bff00' attr: 'b' } + } else if $in < 6wk { + '#0bff00' + } else if $in < 52wk { + '#0bff00' + } else { 'dark_gray' } + } + range: '#0bff00' + float: '#0bff00' + string: '#0bff00' + nothing: '#0bff00' + binary: '#0bff00' + cellpath: '#0bff00' + row_index: { fg: '#0bff00' attr: 'b' } + record: '#0bff00' + list: '#0bff00' + block: '#0bff00' + hints: 'dark_gray' + search_result: { fg: '#0bff00' bg: '#0bff00' } + + shape_and: { fg: '#0bff00' attr: 'b' } + shape_binary: { fg: '#0bff00' attr: 'b' } + shape_block: { fg: '#0bff00' attr: 'b' } + shape_bool: '#0bff00' + shape_custom: '#0bff00' + shape_datetime: { fg: '#0bff00' attr: 'b' } + shape_directory: '#0bff00' + shape_external: '#0bff00' + shape_externalarg: { fg: '#0bff00' attr: 'b' } + shape_filepath: '#0bff00' + shape_flag: { fg: '#0bff00' attr: 'b' } + shape_float: { fg: '#0bff00' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0bff00' attr: 'b' } + shape_int: { fg: '#0bff00' attr: 'b' } + shape_internalcall: { fg: '#0bff00' attr: 'b' } + shape_list: { fg: '#0bff00' attr: 'b' } + shape_literal: '#0bff00' + shape_match_pattern: '#0bff00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0bff00' + shape_operator: '#0bff00' + shape_or: { fg: '#0bff00' attr: 'b' } + shape_pipe: { fg: '#0bff00' attr: 'b' } + shape_range: { fg: '#0bff00' attr: 'b' } + shape_record: { fg: '#0bff00' attr: 'b' } + shape_redirection: { fg: '#0bff00' attr: 'b' } + shape_signature: { fg: '#0bff00' attr: 'b' } + shape_string: '#0bff00' + shape_string_interpolation: { fg: '#0bff00' attr: 'b' } + shape_table: { fg: '#0bff00' attr: 'b' } + shape_variable: '#0bff00' + + background: '#022b00' + foreground: '#0bff00' + cursor: '#0bff00' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mono-red.nu b/themes/nu-themes/mono-red.nu index d3ca3b3..1634aa7 100644 --- a/themes/nu-themes/mono-red.nu +++ b/themes/nu-themes/mono-red.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ff3600" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ff3600" attr: "b" } - empty: "#ff3600" - bool: {|| if $in { "#ff3600" } else { "light_gray" } } - int: "#ff3600" - filesize: {|e| - if $e == 0b { - "#ff3600" - } else if $e < 1mb { - "#ff3600" - } else {{ fg: "#ff3600" }} - } - duration: "#ff3600" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3600" attr: "b" } - } else if $in < 6hr { - "#ff3600" - } else if $in < 1day { - "#ff3600" - } else if $in < 3day { - "#ff3600" - } else if $in < 1wk { - { fg: "#ff3600" attr: "b" } - } else if $in < 6wk { - "#ff3600" - } else if $in < 52wk { - "#ff3600" - } else { "dark_gray" } - } - range: "#ff3600" - float: "#ff3600" - string: "#ff3600" - nothing: "#ff3600" - binary: "#ff3600" - cellpath: "#ff3600" - row_index: { fg: "#ff3600" attr: "b" } - record: "#ff3600" - list: "#ff3600" - block: "#ff3600" - hints: "dark_gray" - search_result: { fg: "#ff3600" bg: "#ff3600" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff3600" attr: "b" } - shape_binary: { fg: "#ff3600" attr: "b" } - shape_block: { fg: "#ff3600" attr: "b" } - shape_bool: "#ff3600" - shape_custom: "#ff3600" - shape_datetime: { fg: "#ff3600" attr: "b" } - shape_directory: "#ff3600" - shape_external: "#ff3600" - shape_externalarg: { fg: "#ff3600" attr: "b" } - shape_filepath: "#ff3600" - shape_flag: { fg: "#ff3600" attr: "b" } - shape_float: { fg: "#ff3600" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ff3600" attr: "b" } - shape_int: { fg: "#ff3600" attr: "b" } - shape_internalcall: { fg: "#ff3600" attr: "b" } - shape_list: { fg: "#ff3600" attr: "b" } - shape_literal: "#ff3600" - shape_match_pattern: "#ff3600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ff3600" - shape_operator: "#ff3600" - shape_or: { fg: "#ff3600" attr: "b" } - shape_pipe: { fg: "#ff3600" attr: "b" } - shape_range: { fg: "#ff3600" attr: "b" } - shape_record: { fg: "#ff3600" attr: "b" } - shape_redirection: { fg: "#ff3600" attr: "b" } - shape_signature: { fg: "#ff3600" attr: "b" } - shape_string: "#ff3600" - shape_string_interpolation: { fg: "#ff3600" attr: "b" } - shape_table: { fg: "#ff3600" attr: "b" } - shape_variable: "#ff3600" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b0c00" - foreground: "#ff3600" - cursor: "#ff3600" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ff3600' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ff3600' attr: 'b' } + empty: '#ff3600' + bool: {|| if $in { '#ff3600' } else { 'light_gray' } } + int: '#ff3600' + filesize: {|e| + if $e == 0b { + '#ff3600' + } else if $e < 1mb { + '#ff3600' + } else {{ fg: '#ff3600' }} + } + duration: '#ff3600' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3600' attr: 'b' } + } else if $in < 6hr { + '#ff3600' + } else if $in < 1day { + '#ff3600' + } else if $in < 3day { + '#ff3600' + } else if $in < 1wk { + { fg: '#ff3600' attr: 'b' } + } else if $in < 6wk { + '#ff3600' + } else if $in < 52wk { + '#ff3600' + } else { 'dark_gray' } + } + range: '#ff3600' + float: '#ff3600' + string: '#ff3600' + nothing: '#ff3600' + binary: '#ff3600' + cellpath: '#ff3600' + row_index: { fg: '#ff3600' attr: 'b' } + record: '#ff3600' + list: '#ff3600' + block: '#ff3600' + hints: 'dark_gray' + search_result: { fg: '#ff3600' bg: '#ff3600' } + + shape_and: { fg: '#ff3600' attr: 'b' } + shape_binary: { fg: '#ff3600' attr: 'b' } + shape_block: { fg: '#ff3600' attr: 'b' } + shape_bool: '#ff3600' + shape_custom: '#ff3600' + shape_datetime: { fg: '#ff3600' attr: 'b' } + shape_directory: '#ff3600' + shape_external: '#ff3600' + shape_externalarg: { fg: '#ff3600' attr: 'b' } + shape_filepath: '#ff3600' + shape_flag: { fg: '#ff3600' attr: 'b' } + shape_float: { fg: '#ff3600' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ff3600' attr: 'b' } + shape_int: { fg: '#ff3600' attr: 'b' } + shape_internalcall: { fg: '#ff3600' attr: 'b' } + shape_list: { fg: '#ff3600' attr: 'b' } + shape_literal: '#ff3600' + shape_match_pattern: '#ff3600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ff3600' + shape_operator: '#ff3600' + shape_or: { fg: '#ff3600' attr: 'b' } + shape_pipe: { fg: '#ff3600' attr: 'b' } + shape_range: { fg: '#ff3600' attr: 'b' } + shape_record: { fg: '#ff3600' attr: 'b' } + shape_redirection: { fg: '#ff3600' attr: 'b' } + shape_signature: { fg: '#ff3600' attr: 'b' } + shape_string: '#ff3600' + shape_string_interpolation: { fg: '#ff3600' attr: 'b' } + shape_table: { fg: '#ff3600' attr: 'b' } + shape_variable: '#ff3600' + + background: '#2b0c00' + foreground: '#ff3600' + cursor: '#ff3600' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mono-white.nu b/themes/nu-themes/mono-white.nu index d042d57..544c19f 100644 --- a/themes/nu-themes/mono-white.nu +++ b/themes/nu-themes/mono-white.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fafafa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#fafafa" attr: "b" } - empty: "#fafafa" - bool: {|| if $in { "#fafafa" } else { "light_gray" } } - int: "#fafafa" - filesize: {|e| - if $e == 0b { - "#fafafa" - } else if $e < 1mb { - "#fafafa" - } else {{ fg: "#fafafa" }} - } - duration: "#fafafa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fafafa" attr: "b" } - } else if $in < 6hr { - "#fafafa" - } else if $in < 1day { - "#fafafa" - } else if $in < 3day { - "#fafafa" - } else if $in < 1wk { - { fg: "#fafafa" attr: "b" } - } else if $in < 6wk { - "#fafafa" - } else if $in < 52wk { - "#fafafa" - } else { "dark_gray" } - } - range: "#fafafa" - float: "#fafafa" - string: "#fafafa" - nothing: "#fafafa" - binary: "#fafafa" - cellpath: "#fafafa" - row_index: { fg: "#fafafa" attr: "b" } - record: "#fafafa" - list: "#fafafa" - block: "#fafafa" - hints: "dark_gray" - search_result: { fg: "#fafafa" bg: "#fafafa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fafafa" attr: "b" } - shape_binary: { fg: "#fafafa" attr: "b" } - shape_block: { fg: "#fafafa" attr: "b" } - shape_bool: "#fafafa" - shape_custom: "#fafafa" - shape_datetime: { fg: "#fafafa" attr: "b" } - shape_directory: "#fafafa" - shape_external: "#fafafa" - shape_externalarg: { fg: "#fafafa" attr: "b" } - shape_filepath: "#fafafa" - shape_flag: { fg: "#fafafa" attr: "b" } - shape_float: { fg: "#fafafa" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#fafafa" attr: "b" } - shape_int: { fg: "#fafafa" attr: "b" } - shape_internalcall: { fg: "#fafafa" attr: "b" } - shape_list: { fg: "#fafafa" attr: "b" } - shape_literal: "#fafafa" - shape_match_pattern: "#fafafa" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#fafafa" - shape_operator: "#fafafa" - shape_or: { fg: "#fafafa" attr: "b" } - shape_pipe: { fg: "#fafafa" attr: "b" } - shape_range: { fg: "#fafafa" attr: "b" } - shape_record: { fg: "#fafafa" attr: "b" } - shape_redirection: { fg: "#fafafa" attr: "b" } - shape_signature: { fg: "#fafafa" attr: "b" } - shape_string: "#fafafa" - shape_string_interpolation: { fg: "#fafafa" attr: "b" } - shape_table: { fg: "#fafafa" attr: "b" } - shape_variable: "#fafafa" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262626" - foreground: "#fafafa" - cursor: "#fafafa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fafafa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#fafafa' attr: 'b' } + empty: '#fafafa' + bool: {|| if $in { '#fafafa' } else { 'light_gray' } } + int: '#fafafa' + filesize: {|e| + if $e == 0b { + '#fafafa' + } else if $e < 1mb { + '#fafafa' + } else {{ fg: '#fafafa' }} + } + duration: '#fafafa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fafafa' attr: 'b' } + } else if $in < 6hr { + '#fafafa' + } else if $in < 1day { + '#fafafa' + } else if $in < 3day { + '#fafafa' + } else if $in < 1wk { + { fg: '#fafafa' attr: 'b' } + } else if $in < 6wk { + '#fafafa' + } else if $in < 52wk { + '#fafafa' + } else { 'dark_gray' } + } + range: '#fafafa' + float: '#fafafa' + string: '#fafafa' + nothing: '#fafafa' + binary: '#fafafa' + cellpath: '#fafafa' + row_index: { fg: '#fafafa' attr: 'b' } + record: '#fafafa' + list: '#fafafa' + block: '#fafafa' + hints: 'dark_gray' + search_result: { fg: '#fafafa' bg: '#fafafa' } + + shape_and: { fg: '#fafafa' attr: 'b' } + shape_binary: { fg: '#fafafa' attr: 'b' } + shape_block: { fg: '#fafafa' attr: 'b' } + shape_bool: '#fafafa' + shape_custom: '#fafafa' + shape_datetime: { fg: '#fafafa' attr: 'b' } + shape_directory: '#fafafa' + shape_external: '#fafafa' + shape_externalarg: { fg: '#fafafa' attr: 'b' } + shape_filepath: '#fafafa' + shape_flag: { fg: '#fafafa' attr: 'b' } + shape_float: { fg: '#fafafa' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#fafafa' attr: 'b' } + shape_int: { fg: '#fafafa' attr: 'b' } + shape_internalcall: { fg: '#fafafa' attr: 'b' } + shape_list: { fg: '#fafafa' attr: 'b' } + shape_literal: '#fafafa' + shape_match_pattern: '#fafafa' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#fafafa' + shape_operator: '#fafafa' + shape_or: { fg: '#fafafa' attr: 'b' } + shape_pipe: { fg: '#fafafa' attr: 'b' } + shape_range: { fg: '#fafafa' attr: 'b' } + shape_record: { fg: '#fafafa' attr: 'b' } + shape_redirection: { fg: '#fafafa' attr: 'b' } + shape_signature: { fg: '#fafafa' attr: 'b' } + shape_string: '#fafafa' + shape_string_interpolation: { fg: '#fafafa' attr: 'b' } + shape_table: { fg: '#fafafa' attr: 'b' } + shape_variable: '#fafafa' + + background: '#262626' + foreground: '#fafafa' + cursor: '#fafafa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mono-yellow.nu b/themes/nu-themes/mono-yellow.nu index 91ababb..b72feaf 100644 --- a/themes/nu-themes/mono-yellow.nu +++ b/themes/nu-themes/mono-yellow.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffd300" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ffd300" attr: "b" } - empty: "#ffd300" - bool: {|| if $in { "#ffd300" } else { "light_gray" } } - int: "#ffd300" - filesize: {|e| - if $e == 0b { - "#ffd300" - } else if $e < 1mb { - "#ffd300" - } else {{ fg: "#ffd300" }} - } - duration: "#ffd300" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ffd300" attr: "b" } - } else if $in < 6hr { - "#ffd300" - } else if $in < 1day { - "#ffd300" - } else if $in < 3day { - "#ffd300" - } else if $in < 1wk { - { fg: "#ffd300" attr: "b" } - } else if $in < 6wk { - "#ffd300" - } else if $in < 52wk { - "#ffd300" - } else { "dark_gray" } - } - range: "#ffd300" - float: "#ffd300" - string: "#ffd300" - nothing: "#ffd300" - binary: "#ffd300" - cellpath: "#ffd300" - row_index: { fg: "#ffd300" attr: "b" } - record: "#ffd300" - list: "#ffd300" - block: "#ffd300" - hints: "dark_gray" - search_result: { fg: "#ffd300" bg: "#ffd300" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ffd300" attr: "b" } - shape_binary: { fg: "#ffd300" attr: "b" } - shape_block: { fg: "#ffd300" attr: "b" } - shape_bool: "#ffd300" - shape_custom: "#ffd300" - shape_datetime: { fg: "#ffd300" attr: "b" } - shape_directory: "#ffd300" - shape_external: "#ffd300" - shape_externalarg: { fg: "#ffd300" attr: "b" } - shape_filepath: "#ffd300" - shape_flag: { fg: "#ffd300" attr: "b" } - shape_float: { fg: "#ffd300" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ffd300" attr: "b" } - shape_int: { fg: "#ffd300" attr: "b" } - shape_internalcall: { fg: "#ffd300" attr: "b" } - shape_list: { fg: "#ffd300" attr: "b" } - shape_literal: "#ffd300" - shape_match_pattern: "#ffd300" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ffd300" - shape_operator: "#ffd300" - shape_or: { fg: "#ffd300" attr: "b" } - shape_pipe: { fg: "#ffd300" attr: "b" } - shape_range: { fg: "#ffd300" attr: "b" } - shape_record: { fg: "#ffd300" attr: "b" } - shape_redirection: { fg: "#ffd300" attr: "b" } - shape_signature: { fg: "#ffd300" attr: "b" } - shape_string: "#ffd300" - shape_string_interpolation: { fg: "#ffd300" attr: "b" } - shape_table: { fg: "#ffd300" attr: "b" } - shape_variable: "#ffd300" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b2400" - foreground: "#ffd300" - cursor: "#ffd300" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffd300' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ffd300' attr: 'b' } + empty: '#ffd300' + bool: {|| if $in { '#ffd300' } else { 'light_gray' } } + int: '#ffd300' + filesize: {|e| + if $e == 0b { + '#ffd300' + } else if $e < 1mb { + '#ffd300' + } else {{ fg: '#ffd300' }} + } + duration: '#ffd300' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ffd300' attr: 'b' } + } else if $in < 6hr { + '#ffd300' + } else if $in < 1day { + '#ffd300' + } else if $in < 3day { + '#ffd300' + } else if $in < 1wk { + { fg: '#ffd300' attr: 'b' } + } else if $in < 6wk { + '#ffd300' + } else if $in < 52wk { + '#ffd300' + } else { 'dark_gray' } + } + range: '#ffd300' + float: '#ffd300' + string: '#ffd300' + nothing: '#ffd300' + binary: '#ffd300' + cellpath: '#ffd300' + row_index: { fg: '#ffd300' attr: 'b' } + record: '#ffd300' + list: '#ffd300' + block: '#ffd300' + hints: 'dark_gray' + search_result: { fg: '#ffd300' bg: '#ffd300' } + + shape_and: { fg: '#ffd300' attr: 'b' } + shape_binary: { fg: '#ffd300' attr: 'b' } + shape_block: { fg: '#ffd300' attr: 'b' } + shape_bool: '#ffd300' + shape_custom: '#ffd300' + shape_datetime: { fg: '#ffd300' attr: 'b' } + shape_directory: '#ffd300' + shape_external: '#ffd300' + shape_externalarg: { fg: '#ffd300' attr: 'b' } + shape_filepath: '#ffd300' + shape_flag: { fg: '#ffd300' attr: 'b' } + shape_float: { fg: '#ffd300' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ffd300' attr: 'b' } + shape_int: { fg: '#ffd300' attr: 'b' } + shape_internalcall: { fg: '#ffd300' attr: 'b' } + shape_list: { fg: '#ffd300' attr: 'b' } + shape_literal: '#ffd300' + shape_match_pattern: '#ffd300' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ffd300' + shape_operator: '#ffd300' + shape_or: { fg: '#ffd300' attr: 'b' } + shape_pipe: { fg: '#ffd300' attr: 'b' } + shape_range: { fg: '#ffd300' attr: 'b' } + shape_record: { fg: '#ffd300' attr: 'b' } + shape_redirection: { fg: '#ffd300' attr: 'b' } + shape_signature: { fg: '#ffd300' attr: 'b' } + shape_string: '#ffd300' + shape_string_interpolation: { fg: '#ffd300' attr: 'b' } + shape_table: { fg: '#ffd300' attr: 'b' } + shape_variable: '#ffd300' + + background: '#2b2400' + foreground: '#ffd300' + cursor: '#ffd300' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/monokai-dark.nu b/themes/nu-themes/monokai-dark.nu index 181ec90..f9b83a8 100644 --- a/themes/nu-themes/monokai-dark.nu +++ b/themes/nu-themes/monokai-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f9f8f5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a6e22e" attr: "b" } - empty: "#66d9ef" - bool: {|| if $in { "#2aa198" } else { "light_gray" } } - int: "#f9f8f5" - filesize: {|e| - if $e == 0b { - "#f9f8f5" - } else if $e < 1mb { - "#2aa198" - } else {{ fg: "#66d9ef" }} - } - duration: "#f9f8f5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f92672" attr: "b" } - } else if $in < 6hr { - "#f92672" - } else if $in < 1day { - "#f4bf75" - } else if $in < 3day { - "#a6e22e" - } else if $in < 1wk { - { fg: "#a6e22e" attr: "b" } - } else if $in < 6wk { - "#2aa198" - } else if $in < 52wk { - "#66d9ef" - } else { "dark_gray" } - } - range: "#f9f8f5" - float: "#f9f8f5" - string: "#f9f8f5" - nothing: "#f9f8f5" - binary: "#f9f8f5" - cellpath: "#f9f8f5" - row_index: { fg: "#a6e22e" attr: "b" } - record: "#f9f8f5" - list: "#f9f8f5" - block: "#f9f8f5" - hints: "dark_gray" - search_result: { fg: "#f92672" bg: "#f9f8f5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ae81ff" attr: "b" } - shape_binary: { fg: "#ae81ff" attr: "b" } - shape_block: { fg: "#66d9ef" attr: "b" } - shape_bool: "#2aa198" - shape_custom: "#a6e22e" - shape_datetime: { fg: "#2aa198" attr: "b" } - shape_directory: "#2aa198" - shape_external: "#2aa198" - shape_externalarg: { fg: "#a6e22e" attr: "b" } - shape_filepath: "#2aa198" - shape_flag: { fg: "#66d9ef" attr: "b" } - shape_float: { fg: "#ae81ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2aa198" attr: "b" } - shape_int: { fg: "#ae81ff" attr: "b" } - shape_internalcall: { fg: "#2aa198" attr: "b" } - shape_list: { fg: "#2aa198" attr: "b" } - shape_literal: "#66d9ef" - shape_match_pattern: "#a6e22e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2aa198" - shape_operator: "#f4bf75" - shape_or: { fg: "#ae81ff" attr: "b" } - shape_pipe: { fg: "#ae81ff" attr: "b" } - shape_range: { fg: "#f4bf75" attr: "b" } - shape_record: { fg: "#2aa198" attr: "b" } - shape_redirection: { fg: "#ae81ff" attr: "b" } - shape_signature: { fg: "#a6e22e" attr: "b" } - shape_string: "#a6e22e" - shape_string_interpolation: { fg: "#2aa198" attr: "b" } - shape_table: { fg: "#66d9ef" attr: "b" } - shape_variable: "#ae81ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#272822" - foreground: "#f8f8f2" - cursor: "#f8f8f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f9f8f5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a6e22e' attr: 'b' } + empty: '#66d9ef' + bool: {|| if $in { '#2aa198' } else { 'light_gray' } } + int: '#f9f8f5' + filesize: {|e| + if $e == 0b { + '#f9f8f5' + } else if $e < 1mb { + '#2aa198' + } else {{ fg: '#66d9ef' }} + } + duration: '#f9f8f5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f92672' attr: 'b' } + } else if $in < 6hr { + '#f92672' + } else if $in < 1day { + '#f4bf75' + } else if $in < 3day { + '#a6e22e' + } else if $in < 1wk { + { fg: '#a6e22e' attr: 'b' } + } else if $in < 6wk { + '#2aa198' + } else if $in < 52wk { + '#66d9ef' + } else { 'dark_gray' } + } + range: '#f9f8f5' + float: '#f9f8f5' + string: '#f9f8f5' + nothing: '#f9f8f5' + binary: '#f9f8f5' + cellpath: '#f9f8f5' + row_index: { fg: '#a6e22e' attr: 'b' } + record: '#f9f8f5' + list: '#f9f8f5' + block: '#f9f8f5' + hints: 'dark_gray' + search_result: { fg: '#f92672' bg: '#f9f8f5' } + + shape_and: { fg: '#ae81ff' attr: 'b' } + shape_binary: { fg: '#ae81ff' attr: 'b' } + shape_block: { fg: '#66d9ef' attr: 'b' } + shape_bool: '#2aa198' + shape_custom: '#a6e22e' + shape_datetime: { fg: '#2aa198' attr: 'b' } + shape_directory: '#2aa198' + shape_external: '#2aa198' + shape_externalarg: { fg: '#a6e22e' attr: 'b' } + shape_filepath: '#2aa198' + shape_flag: { fg: '#66d9ef' attr: 'b' } + shape_float: { fg: '#ae81ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2aa198' attr: 'b' } + shape_int: { fg: '#ae81ff' attr: 'b' } + shape_internalcall: { fg: '#2aa198' attr: 'b' } + shape_list: { fg: '#2aa198' attr: 'b' } + shape_literal: '#66d9ef' + shape_match_pattern: '#a6e22e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2aa198' + shape_operator: '#f4bf75' + shape_or: { fg: '#ae81ff' attr: 'b' } + shape_pipe: { fg: '#ae81ff' attr: 'b' } + shape_range: { fg: '#f4bf75' attr: 'b' } + shape_record: { fg: '#2aa198' attr: 'b' } + shape_redirection: { fg: '#ae81ff' attr: 'b' } + shape_signature: { fg: '#a6e22e' attr: 'b' } + shape_string: '#a6e22e' + shape_string_interpolation: { fg: '#2aa198' attr: 'b' } + shape_table: { fg: '#66d9ef' attr: 'b' } + shape_variable: '#ae81ff' + + background: '#272822' + foreground: '#f8f8f2' + cursor: '#f8f8f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/monokai-soda.nu b/themes/nu-themes/monokai-soda.nu index 2f4c4f5..eda9dc2 100644 --- a/themes/nu-themes/monokai-soda.nu +++ b/themes/nu-themes/monokai-soda.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c4c5b5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98e024" attr: "b" } - empty: "#9d65ff" - bool: {|| if $in { "#58d1eb" } else { "light_gray" } } - int: "#c4c5b5" - filesize: {|e| - if $e == 0b { - "#c4c5b5" - } else if $e < 1mb { - "#58d1eb" - } else {{ fg: "#9d65ff" }} - } - duration: "#c4c5b5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f4005f" attr: "b" } - } else if $in < 6hr { - "#f4005f" - } else if $in < 1day { - "#fa8419" - } else if $in < 3day { - "#98e024" - } else if $in < 1wk { - { fg: "#98e024" attr: "b" } - } else if $in < 6wk { - "#58d1eb" - } else if $in < 52wk { - "#9d65ff" - } else { "dark_gray" } - } - range: "#c4c5b5" - float: "#c4c5b5" - string: "#c4c5b5" - nothing: "#c4c5b5" - binary: "#c4c5b5" - cellpath: "#c4c5b5" - row_index: { fg: "#98e024" attr: "b" } - record: "#c4c5b5" - list: "#c4c5b5" - block: "#c4c5b5" - hints: "dark_gray" - search_result: { fg: "#f4005f" bg: "#c4c5b5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f4005f" attr: "b" } - shape_binary: { fg: "#f4005f" attr: "b" } - shape_block: { fg: "#9d65ff" attr: "b" } - shape_bool: "#58d1eb" - shape_custom: "#98e024" - shape_datetime: { fg: "#58d1eb" attr: "b" } - shape_directory: "#58d1eb" - shape_external: "#58d1eb" - shape_externalarg: { fg: "#98e024" attr: "b" } - shape_filepath: "#58d1eb" - shape_flag: { fg: "#9d65ff" attr: "b" } - shape_float: { fg: "#f4005f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#58d1eb" attr: "b" } - shape_int: { fg: "#f4005f" attr: "b" } - shape_internalcall: { fg: "#58d1eb" attr: "b" } - shape_list: { fg: "#58d1eb" attr: "b" } - shape_literal: "#9d65ff" - shape_match_pattern: "#98e024" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#58d1eb" - shape_operator: "#fa8419" - shape_or: { fg: "#f4005f" attr: "b" } - shape_pipe: { fg: "#f4005f" attr: "b" } - shape_range: { fg: "#fa8419" attr: "b" } - shape_record: { fg: "#58d1eb" attr: "b" } - shape_redirection: { fg: "#f4005f" attr: "b" } - shape_signature: { fg: "#98e024" attr: "b" } - shape_string: "#98e024" - shape_string_interpolation: { fg: "#58d1eb" attr: "b" } - shape_table: { fg: "#9d65ff" attr: "b" } - shape_variable: "#f4005f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1a1a1a" - foreground: "#c4c5b5" - cursor: "#c4c5b5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c4c5b5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98e024' attr: 'b' } + empty: '#9d65ff' + bool: {|| if $in { '#58d1eb' } else { 'light_gray' } } + int: '#c4c5b5' + filesize: {|e| + if $e == 0b { + '#c4c5b5' + } else if $e < 1mb { + '#58d1eb' + } else {{ fg: '#9d65ff' }} + } + duration: '#c4c5b5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f4005f' attr: 'b' } + } else if $in < 6hr { + '#f4005f' + } else if $in < 1day { + '#fa8419' + } else if $in < 3day { + '#98e024' + } else if $in < 1wk { + { fg: '#98e024' attr: 'b' } + } else if $in < 6wk { + '#58d1eb' + } else if $in < 52wk { + '#9d65ff' + } else { 'dark_gray' } + } + range: '#c4c5b5' + float: '#c4c5b5' + string: '#c4c5b5' + nothing: '#c4c5b5' + binary: '#c4c5b5' + cellpath: '#c4c5b5' + row_index: { fg: '#98e024' attr: 'b' } + record: '#c4c5b5' + list: '#c4c5b5' + block: '#c4c5b5' + hints: 'dark_gray' + search_result: { fg: '#f4005f' bg: '#c4c5b5' } + + shape_and: { fg: '#f4005f' attr: 'b' } + shape_binary: { fg: '#f4005f' attr: 'b' } + shape_block: { fg: '#9d65ff' attr: 'b' } + shape_bool: '#58d1eb' + shape_custom: '#98e024' + shape_datetime: { fg: '#58d1eb' attr: 'b' } + shape_directory: '#58d1eb' + shape_external: '#58d1eb' + shape_externalarg: { fg: '#98e024' attr: 'b' } + shape_filepath: '#58d1eb' + shape_flag: { fg: '#9d65ff' attr: 'b' } + shape_float: { fg: '#f4005f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#58d1eb' attr: 'b' } + shape_int: { fg: '#f4005f' attr: 'b' } + shape_internalcall: { fg: '#58d1eb' attr: 'b' } + shape_list: { fg: '#58d1eb' attr: 'b' } + shape_literal: '#9d65ff' + shape_match_pattern: '#98e024' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#58d1eb' + shape_operator: '#fa8419' + shape_or: { fg: '#f4005f' attr: 'b' } + shape_pipe: { fg: '#f4005f' attr: 'b' } + shape_range: { fg: '#fa8419' attr: 'b' } + shape_record: { fg: '#58d1eb' attr: 'b' } + shape_redirection: { fg: '#f4005f' attr: 'b' } + shape_signature: { fg: '#98e024' attr: 'b' } + shape_string: '#98e024' + shape_string_interpolation: { fg: '#58d1eb' attr: 'b' } + shape_table: { fg: '#9d65ff' attr: 'b' } + shape_variable: '#f4005f' + + background: '#1a1a1a' + foreground: '#c4c5b5' + cursor: '#c4c5b5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/monokai.nu b/themes/nu-themes/monokai.nu index 888044a..5bac590 100644 --- a/themes/nu-themes/monokai.nu +++ b/themes/nu-themes/monokai.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f8f8f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a6e22e" attr: "b" } - empty: "#66d9ef" - bool: {|| if $in { "#a1efe4" } else { "light_gray" } } - int: "#f8f8f2" - filesize: {|e| - if $e == 0b { - "#f8f8f2" - } else if $e < 1mb { - "#a1efe4" - } else {{ fg: "#66d9ef" }} - } - duration: "#f8f8f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f92672" attr: "b" } - } else if $in < 6hr { - "#f92672" - } else if $in < 1day { - "#f4bf75" - } else if $in < 3day { - "#a6e22e" - } else if $in < 1wk { - { fg: "#a6e22e" attr: "b" } - } else if $in < 6wk { - "#a1efe4" - } else if $in < 52wk { - "#66d9ef" - } else { "dark_gray" } - } - range: "#f8f8f2" - float: "#f8f8f2" - string: "#f8f8f2" - nothing: "#f8f8f2" - binary: "#f8f8f2" - cellpath: "#f8f8f2" - row_index: { fg: "#a6e22e" attr: "b" } - record: "#f8f8f2" - list: "#f8f8f2" - block: "#f8f8f2" - hints: "dark_gray" - search_result: { fg: "#f92672" bg: "#f8f8f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ae81ff" attr: "b" } - shape_binary: { fg: "#ae81ff" attr: "b" } - shape_block: { fg: "#66d9ef" attr: "b" } - shape_bool: "#a1efe4" - shape_custom: "#a6e22e" - shape_datetime: { fg: "#a1efe4" attr: "b" } - shape_directory: "#a1efe4" - shape_external: "#a1efe4" - shape_externalarg: { fg: "#a6e22e" attr: "b" } - shape_filepath: "#a1efe4" - shape_flag: { fg: "#66d9ef" attr: "b" } - shape_float: { fg: "#ae81ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#a1efe4" attr: "b" } - shape_int: { fg: "#ae81ff" attr: "b" } - shape_internalcall: { fg: "#a1efe4" attr: "b" } - shape_list: { fg: "#a1efe4" attr: "b" } - shape_literal: "#66d9ef" - shape_match_pattern: "#a6e22e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a1efe4" - shape_operator: "#f4bf75" - shape_or: { fg: "#ae81ff" attr: "b" } - shape_pipe: { fg: "#ae81ff" attr: "b" } - shape_range: { fg: "#f4bf75" attr: "b" } - shape_record: { fg: "#a1efe4" attr: "b" } - shape_redirection: { fg: "#ae81ff" attr: "b" } - shape_signature: { fg: "#a6e22e" attr: "b" } - shape_string: "#a6e22e" - shape_string_interpolation: { fg: "#a1efe4" attr: "b" } - shape_table: { fg: "#66d9ef" attr: "b" } - shape_variable: "#ae81ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#272822" - foreground: "#f8f8f2" - cursor: "#f8f8f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f8f8f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a6e22e' attr: 'b' } + empty: '#66d9ef' + bool: {|| if $in { '#a1efe4' } else { 'light_gray' } } + int: '#f8f8f2' + filesize: {|e| + if $e == 0b { + '#f8f8f2' + } else if $e < 1mb { + '#a1efe4' + } else {{ fg: '#66d9ef' }} + } + duration: '#f8f8f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f92672' attr: 'b' } + } else if $in < 6hr { + '#f92672' + } else if $in < 1day { + '#f4bf75' + } else if $in < 3day { + '#a6e22e' + } else if $in < 1wk { + { fg: '#a6e22e' attr: 'b' } + } else if $in < 6wk { + '#a1efe4' + } else if $in < 52wk { + '#66d9ef' + } else { 'dark_gray' } + } + range: '#f8f8f2' + float: '#f8f8f2' + string: '#f8f8f2' + nothing: '#f8f8f2' + binary: '#f8f8f2' + cellpath: '#f8f8f2' + row_index: { fg: '#a6e22e' attr: 'b' } + record: '#f8f8f2' + list: '#f8f8f2' + block: '#f8f8f2' + hints: 'dark_gray' + search_result: { fg: '#f92672' bg: '#f8f8f2' } + + shape_and: { fg: '#ae81ff' attr: 'b' } + shape_binary: { fg: '#ae81ff' attr: 'b' } + shape_block: { fg: '#66d9ef' attr: 'b' } + shape_bool: '#a1efe4' + shape_custom: '#a6e22e' + shape_datetime: { fg: '#a1efe4' attr: 'b' } + shape_directory: '#a1efe4' + shape_external: '#a1efe4' + shape_externalarg: { fg: '#a6e22e' attr: 'b' } + shape_filepath: '#a1efe4' + shape_flag: { fg: '#66d9ef' attr: 'b' } + shape_float: { fg: '#ae81ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#a1efe4' attr: 'b' } + shape_int: { fg: '#ae81ff' attr: 'b' } + shape_internalcall: { fg: '#a1efe4' attr: 'b' } + shape_list: { fg: '#a1efe4' attr: 'b' } + shape_literal: '#66d9ef' + shape_match_pattern: '#a6e22e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a1efe4' + shape_operator: '#f4bf75' + shape_or: { fg: '#ae81ff' attr: 'b' } + shape_pipe: { fg: '#ae81ff' attr: 'b' } + shape_range: { fg: '#f4bf75' attr: 'b' } + shape_record: { fg: '#a1efe4' attr: 'b' } + shape_redirection: { fg: '#ae81ff' attr: 'b' } + shape_signature: { fg: '#a6e22e' attr: 'b' } + shape_string: '#a6e22e' + shape_string_interpolation: { fg: '#a1efe4' attr: 'b' } + shape_table: { fg: '#66d9ef' attr: 'b' } + shape_variable: '#ae81ff' + + background: '#272822' + foreground: '#f8f8f2' + cursor: '#f8f8f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mountaineer-grey.nu b/themes/nu-themes/mountaineer-grey.nu index bba5bc4..b8658a5 100644 --- a/themes/nu-themes/mountaineer-grey.nu +++ b/themes/nu-themes/mountaineer-grey.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c5c8c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b5bd68" attr: "b" } - empty: "#81a2be" - bool: {|| if $in { "#8abeb7" } else { "light_gray" } } - int: "#c5c8c6" - filesize: {|e| - if $e == 0b { - "#c5c8c6" - } else if $e < 1mb { - "#8abeb7" - } else {{ fg: "#81a2be" }} - } - duration: "#c5c8c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc6666" attr: "b" } - } else if $in < 6hr { - "#cc6666" - } else if $in < 1day { - "#f0c674" - } else if $in < 3day { - "#b5bd68" - } else if $in < 1wk { - { fg: "#b5bd68" attr: "b" } - } else if $in < 6wk { - "#8abeb7" - } else if $in < 52wk { - "#81a2be" - } else { "dark_gray" } - } - range: "#c5c8c6" - float: "#c5c8c6" - string: "#c5c8c6" - nothing: "#c5c8c6" - binary: "#c5c8c6" - cellpath: "#c5c8c6" - row_index: { fg: "#b5bd68" attr: "b" } - record: "#c5c8c6" - list: "#c5c8c6" - block: "#c5c8c6" - hints: "dark_gray" - search_result: { fg: "#cc6666" bg: "#c5c8c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b294bb" attr: "b" } - shape_binary: { fg: "#b294bb" attr: "b" } - shape_block: { fg: "#81a2be" attr: "b" } - shape_bool: "#8abeb7" - shape_custom: "#b5bd68" - shape_datetime: { fg: "#8abeb7" attr: "b" } - shape_directory: "#8abeb7" - shape_external: "#8abeb7" - shape_externalarg: { fg: "#b5bd68" attr: "b" } - shape_filepath: "#8abeb7" - shape_flag: { fg: "#81a2be" attr: "b" } - shape_float: { fg: "#b294bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8abeb7" attr: "b" } - shape_int: { fg: "#b294bb" attr: "b" } - shape_internalcall: { fg: "#8abeb7" attr: "b" } - shape_list: { fg: "#8abeb7" attr: "b" } - shape_literal: "#81a2be" - shape_match_pattern: "#b5bd68" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8abeb7" - shape_operator: "#f0c674" - shape_or: { fg: "#b294bb" attr: "b" } - shape_pipe: { fg: "#b294bb" attr: "b" } - shape_range: { fg: "#f0c674" attr: "b" } - shape_record: { fg: "#8abeb7" attr: "b" } - shape_redirection: { fg: "#b294bb" attr: "b" } - shape_signature: { fg: "#b5bd68" attr: "b" } - shape_string: "#b5bd68" - shape_string_interpolation: { fg: "#8abeb7" attr: "b" } - shape_table: { fg: "#81a2be" attr: "b" } - shape_variable: "#b294bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232323" - foreground: "#c0c0c0" - cursor: "#b5bd68" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c5c8c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b5bd68' attr: 'b' } + empty: '#81a2be' + bool: {|| if $in { '#8abeb7' } else { 'light_gray' } } + int: '#c5c8c6' + filesize: {|e| + if $e == 0b { + '#c5c8c6' + } else if $e < 1mb { + '#8abeb7' + } else {{ fg: '#81a2be' }} + } + duration: '#c5c8c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc6666' attr: 'b' } + } else if $in < 6hr { + '#cc6666' + } else if $in < 1day { + '#f0c674' + } else if $in < 3day { + '#b5bd68' + } else if $in < 1wk { + { fg: '#b5bd68' attr: 'b' } + } else if $in < 6wk { + '#8abeb7' + } else if $in < 52wk { + '#81a2be' + } else { 'dark_gray' } + } + range: '#c5c8c6' + float: '#c5c8c6' + string: '#c5c8c6' + nothing: '#c5c8c6' + binary: '#c5c8c6' + cellpath: '#c5c8c6' + row_index: { fg: '#b5bd68' attr: 'b' } + record: '#c5c8c6' + list: '#c5c8c6' + block: '#c5c8c6' + hints: 'dark_gray' + search_result: { fg: '#cc6666' bg: '#c5c8c6' } + + shape_and: { fg: '#b294bb' attr: 'b' } + shape_binary: { fg: '#b294bb' attr: 'b' } + shape_block: { fg: '#81a2be' attr: 'b' } + shape_bool: '#8abeb7' + shape_custom: '#b5bd68' + shape_datetime: { fg: '#8abeb7' attr: 'b' } + shape_directory: '#8abeb7' + shape_external: '#8abeb7' + shape_externalarg: { fg: '#b5bd68' attr: 'b' } + shape_filepath: '#8abeb7' + shape_flag: { fg: '#81a2be' attr: 'b' } + shape_float: { fg: '#b294bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8abeb7' attr: 'b' } + shape_int: { fg: '#b294bb' attr: 'b' } + shape_internalcall: { fg: '#8abeb7' attr: 'b' } + shape_list: { fg: '#8abeb7' attr: 'b' } + shape_literal: '#81a2be' + shape_match_pattern: '#b5bd68' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8abeb7' + shape_operator: '#f0c674' + shape_or: { fg: '#b294bb' attr: 'b' } + shape_pipe: { fg: '#b294bb' attr: 'b' } + shape_range: { fg: '#f0c674' attr: 'b' } + shape_record: { fg: '#8abeb7' attr: 'b' } + shape_redirection: { fg: '#b294bb' attr: 'b' } + shape_signature: { fg: '#b5bd68' attr: 'b' } + shape_string: '#b5bd68' + shape_string_interpolation: { fg: '#8abeb7' attr: 'b' } + shape_table: { fg: '#81a2be' attr: 'b' } + shape_variable: '#b294bb' + + background: '#232323' + foreground: '#c0c0c0' + cursor: '#b5bd68' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/mountaineer.nu b/themes/nu-themes/mountaineer.nu index 6b89247..5e5f67d 100644 --- a/themes/nu-themes/mountaineer.nu +++ b/themes/nu-themes/mountaineer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c5c8c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b5bd68" attr: "b" } - empty: "#81a2be" - bool: {|| if $in { "#8abeb7" } else { "light_gray" } } - int: "#c5c8c6" - filesize: {|e| - if $e == 0b { - "#c5c8c6" - } else if $e < 1mb { - "#8abeb7" - } else {{ fg: "#81a2be" }} - } - duration: "#c5c8c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc6666" attr: "b" } - } else if $in < 6hr { - "#cc6666" - } else if $in < 1day { - "#f0c674" - } else if $in < 3day { - "#b5bd68" - } else if $in < 1wk { - { fg: "#b5bd68" attr: "b" } - } else if $in < 6wk { - "#8abeb7" - } else if $in < 52wk { - "#81a2be" - } else { "dark_gray" } - } - range: "#c5c8c6" - float: "#c5c8c6" - string: "#c5c8c6" - nothing: "#c5c8c6" - binary: "#c5c8c6" - cellpath: "#c5c8c6" - row_index: { fg: "#b5bd68" attr: "b" } - record: "#c5c8c6" - list: "#c5c8c6" - block: "#c5c8c6" - hints: "dark_gray" - search_result: { fg: "#cc6666" bg: "#c5c8c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b294bb" attr: "b" } - shape_binary: { fg: "#b294bb" attr: "b" } - shape_block: { fg: "#81a2be" attr: "b" } - shape_bool: "#8abeb7" - shape_custom: "#b5bd68" - shape_datetime: { fg: "#8abeb7" attr: "b" } - shape_directory: "#8abeb7" - shape_external: "#8abeb7" - shape_externalarg: { fg: "#b5bd68" attr: "b" } - shape_filepath: "#8abeb7" - shape_flag: { fg: "#81a2be" attr: "b" } - shape_float: { fg: "#b294bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8abeb7" attr: "b" } - shape_int: { fg: "#b294bb" attr: "b" } - shape_internalcall: { fg: "#8abeb7" attr: "b" } - shape_list: { fg: "#8abeb7" attr: "b" } - shape_literal: "#81a2be" - shape_match_pattern: "#b5bd68" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8abeb7" - shape_operator: "#f0c674" - shape_or: { fg: "#b294bb" attr: "b" } - shape_pipe: { fg: "#b294bb" attr: "b" } - shape_range: { fg: "#f0c674" attr: "b" } - shape_record: { fg: "#8abeb7" attr: "b" } - shape_redirection: { fg: "#b294bb" attr: "b" } - shape_signature: { fg: "#b5bd68" attr: "b" } - shape_string: "#b5bd68" - shape_string_interpolation: { fg: "#8abeb7" attr: "b" } - shape_table: { fg: "#81a2be" attr: "b" } - shape_variable: "#b294bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#050505" - foreground: "#f0f0f0" - cursor: "#b5bd68" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c5c8c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b5bd68' attr: 'b' } + empty: '#81a2be' + bool: {|| if $in { '#8abeb7' } else { 'light_gray' } } + int: '#c5c8c6' + filesize: {|e| + if $e == 0b { + '#c5c8c6' + } else if $e < 1mb { + '#8abeb7' + } else {{ fg: '#81a2be' }} + } + duration: '#c5c8c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc6666' attr: 'b' } + } else if $in < 6hr { + '#cc6666' + } else if $in < 1day { + '#f0c674' + } else if $in < 3day { + '#b5bd68' + } else if $in < 1wk { + { fg: '#b5bd68' attr: 'b' } + } else if $in < 6wk { + '#8abeb7' + } else if $in < 52wk { + '#81a2be' + } else { 'dark_gray' } + } + range: '#c5c8c6' + float: '#c5c8c6' + string: '#c5c8c6' + nothing: '#c5c8c6' + binary: '#c5c8c6' + cellpath: '#c5c8c6' + row_index: { fg: '#b5bd68' attr: 'b' } + record: '#c5c8c6' + list: '#c5c8c6' + block: '#c5c8c6' + hints: 'dark_gray' + search_result: { fg: '#cc6666' bg: '#c5c8c6' } + + shape_and: { fg: '#b294bb' attr: 'b' } + shape_binary: { fg: '#b294bb' attr: 'b' } + shape_block: { fg: '#81a2be' attr: 'b' } + shape_bool: '#8abeb7' + shape_custom: '#b5bd68' + shape_datetime: { fg: '#8abeb7' attr: 'b' } + shape_directory: '#8abeb7' + shape_external: '#8abeb7' + shape_externalarg: { fg: '#b5bd68' attr: 'b' } + shape_filepath: '#8abeb7' + shape_flag: { fg: '#81a2be' attr: 'b' } + shape_float: { fg: '#b294bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8abeb7' attr: 'b' } + shape_int: { fg: '#b294bb' attr: 'b' } + shape_internalcall: { fg: '#8abeb7' attr: 'b' } + shape_list: { fg: '#8abeb7' attr: 'b' } + shape_literal: '#81a2be' + shape_match_pattern: '#b5bd68' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8abeb7' + shape_operator: '#f0c674' + shape_or: { fg: '#b294bb' attr: 'b' } + shape_pipe: { fg: '#b294bb' attr: 'b' } + shape_range: { fg: '#f0c674' attr: 'b' } + shape_record: { fg: '#8abeb7' attr: 'b' } + shape_redirection: { fg: '#b294bb' attr: 'b' } + shape_signature: { fg: '#b5bd68' attr: 'b' } + shape_string: '#b5bd68' + shape_string_interpolation: { fg: '#8abeb7' attr: 'b' } + shape_table: { fg: '#81a2be' attr: 'b' } + shape_variable: '#b294bb' + + background: '#050505' + foreground: '#f0f0f0' + cursor: '#b5bd68' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/n0tch2k.nu b/themes/nu-themes/n0tch2k.nu index f2f107c..13d2e5a 100644 --- a/themes/nu-themes/n0tch2k.nu +++ b/themes/nu-themes/n0tch2k.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0b8a3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#666666" attr: "b" } - empty: "#657d3e" - bool: {|| if $in { "#dcdcdc" } else { "light_gray" } } - int: "#d0b8a3" - filesize: {|e| - if $e == 0b { - "#d0b8a3" - } else if $e < 1mb { - "#c9c9c9" - } else {{ fg: "#657d3e" }} - } - duration: "#d0b8a3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a95551" attr: "b" } - } else if $in < 6hr { - "#a95551" - } else if $in < 1day { - "#a98051" - } else if $in < 3day { - "#666666" - } else if $in < 1wk { - { fg: "#666666" attr: "b" } - } else if $in < 6wk { - "#c9c9c9" - } else if $in < 52wk { - "#657d3e" - } else { "dark_gray" } - } - range: "#d0b8a3" - float: "#d0b8a3" - string: "#d0b8a3" - nothing: "#d0b8a3" - binary: "#d0b8a3" - cellpath: "#d0b8a3" - row_index: { fg: "#666666" attr: "b" } - record: "#d0b8a3" - list: "#d0b8a3" - block: "#d0b8a3" - hints: "dark_gray" - search_result: { fg: "#a95551" bg: "#d0b8a3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#767676" attr: "b" } - shape_binary: { fg: "#767676" attr: "b" } - shape_block: { fg: "#657d3e" attr: "b" } - shape_bool: "#dcdcdc" - shape_custom: "#666666" - shape_datetime: { fg: "#c9c9c9" attr: "b" } - shape_directory: "#c9c9c9" - shape_external: "#c9c9c9" - shape_externalarg: { fg: "#666666" attr: "b" } - shape_filepath: "#c9c9c9" - shape_flag: { fg: "#657d3e" attr: "b" } - shape_float: { fg: "#767676" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c9c9c9" attr: "b" } - shape_int: { fg: "#767676" attr: "b" } - shape_internalcall: { fg: "#c9c9c9" attr: "b" } - shape_list: { fg: "#c9c9c9" attr: "b" } - shape_literal: "#657d3e" - shape_match_pattern: "#666666" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#dcdcdc" - shape_operator: "#a98051" - shape_or: { fg: "#767676" attr: "b" } - shape_pipe: { fg: "#767676" attr: "b" } - shape_range: { fg: "#a98051" attr: "b" } - shape_record: { fg: "#c9c9c9" attr: "b" } - shape_redirection: { fg: "#767676" attr: "b" } - shape_signature: { fg: "#666666" attr: "b" } - shape_string: "#666666" - shape_string_interpolation: { fg: "#c9c9c9" attr: "b" } - shape_table: { fg: "#657d3e" attr: "b" } - shape_variable: "#767676" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#a0a0a0" - cursor: "#a0a0a0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0b8a3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#666666' attr: 'b' } + empty: '#657d3e' + bool: {|| if $in { '#dcdcdc' } else { 'light_gray' } } + int: '#d0b8a3' + filesize: {|e| + if $e == 0b { + '#d0b8a3' + } else if $e < 1mb { + '#c9c9c9' + } else {{ fg: '#657d3e' }} + } + duration: '#d0b8a3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a95551' attr: 'b' } + } else if $in < 6hr { + '#a95551' + } else if $in < 1day { + '#a98051' + } else if $in < 3day { + '#666666' + } else if $in < 1wk { + { fg: '#666666' attr: 'b' } + } else if $in < 6wk { + '#c9c9c9' + } else if $in < 52wk { + '#657d3e' + } else { 'dark_gray' } + } + range: '#d0b8a3' + float: '#d0b8a3' + string: '#d0b8a3' + nothing: '#d0b8a3' + binary: '#d0b8a3' + cellpath: '#d0b8a3' + row_index: { fg: '#666666' attr: 'b' } + record: '#d0b8a3' + list: '#d0b8a3' + block: '#d0b8a3' + hints: 'dark_gray' + search_result: { fg: '#a95551' bg: '#d0b8a3' } + + shape_and: { fg: '#767676' attr: 'b' } + shape_binary: { fg: '#767676' attr: 'b' } + shape_block: { fg: '#657d3e' attr: 'b' } + shape_bool: '#dcdcdc' + shape_custom: '#666666' + shape_datetime: { fg: '#c9c9c9' attr: 'b' } + shape_directory: '#c9c9c9' + shape_external: '#c9c9c9' + shape_externalarg: { fg: '#666666' attr: 'b' } + shape_filepath: '#c9c9c9' + shape_flag: { fg: '#657d3e' attr: 'b' } + shape_float: { fg: '#767676' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c9c9c9' attr: 'b' } + shape_int: { fg: '#767676' attr: 'b' } + shape_internalcall: { fg: '#c9c9c9' attr: 'b' } + shape_list: { fg: '#c9c9c9' attr: 'b' } + shape_literal: '#657d3e' + shape_match_pattern: '#666666' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#dcdcdc' + shape_operator: '#a98051' + shape_or: { fg: '#767676' attr: 'b' } + shape_pipe: { fg: '#767676' attr: 'b' } + shape_range: { fg: '#a98051' attr: 'b' } + shape_record: { fg: '#c9c9c9' attr: 'b' } + shape_redirection: { fg: '#767676' attr: 'b' } + shape_signature: { fg: '#666666' attr: 'b' } + shape_string: '#666666' + shape_string_interpolation: { fg: '#c9c9c9' attr: 'b' } + shape_table: { fg: '#657d3e' attr: 'b' } + shape_variable: '#767676' + + background: '#222222' + foreground: '#a0a0a0' + cursor: '#a0a0a0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nebula.nu b/themes/nu-themes/nebula.nu index c4f4991..e6cc65a 100644 --- a/themes/nu-themes/nebula.nu +++ b/themes/nu-themes/nebula.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a4a6a9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6562a8" attr: "b" } - empty: "#4d6bb6" - bool: {|| if $in { "#226f68" } else { "light_gray" } } - int: "#a4a6a9" - filesize: {|e| - if $e == 0b { - "#a4a6a9" - } else if $e < 1mb { - "#226f68" - } else {{ fg: "#4d6bb6" }} - } - duration: "#a4a6a9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#777abc" attr: "b" } - } else if $in < 6hr { - "#777abc" - } else if $in < 1day { - "#4f9062" - } else if $in < 3day { - "#6562a8" - } else if $in < 1wk { - { fg: "#6562a8" attr: "b" } - } else if $in < 6wk { - "#226f68" - } else if $in < 52wk { - "#4d6bb6" - } else { "dark_gray" } - } - range: "#a4a6a9" - float: "#a4a6a9" - string: "#a4a6a9" - nothing: "#a4a6a9" - binary: "#a4a6a9" - cellpath: "#a4a6a9" - row_index: { fg: "#6562a8" attr: "b" } - record: "#a4a6a9" - list: "#a4a6a9" - block: "#a4a6a9" - hints: "dark_gray" - search_result: { fg: "#777abc" bg: "#a4a6a9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#716cae" attr: "b" } - shape_binary: { fg: "#716cae" attr: "b" } - shape_block: { fg: "#4d6bb6" attr: "b" } - shape_bool: "#226f68" - shape_custom: "#6562a8" - shape_datetime: { fg: "#226f68" attr: "b" } - shape_directory: "#226f68" - shape_external: "#226f68" - shape_externalarg: { fg: "#6562a8" attr: "b" } - shape_filepath: "#226f68" - shape_flag: { fg: "#4d6bb6" attr: "b" } - shape_float: { fg: "#716cae" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#226f68" attr: "b" } - shape_int: { fg: "#716cae" attr: "b" } - shape_internalcall: { fg: "#226f68" attr: "b" } - shape_list: { fg: "#226f68" attr: "b" } - shape_literal: "#4d6bb6" - shape_match_pattern: "#6562a8" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#226f68" - shape_operator: "#4f9062" - shape_or: { fg: "#716cae" attr: "b" } - shape_pipe: { fg: "#716cae" attr: "b" } - shape_range: { fg: "#4f9062" attr: "b" } - shape_record: { fg: "#226f68" attr: "b" } - shape_redirection: { fg: "#716cae" attr: "b" } - shape_signature: { fg: "#6562a8" attr: "b" } - shape_string: "#6562a8" - shape_string_interpolation: { fg: "#226f68" attr: "b" } - shape_table: { fg: "#4d6bb6" attr: "b" } - shape_variable: "#716cae" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#22273b" - foreground: "#a4a6a9" - cursor: "#a4a6a9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a4a6a9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6562a8' attr: 'b' } + empty: '#4d6bb6' + bool: {|| if $in { '#226f68' } else { 'light_gray' } } + int: '#a4a6a9' + filesize: {|e| + if $e == 0b { + '#a4a6a9' + } else if $e < 1mb { + '#226f68' + } else {{ fg: '#4d6bb6' }} + } + duration: '#a4a6a9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#777abc' attr: 'b' } + } else if $in < 6hr { + '#777abc' + } else if $in < 1day { + '#4f9062' + } else if $in < 3day { + '#6562a8' + } else if $in < 1wk { + { fg: '#6562a8' attr: 'b' } + } else if $in < 6wk { + '#226f68' + } else if $in < 52wk { + '#4d6bb6' + } else { 'dark_gray' } + } + range: '#a4a6a9' + float: '#a4a6a9' + string: '#a4a6a9' + nothing: '#a4a6a9' + binary: '#a4a6a9' + cellpath: '#a4a6a9' + row_index: { fg: '#6562a8' attr: 'b' } + record: '#a4a6a9' + list: '#a4a6a9' + block: '#a4a6a9' + hints: 'dark_gray' + search_result: { fg: '#777abc' bg: '#a4a6a9' } + + shape_and: { fg: '#716cae' attr: 'b' } + shape_binary: { fg: '#716cae' attr: 'b' } + shape_block: { fg: '#4d6bb6' attr: 'b' } + shape_bool: '#226f68' + shape_custom: '#6562a8' + shape_datetime: { fg: '#226f68' attr: 'b' } + shape_directory: '#226f68' + shape_external: '#226f68' + shape_externalarg: { fg: '#6562a8' attr: 'b' } + shape_filepath: '#226f68' + shape_flag: { fg: '#4d6bb6' attr: 'b' } + shape_float: { fg: '#716cae' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#226f68' attr: 'b' } + shape_int: { fg: '#716cae' attr: 'b' } + shape_internalcall: { fg: '#226f68' attr: 'b' } + shape_list: { fg: '#226f68' attr: 'b' } + shape_literal: '#4d6bb6' + shape_match_pattern: '#6562a8' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#226f68' + shape_operator: '#4f9062' + shape_or: { fg: '#716cae' attr: 'b' } + shape_pipe: { fg: '#716cae' attr: 'b' } + shape_range: { fg: '#4f9062' attr: 'b' } + shape_record: { fg: '#226f68' attr: 'b' } + shape_redirection: { fg: '#716cae' attr: 'b' } + shape_signature: { fg: '#6562a8' attr: 'b' } + shape_string: '#6562a8' + shape_string_interpolation: { fg: '#226f68' attr: 'b' } + shape_table: { fg: '#4d6bb6' attr: 'b' } + shape_variable: '#716cae' + + background: '#22273b' + foreground: '#a4a6a9' + cursor: '#a4a6a9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/neon-night.nu b/themes/nu-themes/neon-night.nu index dfd8f5b..8defe41 100644 --- a/themes/nu-themes/neon-night.nu +++ b/themes/nu-themes/neon-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c9cccd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7efdd0" attr: "b" } - empty: "#69b4f9" - bool: {|| if $in { "#8ce8ff" } else { "light_gray" } } - int: "#c9cccd" - filesize: {|e| - if $e == 0b { - "#c9cccd" - } else if $e < 1mb { - "#8ce8ff" - } else {{ fg: "#69b4f9" }} - } - duration: "#c9cccd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff8e8e" attr: "b" } - } else if $in < 6hr { - "#ff8e8e" - } else if $in < 1day { - "#fcad3f" - } else if $in < 3day { - "#7efdd0" - } else if $in < 1wk { - { fg: "#7efdd0" attr: "b" } - } else if $in < 6wk { - "#8ce8ff" - } else if $in < 52wk { - "#69b4f9" - } else { "dark_gray" } - } - range: "#c9cccd" - float: "#c9cccd" - string: "#c9cccd" - nothing: "#c9cccd" - binary: "#c9cccd" - cellpath: "#c9cccd" - row_index: { fg: "#7efdd0" attr: "b" } - record: "#c9cccd" - list: "#c9cccd" - block: "#c9cccd" - hints: "dark_gray" - search_result: { fg: "#ff8e8e" bg: "#c9cccd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#dd92f6" attr: "b" } - shape_binary: { fg: "#dd92f6" attr: "b" } - shape_block: { fg: "#69b4f9" attr: "b" } - shape_bool: "#8ce8ff" - shape_custom: "#7efdd0" - shape_datetime: { fg: "#8ce8ff" attr: "b" } - shape_directory: "#8ce8ff" - shape_external: "#8ce8ff" - shape_externalarg: { fg: "#7efdd0" attr: "b" } - shape_filepath: "#8ce8ff" - shape_flag: { fg: "#69b4f9" attr: "b" } - shape_float: { fg: "#dd92f6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ce8ff" attr: "b" } - shape_int: { fg: "#dd92f6" attr: "b" } - shape_internalcall: { fg: "#8ce8ff" attr: "b" } - shape_list: { fg: "#8ce8ff" attr: "b" } - shape_literal: "#69b4f9" - shape_match_pattern: "#7efdd0" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8ce8ff" - shape_operator: "#fcad3f" - shape_or: { fg: "#dd92f6" attr: "b" } - shape_pipe: { fg: "#dd92f6" attr: "b" } - shape_range: { fg: "#fcad3f" attr: "b" } - shape_record: { fg: "#8ce8ff" attr: "b" } - shape_redirection: { fg: "#dd92f6" attr: "b" } - shape_signature: { fg: "#7efdd0" attr: "b" } - shape_string: "#7efdd0" - shape_string_interpolation: { fg: "#8ce8ff" attr: "b" } - shape_table: { fg: "#69b4f9" attr: "b" } - shape_variable: "#dd92f6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#20242d" - foreground: "#c7c8ff" - cursor: "#c7c8ff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c9cccd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7efdd0' attr: 'b' } + empty: '#69b4f9' + bool: {|| if $in { '#8ce8ff' } else { 'light_gray' } } + int: '#c9cccd' + filesize: {|e| + if $e == 0b { + '#c9cccd' + } else if $e < 1mb { + '#8ce8ff' + } else {{ fg: '#69b4f9' }} + } + duration: '#c9cccd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff8e8e' attr: 'b' } + } else if $in < 6hr { + '#ff8e8e' + } else if $in < 1day { + '#fcad3f' + } else if $in < 3day { + '#7efdd0' + } else if $in < 1wk { + { fg: '#7efdd0' attr: 'b' } + } else if $in < 6wk { + '#8ce8ff' + } else if $in < 52wk { + '#69b4f9' + } else { 'dark_gray' } + } + range: '#c9cccd' + float: '#c9cccd' + string: '#c9cccd' + nothing: '#c9cccd' + binary: '#c9cccd' + cellpath: '#c9cccd' + row_index: { fg: '#7efdd0' attr: 'b' } + record: '#c9cccd' + list: '#c9cccd' + block: '#c9cccd' + hints: 'dark_gray' + search_result: { fg: '#ff8e8e' bg: '#c9cccd' } + + shape_and: { fg: '#dd92f6' attr: 'b' } + shape_binary: { fg: '#dd92f6' attr: 'b' } + shape_block: { fg: '#69b4f9' attr: 'b' } + shape_bool: '#8ce8ff' + shape_custom: '#7efdd0' + shape_datetime: { fg: '#8ce8ff' attr: 'b' } + shape_directory: '#8ce8ff' + shape_external: '#8ce8ff' + shape_externalarg: { fg: '#7efdd0' attr: 'b' } + shape_filepath: '#8ce8ff' + shape_flag: { fg: '#69b4f9' attr: 'b' } + shape_float: { fg: '#dd92f6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ce8ff' attr: 'b' } + shape_int: { fg: '#dd92f6' attr: 'b' } + shape_internalcall: { fg: '#8ce8ff' attr: 'b' } + shape_list: { fg: '#8ce8ff' attr: 'b' } + shape_literal: '#69b4f9' + shape_match_pattern: '#7efdd0' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8ce8ff' + shape_operator: '#fcad3f' + shape_or: { fg: '#dd92f6' attr: 'b' } + shape_pipe: { fg: '#dd92f6' attr: 'b' } + shape_range: { fg: '#fcad3f' attr: 'b' } + shape_record: { fg: '#8ce8ff' attr: 'b' } + shape_redirection: { fg: '#dd92f6' attr: 'b' } + shape_signature: { fg: '#7efdd0' attr: 'b' } + shape_string: '#7efdd0' + shape_string_interpolation: { fg: '#8ce8ff' attr: 'b' } + shape_table: { fg: '#69b4f9' attr: 'b' } + shape_variable: '#dd92f6' + + background: '#20242d' + foreground: '#c7c8ff' + cursor: '#c7c8ff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/neopolitan.nu b/themes/nu-themes/neopolitan.nu index 76ebdd0..03819fb 100644 --- a/themes/nu-themes/neopolitan.nu +++ b/themes/nu-themes/neopolitan.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f8f8f8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#61ce3c" attr: "b" } - empty: "#253b76" - bool: {|| if $in { "#8da6ce" } else { "light_gray" } } - int: "#f8f8f8" - filesize: {|e| - if $e == 0b { - "#f8f8f8" - } else if $e < 1mb { - "#8da6ce" - } else {{ fg: "#253b76" }} - } - duration: "#f8f8f8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#800000" attr: "b" } - } else if $in < 6hr { - "#800000" - } else if $in < 1day { - "#fbde2d" - } else if $in < 3day { - "#61ce3c" - } else if $in < 1wk { - { fg: "#61ce3c" attr: "b" } - } else if $in < 6wk { - "#8da6ce" - } else if $in < 52wk { - "#253b76" - } else { "dark_gray" } - } - range: "#f8f8f8" - float: "#f8f8f8" - string: "#f8f8f8" - nothing: "#f8f8f8" - binary: "#f8f8f8" - cellpath: "#f8f8f8" - row_index: { fg: "#61ce3c" attr: "b" } - record: "#f8f8f8" - list: "#f8f8f8" - block: "#f8f8f8" - hints: "dark_gray" - search_result: { fg: "#800000" bg: "#f8f8f8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff0080" attr: "b" } - shape_binary: { fg: "#ff0080" attr: "b" } - shape_block: { fg: "#253b76" attr: "b" } - shape_bool: "#8da6ce" - shape_custom: "#61ce3c" - shape_datetime: { fg: "#8da6ce" attr: "b" } - shape_directory: "#8da6ce" - shape_external: "#8da6ce" - shape_externalarg: { fg: "#61ce3c" attr: "b" } - shape_filepath: "#8da6ce" - shape_flag: { fg: "#253b76" attr: "b" } - shape_float: { fg: "#ff0080" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8da6ce" attr: "b" } - shape_int: { fg: "#ff0080" attr: "b" } - shape_internalcall: { fg: "#8da6ce" attr: "b" } - shape_list: { fg: "#8da6ce" attr: "b" } - shape_literal: "#253b76" - shape_match_pattern: "#61ce3c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8da6ce" - shape_operator: "#fbde2d" - shape_or: { fg: "#ff0080" attr: "b" } - shape_pipe: { fg: "#ff0080" attr: "b" } - shape_range: { fg: "#fbde2d" attr: "b" } - shape_record: { fg: "#8da6ce" attr: "b" } - shape_redirection: { fg: "#ff0080" attr: "b" } - shape_signature: { fg: "#61ce3c" attr: "b" } - shape_string: "#61ce3c" - shape_string_interpolation: { fg: "#8da6ce" attr: "b" } - shape_table: { fg: "#253b76" attr: "b" } - shape_variable: "#ff0080" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#271f19" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f8f8f8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#61ce3c' attr: 'b' } + empty: '#253b76' + bool: {|| if $in { '#8da6ce' } else { 'light_gray' } } + int: '#f8f8f8' + filesize: {|e| + if $e == 0b { + '#f8f8f8' + } else if $e < 1mb { + '#8da6ce' + } else {{ fg: '#253b76' }} + } + duration: '#f8f8f8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#800000' attr: 'b' } + } else if $in < 6hr { + '#800000' + } else if $in < 1day { + '#fbde2d' + } else if $in < 3day { + '#61ce3c' + } else if $in < 1wk { + { fg: '#61ce3c' attr: 'b' } + } else if $in < 6wk { + '#8da6ce' + } else if $in < 52wk { + '#253b76' + } else { 'dark_gray' } + } + range: '#f8f8f8' + float: '#f8f8f8' + string: '#f8f8f8' + nothing: '#f8f8f8' + binary: '#f8f8f8' + cellpath: '#f8f8f8' + row_index: { fg: '#61ce3c' attr: 'b' } + record: '#f8f8f8' + list: '#f8f8f8' + block: '#f8f8f8' + hints: 'dark_gray' + search_result: { fg: '#800000' bg: '#f8f8f8' } + + shape_and: { fg: '#ff0080' attr: 'b' } + shape_binary: { fg: '#ff0080' attr: 'b' } + shape_block: { fg: '#253b76' attr: 'b' } + shape_bool: '#8da6ce' + shape_custom: '#61ce3c' + shape_datetime: { fg: '#8da6ce' attr: 'b' } + shape_directory: '#8da6ce' + shape_external: '#8da6ce' + shape_externalarg: { fg: '#61ce3c' attr: 'b' } + shape_filepath: '#8da6ce' + shape_flag: { fg: '#253b76' attr: 'b' } + shape_float: { fg: '#ff0080' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8da6ce' attr: 'b' } + shape_int: { fg: '#ff0080' attr: 'b' } + shape_internalcall: { fg: '#8da6ce' attr: 'b' } + shape_list: { fg: '#8da6ce' attr: 'b' } + shape_literal: '#253b76' + shape_match_pattern: '#61ce3c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8da6ce' + shape_operator: '#fbde2d' + shape_or: { fg: '#ff0080' attr: 'b' } + shape_pipe: { fg: '#ff0080' attr: 'b' } + shape_range: { fg: '#fbde2d' attr: 'b' } + shape_record: { fg: '#8da6ce' attr: 'b' } + shape_redirection: { fg: '#ff0080' attr: 'b' } + shape_signature: { fg: '#61ce3c' attr: 'b' } + shape_string: '#61ce3c' + shape_string_interpolation: { fg: '#8da6ce' attr: 'b' } + shape_table: { fg: '#253b76' attr: 'b' } + shape_variable: '#ff0080' + + background: '#271f19' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nep.nu b/themes/nu-themes/nep.nu index faf9bef..cde24d8 100644 --- a/themes/nu-themes/nep.nu +++ b/themes/nu-themes/nep.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00dd6f" attr: "b" } - empty: "#6f00dd" - bool: {|| if $in { "#74b9ff" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#006fdd" - } else {{ fg: "#6f00dd" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dd6f00" attr: "b" } - } else if $in < 6hr { - "#dd6f00" - } else if $in < 1day { - "#6fdd00" - } else if $in < 3day { - "#00dd6f" - } else if $in < 1wk { - { fg: "#00dd6f" attr: "b" } - } else if $in < 6wk { - "#006fdd" - } else if $in < 52wk { - "#6f00dd" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#00dd6f" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#dd6f00" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#dd006f" attr: "b" } - shape_binary: { fg: "#dd006f" attr: "b" } - shape_block: { fg: "#6f00dd" attr: "b" } - shape_bool: "#74b9ff" - shape_custom: "#00dd6f" - shape_datetime: { fg: "#006fdd" attr: "b" } - shape_directory: "#006fdd" - shape_external: "#006fdd" - shape_externalarg: { fg: "#00dd6f" attr: "b" } - shape_filepath: "#006fdd" - shape_flag: { fg: "#6f00dd" attr: "b" } - shape_float: { fg: "#dd006f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#006fdd" attr: "b" } - shape_int: { fg: "#dd006f" attr: "b" } - shape_internalcall: { fg: "#006fdd" attr: "b" } - shape_list: { fg: "#006fdd" attr: "b" } - shape_literal: "#6f00dd" - shape_match_pattern: "#00dd6f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#74b9ff" - shape_operator: "#6fdd00" - shape_or: { fg: "#dd006f" attr: "b" } - shape_pipe: { fg: "#dd006f" attr: "b" } - shape_range: { fg: "#6fdd00" attr: "b" } - shape_record: { fg: "#006fdd" attr: "b" } - shape_redirection: { fg: "#dd006f" attr: "b" } - shape_signature: { fg: "#00dd6f" attr: "b" } - shape_string: "#00dd6f" - shape_string_interpolation: { fg: "#006fdd" attr: "b" } - shape_table: { fg: "#6f00dd" attr: "b" } - shape_variable: "#dd006f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#758480" - foreground: "#23476a" - cursor: "#23476a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00dd6f' attr: 'b' } + empty: '#6f00dd' + bool: {|| if $in { '#74b9ff' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#006fdd' + } else {{ fg: '#6f00dd' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dd6f00' attr: 'b' } + } else if $in < 6hr { + '#dd6f00' + } else if $in < 1day { + '#6fdd00' + } else if $in < 3day { + '#00dd6f' + } else if $in < 1wk { + { fg: '#00dd6f' attr: 'b' } + } else if $in < 6wk { + '#006fdd' + } else if $in < 52wk { + '#6f00dd' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#00dd6f' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#dd6f00' bg: '#f2f2f2' } + + shape_and: { fg: '#dd006f' attr: 'b' } + shape_binary: { fg: '#dd006f' attr: 'b' } + shape_block: { fg: '#6f00dd' attr: 'b' } + shape_bool: '#74b9ff' + shape_custom: '#00dd6f' + shape_datetime: { fg: '#006fdd' attr: 'b' } + shape_directory: '#006fdd' + shape_external: '#006fdd' + shape_externalarg: { fg: '#00dd6f' attr: 'b' } + shape_filepath: '#006fdd' + shape_flag: { fg: '#6f00dd' attr: 'b' } + shape_float: { fg: '#dd006f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#006fdd' attr: 'b' } + shape_int: { fg: '#dd006f' attr: 'b' } + shape_internalcall: { fg: '#006fdd' attr: 'b' } + shape_list: { fg: '#006fdd' attr: 'b' } + shape_literal: '#6f00dd' + shape_match_pattern: '#00dd6f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#74b9ff' + shape_operator: '#6fdd00' + shape_or: { fg: '#dd006f' attr: 'b' } + shape_pipe: { fg: '#dd006f' attr: 'b' } + shape_range: { fg: '#6fdd00' attr: 'b' } + shape_record: { fg: '#006fdd' attr: 'b' } + shape_redirection: { fg: '#dd006f' attr: 'b' } + shape_signature: { fg: '#00dd6f' attr: 'b' } + shape_string: '#00dd6f' + shape_string_interpolation: { fg: '#006fdd' attr: 'b' } + shape_table: { fg: '#6f00dd' attr: 'b' } + shape_variable: '#dd006f' + + background: '#758480' + foreground: '#23476a' + cursor: '#23476a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/neutron.nu b/themes/nu-themes/neutron.nu index 9be7971..a9cc0e0 100644 --- a/themes/nu-themes/neutron.nu +++ b/themes/nu-themes/neutron.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e6e8ef" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5ab977" attr: "b" } - empty: "#6a7c93" - bool: {|| if $in { "#3f94a8" } else { "light_gray" } } - int: "#e6e8ef" - filesize: {|e| - if $e == 0b { - "#e6e8ef" - } else if $e < 1mb { - "#3f94a8" - } else {{ fg: "#6a7c93" }} - } - duration: "#e6e8ef" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b54036" attr: "b" } - } else if $in < 6hr { - "#b54036" - } else if $in < 1day { - "#deb566" - } else if $in < 3day { - "#5ab977" - } else if $in < 1wk { - { fg: "#5ab977" attr: "b" } - } else if $in < 6wk { - "#3f94a8" - } else if $in < 52wk { - "#6a7c93" - } else { "dark_gray" } - } - range: "#e6e8ef" - float: "#e6e8ef" - string: "#e6e8ef" - nothing: "#e6e8ef" - binary: "#e6e8ef" - cellpath: "#e6e8ef" - row_index: { fg: "#5ab977" attr: "b" } - record: "#e6e8ef" - list: "#e6e8ef" - block: "#e6e8ef" - hints: "dark_gray" - search_result: { fg: "#b54036" bg: "#e6e8ef" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a4799d" attr: "b" } - shape_binary: { fg: "#a4799d" attr: "b" } - shape_block: { fg: "#6a7c93" attr: "b" } - shape_bool: "#3f94a8" - shape_custom: "#5ab977" - shape_datetime: { fg: "#3f94a8" attr: "b" } - shape_directory: "#3f94a8" - shape_external: "#3f94a8" - shape_externalarg: { fg: "#5ab977" attr: "b" } - shape_filepath: "#3f94a8" - shape_flag: { fg: "#6a7c93" attr: "b" } - shape_float: { fg: "#a4799d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3f94a8" attr: "b" } - shape_int: { fg: "#a4799d" attr: "b" } - shape_internalcall: { fg: "#3f94a8" attr: "b" } - shape_list: { fg: "#3f94a8" attr: "b" } - shape_literal: "#6a7c93" - shape_match_pattern: "#5ab977" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3f94a8" - shape_operator: "#deb566" - shape_or: { fg: "#a4799d" attr: "b" } - shape_pipe: { fg: "#a4799d" attr: "b" } - shape_range: { fg: "#deb566" attr: "b" } - shape_record: { fg: "#3f94a8" attr: "b" } - shape_redirection: { fg: "#a4799d" attr: "b" } - shape_signature: { fg: "#5ab977" attr: "b" } - shape_string: "#5ab977" - shape_string_interpolation: { fg: "#3f94a8" attr: "b" } - shape_table: { fg: "#6a7c93" attr: "b" } - shape_variable: "#a4799d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1e22" - foreground: "#e6e8ef" - cursor: "#e6e8ef" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e6e8ef' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5ab977' attr: 'b' } + empty: '#6a7c93' + bool: {|| if $in { '#3f94a8' } else { 'light_gray' } } + int: '#e6e8ef' + filesize: {|e| + if $e == 0b { + '#e6e8ef' + } else if $e < 1mb { + '#3f94a8' + } else {{ fg: '#6a7c93' }} + } + duration: '#e6e8ef' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b54036' attr: 'b' } + } else if $in < 6hr { + '#b54036' + } else if $in < 1day { + '#deb566' + } else if $in < 3day { + '#5ab977' + } else if $in < 1wk { + { fg: '#5ab977' attr: 'b' } + } else if $in < 6wk { + '#3f94a8' + } else if $in < 52wk { + '#6a7c93' + } else { 'dark_gray' } + } + range: '#e6e8ef' + float: '#e6e8ef' + string: '#e6e8ef' + nothing: '#e6e8ef' + binary: '#e6e8ef' + cellpath: '#e6e8ef' + row_index: { fg: '#5ab977' attr: 'b' } + record: '#e6e8ef' + list: '#e6e8ef' + block: '#e6e8ef' + hints: 'dark_gray' + search_result: { fg: '#b54036' bg: '#e6e8ef' } + + shape_and: { fg: '#a4799d' attr: 'b' } + shape_binary: { fg: '#a4799d' attr: 'b' } + shape_block: { fg: '#6a7c93' attr: 'b' } + shape_bool: '#3f94a8' + shape_custom: '#5ab977' + shape_datetime: { fg: '#3f94a8' attr: 'b' } + shape_directory: '#3f94a8' + shape_external: '#3f94a8' + shape_externalarg: { fg: '#5ab977' attr: 'b' } + shape_filepath: '#3f94a8' + shape_flag: { fg: '#6a7c93' attr: 'b' } + shape_float: { fg: '#a4799d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3f94a8' attr: 'b' } + shape_int: { fg: '#a4799d' attr: 'b' } + shape_internalcall: { fg: '#3f94a8' attr: 'b' } + shape_list: { fg: '#3f94a8' attr: 'b' } + shape_literal: '#6a7c93' + shape_match_pattern: '#5ab977' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3f94a8' + shape_operator: '#deb566' + shape_or: { fg: '#a4799d' attr: 'b' } + shape_pipe: { fg: '#a4799d' attr: 'b' } + shape_range: { fg: '#deb566' attr: 'b' } + shape_record: { fg: '#3f94a8' attr: 'b' } + shape_redirection: { fg: '#a4799d' attr: 'b' } + shape_signature: { fg: '#5ab977' attr: 'b' } + shape_string: '#5ab977' + shape_string_interpolation: { fg: '#3f94a8' attr: 'b' } + shape_table: { fg: '#6a7c93' attr: 'b' } + shape_variable: '#a4799d' + + background: '#1c1e22' + foreground: '#e6e8ef' + cursor: '#e6e8ef' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nightfly.nu b/themes/nu-themes/nightfly.nu index a0cb17b..8eb4946 100644 --- a/themes/nu-themes/nightfly.nu +++ b/themes/nu-themes/nightfly.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a1aab8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1cd5e" attr: "b" } - empty: "#82aaff" - bool: {|| if $in { "#7fdbca" } else { "light_gray" } } - int: "#a1aab8" - filesize: {|e| - if $e == 0b { - "#a1aab8" - } else if $e < 1mb { - "#7fdbca" - } else {{ fg: "#82aaff" }} - } - duration: "#a1aab8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fc514e" attr: "b" } - } else if $in < 6hr { - "#fc514e" - } else if $in < 1day { - "#e7d37a" - } else if $in < 3day { - "#a1cd5e" - } else if $in < 1wk { - { fg: "#a1cd5e" attr: "b" } - } else if $in < 6wk { - "#7fdbca" - } else if $in < 52wk { - "#82aaff" - } else { "dark_gray" } - } - range: "#a1aab8" - float: "#a1aab8" - string: "#a1aab8" - nothing: "#a1aab8" - binary: "#a1aab8" - cellpath: "#a1aab8" - row_index: { fg: "#a1cd5e" attr: "b" } - record: "#a1aab8" - list: "#a1aab8" - block: "#a1aab8" - hints: "dark_gray" - search_result: { fg: "#fc514e" bg: "#a1aab8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c792ea" attr: "b" } - shape_binary: { fg: "#c792ea" attr: "b" } - shape_block: { fg: "#82aaff" attr: "b" } - shape_bool: "#7fdbca" - shape_custom: "#a1cd5e" - shape_datetime: { fg: "#7fdbca" attr: "b" } - shape_directory: "#7fdbca" - shape_external: "#7fdbca" - shape_externalarg: { fg: "#a1cd5e" attr: "b" } - shape_filepath: "#7fdbca" - shape_flag: { fg: "#82aaff" attr: "b" } - shape_float: { fg: "#c792ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7fdbca" attr: "b" } - shape_int: { fg: "#c792ea" attr: "b" } - shape_internalcall: { fg: "#7fdbca" attr: "b" } - shape_list: { fg: "#7fdbca" attr: "b" } - shape_literal: "#82aaff" - shape_match_pattern: "#a1cd5e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7fdbca" - shape_operator: "#e7d37a" - shape_or: { fg: "#c792ea" attr: "b" } - shape_pipe: { fg: "#c792ea" attr: "b" } - shape_range: { fg: "#e7d37a" attr: "b" } - shape_record: { fg: "#7fdbca" attr: "b" } - shape_redirection: { fg: "#c792ea" attr: "b" } - shape_signature: { fg: "#a1cd5e" attr: "b" } - shape_string: "#a1cd5e" - shape_string_interpolation: { fg: "#7fdbca" attr: "b" } - shape_table: { fg: "#82aaff" attr: "b" } - shape_variable: "#c792ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#011627" - foreground: "#c3ccdc" - cursor: "#82aaff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a1aab8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1cd5e' attr: 'b' } + empty: '#82aaff' + bool: {|| if $in { '#7fdbca' } else { 'light_gray' } } + int: '#a1aab8' + filesize: {|e| + if $e == 0b { + '#a1aab8' + } else if $e < 1mb { + '#7fdbca' + } else {{ fg: '#82aaff' }} + } + duration: '#a1aab8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fc514e' attr: 'b' } + } else if $in < 6hr { + '#fc514e' + } else if $in < 1day { + '#e7d37a' + } else if $in < 3day { + '#a1cd5e' + } else if $in < 1wk { + { fg: '#a1cd5e' attr: 'b' } + } else if $in < 6wk { + '#7fdbca' + } else if $in < 52wk { + '#82aaff' + } else { 'dark_gray' } + } + range: '#a1aab8' + float: '#a1aab8' + string: '#a1aab8' + nothing: '#a1aab8' + binary: '#a1aab8' + cellpath: '#a1aab8' + row_index: { fg: '#a1cd5e' attr: 'b' } + record: '#a1aab8' + list: '#a1aab8' + block: '#a1aab8' + hints: 'dark_gray' + search_result: { fg: '#fc514e' bg: '#a1aab8' } + + shape_and: { fg: '#c792ea' attr: 'b' } + shape_binary: { fg: '#c792ea' attr: 'b' } + shape_block: { fg: '#82aaff' attr: 'b' } + shape_bool: '#7fdbca' + shape_custom: '#a1cd5e' + shape_datetime: { fg: '#7fdbca' attr: 'b' } + shape_directory: '#7fdbca' + shape_external: '#7fdbca' + shape_externalarg: { fg: '#a1cd5e' attr: 'b' } + shape_filepath: '#7fdbca' + shape_flag: { fg: '#82aaff' attr: 'b' } + shape_float: { fg: '#c792ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7fdbca' attr: 'b' } + shape_int: { fg: '#c792ea' attr: 'b' } + shape_internalcall: { fg: '#7fdbca' attr: 'b' } + shape_list: { fg: '#7fdbca' attr: 'b' } + shape_literal: '#82aaff' + shape_match_pattern: '#a1cd5e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7fdbca' + shape_operator: '#e7d37a' + shape_or: { fg: '#c792ea' attr: 'b' } + shape_pipe: { fg: '#c792ea' attr: 'b' } + shape_range: { fg: '#e7d37a' attr: 'b' } + shape_record: { fg: '#7fdbca' attr: 'b' } + shape_redirection: { fg: '#c792ea' attr: 'b' } + shape_signature: { fg: '#a1cd5e' attr: 'b' } + shape_string: '#a1cd5e' + shape_string_interpolation: { fg: '#7fdbca' attr: 'b' } + shape_table: { fg: '#82aaff' attr: 'b' } + shape_variable: '#c792ea' + + background: '#011627' + foreground: '#c3ccdc' + cursor: '#82aaff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nightlion-v1.nu b/themes/nu-themes/nightlion-v1.nu index b74b75e..25ba583 100644 --- a/themes/nu-themes/nightlion-v1.nu +++ b/themes/nu-themes/nightlion-v1.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5fde8f" attr: "b" } - empty: "#276bd8" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#00dadf" - } else {{ fg: "#276bd8" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bb0000" attr: "b" } - } else if $in < 6hr { - "#bb0000" - } else if $in < 1day { - "#f3f167" - } else if $in < 3day { - "#5fde8f" - } else if $in < 1wk { - { fg: "#5fde8f" attr: "b" } - } else if $in < 6wk { - "#00dadf" - } else if $in < 52wk { - "#276bd8" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#5fde8f" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#bb0000" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb00bb" attr: "b" } - shape_binary: { fg: "#bb00bb" attr: "b" } - shape_block: { fg: "#276bd8" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#5fde8f" - shape_datetime: { fg: "#00dadf" attr: "b" } - shape_directory: "#00dadf" - shape_external: "#00dadf" - shape_externalarg: { fg: "#5fde8f" attr: "b" } - shape_filepath: "#00dadf" - shape_flag: { fg: "#276bd8" attr: "b" } - shape_float: { fg: "#bb00bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00dadf" attr: "b" } - shape_int: { fg: "#bb00bb" attr: "b" } - shape_internalcall: { fg: "#00dadf" attr: "b" } - shape_list: { fg: "#00dadf" attr: "b" } - shape_literal: "#276bd8" - shape_match_pattern: "#5fde8f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#f3f167" - shape_or: { fg: "#bb00bb" attr: "b" } - shape_pipe: { fg: "#bb00bb" attr: "b" } - shape_range: { fg: "#f3f167" attr: "b" } - shape_record: { fg: "#00dadf" attr: "b" } - shape_redirection: { fg: "#bb00bb" attr: "b" } - shape_signature: { fg: "#5fde8f" attr: "b" } - shape_string: "#5fde8f" - shape_string_interpolation: { fg: "#00dadf" attr: "b" } - shape_table: { fg: "#276bd8" attr: "b" } - shape_variable: "#bb00bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#bbbbbb" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5fde8f' attr: 'b' } + empty: '#276bd8' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#00dadf' + } else {{ fg: '#276bd8' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bb0000' attr: 'b' } + } else if $in < 6hr { + '#bb0000' + } else if $in < 1day { + '#f3f167' + } else if $in < 3day { + '#5fde8f' + } else if $in < 1wk { + { fg: '#5fde8f' attr: 'b' } + } else if $in < 6wk { + '#00dadf' + } else if $in < 52wk { + '#276bd8' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#5fde8f' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#bb0000' bg: '#bbbbbb' } + + shape_and: { fg: '#bb00bb' attr: 'b' } + shape_binary: { fg: '#bb00bb' attr: 'b' } + shape_block: { fg: '#276bd8' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#5fde8f' + shape_datetime: { fg: '#00dadf' attr: 'b' } + shape_directory: '#00dadf' + shape_external: '#00dadf' + shape_externalarg: { fg: '#5fde8f' attr: 'b' } + shape_filepath: '#00dadf' + shape_flag: { fg: '#276bd8' attr: 'b' } + shape_float: { fg: '#bb00bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00dadf' attr: 'b' } + shape_int: { fg: '#bb00bb' attr: 'b' } + shape_internalcall: { fg: '#00dadf' attr: 'b' } + shape_list: { fg: '#00dadf' attr: 'b' } + shape_literal: '#276bd8' + shape_match_pattern: '#5fde8f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#f3f167' + shape_or: { fg: '#bb00bb' attr: 'b' } + shape_pipe: { fg: '#bb00bb' attr: 'b' } + shape_range: { fg: '#f3f167' attr: 'b' } + shape_record: { fg: '#00dadf' attr: 'b' } + shape_redirection: { fg: '#bb00bb' attr: 'b' } + shape_signature: { fg: '#5fde8f' attr: 'b' } + shape_string: '#5fde8f' + shape_string_interpolation: { fg: '#00dadf' attr: 'b' } + shape_table: { fg: '#276bd8' attr: 'b' } + shape_variable: '#bb00bb' + + background: '#000000' + foreground: '#bbbbbb' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nightlion-v2.nu b/themes/nu-themes/nightlion-v2.nu index 9c5afe1..7da17e6 100644 --- a/themes/nu-themes/nightlion-v2.nu +++ b/themes/nu-themes/nightlion-v2.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#04f623" attr: "b" } - empty: "#64d0f0" - bool: {|| if $in { "#00ccd8" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#00dadf" - } else {{ fg: "#64d0f0" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bb0000" attr: "b" } - } else if $in < 6hr { - "#bb0000" - } else if $in < 1day { - "#f3f167" - } else if $in < 3day { - "#04f623" - } else if $in < 1wk { - { fg: "#04f623" attr: "b" } - } else if $in < 6wk { - "#00dadf" - } else if $in < 52wk { - "#64d0f0" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#04f623" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#bb0000" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ce6fdb" attr: "b" } - shape_binary: { fg: "#ce6fdb" attr: "b" } - shape_block: { fg: "#64d0f0" attr: "b" } - shape_bool: "#00ccd8" - shape_custom: "#04f623" - shape_datetime: { fg: "#00dadf" attr: "b" } - shape_directory: "#00dadf" - shape_external: "#00dadf" - shape_externalarg: { fg: "#04f623" attr: "b" } - shape_filepath: "#00dadf" - shape_flag: { fg: "#64d0f0" attr: "b" } - shape_float: { fg: "#ce6fdb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00dadf" attr: "b" } - shape_int: { fg: "#ce6fdb" attr: "b" } - shape_internalcall: { fg: "#00dadf" attr: "b" } - shape_list: { fg: "#00dadf" attr: "b" } - shape_literal: "#64d0f0" - shape_match_pattern: "#04f623" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ccd8" - shape_operator: "#f3f167" - shape_or: { fg: "#ce6fdb" attr: "b" } - shape_pipe: { fg: "#ce6fdb" attr: "b" } - shape_range: { fg: "#f3f167" attr: "b" } - shape_record: { fg: "#00dadf" attr: "b" } - shape_redirection: { fg: "#ce6fdb" attr: "b" } - shape_signature: { fg: "#04f623" attr: "b" } - shape_string: "#04f623" - shape_string_interpolation: { fg: "#00dadf" attr: "b" } - shape_table: { fg: "#64d0f0" attr: "b" } - shape_variable: "#ce6fdb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#171717" - foreground: "#bbbbbb" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#04f623' attr: 'b' } + empty: '#64d0f0' + bool: {|| if $in { '#00ccd8' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#00dadf' + } else {{ fg: '#64d0f0' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bb0000' attr: 'b' } + } else if $in < 6hr { + '#bb0000' + } else if $in < 1day { + '#f3f167' + } else if $in < 3day { + '#04f623' + } else if $in < 1wk { + { fg: '#04f623' attr: 'b' } + } else if $in < 6wk { + '#00dadf' + } else if $in < 52wk { + '#64d0f0' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#04f623' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#bb0000' bg: '#bbbbbb' } + + shape_and: { fg: '#ce6fdb' attr: 'b' } + shape_binary: { fg: '#ce6fdb' attr: 'b' } + shape_block: { fg: '#64d0f0' attr: 'b' } + shape_bool: '#00ccd8' + shape_custom: '#04f623' + shape_datetime: { fg: '#00dadf' attr: 'b' } + shape_directory: '#00dadf' + shape_external: '#00dadf' + shape_externalarg: { fg: '#04f623' attr: 'b' } + shape_filepath: '#00dadf' + shape_flag: { fg: '#64d0f0' attr: 'b' } + shape_float: { fg: '#ce6fdb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00dadf' attr: 'b' } + shape_int: { fg: '#ce6fdb' attr: 'b' } + shape_internalcall: { fg: '#00dadf' attr: 'b' } + shape_list: { fg: '#00dadf' attr: 'b' } + shape_literal: '#64d0f0' + shape_match_pattern: '#04f623' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ccd8' + shape_operator: '#f3f167' + shape_or: { fg: '#ce6fdb' attr: 'b' } + shape_pipe: { fg: '#ce6fdb' attr: 'b' } + shape_range: { fg: '#f3f167' attr: 'b' } + shape_record: { fg: '#00dadf' attr: 'b' } + shape_redirection: { fg: '#ce6fdb' attr: 'b' } + shape_signature: { fg: '#04f623' attr: 'b' } + shape_string: '#04f623' + shape_string_interpolation: { fg: '#00dadf' attr: 'b' } + shape_table: { fg: '#64d0f0' attr: 'b' } + shape_variable: '#ce6fdb' + + background: '#171717' + foreground: '#bbbbbb' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nighty.nu b/themes/nu-themes/nighty.nu index 8c69506..181c09e 100644 --- a/themes/nu-themes/nighty.nu +++ b/themes/nu-themes/nighty.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#828282" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#095b32" attr: "b" } - empty: "#1d3e6f" - bool: {|| if $in { "#70d2a4" } else { "light_gray" } } - int: "#828282" - filesize: {|e| - if $e == 0b { - "#828282" - } else if $e < 1mb { - "#3a7458" - } else {{ fg: "#1d3e6f" }} - } - duration: "#828282" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#9b3e46" attr: "b" } - } else if $in < 6hr { - "#9b3e46" - } else if $in < 1day { - "#808020" - } else if $in < 3day { - "#095b32" - } else if $in < 1wk { - { fg: "#095b32" attr: "b" } - } else if $in < 6wk { - "#3a7458" - } else if $in < 52wk { - "#1d3e6f" - } else { "dark_gray" } - } - range: "#828282" - float: "#828282" - string: "#828282" - nothing: "#828282" - binary: "#828282" - cellpath: "#828282" - row_index: { fg: "#095b32" attr: "b" } - record: "#828282" - list: "#828282" - block: "#828282" - hints: "dark_gray" - search_result: { fg: "#9b3e46" bg: "#828282" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#823065" attr: "b" } - shape_binary: { fg: "#823065" attr: "b" } - shape_block: { fg: "#1d3e6f" attr: "b" } - shape_bool: "#70d2a4" - shape_custom: "#095b32" - shape_datetime: { fg: "#3a7458" attr: "b" } - shape_directory: "#3a7458" - shape_external: "#3a7458" - shape_externalarg: { fg: "#095b32" attr: "b" } - shape_filepath: "#3a7458" - shape_flag: { fg: "#1d3e6f" attr: "b" } - shape_float: { fg: "#823065" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3a7458" attr: "b" } - shape_int: { fg: "#823065" attr: "b" } - shape_internalcall: { fg: "#3a7458" attr: "b" } - shape_list: { fg: "#3a7458" attr: "b" } - shape_literal: "#1d3e6f" - shape_match_pattern: "#095b32" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#70d2a4" - shape_operator: "#808020" - shape_or: { fg: "#823065" attr: "b" } - shape_pipe: { fg: "#823065" attr: "b" } - shape_range: { fg: "#808020" attr: "b" } - shape_record: { fg: "#3a7458" attr: "b" } - shape_redirection: { fg: "#823065" attr: "b" } - shape_signature: { fg: "#095b32" attr: "b" } - shape_string: "#095b32" - shape_string_interpolation: { fg: "#3a7458" attr: "b" } - shape_table: { fg: "#1d3e6f" attr: "b" } - shape_variable: "#823065" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2f2f2f" - foreground: "#dfdfdf" - cursor: "#dfdfdf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#828282' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#095b32' attr: 'b' } + empty: '#1d3e6f' + bool: {|| if $in { '#70d2a4' } else { 'light_gray' } } + int: '#828282' + filesize: {|e| + if $e == 0b { + '#828282' + } else if $e < 1mb { + '#3a7458' + } else {{ fg: '#1d3e6f' }} + } + duration: '#828282' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#9b3e46' attr: 'b' } + } else if $in < 6hr { + '#9b3e46' + } else if $in < 1day { + '#808020' + } else if $in < 3day { + '#095b32' + } else if $in < 1wk { + { fg: '#095b32' attr: 'b' } + } else if $in < 6wk { + '#3a7458' + } else if $in < 52wk { + '#1d3e6f' + } else { 'dark_gray' } + } + range: '#828282' + float: '#828282' + string: '#828282' + nothing: '#828282' + binary: '#828282' + cellpath: '#828282' + row_index: { fg: '#095b32' attr: 'b' } + record: '#828282' + list: '#828282' + block: '#828282' + hints: 'dark_gray' + search_result: { fg: '#9b3e46' bg: '#828282' } + + shape_and: { fg: '#823065' attr: 'b' } + shape_binary: { fg: '#823065' attr: 'b' } + shape_block: { fg: '#1d3e6f' attr: 'b' } + shape_bool: '#70d2a4' + shape_custom: '#095b32' + shape_datetime: { fg: '#3a7458' attr: 'b' } + shape_directory: '#3a7458' + shape_external: '#3a7458' + shape_externalarg: { fg: '#095b32' attr: 'b' } + shape_filepath: '#3a7458' + shape_flag: { fg: '#1d3e6f' attr: 'b' } + shape_float: { fg: '#823065' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3a7458' attr: 'b' } + shape_int: { fg: '#823065' attr: 'b' } + shape_internalcall: { fg: '#3a7458' attr: 'b' } + shape_list: { fg: '#3a7458' attr: 'b' } + shape_literal: '#1d3e6f' + shape_match_pattern: '#095b32' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#70d2a4' + shape_operator: '#808020' + shape_or: { fg: '#823065' attr: 'b' } + shape_pipe: { fg: '#823065' attr: 'b' } + shape_range: { fg: '#808020' attr: 'b' } + shape_record: { fg: '#3a7458' attr: 'b' } + shape_redirection: { fg: '#823065' attr: 'b' } + shape_signature: { fg: '#095b32' attr: 'b' } + shape_string: '#095b32' + shape_string_interpolation: { fg: '#3a7458' attr: 'b' } + shape_table: { fg: '#1d3e6f' attr: 'b' } + shape_variable: '#823065' + + background: '#2f2f2f' + foreground: '#dfdfdf' + cursor: '#dfdfdf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nord-alt.nu b/themes/nu-themes/nord-alt.nu index 7a72ea4..4502d25 100644 --- a/themes/nu-themes/nord-alt.nu +++ b/themes/nu-themes/nord-alt.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8fbcbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#434c5e" attr: "b" } - empty: "#d8dee9" - bool: {|| if $in { "#b48ead" } else { "light_gray" } } - int: "#8fbcbb" - filesize: {|e| - if $e == 0b { - "#8fbcbb" - } else if $e < 1mb { - "#eceff4" - } else {{ fg: "#d8dee9" }} - } - duration: "#8fbcbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#3b4252" attr: "b" } - } else if $in < 6hr { - "#3b4252" - } else if $in < 1day { - "#4c566a" - } else if $in < 3day { - "#434c5e" - } else if $in < 1wk { - { fg: "#434c5e" attr: "b" } - } else if $in < 6wk { - "#eceff4" - } else if $in < 52wk { - "#d8dee9" - } else { "dark_gray" } - } - range: "#8fbcbb" - float: "#8fbcbb" - string: "#8fbcbb" - nothing: "#8fbcbb" - binary: "#8fbcbb" - cellpath: "#8fbcbb" - row_index: { fg: "#434c5e" attr: "b" } - record: "#8fbcbb" - list: "#8fbcbb" - block: "#8fbcbb" - hints: "dark_gray" - search_result: { fg: "#3b4252" bg: "#8fbcbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e5e9f0" attr: "b" } - shape_binary: { fg: "#e5e9f0" attr: "b" } - shape_block: { fg: "#d8dee9" attr: "b" } - shape_bool: "#b48ead" - shape_custom: "#434c5e" - shape_datetime: { fg: "#eceff4" attr: "b" } - shape_directory: "#eceff4" - shape_external: "#eceff4" - shape_externalarg: { fg: "#434c5e" attr: "b" } - shape_filepath: "#eceff4" - shape_flag: { fg: "#d8dee9" attr: "b" } - shape_float: { fg: "#e5e9f0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#eceff4" attr: "b" } - shape_int: { fg: "#e5e9f0" attr: "b" } - shape_internalcall: { fg: "#eceff4" attr: "b" } - shape_list: { fg: "#eceff4" attr: "b" } - shape_literal: "#d8dee9" - shape_match_pattern: "#434c5e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b48ead" - shape_operator: "#4c566a" - shape_or: { fg: "#e5e9f0" attr: "b" } - shape_pipe: { fg: "#e5e9f0" attr: "b" } - shape_range: { fg: "#4c566a" attr: "b" } - shape_record: { fg: "#eceff4" attr: "b" } - shape_redirection: { fg: "#e5e9f0" attr: "b" } - shape_signature: { fg: "#434c5e" attr: "b" } - shape_string: "#434c5e" - shape_string_interpolation: { fg: "#eceff4" attr: "b" } - shape_table: { fg: "#d8dee9" attr: "b" } - shape_variable: "#e5e9f0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2e3440" - foreground: "#8fbcbb" - cursor: "#8fbcbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8fbcbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#434c5e' attr: 'b' } + empty: '#d8dee9' + bool: {|| if $in { '#b48ead' } else { 'light_gray' } } + int: '#8fbcbb' + filesize: {|e| + if $e == 0b { + '#8fbcbb' + } else if $e < 1mb { + '#eceff4' + } else {{ fg: '#d8dee9' }} + } + duration: '#8fbcbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#3b4252' attr: 'b' } + } else if $in < 6hr { + '#3b4252' + } else if $in < 1day { + '#4c566a' + } else if $in < 3day { + '#434c5e' + } else if $in < 1wk { + { fg: '#434c5e' attr: 'b' } + } else if $in < 6wk { + '#eceff4' + } else if $in < 52wk { + '#d8dee9' + } else { 'dark_gray' } + } + range: '#8fbcbb' + float: '#8fbcbb' + string: '#8fbcbb' + nothing: '#8fbcbb' + binary: '#8fbcbb' + cellpath: '#8fbcbb' + row_index: { fg: '#434c5e' attr: 'b' } + record: '#8fbcbb' + list: '#8fbcbb' + block: '#8fbcbb' + hints: 'dark_gray' + search_result: { fg: '#3b4252' bg: '#8fbcbb' } + + shape_and: { fg: '#e5e9f0' attr: 'b' } + shape_binary: { fg: '#e5e9f0' attr: 'b' } + shape_block: { fg: '#d8dee9' attr: 'b' } + shape_bool: '#b48ead' + shape_custom: '#434c5e' + shape_datetime: { fg: '#eceff4' attr: 'b' } + shape_directory: '#eceff4' + shape_external: '#eceff4' + shape_externalarg: { fg: '#434c5e' attr: 'b' } + shape_filepath: '#eceff4' + shape_flag: { fg: '#d8dee9' attr: 'b' } + shape_float: { fg: '#e5e9f0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#eceff4' attr: 'b' } + shape_int: { fg: '#e5e9f0' attr: 'b' } + shape_internalcall: { fg: '#eceff4' attr: 'b' } + shape_list: { fg: '#eceff4' attr: 'b' } + shape_literal: '#d8dee9' + shape_match_pattern: '#434c5e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b48ead' + shape_operator: '#4c566a' + shape_or: { fg: '#e5e9f0' attr: 'b' } + shape_pipe: { fg: '#e5e9f0' attr: 'b' } + shape_range: { fg: '#4c566a' attr: 'b' } + shape_record: { fg: '#eceff4' attr: 'b' } + shape_redirection: { fg: '#e5e9f0' attr: 'b' } + shape_signature: { fg: '#434c5e' attr: 'b' } + shape_string: '#434c5e' + shape_string_interpolation: { fg: '#eceff4' attr: 'b' } + shape_table: { fg: '#d8dee9' attr: 'b' } + shape_variable: '#e5e9f0' + + background: '#2e3440' + foreground: '#8fbcbb' + cursor: '#8fbcbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nord-light.nu b/themes/nu-themes/nord-light.nu index 77c6cae..f50e2ad 100644 --- a/themes/nu-themes/nord-light.nu +++ b/themes/nu-themes/nord-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b3b3b3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#89d287" attr: "b" } - empty: "#439ecf" - bool: {|| if $in { "#96dcda" } else { "light_gray" } } - int: "#b3b3b3" - filesize: {|e| - if $e == 0b { - "#b3b3b3" - } else if $e < 1mb { - "#64aaaf" - } else {{ fg: "#439ecf" }} - } - duration: "#b3b3b3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e64569" attr: "b" } - } else if $in < 6hr { - "#e64569" - } else if $in < 1day { - "#dab752" - } else if $in < 3day { - "#89d287" - } else if $in < 1wk { - { fg: "#89d287" attr: "b" } - } else if $in < 6wk { - "#64aaaf" - } else if $in < 52wk { - "#439ecf" - } else { "dark_gray" } - } - range: "#b3b3b3" - float: "#b3b3b3" - string: "#b3b3b3" - nothing: "#b3b3b3" - binary: "#b3b3b3" - cellpath: "#b3b3b3" - row_index: { fg: "#89d287" attr: "b" } - record: "#b3b3b3" - list: "#b3b3b3" - block: "#b3b3b3" - hints: "dark_gray" - search_result: { fg: "#e64569" bg: "#b3b3b3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d961dc" attr: "b" } - shape_binary: { fg: "#d961dc" attr: "b" } - shape_block: { fg: "#439ecf" attr: "b" } - shape_bool: "#96dcda" - shape_custom: "#89d287" - shape_datetime: { fg: "#64aaaf" attr: "b" } - shape_directory: "#64aaaf" - shape_external: "#64aaaf" - shape_externalarg: { fg: "#89d287" attr: "b" } - shape_filepath: "#64aaaf" - shape_flag: { fg: "#439ecf" attr: "b" } - shape_float: { fg: "#d961dc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#64aaaf" attr: "b" } - shape_int: { fg: "#d961dc" attr: "b" } - shape_internalcall: { fg: "#64aaaf" attr: "b" } - shape_list: { fg: "#64aaaf" attr: "b" } - shape_literal: "#439ecf" - shape_match_pattern: "#89d287" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#96dcda" - shape_operator: "#dab752" - shape_or: { fg: "#d961dc" attr: "b" } - shape_pipe: { fg: "#d961dc" attr: "b" } - shape_range: { fg: "#dab752" attr: "b" } - shape_record: { fg: "#64aaaf" attr: "b" } - shape_redirection: { fg: "#d961dc" attr: "b" } - shape_signature: { fg: "#89d287" attr: "b" } - shape_string: "#89d287" - shape_string_interpolation: { fg: "#64aaaf" attr: "b" } - shape_table: { fg: "#439ecf" attr: "b" } - shape_variable: "#d961dc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ebeaf2" - foreground: "#004f7c" - cursor: "#004f7c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b3b3b3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#89d287' attr: 'b' } + empty: '#439ecf' + bool: {|| if $in { '#96dcda' } else { 'light_gray' } } + int: '#b3b3b3' + filesize: {|e| + if $e == 0b { + '#b3b3b3' + } else if $e < 1mb { + '#64aaaf' + } else {{ fg: '#439ecf' }} + } + duration: '#b3b3b3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e64569' attr: 'b' } + } else if $in < 6hr { + '#e64569' + } else if $in < 1day { + '#dab752' + } else if $in < 3day { + '#89d287' + } else if $in < 1wk { + { fg: '#89d287' attr: 'b' } + } else if $in < 6wk { + '#64aaaf' + } else if $in < 52wk { + '#439ecf' + } else { 'dark_gray' } + } + range: '#b3b3b3' + float: '#b3b3b3' + string: '#b3b3b3' + nothing: '#b3b3b3' + binary: '#b3b3b3' + cellpath: '#b3b3b3' + row_index: { fg: '#89d287' attr: 'b' } + record: '#b3b3b3' + list: '#b3b3b3' + block: '#b3b3b3' + hints: 'dark_gray' + search_result: { fg: '#e64569' bg: '#b3b3b3' } + + shape_and: { fg: '#d961dc' attr: 'b' } + shape_binary: { fg: '#d961dc' attr: 'b' } + shape_block: { fg: '#439ecf' attr: 'b' } + shape_bool: '#96dcda' + shape_custom: '#89d287' + shape_datetime: { fg: '#64aaaf' attr: 'b' } + shape_directory: '#64aaaf' + shape_external: '#64aaaf' + shape_externalarg: { fg: '#89d287' attr: 'b' } + shape_filepath: '#64aaaf' + shape_flag: { fg: '#439ecf' attr: 'b' } + shape_float: { fg: '#d961dc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#64aaaf' attr: 'b' } + shape_int: { fg: '#d961dc' attr: 'b' } + shape_internalcall: { fg: '#64aaaf' attr: 'b' } + shape_list: { fg: '#64aaaf' attr: 'b' } + shape_literal: '#439ecf' + shape_match_pattern: '#89d287' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#96dcda' + shape_operator: '#dab752' + shape_or: { fg: '#d961dc' attr: 'b' } + shape_pipe: { fg: '#d961dc' attr: 'b' } + shape_range: { fg: '#dab752' attr: 'b' } + shape_record: { fg: '#64aaaf' attr: 'b' } + shape_redirection: { fg: '#d961dc' attr: 'b' } + shape_signature: { fg: '#89d287' attr: 'b' } + shape_string: '#89d287' + shape_string_interpolation: { fg: '#64aaaf' attr: 'b' } + shape_table: { fg: '#439ecf' attr: 'b' } + shape_variable: '#d961dc' + + background: '#ebeaf2' + foreground: '#004f7c' + cursor: '#004f7c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nord.nu b/themes/nu-themes/nord.nu index 1aa1d7b..7490f40 100644 --- a/themes/nu-themes/nord.nu +++ b/themes/nu-themes/nord.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e5e9f0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a3be8c" attr: "b" } - empty: "#81a1c1" - bool: {|| if $in { "#88c0d0" } else { "light_gray" } } - int: "#e5e9f0" - filesize: {|e| - if $e == 0b { - "#e5e9f0" - } else if $e < 1mb { - "#88c0d0" - } else {{ fg: "#81a1c1" }} - } - duration: "#e5e9f0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf616a" attr: "b" } - } else if $in < 6hr { - "#bf616a" - } else if $in < 1day { - "#ebcb8b" - } else if $in < 3day { - "#a3be8c" - } else if $in < 1wk { - { fg: "#a3be8c" attr: "b" } - } else if $in < 6wk { - "#88c0d0" - } else if $in < 52wk { - "#81a1c1" - } else { "dark_gray" } - } - range: "#e5e9f0" - float: "#e5e9f0" - string: "#e5e9f0" - nothing: "#e5e9f0" - binary: "#e5e9f0" - cellpath: "#e5e9f0" - row_index: { fg: "#a3be8c" attr: "b" } - record: "#e5e9f0" - list: "#e5e9f0" - block: "#e5e9f0" - hints: "dark_gray" - search_result: { fg: "#bf616a" bg: "#e5e9f0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b48ead" attr: "b" } - shape_binary: { fg: "#b48ead" attr: "b" } - shape_block: { fg: "#81a1c1" attr: "b" } - shape_bool: "#88c0d0" - shape_custom: "#a3be8c" - shape_datetime: { fg: "#88c0d0" attr: "b" } - shape_directory: "#88c0d0" - shape_external: "#88c0d0" - shape_externalarg: { fg: "#a3be8c" attr: "b" } - shape_filepath: "#88c0d0" - shape_flag: { fg: "#81a1c1" attr: "b" } - shape_float: { fg: "#b48ead" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#88c0d0" attr: "b" } - shape_int: { fg: "#b48ead" attr: "b" } - shape_internalcall: { fg: "#88c0d0" attr: "b" } - shape_list: { fg: "#88c0d0" attr: "b" } - shape_literal: "#81a1c1" - shape_match_pattern: "#a3be8c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#88c0d0" - shape_operator: "#ebcb8b" - shape_or: { fg: "#b48ead" attr: "b" } - shape_pipe: { fg: "#b48ead" attr: "b" } - shape_range: { fg: "#ebcb8b" attr: "b" } - shape_record: { fg: "#88c0d0" attr: "b" } - shape_redirection: { fg: "#b48ead" attr: "b" } - shape_signature: { fg: "#a3be8c" attr: "b" } - shape_string: "#a3be8c" - shape_string_interpolation: { fg: "#88c0d0" attr: "b" } - shape_table: { fg: "#81a1c1" attr: "b" } - shape_variable: "#b48ead" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2e3440" - foreground: "#e5e9f0" - cursor: "#e5e9f0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e5e9f0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a3be8c' attr: 'b' } + empty: '#81a1c1' + bool: {|| if $in { '#88c0d0' } else { 'light_gray' } } + int: '#e5e9f0' + filesize: {|e| + if $e == 0b { + '#e5e9f0' + } else if $e < 1mb { + '#88c0d0' + } else {{ fg: '#81a1c1' }} + } + duration: '#e5e9f0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf616a' attr: 'b' } + } else if $in < 6hr { + '#bf616a' + } else if $in < 1day { + '#ebcb8b' + } else if $in < 3day { + '#a3be8c' + } else if $in < 1wk { + { fg: '#a3be8c' attr: 'b' } + } else if $in < 6wk { + '#88c0d0' + } else if $in < 52wk { + '#81a1c1' + } else { 'dark_gray' } + } + range: '#e5e9f0' + float: '#e5e9f0' + string: '#e5e9f0' + nothing: '#e5e9f0' + binary: '#e5e9f0' + cellpath: '#e5e9f0' + row_index: { fg: '#a3be8c' attr: 'b' } + record: '#e5e9f0' + list: '#e5e9f0' + block: '#e5e9f0' + hints: 'dark_gray' + search_result: { fg: '#bf616a' bg: '#e5e9f0' } + + shape_and: { fg: '#b48ead' attr: 'b' } + shape_binary: { fg: '#b48ead' attr: 'b' } + shape_block: { fg: '#81a1c1' attr: 'b' } + shape_bool: '#88c0d0' + shape_custom: '#a3be8c' + shape_datetime: { fg: '#88c0d0' attr: 'b' } + shape_directory: '#88c0d0' + shape_external: '#88c0d0' + shape_externalarg: { fg: '#a3be8c' attr: 'b' } + shape_filepath: '#88c0d0' + shape_flag: { fg: '#81a1c1' attr: 'b' } + shape_float: { fg: '#b48ead' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#88c0d0' attr: 'b' } + shape_int: { fg: '#b48ead' attr: 'b' } + shape_internalcall: { fg: '#88c0d0' attr: 'b' } + shape_list: { fg: '#88c0d0' attr: 'b' } + shape_literal: '#81a1c1' + shape_match_pattern: '#a3be8c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#88c0d0' + shape_operator: '#ebcb8b' + shape_or: { fg: '#b48ead' attr: 'b' } + shape_pipe: { fg: '#b48ead' attr: 'b' } + shape_range: { fg: '#ebcb8b' attr: 'b' } + shape_record: { fg: '#88c0d0' attr: 'b' } + shape_redirection: { fg: '#b48ead' attr: 'b' } + shape_signature: { fg: '#a3be8c' attr: 'b' } + shape_string: '#a3be8c' + shape_string_interpolation: { fg: '#88c0d0' attr: 'b' } + shape_table: { fg: '#81a1c1' attr: 'b' } + shape_variable: '#b48ead' + + background: '#2e3440' + foreground: '#e5e9f0' + cursor: '#e5e9f0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nova.nu b/themes/nu-themes/nova.nu index dae905c..d4fdd7c 100644 --- a/themes/nu-themes/nova.nu +++ b/themes/nu-themes/nova.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c5d4dd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7fc1ca" attr: "b" } - empty: "#83afe5" - bool: {|| if $in { "#f2c38f" } else { "light_gray" } } - int: "#c5d4dd" - filesize: {|e| - if $e == 0b { - "#c5d4dd" - } else if $e < 1mb { - "#f2c38f" - } else {{ fg: "#83afe5" }} - } - duration: "#c5d4dd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#83afe5" attr: "b" } - } else if $in < 6hr { - "#83afe5" - } else if $in < 1day { - "#a8ce93" - } else if $in < 3day { - "#7fc1ca" - } else if $in < 1wk { - { fg: "#7fc1ca" attr: "b" } - } else if $in < 6wk { - "#f2c38f" - } else if $in < 52wk { - "#83afe5" - } else { "dark_gray" } - } - range: "#c5d4dd" - float: "#c5d4dd" - string: "#c5d4dd" - nothing: "#c5d4dd" - binary: "#c5d4dd" - cellpath: "#c5d4dd" - row_index: { fg: "#7fc1ca" attr: "b" } - record: "#c5d4dd" - list: "#c5d4dd" - block: "#c5d4dd" - hints: "dark_gray" - search_result: { fg: "#83afe5" bg: "#c5d4dd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9a93e1" attr: "b" } - shape_binary: { fg: "#9a93e1" attr: "b" } - shape_block: { fg: "#83afe5" attr: "b" } - shape_bool: "#f2c38f" - shape_custom: "#7fc1ca" - shape_datetime: { fg: "#f2c38f" attr: "b" } - shape_directory: "#f2c38f" - shape_external: "#f2c38f" - shape_externalarg: { fg: "#7fc1ca" attr: "b" } - shape_filepath: "#f2c38f" - shape_flag: { fg: "#83afe5" attr: "b" } - shape_float: { fg: "#9a93e1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#f2c38f" attr: "b" } - shape_int: { fg: "#9a93e1" attr: "b" } - shape_internalcall: { fg: "#f2c38f" attr: "b" } - shape_list: { fg: "#f2c38f" attr: "b" } - shape_literal: "#83afe5" - shape_match_pattern: "#7fc1ca" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#f2c38f" - shape_operator: "#a8ce93" - shape_or: { fg: "#9a93e1" attr: "b" } - shape_pipe: { fg: "#9a93e1" attr: "b" } - shape_range: { fg: "#a8ce93" attr: "b" } - shape_record: { fg: "#f2c38f" attr: "b" } - shape_redirection: { fg: "#9a93e1" attr: "b" } - shape_signature: { fg: "#7fc1ca" attr: "b" } - shape_string: "#7fc1ca" - shape_string_interpolation: { fg: "#f2c38f" attr: "b" } - shape_table: { fg: "#83afe5" attr: "b" } - shape_variable: "#9a93e1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3c4c55" - foreground: "#c5d4dd" - cursor: "#c5d4dd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c5d4dd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7fc1ca' attr: 'b' } + empty: '#83afe5' + bool: {|| if $in { '#f2c38f' } else { 'light_gray' } } + int: '#c5d4dd' + filesize: {|e| + if $e == 0b { + '#c5d4dd' + } else if $e < 1mb { + '#f2c38f' + } else {{ fg: '#83afe5' }} + } + duration: '#c5d4dd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#83afe5' attr: 'b' } + } else if $in < 6hr { + '#83afe5' + } else if $in < 1day { + '#a8ce93' + } else if $in < 3day { + '#7fc1ca' + } else if $in < 1wk { + { fg: '#7fc1ca' attr: 'b' } + } else if $in < 6wk { + '#f2c38f' + } else if $in < 52wk { + '#83afe5' + } else { 'dark_gray' } + } + range: '#c5d4dd' + float: '#c5d4dd' + string: '#c5d4dd' + nothing: '#c5d4dd' + binary: '#c5d4dd' + cellpath: '#c5d4dd' + row_index: { fg: '#7fc1ca' attr: 'b' } + record: '#c5d4dd' + list: '#c5d4dd' + block: '#c5d4dd' + hints: 'dark_gray' + search_result: { fg: '#83afe5' bg: '#c5d4dd' } + + shape_and: { fg: '#9a93e1' attr: 'b' } + shape_binary: { fg: '#9a93e1' attr: 'b' } + shape_block: { fg: '#83afe5' attr: 'b' } + shape_bool: '#f2c38f' + shape_custom: '#7fc1ca' + shape_datetime: { fg: '#f2c38f' attr: 'b' } + shape_directory: '#f2c38f' + shape_external: '#f2c38f' + shape_externalarg: { fg: '#7fc1ca' attr: 'b' } + shape_filepath: '#f2c38f' + shape_flag: { fg: '#83afe5' attr: 'b' } + shape_float: { fg: '#9a93e1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#f2c38f' attr: 'b' } + shape_int: { fg: '#9a93e1' attr: 'b' } + shape_internalcall: { fg: '#f2c38f' attr: 'b' } + shape_list: { fg: '#f2c38f' attr: 'b' } + shape_literal: '#83afe5' + shape_match_pattern: '#7fc1ca' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#f2c38f' + shape_operator: '#a8ce93' + shape_or: { fg: '#9a93e1' attr: 'b' } + shape_pipe: { fg: '#9a93e1' attr: 'b' } + shape_range: { fg: '#a8ce93' attr: 'b' } + shape_record: { fg: '#f2c38f' attr: 'b' } + shape_redirection: { fg: '#9a93e1' attr: 'b' } + shape_signature: { fg: '#7fc1ca' attr: 'b' } + shape_string: '#7fc1ca' + shape_string_interpolation: { fg: '#f2c38f' attr: 'b' } + shape_table: { fg: '#83afe5' attr: 'b' } + shape_variable: '#9a93e1' + + background: '#3c4c55' + foreground: '#c5d4dd' + cursor: '#c5d4dd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/novel.nu b/themes/nu-themes/novel.nu index 7fa0d1f..2b8a21d 100644 --- a/themes/nu-themes/novel.nu +++ b/themes/nu-themes/novel.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#009600" attr: "b" } - empty: "#0000cc" - bool: {|| if $in { "#0087cc" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#0087cc" - } else {{ fg: "#0000cc" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#d06b00" - } else if $in < 3day { - "#009600" - } else if $in < 1wk { - { fg: "#009600" attr: "b" } - } else if $in < 6wk { - "#0087cc" - } else if $in < 52wk { - "#0000cc" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#009600" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc00cc" attr: "b" } - shape_binary: { fg: "#cc00cc" attr: "b" } - shape_block: { fg: "#0000cc" attr: "b" } - shape_bool: "#0087cc" - shape_custom: "#009600" - shape_datetime: { fg: "#0087cc" attr: "b" } - shape_directory: "#0087cc" - shape_external: "#0087cc" - shape_externalarg: { fg: "#009600" attr: "b" } - shape_filepath: "#0087cc" - shape_flag: { fg: "#0000cc" attr: "b" } - shape_float: { fg: "#cc00cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0087cc" attr: "b" } - shape_int: { fg: "#cc00cc" attr: "b" } - shape_internalcall: { fg: "#0087cc" attr: "b" } - shape_list: { fg: "#0087cc" attr: "b" } - shape_literal: "#0000cc" - shape_match_pattern: "#009600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0087cc" - shape_operator: "#d06b00" - shape_or: { fg: "#cc00cc" attr: "b" } - shape_pipe: { fg: "#cc00cc" attr: "b" } - shape_range: { fg: "#d06b00" attr: "b" } - shape_record: { fg: "#0087cc" attr: "b" } - shape_redirection: { fg: "#cc00cc" attr: "b" } - shape_signature: { fg: "#009600" attr: "b" } - shape_string: "#009600" - shape_string_interpolation: { fg: "#0087cc" attr: "b" } - shape_table: { fg: "#0000cc" attr: "b" } - shape_variable: "#cc00cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#dfdbc3" - foreground: "#3b2322" - cursor: "#3b2322" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#009600' attr: 'b' } + empty: '#0000cc' + bool: {|| if $in { '#0087cc' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#0087cc' + } else {{ fg: '#0000cc' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#d06b00' + } else if $in < 3day { + '#009600' + } else if $in < 1wk { + { fg: '#009600' attr: 'b' } + } else if $in < 6wk { + '#0087cc' + } else if $in < 52wk { + '#0000cc' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#009600' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#cccccc' } + + shape_and: { fg: '#cc00cc' attr: 'b' } + shape_binary: { fg: '#cc00cc' attr: 'b' } + shape_block: { fg: '#0000cc' attr: 'b' } + shape_bool: '#0087cc' + shape_custom: '#009600' + shape_datetime: { fg: '#0087cc' attr: 'b' } + shape_directory: '#0087cc' + shape_external: '#0087cc' + shape_externalarg: { fg: '#009600' attr: 'b' } + shape_filepath: '#0087cc' + shape_flag: { fg: '#0000cc' attr: 'b' } + shape_float: { fg: '#cc00cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0087cc' attr: 'b' } + shape_int: { fg: '#cc00cc' attr: 'b' } + shape_internalcall: { fg: '#0087cc' attr: 'b' } + shape_list: { fg: '#0087cc' attr: 'b' } + shape_literal: '#0000cc' + shape_match_pattern: '#009600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0087cc' + shape_operator: '#d06b00' + shape_or: { fg: '#cc00cc' attr: 'b' } + shape_pipe: { fg: '#cc00cc' attr: 'b' } + shape_range: { fg: '#d06b00' attr: 'b' } + shape_record: { fg: '#0087cc' attr: 'b' } + shape_redirection: { fg: '#cc00cc' attr: 'b' } + shape_signature: { fg: '#009600' attr: 'b' } + shape_string: '#009600' + shape_string_interpolation: { fg: '#0087cc' attr: 'b' } + shape_table: { fg: '#0000cc' attr: 'b' } + shape_variable: '#cc00cc' + + background: '#dfdbc3' + foreground: '#3b2322' + cursor: '#3b2322' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/nushell-dark.nu b/themes/nu-themes/nushell-dark.nu deleted file mode 100644 index 2cb40da..0000000 --- a/themes/nu-themes/nushell-dark.nu +++ /dev/null @@ -1,88 +0,0 @@ -export def main [] { return { - # color for nushell primitives - separator: white - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off - header: green_bold - empty: blue - # Closures can be used to choose colors for specific values. - # The value (in this case, a bool) is piped into the closure. - bool: {|| if $in { 'light_cyan' } else { 'light_gray' } } - int: white - filesize: {|e| - if $e == 0b { - 'white' - } else if $e < 1mb { - 'cyan' - } else { 'blue' } - } - duration: white - date: {|| (date now) - $in | - if $in < 1hr { - 'purple' - } else if $in < 6hr { - 'red' - } else if $in < 1day { - 'yellow' - } else if $in < 3day { - 'green' - } else if $in < 1wk { - 'light_green' - } else if $in < 6wk { - 'cyan' - } else if $in < 52wk { - 'blue' - } else { 'dark_gray' } - } - range: white - float: white - string: white - nothing: white - binary: white - cellpath: white - row_index: green_bold - record: white - list: white - block: white - hints: dark_gray - search_result: {bg: red fg: white} - - shape_and: purple_bold - shape_binary: purple_bold - shape_block: blue_bold - shape_bool: light_cyan - shape_closure: green_bold - shape_custom: green - shape_datetime: cyan_bold - shape_directory: cyan - shape_external: cyan - shape_externalarg: green_bold - shape_filepath: cyan - shape_flag: blue_bold - shape_float: purple_bold - # shapes are used to change the cli syntax highlighting - shape_garbage: { fg: white bg: red attr: b} - shape_globpattern: cyan_bold - shape_int: purple_bold - shape_internalcall: cyan_bold - shape_list: cyan_bold - shape_literal: blue - shape_match_pattern: green - shape_matching_brackets: { attr: u } - shape_nothing: light_cyan - shape_operator: yellow - shape_or: purple_bold - shape_pipe: purple_bold - shape_range: yellow_bold - shape_record: cyan_bold - shape_redirection: purple_bold - shape_signature: green_bold - shape_string: green - shape_string_interpolation: cyan_bold - shape_table: blue_bold - shape_variable: purple - shape_vardecl: purple - - background: dark_gray - foreground: default - cursor: red -}} diff --git a/themes/nu-themes/nushell-light.nu b/themes/nu-themes/nushell-light.nu deleted file mode 100644 index dd5f19e..0000000 --- a/themes/nu-themes/nushell-light.nu +++ /dev/null @@ -1,88 +0,0 @@ -export def main [] { return { - # color for nushell primitives - separator: dark_gray - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off - header: green_bold - empty: blue - # Closures can be used to choose colors for specific values. - # The value (in this case, a bool) is piped into the closure. - bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } } - int: dark_gray - filesize: {|e| - if $e == 0b { - 'dark_gray' - } else if $e < 1mb { - 'cyan_bold' - } else { 'blue_bold' } - } - duration: dark_gray - date: {|| (date now) - $in | - if $in < 1hr { - 'purple' - } else if $in < 6hr { - 'red' - } else if $in < 1day { - 'yellow' - } else if $in < 3day { - 'green' - } else if $in < 1wk { - 'light_green' - } else if $in < 6wk { - 'cyan' - } else if $in < 52wk { - 'blue' - } else { 'dark_gray' } - } - range: dark_gray - float: dark_gray - string: dark_gray - nothing: dark_gray - binary: dark_gray - cellpath: dark_gray - row_index: green_bold - record: white - list: white - block: white - hints: dark_gray - search_result: {fg: white bg: red} - - shape_and: purple_bold - shape_binary: purple_bold - shape_block: blue_bold - shape_bool: light_cyan - shape_closure: green_bold - shape_custom: green - shape_datetime: cyan_bold - shape_directory: cyan - shape_external: cyan - shape_externalarg: green_bold - shape_filepath: cyan - shape_flag: blue_bold - shape_float: purple_bold - # shapes are used to change the cli syntax highlighting - shape_garbage: { fg: white bg: red attr: b} - shape_globpattern: cyan_bold - shape_int: purple_bold - shape_internalcall: cyan_bold - shape_list: cyan_bold - shape_literal: blue - shape_match_pattern: green - shape_matching_brackets: { attr: u } - shape_nothing: light_cyan - shape_operator: yellow - shape_or: purple_bold - shape_pipe: purple_bold - shape_range: yellow_bold - shape_record: cyan_bold - shape_redirection: purple_bold - shape_signature: green_bold - shape_string: green - shape_string_interpolation: cyan_bold - shape_table: blue_bold - shape_variable: purple - shape_vardecl: purple - - background: light_gray - foreground: default - cursor: red -}} diff --git a/themes/nu-themes/obsidian.nu b/themes/nu-themes/obsidian.nu index 281b4db..d91d395 100644 --- a/themes/nu-themes/obsidian.nu +++ b/themes/nu-themes/obsidian.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00bb00" attr: "b" } - empty: "#3a9bdb" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#00bbbb" - } else {{ fg: "#3a9bdb" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a60001" attr: "b" } - } else if $in < 6hr { - "#a60001" - } else if $in < 1day { - "#fecd22" - } else if $in < 3day { - "#00bb00" - } else if $in < 1wk { - { fg: "#00bb00" attr: "b" } - } else if $in < 6wk { - "#00bbbb" - } else if $in < 52wk { - "#3a9bdb" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#00bb00" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#a60001" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb00bb" attr: "b" } - shape_binary: { fg: "#bb00bb" attr: "b" } - shape_block: { fg: "#3a9bdb" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#00bb00" - shape_datetime: { fg: "#00bbbb" attr: "b" } - shape_directory: "#00bbbb" - shape_external: "#00bbbb" - shape_externalarg: { fg: "#00bb00" attr: "b" } - shape_filepath: "#00bbbb" - shape_flag: { fg: "#3a9bdb" attr: "b" } - shape_float: { fg: "#bb00bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00bbbb" attr: "b" } - shape_int: { fg: "#bb00bb" attr: "b" } - shape_internalcall: { fg: "#00bbbb" attr: "b" } - shape_list: { fg: "#00bbbb" attr: "b" } - shape_literal: "#3a9bdb" - shape_match_pattern: "#00bb00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#fecd22" - shape_or: { fg: "#bb00bb" attr: "b" } - shape_pipe: { fg: "#bb00bb" attr: "b" } - shape_range: { fg: "#fecd22" attr: "b" } - shape_record: { fg: "#00bbbb" attr: "b" } - shape_redirection: { fg: "#bb00bb" attr: "b" } - shape_signature: { fg: "#00bb00" attr: "b" } - shape_string: "#00bb00" - shape_string_interpolation: { fg: "#00bbbb" attr: "b" } - shape_table: { fg: "#3a9bdb" attr: "b" } - shape_variable: "#bb00bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#283033" - foreground: "#cdcdcd" - cursor: "#cdcdcd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00bb00' attr: 'b' } + empty: '#3a9bdb' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#00bbbb' + } else {{ fg: '#3a9bdb' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a60001' attr: 'b' } + } else if $in < 6hr { + '#a60001' + } else if $in < 1day { + '#fecd22' + } else if $in < 3day { + '#00bb00' + } else if $in < 1wk { + { fg: '#00bb00' attr: 'b' } + } else if $in < 6wk { + '#00bbbb' + } else if $in < 52wk { + '#3a9bdb' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#00bb00' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#a60001' bg: '#bbbbbb' } + + shape_and: { fg: '#bb00bb' attr: 'b' } + shape_binary: { fg: '#bb00bb' attr: 'b' } + shape_block: { fg: '#3a9bdb' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#00bb00' + shape_datetime: { fg: '#00bbbb' attr: 'b' } + shape_directory: '#00bbbb' + shape_external: '#00bbbb' + shape_externalarg: { fg: '#00bb00' attr: 'b' } + shape_filepath: '#00bbbb' + shape_flag: { fg: '#3a9bdb' attr: 'b' } + shape_float: { fg: '#bb00bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00bbbb' attr: 'b' } + shape_int: { fg: '#bb00bb' attr: 'b' } + shape_internalcall: { fg: '#00bbbb' attr: 'b' } + shape_list: { fg: '#00bbbb' attr: 'b' } + shape_literal: '#3a9bdb' + shape_match_pattern: '#00bb00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#fecd22' + shape_or: { fg: '#bb00bb' attr: 'b' } + shape_pipe: { fg: '#bb00bb' attr: 'b' } + shape_range: { fg: '#fecd22' attr: 'b' } + shape_record: { fg: '#00bbbb' attr: 'b' } + shape_redirection: { fg: '#bb00bb' attr: 'b' } + shape_signature: { fg: '#00bb00' attr: 'b' } + shape_string: '#00bb00' + shape_string_interpolation: { fg: '#00bbbb' attr: 'b' } + shape_table: { fg: '#3a9bdb' attr: 'b' } + shape_variable: '#bb00bb' + + background: '#283033' + foreground: '#cdcdcd' + cursor: '#cdcdcd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ocean-dark.nu b/themes/nu-themes/ocean-dark.nu index a19d9a0..628c024 100644 --- a/themes/nu-themes/ocean-dark.nu +++ b/themes/nu-themes/ocean-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeedee" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#afd383" attr: "b" } - empty: "#7d90a4" - bool: {|| if $in { "#dfdffd" } else { "light_gray" } } - int: "#eeedee" - filesize: {|e| - if $e == 0b { - "#eeedee" - } else if $e < 1mb { - "#85a6a5" - } else {{ fg: "#7d90a4" }} - } - duration: "#eeedee" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#af4b57" attr: "b" } - } else if $in < 6hr { - "#af4b57" - } else if $in < 1day { - "#e5c079" - } else if $in < 3day { - "#afd383" - } else if $in < 1wk { - { fg: "#afd383" attr: "b" } - } else if $in < 6wk { - "#85a6a5" - } else if $in < 52wk { - "#7d90a4" - } else { "dark_gray" } - } - range: "#eeedee" - float: "#eeedee" - string: "#eeedee" - nothing: "#eeedee" - binary: "#eeedee" - cellpath: "#eeedee" - row_index: { fg: "#afd383" attr: "b" } - record: "#eeedee" - list: "#eeedee" - block: "#eeedee" - hints: "dark_gray" - search_result: { fg: "#af4b57" bg: "#eeedee" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a4799d" attr: "b" } - shape_binary: { fg: "#a4799d" attr: "b" } - shape_block: { fg: "#7d90a4" attr: "b" } - shape_bool: "#dfdffd" - shape_custom: "#afd383" - shape_datetime: { fg: "#85a6a5" attr: "b" } - shape_directory: "#85a6a5" - shape_external: "#85a6a5" - shape_externalarg: { fg: "#afd383" attr: "b" } - shape_filepath: "#85a6a5" - shape_flag: { fg: "#7d90a4" attr: "b" } - shape_float: { fg: "#a4799d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#85a6a5" attr: "b" } - shape_int: { fg: "#a4799d" attr: "b" } - shape_internalcall: { fg: "#85a6a5" attr: "b" } - shape_list: { fg: "#85a6a5" attr: "b" } - shape_literal: "#7d90a4" - shape_match_pattern: "#afd383" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#dfdffd" - shape_operator: "#e5c079" - shape_or: { fg: "#a4799d" attr: "b" } - shape_pipe: { fg: "#a4799d" attr: "b" } - shape_range: { fg: "#e5c079" attr: "b" } - shape_record: { fg: "#85a6a5" attr: "b" } - shape_redirection: { fg: "#a4799d" attr: "b" } - shape_signature: { fg: "#afd383" attr: "b" } - shape_string: "#afd383" - shape_string_interpolation: { fg: "#85a6a5" attr: "b" } - shape_table: { fg: "#7d90a4" attr: "b" } - shape_variable: "#a4799d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1f27" - foreground: "#979cac" - cursor: "#979cac" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeedee' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#afd383' attr: 'b' } + empty: '#7d90a4' + bool: {|| if $in { '#dfdffd' } else { 'light_gray' } } + int: '#eeedee' + filesize: {|e| + if $e == 0b { + '#eeedee' + } else if $e < 1mb { + '#85a6a5' + } else {{ fg: '#7d90a4' }} + } + duration: '#eeedee' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#af4b57' attr: 'b' } + } else if $in < 6hr { + '#af4b57' + } else if $in < 1day { + '#e5c079' + } else if $in < 3day { + '#afd383' + } else if $in < 1wk { + { fg: '#afd383' attr: 'b' } + } else if $in < 6wk { + '#85a6a5' + } else if $in < 52wk { + '#7d90a4' + } else { 'dark_gray' } + } + range: '#eeedee' + float: '#eeedee' + string: '#eeedee' + nothing: '#eeedee' + binary: '#eeedee' + cellpath: '#eeedee' + row_index: { fg: '#afd383' attr: 'b' } + record: '#eeedee' + list: '#eeedee' + block: '#eeedee' + hints: 'dark_gray' + search_result: { fg: '#af4b57' bg: '#eeedee' } + + shape_and: { fg: '#a4799d' attr: 'b' } + shape_binary: { fg: '#a4799d' attr: 'b' } + shape_block: { fg: '#7d90a4' attr: 'b' } + shape_bool: '#dfdffd' + shape_custom: '#afd383' + shape_datetime: { fg: '#85a6a5' attr: 'b' } + shape_directory: '#85a6a5' + shape_external: '#85a6a5' + shape_externalarg: { fg: '#afd383' attr: 'b' } + shape_filepath: '#85a6a5' + shape_flag: { fg: '#7d90a4' attr: 'b' } + shape_float: { fg: '#a4799d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#85a6a5' attr: 'b' } + shape_int: { fg: '#a4799d' attr: 'b' } + shape_internalcall: { fg: '#85a6a5' attr: 'b' } + shape_list: { fg: '#85a6a5' attr: 'b' } + shape_literal: '#7d90a4' + shape_match_pattern: '#afd383' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#dfdffd' + shape_operator: '#e5c079' + shape_or: { fg: '#a4799d' attr: 'b' } + shape_pipe: { fg: '#a4799d' attr: 'b' } + shape_range: { fg: '#e5c079' attr: 'b' } + shape_record: { fg: '#85a6a5' attr: 'b' } + shape_redirection: { fg: '#a4799d' attr: 'b' } + shape_signature: { fg: '#afd383' attr: 'b' } + shape_string: '#afd383' + shape_string_interpolation: { fg: '#85a6a5' attr: 'b' } + shape_table: { fg: '#7d90a4' attr: 'b' } + shape_variable: '#a4799d' + + background: '#1c1f27' + foreground: '#979cac' + cursor: '#979cac' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ocean.nu b/themes/nu-themes/ocean.nu index dd62071..8d0822d 100644 --- a/themes/nu-themes/ocean.nu +++ b/themes/nu-themes/ocean.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c0c5ce" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a3be8c" attr: "b" } - empty: "#8fa1b3" - bool: {|| if $in { "#96b5b4" } else { "light_gray" } } - int: "#c0c5ce" - filesize: {|e| - if $e == 0b { - "#c0c5ce" - } else if $e < 1mb { - "#96b5b4" - } else {{ fg: "#8fa1b3" }} - } - duration: "#c0c5ce" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bf616a" attr: "b" } - } else if $in < 6hr { - "#bf616a" - } else if $in < 1day { - "#ebcb8b" - } else if $in < 3day { - "#a3be8c" - } else if $in < 1wk { - { fg: "#a3be8c" attr: "b" } - } else if $in < 6wk { - "#96b5b4" - } else if $in < 52wk { - "#8fa1b3" - } else { "dark_gray" } - } - range: "#c0c5ce" - float: "#c0c5ce" - string: "#c0c5ce" - nothing: "#c0c5ce" - binary: "#c0c5ce" - cellpath: "#c0c5ce" - row_index: { fg: "#a3be8c" attr: "b" } - record: "#c0c5ce" - list: "#c0c5ce" - block: "#c0c5ce" - hints: "dark_gray" - search_result: { fg: "#bf616a" bg: "#c0c5ce" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b48ead" attr: "b" } - shape_binary: { fg: "#b48ead" attr: "b" } - shape_block: { fg: "#8fa1b3" attr: "b" } - shape_bool: "#96b5b4" - shape_custom: "#a3be8c" - shape_datetime: { fg: "#96b5b4" attr: "b" } - shape_directory: "#96b5b4" - shape_external: "#96b5b4" - shape_externalarg: { fg: "#a3be8c" attr: "b" } - shape_filepath: "#96b5b4" - shape_flag: { fg: "#8fa1b3" attr: "b" } - shape_float: { fg: "#b48ead" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#96b5b4" attr: "b" } - shape_int: { fg: "#b48ead" attr: "b" } - shape_internalcall: { fg: "#96b5b4" attr: "b" } - shape_list: { fg: "#96b5b4" attr: "b" } - shape_literal: "#8fa1b3" - shape_match_pattern: "#a3be8c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#96b5b4" - shape_operator: "#ebcb8b" - shape_or: { fg: "#b48ead" attr: "b" } - shape_pipe: { fg: "#b48ead" attr: "b" } - shape_range: { fg: "#ebcb8b" attr: "b" } - shape_record: { fg: "#96b5b4" attr: "b" } - shape_redirection: { fg: "#b48ead" attr: "b" } - shape_signature: { fg: "#a3be8c" attr: "b" } - shape_string: "#a3be8c" - shape_string_interpolation: { fg: "#96b5b4" attr: "b" } - shape_table: { fg: "#8fa1b3" attr: "b" } - shape_variable: "#b48ead" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b303b" - foreground: "#c0c5ce" - cursor: "#c0c5ce" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c0c5ce' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a3be8c' attr: 'b' } + empty: '#8fa1b3' + bool: {|| if $in { '#96b5b4' } else { 'light_gray' } } + int: '#c0c5ce' + filesize: {|e| + if $e == 0b { + '#c0c5ce' + } else if $e < 1mb { + '#96b5b4' + } else {{ fg: '#8fa1b3' }} + } + duration: '#c0c5ce' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bf616a' attr: 'b' } + } else if $in < 6hr { + '#bf616a' + } else if $in < 1day { + '#ebcb8b' + } else if $in < 3day { + '#a3be8c' + } else if $in < 1wk { + { fg: '#a3be8c' attr: 'b' } + } else if $in < 6wk { + '#96b5b4' + } else if $in < 52wk { + '#8fa1b3' + } else { 'dark_gray' } + } + range: '#c0c5ce' + float: '#c0c5ce' + string: '#c0c5ce' + nothing: '#c0c5ce' + binary: '#c0c5ce' + cellpath: '#c0c5ce' + row_index: { fg: '#a3be8c' attr: 'b' } + record: '#c0c5ce' + list: '#c0c5ce' + block: '#c0c5ce' + hints: 'dark_gray' + search_result: { fg: '#bf616a' bg: '#c0c5ce' } + + shape_and: { fg: '#b48ead' attr: 'b' } + shape_binary: { fg: '#b48ead' attr: 'b' } + shape_block: { fg: '#8fa1b3' attr: 'b' } + shape_bool: '#96b5b4' + shape_custom: '#a3be8c' + shape_datetime: { fg: '#96b5b4' attr: 'b' } + shape_directory: '#96b5b4' + shape_external: '#96b5b4' + shape_externalarg: { fg: '#a3be8c' attr: 'b' } + shape_filepath: '#96b5b4' + shape_flag: { fg: '#8fa1b3' attr: 'b' } + shape_float: { fg: '#b48ead' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#96b5b4' attr: 'b' } + shape_int: { fg: '#b48ead' attr: 'b' } + shape_internalcall: { fg: '#96b5b4' attr: 'b' } + shape_list: { fg: '#96b5b4' attr: 'b' } + shape_literal: '#8fa1b3' + shape_match_pattern: '#a3be8c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#96b5b4' + shape_operator: '#ebcb8b' + shape_or: { fg: '#b48ead' attr: 'b' } + shape_pipe: { fg: '#b48ead' attr: 'b' } + shape_range: { fg: '#ebcb8b' attr: 'b' } + shape_record: { fg: '#96b5b4' attr: 'b' } + shape_redirection: { fg: '#b48ead' attr: 'b' } + shape_signature: { fg: '#a3be8c' attr: 'b' } + shape_string: '#a3be8c' + shape_string_interpolation: { fg: '#96b5b4' attr: 'b' } + shape_table: { fg: '#8fa1b3' attr: 'b' } + shape_variable: '#b48ead' + + background: '#2b303b' + foreground: '#c0c5ce' + cursor: '#c0c5ce' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/oceanic-material.nu b/themes/nu-themes/oceanic-material.nu index 9e82d38..97c3c56 100644 --- a/themes/nu-themes/oceanic-material.nu +++ b/themes/nu-themes/oceanic-material.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a4a4a4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#3fa33f" attr: "b" } - empty: "#1d80ef" - bool: {|| if $in { "#42c6d9" } else { "light_gray" } } - int: "#a4a4a4" - filesize: {|e| - if $e == 0b { - "#a4a4a4" - } else if $e < 1mb { - "#16aec9" - } else {{ fg: "#1d80ef" }} - } - duration: "#a4a4a4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ee2a29" attr: "b" } - } else if $in < 6hr { - "#ee2a29" - } else if $in < 1day { - "#fee92e" - } else if $in < 3day { - "#3fa33f" - } else if $in < 1wk { - { fg: "#3fa33f" attr: "b" } - } else if $in < 6wk { - "#16aec9" - } else if $in < 52wk { - "#1d80ef" - } else { "dark_gray" } - } - range: "#a4a4a4" - float: "#a4a4a4" - string: "#a4a4a4" - nothing: "#a4a4a4" - binary: "#a4a4a4" - cellpath: "#a4a4a4" - row_index: { fg: "#3fa33f" attr: "b" } - record: "#a4a4a4" - list: "#a4a4a4" - block: "#a4a4a4" - hints: "dark_gray" - search_result: { fg: "#ee2a29" bg: "#a4a4a4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8800a0" attr: "b" } - shape_binary: { fg: "#8800a0" attr: "b" } - shape_block: { fg: "#1d80ef" attr: "b" } - shape_bool: "#42c6d9" - shape_custom: "#3fa33f" - shape_datetime: { fg: "#16aec9" attr: "b" } - shape_directory: "#16aec9" - shape_external: "#16aec9" - shape_externalarg: { fg: "#3fa33f" attr: "b" } - shape_filepath: "#16aec9" - shape_flag: { fg: "#1d80ef" attr: "b" } - shape_float: { fg: "#8800a0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#16aec9" attr: "b" } - shape_int: { fg: "#8800a0" attr: "b" } - shape_internalcall: { fg: "#16aec9" attr: "b" } - shape_list: { fg: "#16aec9" attr: "b" } - shape_literal: "#1d80ef" - shape_match_pattern: "#3fa33f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#42c6d9" - shape_operator: "#fee92e" - shape_or: { fg: "#8800a0" attr: "b" } - shape_pipe: { fg: "#8800a0" attr: "b" } - shape_range: { fg: "#fee92e" attr: "b" } - shape_record: { fg: "#16aec9" attr: "b" } - shape_redirection: { fg: "#8800a0" attr: "b" } - shape_signature: { fg: "#3fa33f" attr: "b" } - shape_string: "#3fa33f" - shape_string_interpolation: { fg: "#16aec9" attr: "b" } - shape_table: { fg: "#1d80ef" attr: "b" } - shape_variable: "#8800a0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c262b" - foreground: "#c1c8d6" - cursor: "#b2b8c3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a4a4a4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#3fa33f' attr: 'b' } + empty: '#1d80ef' + bool: {|| if $in { '#42c6d9' } else { 'light_gray' } } + int: '#a4a4a4' + filesize: {|e| + if $e == 0b { + '#a4a4a4' + } else if $e < 1mb { + '#16aec9' + } else {{ fg: '#1d80ef' }} + } + duration: '#a4a4a4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ee2a29' attr: 'b' } + } else if $in < 6hr { + '#ee2a29' + } else if $in < 1day { + '#fee92e' + } else if $in < 3day { + '#3fa33f' + } else if $in < 1wk { + { fg: '#3fa33f' attr: 'b' } + } else if $in < 6wk { + '#16aec9' + } else if $in < 52wk { + '#1d80ef' + } else { 'dark_gray' } + } + range: '#a4a4a4' + float: '#a4a4a4' + string: '#a4a4a4' + nothing: '#a4a4a4' + binary: '#a4a4a4' + cellpath: '#a4a4a4' + row_index: { fg: '#3fa33f' attr: 'b' } + record: '#a4a4a4' + list: '#a4a4a4' + block: '#a4a4a4' + hints: 'dark_gray' + search_result: { fg: '#ee2a29' bg: '#a4a4a4' } + + shape_and: { fg: '#8800a0' attr: 'b' } + shape_binary: { fg: '#8800a0' attr: 'b' } + shape_block: { fg: '#1d80ef' attr: 'b' } + shape_bool: '#42c6d9' + shape_custom: '#3fa33f' + shape_datetime: { fg: '#16aec9' attr: 'b' } + shape_directory: '#16aec9' + shape_external: '#16aec9' + shape_externalarg: { fg: '#3fa33f' attr: 'b' } + shape_filepath: '#16aec9' + shape_flag: { fg: '#1d80ef' attr: 'b' } + shape_float: { fg: '#8800a0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#16aec9' attr: 'b' } + shape_int: { fg: '#8800a0' attr: 'b' } + shape_internalcall: { fg: '#16aec9' attr: 'b' } + shape_list: { fg: '#16aec9' attr: 'b' } + shape_literal: '#1d80ef' + shape_match_pattern: '#3fa33f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#42c6d9' + shape_operator: '#fee92e' + shape_or: { fg: '#8800a0' attr: 'b' } + shape_pipe: { fg: '#8800a0' attr: 'b' } + shape_range: { fg: '#fee92e' attr: 'b' } + shape_record: { fg: '#16aec9' attr: 'b' } + shape_redirection: { fg: '#8800a0' attr: 'b' } + shape_signature: { fg: '#3fa33f' attr: 'b' } + shape_string: '#3fa33f' + shape_string_interpolation: { fg: '#16aec9' attr: 'b' } + shape_table: { fg: '#1d80ef' attr: 'b' } + shape_variable: '#8800a0' + + background: '#1c262b' + foreground: '#c1c8d6' + cursor: '#b2b8c3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/oceanic-next.nu b/themes/nu-themes/oceanic-next.nu index ae58c59..b9874f4 100644 --- a/themes/nu-themes/oceanic-next.nu +++ b/themes/nu-themes/oceanic-next.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#89bd82" attr: "b" } - empty: "#5486c0" - bool: {|| if $in { "#50a5a4" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#50a5a4" - } else {{ fg: "#5486c0" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e44754" attr: "b" } - } else if $in < 6hr { - "#e44754" - } else if $in < 1day { - "#f7bd51" - } else if $in < 3day { - "#89bd82" - } else if $in < 1wk { - { fg: "#89bd82" attr: "b" } - } else if $in < 6wk { - "#50a5a4" - } else if $in < 52wk { - "#5486c0" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#89bd82" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#e44754" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b77eb8" attr: "b" } - shape_binary: { fg: "#b77eb8" attr: "b" } - shape_block: { fg: "#5486c0" attr: "b" } - shape_bool: "#50a5a4" - shape_custom: "#89bd82" - shape_datetime: { fg: "#50a5a4" attr: "b" } - shape_directory: "#50a5a4" - shape_external: "#50a5a4" - shape_externalarg: { fg: "#89bd82" attr: "b" } - shape_filepath: "#50a5a4" - shape_flag: { fg: "#5486c0" attr: "b" } - shape_float: { fg: "#b77eb8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#50a5a4" attr: "b" } - shape_int: { fg: "#b77eb8" attr: "b" } - shape_internalcall: { fg: "#50a5a4" attr: "b" } - shape_list: { fg: "#50a5a4" attr: "b" } - shape_literal: "#5486c0" - shape_match_pattern: "#89bd82" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#50a5a4" - shape_operator: "#f7bd51" - shape_or: { fg: "#b77eb8" attr: "b" } - shape_pipe: { fg: "#b77eb8" attr: "b" } - shape_range: { fg: "#f7bd51" attr: "b" } - shape_record: { fg: "#50a5a4" attr: "b" } - shape_redirection: { fg: "#b77eb8" attr: "b" } - shape_signature: { fg: "#89bd82" attr: "b" } - shape_string: "#89bd82" - shape_string_interpolation: { fg: "#50a5a4" attr: "b" } - shape_table: { fg: "#5486c0" attr: "b" } - shape_variable: "#b77eb8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#121b21" - foreground: "#b3b8c3" - cursor: "#b3b8c3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#89bd82' attr: 'b' } + empty: '#5486c0' + bool: {|| if $in { '#50a5a4' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#50a5a4' + } else {{ fg: '#5486c0' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e44754' attr: 'b' } + } else if $in < 6hr { + '#e44754' + } else if $in < 1day { + '#f7bd51' + } else if $in < 3day { + '#89bd82' + } else if $in < 1wk { + { fg: '#89bd82' attr: 'b' } + } else if $in < 6wk { + '#50a5a4' + } else if $in < 52wk { + '#5486c0' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#89bd82' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#e44754' bg: '#ffffff' } + + shape_and: { fg: '#b77eb8' attr: 'b' } + shape_binary: { fg: '#b77eb8' attr: 'b' } + shape_block: { fg: '#5486c0' attr: 'b' } + shape_bool: '#50a5a4' + shape_custom: '#89bd82' + shape_datetime: { fg: '#50a5a4' attr: 'b' } + shape_directory: '#50a5a4' + shape_external: '#50a5a4' + shape_externalarg: { fg: '#89bd82' attr: 'b' } + shape_filepath: '#50a5a4' + shape_flag: { fg: '#5486c0' attr: 'b' } + shape_float: { fg: '#b77eb8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#50a5a4' attr: 'b' } + shape_int: { fg: '#b77eb8' attr: 'b' } + shape_internalcall: { fg: '#50a5a4' attr: 'b' } + shape_list: { fg: '#50a5a4' attr: 'b' } + shape_literal: '#5486c0' + shape_match_pattern: '#89bd82' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#50a5a4' + shape_operator: '#f7bd51' + shape_or: { fg: '#b77eb8' attr: 'b' } + shape_pipe: { fg: '#b77eb8' attr: 'b' } + shape_range: { fg: '#f7bd51' attr: 'b' } + shape_record: { fg: '#50a5a4' attr: 'b' } + shape_redirection: { fg: '#b77eb8' attr: 'b' } + shape_signature: { fg: '#89bd82' attr: 'b' } + shape_string: '#89bd82' + shape_string_interpolation: { fg: '#50a5a4' attr: 'b' } + shape_table: { fg: '#5486c0' attr: 'b' } + shape_variable: '#b77eb8' + + background: '#121b21' + foreground: '#b3b8c3' + cursor: '#b3b8c3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/oceanicnext.nu b/themes/nu-themes/oceanicnext.nu index 1158c87..99031d8 100644 --- a/themes/nu-themes/oceanicnext.nu +++ b/themes/nu-themes/oceanicnext.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c0c5ce" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#99c794" attr: "b" } - empty: "#6699cc" - bool: {|| if $in { "#5fb3b3" } else { "light_gray" } } - int: "#c0c5ce" - filesize: {|e| - if $e == 0b { - "#c0c5ce" - } else if $e < 1mb { - "#5fb3b3" - } else {{ fg: "#6699cc" }} - } - duration: "#c0c5ce" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ec5f67" attr: "b" } - } else if $in < 6hr { - "#ec5f67" - } else if $in < 1day { - "#fac863" - } else if $in < 3day { - "#99c794" - } else if $in < 1wk { - { fg: "#99c794" attr: "b" } - } else if $in < 6wk { - "#5fb3b3" - } else if $in < 52wk { - "#6699cc" - } else { "dark_gray" } - } - range: "#c0c5ce" - float: "#c0c5ce" - string: "#c0c5ce" - nothing: "#c0c5ce" - binary: "#c0c5ce" - cellpath: "#c0c5ce" - row_index: { fg: "#99c794" attr: "b" } - record: "#c0c5ce" - list: "#c0c5ce" - block: "#c0c5ce" - hints: "dark_gray" - search_result: { fg: "#ec5f67" bg: "#c0c5ce" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c594c5" attr: "b" } - shape_binary: { fg: "#c594c5" attr: "b" } - shape_block: { fg: "#6699cc" attr: "b" } - shape_bool: "#5fb3b3" - shape_custom: "#99c794" - shape_datetime: { fg: "#5fb3b3" attr: "b" } - shape_directory: "#5fb3b3" - shape_external: "#5fb3b3" - shape_externalarg: { fg: "#99c794" attr: "b" } - shape_filepath: "#5fb3b3" - shape_flag: { fg: "#6699cc" attr: "b" } - shape_float: { fg: "#c594c5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5fb3b3" attr: "b" } - shape_int: { fg: "#c594c5" attr: "b" } - shape_internalcall: { fg: "#5fb3b3" attr: "b" } - shape_list: { fg: "#5fb3b3" attr: "b" } - shape_literal: "#6699cc" - shape_match_pattern: "#99c794" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5fb3b3" - shape_operator: "#fac863" - shape_or: { fg: "#c594c5" attr: "b" } - shape_pipe: { fg: "#c594c5" attr: "b" } - shape_range: { fg: "#fac863" attr: "b" } - shape_record: { fg: "#5fb3b3" attr: "b" } - shape_redirection: { fg: "#c594c5" attr: "b" } - shape_signature: { fg: "#99c794" attr: "b" } - shape_string: "#99c794" - shape_string_interpolation: { fg: "#5fb3b3" attr: "b" } - shape_table: { fg: "#6699cc" attr: "b" } - shape_variable: "#c594c5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b2b34" - foreground: "#c0c5ce" - cursor: "#c0c5ce" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c0c5ce' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#99c794' attr: 'b' } + empty: '#6699cc' + bool: {|| if $in { '#5fb3b3' } else { 'light_gray' } } + int: '#c0c5ce' + filesize: {|e| + if $e == 0b { + '#c0c5ce' + } else if $e < 1mb { + '#5fb3b3' + } else {{ fg: '#6699cc' }} + } + duration: '#c0c5ce' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ec5f67' attr: 'b' } + } else if $in < 6hr { + '#ec5f67' + } else if $in < 1day { + '#fac863' + } else if $in < 3day { + '#99c794' + } else if $in < 1wk { + { fg: '#99c794' attr: 'b' } + } else if $in < 6wk { + '#5fb3b3' + } else if $in < 52wk { + '#6699cc' + } else { 'dark_gray' } + } + range: '#c0c5ce' + float: '#c0c5ce' + string: '#c0c5ce' + nothing: '#c0c5ce' + binary: '#c0c5ce' + cellpath: '#c0c5ce' + row_index: { fg: '#99c794' attr: 'b' } + record: '#c0c5ce' + list: '#c0c5ce' + block: '#c0c5ce' + hints: 'dark_gray' + search_result: { fg: '#ec5f67' bg: '#c0c5ce' } + + shape_and: { fg: '#c594c5' attr: 'b' } + shape_binary: { fg: '#c594c5' attr: 'b' } + shape_block: { fg: '#6699cc' attr: 'b' } + shape_bool: '#5fb3b3' + shape_custom: '#99c794' + shape_datetime: { fg: '#5fb3b3' attr: 'b' } + shape_directory: '#5fb3b3' + shape_external: '#5fb3b3' + shape_externalarg: { fg: '#99c794' attr: 'b' } + shape_filepath: '#5fb3b3' + shape_flag: { fg: '#6699cc' attr: 'b' } + shape_float: { fg: '#c594c5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5fb3b3' attr: 'b' } + shape_int: { fg: '#c594c5' attr: 'b' } + shape_internalcall: { fg: '#5fb3b3' attr: 'b' } + shape_list: { fg: '#5fb3b3' attr: 'b' } + shape_literal: '#6699cc' + shape_match_pattern: '#99c794' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5fb3b3' + shape_operator: '#fac863' + shape_or: { fg: '#c594c5' attr: 'b' } + shape_pipe: { fg: '#c594c5' attr: 'b' } + shape_range: { fg: '#fac863' attr: 'b' } + shape_record: { fg: '#5fb3b3' attr: 'b' } + shape_redirection: { fg: '#c594c5' attr: 'b' } + shape_signature: { fg: '#99c794' attr: 'b' } + shape_string: '#99c794' + shape_string_interpolation: { fg: '#5fb3b3' attr: 'b' } + shape_table: { fg: '#6699cc' attr: 'b' } + shape_variable: '#c594c5' + + background: '#1b2b34' + foreground: '#c0c5ce' + cursor: '#c0c5ce' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ollie.nu b/themes/nu-themes/ollie.nu index 2edf930..75cdcb9 100644 --- a/themes/nu-themes/ollie.nu +++ b/themes/nu-themes/ollie.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8a8eac" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#31ac61" attr: "b" } - empty: "#2d57ac" - bool: {|| if $in { "#1ffaff" } else { "light_gray" } } - int: "#8a8eac" - filesize: {|e| - if $e == 0b { - "#8a8eac" - } else if $e < 1mb { - "#1fa6ac" - } else {{ fg: "#2d57ac" }} - } - duration: "#8a8eac" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ac2e31" attr: "b" } - } else if $in < 6hr { - "#ac2e31" - } else if $in < 1day { - "#ac4300" - } else if $in < 3day { - "#31ac61" - } else if $in < 1wk { - { fg: "#31ac61" attr: "b" } - } else if $in < 6wk { - "#1fa6ac" - } else if $in < 52wk { - "#2d57ac" - } else { "dark_gray" } - } - range: "#8a8eac" - float: "#8a8eac" - string: "#8a8eac" - nothing: "#8a8eac" - binary: "#8a8eac" - cellpath: "#8a8eac" - row_index: { fg: "#31ac61" attr: "b" } - record: "#8a8eac" - list: "#8a8eac" - block: "#8a8eac" - hints: "dark_gray" - search_result: { fg: "#ac2e31" bg: "#8a8eac" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b08528" attr: "b" } - shape_binary: { fg: "#b08528" attr: "b" } - shape_block: { fg: "#2d57ac" attr: "b" } - shape_bool: "#1ffaff" - shape_custom: "#31ac61" - shape_datetime: { fg: "#1fa6ac" attr: "b" } - shape_directory: "#1fa6ac" - shape_external: "#1fa6ac" - shape_externalarg: { fg: "#31ac61" attr: "b" } - shape_filepath: "#1fa6ac" - shape_flag: { fg: "#2d57ac" attr: "b" } - shape_float: { fg: "#b08528" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1fa6ac" attr: "b" } - shape_int: { fg: "#b08528" attr: "b" } - shape_internalcall: { fg: "#1fa6ac" attr: "b" } - shape_list: { fg: "#1fa6ac" attr: "b" } - shape_literal: "#2d57ac" - shape_match_pattern: "#31ac61" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1ffaff" - shape_operator: "#ac4300" - shape_or: { fg: "#b08528" attr: "b" } - shape_pipe: { fg: "#b08528" attr: "b" } - shape_range: { fg: "#ac4300" attr: "b" } - shape_record: { fg: "#1fa6ac" attr: "b" } - shape_redirection: { fg: "#b08528" attr: "b" } - shape_signature: { fg: "#31ac61" attr: "b" } - shape_string: "#31ac61" - shape_string_interpolation: { fg: "#1fa6ac" attr: "b" } - shape_table: { fg: "#2d57ac" attr: "b" } - shape_variable: "#b08528" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222125" - foreground: "#8a8dae" - cursor: "#8a8dae" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8a8eac' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#31ac61' attr: 'b' } + empty: '#2d57ac' + bool: {|| if $in { '#1ffaff' } else { 'light_gray' } } + int: '#8a8eac' + filesize: {|e| + if $e == 0b { + '#8a8eac' + } else if $e < 1mb { + '#1fa6ac' + } else {{ fg: '#2d57ac' }} + } + duration: '#8a8eac' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ac2e31' attr: 'b' } + } else if $in < 6hr { + '#ac2e31' + } else if $in < 1day { + '#ac4300' + } else if $in < 3day { + '#31ac61' + } else if $in < 1wk { + { fg: '#31ac61' attr: 'b' } + } else if $in < 6wk { + '#1fa6ac' + } else if $in < 52wk { + '#2d57ac' + } else { 'dark_gray' } + } + range: '#8a8eac' + float: '#8a8eac' + string: '#8a8eac' + nothing: '#8a8eac' + binary: '#8a8eac' + cellpath: '#8a8eac' + row_index: { fg: '#31ac61' attr: 'b' } + record: '#8a8eac' + list: '#8a8eac' + block: '#8a8eac' + hints: 'dark_gray' + search_result: { fg: '#ac2e31' bg: '#8a8eac' } + + shape_and: { fg: '#b08528' attr: 'b' } + shape_binary: { fg: '#b08528' attr: 'b' } + shape_block: { fg: '#2d57ac' attr: 'b' } + shape_bool: '#1ffaff' + shape_custom: '#31ac61' + shape_datetime: { fg: '#1fa6ac' attr: 'b' } + shape_directory: '#1fa6ac' + shape_external: '#1fa6ac' + shape_externalarg: { fg: '#31ac61' attr: 'b' } + shape_filepath: '#1fa6ac' + shape_flag: { fg: '#2d57ac' attr: 'b' } + shape_float: { fg: '#b08528' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1fa6ac' attr: 'b' } + shape_int: { fg: '#b08528' attr: 'b' } + shape_internalcall: { fg: '#1fa6ac' attr: 'b' } + shape_list: { fg: '#1fa6ac' attr: 'b' } + shape_literal: '#2d57ac' + shape_match_pattern: '#31ac61' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1ffaff' + shape_operator: '#ac4300' + shape_or: { fg: '#b08528' attr: 'b' } + shape_pipe: { fg: '#b08528' attr: 'b' } + shape_range: { fg: '#ac4300' attr: 'b' } + shape_record: { fg: '#1fa6ac' attr: 'b' } + shape_redirection: { fg: '#b08528' attr: 'b' } + shape_signature: { fg: '#31ac61' attr: 'b' } + shape_string: '#31ac61' + shape_string_interpolation: { fg: '#1fa6ac' attr: 'b' } + shape_table: { fg: '#2d57ac' attr: 'b' } + shape_variable: '#b08528' + + background: '#222125' + foreground: '#8a8dae' + cursor: '#8a8dae' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/one-dark.nu b/themes/nu-themes/one-dark.nu index d3ce855..4b6fea8 100644 --- a/themes/nu-themes/one-dark.nu +++ b/themes/nu-themes/one-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#abb2bf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98c379" attr: "b" } - empty: "#61afef" - bool: {|| if $in { "#56b6c2" } else { "light_gray" } } - int: "#abb2bf" - filesize: {|e| - if $e == 0b { - "#abb2bf" - } else if $e < 1mb { - "#56b6c2" - } else {{ fg: "#61afef" }} - } - duration: "#abb2bf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e06c75" attr: "b" } - } else if $in < 6hr { - "#e06c75" - } else if $in < 1day { - "#d19a66" - } else if $in < 3day { - "#98c379" - } else if $in < 1wk { - { fg: "#98c379" attr: "b" } - } else if $in < 6wk { - "#56b6c2" - } else if $in < 52wk { - "#61afef" - } else { "dark_gray" } - } - range: "#abb2bf" - float: "#abb2bf" - string: "#abb2bf" - nothing: "#abb2bf" - binary: "#abb2bf" - cellpath: "#abb2bf" - row_index: { fg: "#98c379" attr: "b" } - record: "#abb2bf" - list: "#abb2bf" - block: "#abb2bf" - hints: "dark_gray" - search_result: { fg: "#e06c75" bg: "#abb2bf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c678dd" attr: "b" } - shape_binary: { fg: "#c678dd" attr: "b" } - shape_block: { fg: "#61afef" attr: "b" } - shape_bool: "#56b6c2" - shape_custom: "#98c379" - shape_datetime: { fg: "#56b6c2" attr: "b" } - shape_directory: "#56b6c2" - shape_external: "#56b6c2" - shape_externalarg: { fg: "#98c379" attr: "b" } - shape_filepath: "#56b6c2" - shape_flag: { fg: "#61afef" attr: "b" } - shape_float: { fg: "#c678dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#56b6c2" attr: "b" } - shape_int: { fg: "#c678dd" attr: "b" } - shape_internalcall: { fg: "#56b6c2" attr: "b" } - shape_list: { fg: "#56b6c2" attr: "b" } - shape_literal: "#61afef" - shape_match_pattern: "#98c379" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56b6c2" - shape_operator: "#d19a66" - shape_or: { fg: "#c678dd" attr: "b" } - shape_pipe: { fg: "#c678dd" attr: "b" } - shape_range: { fg: "#d19a66" attr: "b" } - shape_record: { fg: "#56b6c2" attr: "b" } - shape_redirection: { fg: "#c678dd" attr: "b" } - shape_signature: { fg: "#98c379" attr: "b" } - shape_string: "#98c379" - shape_string_interpolation: { fg: "#56b6c2" attr: "b" } - shape_table: { fg: "#61afef" attr: "b" } - shape_variable: "#c678dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e2127" - foreground: "#5c6370" - cursor: "#5c6370" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#abb2bf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98c379' attr: 'b' } + empty: '#61afef' + bool: {|| if $in { '#56b6c2' } else { 'light_gray' } } + int: '#abb2bf' + filesize: {|e| + if $e == 0b { + '#abb2bf' + } else if $e < 1mb { + '#56b6c2' + } else {{ fg: '#61afef' }} + } + duration: '#abb2bf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e06c75' attr: 'b' } + } else if $in < 6hr { + '#e06c75' + } else if $in < 1day { + '#d19a66' + } else if $in < 3day { + '#98c379' + } else if $in < 1wk { + { fg: '#98c379' attr: 'b' } + } else if $in < 6wk { + '#56b6c2' + } else if $in < 52wk { + '#61afef' + } else { 'dark_gray' } + } + range: '#abb2bf' + float: '#abb2bf' + string: '#abb2bf' + nothing: '#abb2bf' + binary: '#abb2bf' + cellpath: '#abb2bf' + row_index: { fg: '#98c379' attr: 'b' } + record: '#abb2bf' + list: '#abb2bf' + block: '#abb2bf' + hints: 'dark_gray' + search_result: { fg: '#e06c75' bg: '#abb2bf' } + + shape_and: { fg: '#c678dd' attr: 'b' } + shape_binary: { fg: '#c678dd' attr: 'b' } + shape_block: { fg: '#61afef' attr: 'b' } + shape_bool: '#56b6c2' + shape_custom: '#98c379' + shape_datetime: { fg: '#56b6c2' attr: 'b' } + shape_directory: '#56b6c2' + shape_external: '#56b6c2' + shape_externalarg: { fg: '#98c379' attr: 'b' } + shape_filepath: '#56b6c2' + shape_flag: { fg: '#61afef' attr: 'b' } + shape_float: { fg: '#c678dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#56b6c2' attr: 'b' } + shape_int: { fg: '#c678dd' attr: 'b' } + shape_internalcall: { fg: '#56b6c2' attr: 'b' } + shape_list: { fg: '#56b6c2' attr: 'b' } + shape_literal: '#61afef' + shape_match_pattern: '#98c379' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56b6c2' + shape_operator: '#d19a66' + shape_or: { fg: '#c678dd' attr: 'b' } + shape_pipe: { fg: '#c678dd' attr: 'b' } + shape_range: { fg: '#d19a66' attr: 'b' } + shape_record: { fg: '#56b6c2' attr: 'b' } + shape_redirection: { fg: '#c678dd' attr: 'b' } + shape_signature: { fg: '#98c379' attr: 'b' } + shape_string: '#98c379' + shape_string_interpolation: { fg: '#56b6c2' attr: 'b' } + shape_table: { fg: '#61afef' attr: 'b' } + shape_variable: '#c678dd' + + background: '#1e2127' + foreground: '#5c6370' + cursor: '#5c6370' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/one-half-black.nu b/themes/nu-themes/one-half-black.nu index f133090..96871c7 100644 --- a/themes/nu-themes/one-half-black.nu +++ b/themes/nu-themes/one-half-black.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dcdfe4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98c379" attr: "b" } - empty: "#61afef" - bool: {|| if $in { "#56b6c2" } else { "light_gray" } } - int: "#dcdfe4" - filesize: {|e| - if $e == 0b { - "#dcdfe4" - } else if $e < 1mb { - "#56b6c2" - } else {{ fg: "#61afef" }} - } - duration: "#dcdfe4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e06c75" attr: "b" } - } else if $in < 6hr { - "#e06c75" - } else if $in < 1day { - "#e5c07b" - } else if $in < 3day { - "#98c379" - } else if $in < 1wk { - { fg: "#98c379" attr: "b" } - } else if $in < 6wk { - "#56b6c2" - } else if $in < 52wk { - "#61afef" - } else { "dark_gray" } - } - range: "#dcdfe4" - float: "#dcdfe4" - string: "#dcdfe4" - nothing: "#dcdfe4" - binary: "#dcdfe4" - cellpath: "#dcdfe4" - row_index: { fg: "#98c379" attr: "b" } - record: "#dcdfe4" - list: "#dcdfe4" - block: "#dcdfe4" - hints: "dark_gray" - search_result: { fg: "#e06c75" bg: "#dcdfe4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c678dd" attr: "b" } - shape_binary: { fg: "#c678dd" attr: "b" } - shape_block: { fg: "#61afef" attr: "b" } - shape_bool: "#56b6c2" - shape_custom: "#98c379" - shape_datetime: { fg: "#56b6c2" attr: "b" } - shape_directory: "#56b6c2" - shape_external: "#56b6c2" - shape_externalarg: { fg: "#98c379" attr: "b" } - shape_filepath: "#56b6c2" - shape_flag: { fg: "#61afef" attr: "b" } - shape_float: { fg: "#c678dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#56b6c2" attr: "b" } - shape_int: { fg: "#c678dd" attr: "b" } - shape_internalcall: { fg: "#56b6c2" attr: "b" } - shape_list: { fg: "#56b6c2" attr: "b" } - shape_literal: "#61afef" - shape_match_pattern: "#98c379" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56b6c2" - shape_operator: "#e5c07b" - shape_or: { fg: "#c678dd" attr: "b" } - shape_pipe: { fg: "#c678dd" attr: "b" } - shape_range: { fg: "#e5c07b" attr: "b" } - shape_record: { fg: "#56b6c2" attr: "b" } - shape_redirection: { fg: "#c678dd" attr: "b" } - shape_signature: { fg: "#98c379" attr: "b" } - shape_string: "#98c379" - shape_string_interpolation: { fg: "#56b6c2" attr: "b" } - shape_table: { fg: "#61afef" attr: "b" } - shape_variable: "#c678dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#dcdfe4" - cursor: "#dcdfe4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dcdfe4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98c379' attr: 'b' } + empty: '#61afef' + bool: {|| if $in { '#56b6c2' } else { 'light_gray' } } + int: '#dcdfe4' + filesize: {|e| + if $e == 0b { + '#dcdfe4' + } else if $e < 1mb { + '#56b6c2' + } else {{ fg: '#61afef' }} + } + duration: '#dcdfe4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e06c75' attr: 'b' } + } else if $in < 6hr { + '#e06c75' + } else if $in < 1day { + '#e5c07b' + } else if $in < 3day { + '#98c379' + } else if $in < 1wk { + { fg: '#98c379' attr: 'b' } + } else if $in < 6wk { + '#56b6c2' + } else if $in < 52wk { + '#61afef' + } else { 'dark_gray' } + } + range: '#dcdfe4' + float: '#dcdfe4' + string: '#dcdfe4' + nothing: '#dcdfe4' + binary: '#dcdfe4' + cellpath: '#dcdfe4' + row_index: { fg: '#98c379' attr: 'b' } + record: '#dcdfe4' + list: '#dcdfe4' + block: '#dcdfe4' + hints: 'dark_gray' + search_result: { fg: '#e06c75' bg: '#dcdfe4' } + + shape_and: { fg: '#c678dd' attr: 'b' } + shape_binary: { fg: '#c678dd' attr: 'b' } + shape_block: { fg: '#61afef' attr: 'b' } + shape_bool: '#56b6c2' + shape_custom: '#98c379' + shape_datetime: { fg: '#56b6c2' attr: 'b' } + shape_directory: '#56b6c2' + shape_external: '#56b6c2' + shape_externalarg: { fg: '#98c379' attr: 'b' } + shape_filepath: '#56b6c2' + shape_flag: { fg: '#61afef' attr: 'b' } + shape_float: { fg: '#c678dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#56b6c2' attr: 'b' } + shape_int: { fg: '#c678dd' attr: 'b' } + shape_internalcall: { fg: '#56b6c2' attr: 'b' } + shape_list: { fg: '#56b6c2' attr: 'b' } + shape_literal: '#61afef' + shape_match_pattern: '#98c379' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56b6c2' + shape_operator: '#e5c07b' + shape_or: { fg: '#c678dd' attr: 'b' } + shape_pipe: { fg: '#c678dd' attr: 'b' } + shape_range: { fg: '#e5c07b' attr: 'b' } + shape_record: { fg: '#56b6c2' attr: 'b' } + shape_redirection: { fg: '#c678dd' attr: 'b' } + shape_signature: { fg: '#98c379' attr: 'b' } + shape_string: '#98c379' + shape_string_interpolation: { fg: '#56b6c2' attr: 'b' } + shape_table: { fg: '#61afef' attr: 'b' } + shape_variable: '#c678dd' + + background: '#000000' + foreground: '#dcdfe4' + cursor: '#dcdfe4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/one-half-light.nu b/themes/nu-themes/one-half-light.nu index e5683c5..03102d0 100644 --- a/themes/nu-themes/one-half-light.nu +++ b/themes/nu-themes/one-half-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fafafa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#40a14f" attr: "b" } - empty: "#0184bc" - bool: {|| if $in { "#0997b3" } else { "light_gray" } } - int: "#fafafa" - filesize: {|e| - if $e == 0b { - "#fafafa" - } else if $e < 1mb { - "#0997b3" - } else {{ fg: "#0184bc" }} - } - duration: "#fafafa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e45649" attr: "b" } - } else if $in < 6hr { - "#e45649" - } else if $in < 1day { - "#c18401" - } else if $in < 3day { - "#40a14f" - } else if $in < 1wk { - { fg: "#40a14f" attr: "b" } - } else if $in < 6wk { - "#0997b3" - } else if $in < 52wk { - "#0184bc" - } else { "dark_gray" } - } - range: "#fafafa" - float: "#fafafa" - string: "#fafafa" - nothing: "#fafafa" - binary: "#fafafa" - cellpath: "#fafafa" - row_index: { fg: "#40a14f" attr: "b" } - record: "#fafafa" - list: "#fafafa" - block: "#fafafa" - hints: "dark_gray" - search_result: { fg: "#e45649" bg: "#fafafa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a626a4" attr: "b" } - shape_binary: { fg: "#a626a4" attr: "b" } - shape_block: { fg: "#0184bc" attr: "b" } - shape_bool: "#0997b3" - shape_custom: "#40a14f" - shape_datetime: { fg: "#0997b3" attr: "b" } - shape_directory: "#0997b3" - shape_external: "#0997b3" - shape_externalarg: { fg: "#40a14f" attr: "b" } - shape_filepath: "#0997b3" - shape_flag: { fg: "#0184bc" attr: "b" } - shape_float: { fg: "#a626a4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0997b3" attr: "b" } - shape_int: { fg: "#a626a4" attr: "b" } - shape_internalcall: { fg: "#0997b3" attr: "b" } - shape_list: { fg: "#0997b3" attr: "b" } - shape_literal: "#0184bc" - shape_match_pattern: "#40a14f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0997b3" - shape_operator: "#c18401" - shape_or: { fg: "#a626a4" attr: "b" } - shape_pipe: { fg: "#a626a4" attr: "b" } - shape_range: { fg: "#c18401" attr: "b" } - shape_record: { fg: "#0997b3" attr: "b" } - shape_redirection: { fg: "#a626a4" attr: "b" } - shape_signature: { fg: "#40a14f" attr: "b" } - shape_string: "#40a14f" - shape_string_interpolation: { fg: "#0997b3" attr: "b" } - shape_table: { fg: "#0184bc" attr: "b" } - shape_variable: "#a626a4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fafafa" - foreground: "#383a42" - cursor: "#383a42" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fafafa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#40a14f' attr: 'b' } + empty: '#0184bc' + bool: {|| if $in { '#0997b3' } else { 'light_gray' } } + int: '#fafafa' + filesize: {|e| + if $e == 0b { + '#fafafa' + } else if $e < 1mb { + '#0997b3' + } else {{ fg: '#0184bc' }} + } + duration: '#fafafa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e45649' attr: 'b' } + } else if $in < 6hr { + '#e45649' + } else if $in < 1day { + '#c18401' + } else if $in < 3day { + '#40a14f' + } else if $in < 1wk { + { fg: '#40a14f' attr: 'b' } + } else if $in < 6wk { + '#0997b3' + } else if $in < 52wk { + '#0184bc' + } else { 'dark_gray' } + } + range: '#fafafa' + float: '#fafafa' + string: '#fafafa' + nothing: '#fafafa' + binary: '#fafafa' + cellpath: '#fafafa' + row_index: { fg: '#40a14f' attr: 'b' } + record: '#fafafa' + list: '#fafafa' + block: '#fafafa' + hints: 'dark_gray' + search_result: { fg: '#e45649' bg: '#fafafa' } + + shape_and: { fg: '#a626a4' attr: 'b' } + shape_binary: { fg: '#a626a4' attr: 'b' } + shape_block: { fg: '#0184bc' attr: 'b' } + shape_bool: '#0997b3' + shape_custom: '#40a14f' + shape_datetime: { fg: '#0997b3' attr: 'b' } + shape_directory: '#0997b3' + shape_external: '#0997b3' + shape_externalarg: { fg: '#40a14f' attr: 'b' } + shape_filepath: '#0997b3' + shape_flag: { fg: '#0184bc' attr: 'b' } + shape_float: { fg: '#a626a4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0997b3' attr: 'b' } + shape_int: { fg: '#a626a4' attr: 'b' } + shape_internalcall: { fg: '#0997b3' attr: 'b' } + shape_list: { fg: '#0997b3' attr: 'b' } + shape_literal: '#0184bc' + shape_match_pattern: '#40a14f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0997b3' + shape_operator: '#c18401' + shape_or: { fg: '#a626a4' attr: 'b' } + shape_pipe: { fg: '#a626a4' attr: 'b' } + shape_range: { fg: '#c18401' attr: 'b' } + shape_record: { fg: '#0997b3' attr: 'b' } + shape_redirection: { fg: '#a626a4' attr: 'b' } + shape_signature: { fg: '#40a14f' attr: 'b' } + shape_string: '#40a14f' + shape_string_interpolation: { fg: '#0997b3' attr: 'b' } + shape_table: { fg: '#0184bc' attr: 'b' } + shape_variable: '#a626a4' + + background: '#fafafa' + foreground: '#383a42' + cursor: '#383a42' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/one-light.nu b/themes/nu-themes/one-light.nu index 1961518..c0d292d 100644 --- a/themes/nu-themes/one-light.nu +++ b/themes/nu-themes/one-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#383a42" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#50a14f" attr: "b" } - empty: "#4078f2" - bool: {|| if $in { "#0184bc" } else { "light_gray" } } - int: "#383a42" - filesize: {|e| - if $e == 0b { - "#383a42" - } else if $e < 1mb { - "#0184bc" - } else {{ fg: "#4078f2" }} - } - duration: "#383a42" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ca1243" attr: "b" } - } else if $in < 6hr { - "#ca1243" - } else if $in < 1day { - "#c18401" - } else if $in < 3day { - "#50a14f" - } else if $in < 1wk { - { fg: "#50a14f" attr: "b" } - } else if $in < 6wk { - "#0184bc" - } else if $in < 52wk { - "#4078f2" - } else { "dark_gray" } - } - range: "#383a42" - float: "#383a42" - string: "#383a42" - nothing: "#383a42" - binary: "#383a42" - cellpath: "#383a42" - row_index: { fg: "#50a14f" attr: "b" } - record: "#383a42" - list: "#383a42" - block: "#383a42" - hints: "dark_gray" - search_result: { fg: "#ca1243" bg: "#383a42" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a626a4" attr: "b" } - shape_binary: { fg: "#a626a4" attr: "b" } - shape_block: { fg: "#4078f2" attr: "b" } - shape_bool: "#0184bc" - shape_custom: "#50a14f" - shape_datetime: { fg: "#0184bc" attr: "b" } - shape_directory: "#0184bc" - shape_external: "#0184bc" - shape_externalarg: { fg: "#50a14f" attr: "b" } - shape_filepath: "#0184bc" - shape_flag: { fg: "#4078f2" attr: "b" } - shape_float: { fg: "#a626a4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0184bc" attr: "b" } - shape_int: { fg: "#a626a4" attr: "b" } - shape_internalcall: { fg: "#0184bc" attr: "b" } - shape_list: { fg: "#0184bc" attr: "b" } - shape_literal: "#4078f2" - shape_match_pattern: "#50a14f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0184bc" - shape_operator: "#c18401" - shape_or: { fg: "#a626a4" attr: "b" } - shape_pipe: { fg: "#a626a4" attr: "b" } - shape_range: { fg: "#c18401" attr: "b" } - shape_record: { fg: "#0184bc" attr: "b" } - shape_redirection: { fg: "#a626a4" attr: "b" } - shape_signature: { fg: "#50a14f" attr: "b" } - shape_string: "#50a14f" - shape_string_interpolation: { fg: "#0184bc" attr: "b" } - shape_table: { fg: "#4078f2" attr: "b" } - shape_variable: "#a626a4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fafafa" - foreground: "#383a42" - cursor: "#383a42" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#383a42' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#50a14f' attr: 'b' } + empty: '#4078f2' + bool: {|| if $in { '#0184bc' } else { 'light_gray' } } + int: '#383a42' + filesize: {|e| + if $e == 0b { + '#383a42' + } else if $e < 1mb { + '#0184bc' + } else {{ fg: '#4078f2' }} + } + duration: '#383a42' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ca1243' attr: 'b' } + } else if $in < 6hr { + '#ca1243' + } else if $in < 1day { + '#c18401' + } else if $in < 3day { + '#50a14f' + } else if $in < 1wk { + { fg: '#50a14f' attr: 'b' } + } else if $in < 6wk { + '#0184bc' + } else if $in < 52wk { + '#4078f2' + } else { 'dark_gray' } + } + range: '#383a42' + float: '#383a42' + string: '#383a42' + nothing: '#383a42' + binary: '#383a42' + cellpath: '#383a42' + row_index: { fg: '#50a14f' attr: 'b' } + record: '#383a42' + list: '#383a42' + block: '#383a42' + hints: 'dark_gray' + search_result: { fg: '#ca1243' bg: '#383a42' } + + shape_and: { fg: '#a626a4' attr: 'b' } + shape_binary: { fg: '#a626a4' attr: 'b' } + shape_block: { fg: '#4078f2' attr: 'b' } + shape_bool: '#0184bc' + shape_custom: '#50a14f' + shape_datetime: { fg: '#0184bc' attr: 'b' } + shape_directory: '#0184bc' + shape_external: '#0184bc' + shape_externalarg: { fg: '#50a14f' attr: 'b' } + shape_filepath: '#0184bc' + shape_flag: { fg: '#4078f2' attr: 'b' } + shape_float: { fg: '#a626a4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0184bc' attr: 'b' } + shape_int: { fg: '#a626a4' attr: 'b' } + shape_internalcall: { fg: '#0184bc' attr: 'b' } + shape_list: { fg: '#0184bc' attr: 'b' } + shape_literal: '#4078f2' + shape_match_pattern: '#50a14f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0184bc' + shape_operator: '#c18401' + shape_or: { fg: '#a626a4' attr: 'b' } + shape_pipe: { fg: '#a626a4' attr: 'b' } + shape_range: { fg: '#c18401' attr: 'b' } + shape_record: { fg: '#0184bc' attr: 'b' } + shape_redirection: { fg: '#a626a4' attr: 'b' } + shape_signature: { fg: '#50a14f' attr: 'b' } + shape_string: '#50a14f' + shape_string_interpolation: { fg: '#0184bc' attr: 'b' } + shape_table: { fg: '#4078f2' attr: 'b' } + shape_variable: '#a626a4' + + background: '#fafafa' + foreground: '#383a42' + cursor: '#383a42' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/onedark.nu b/themes/nu-themes/onedark.nu index 9064b70..98d3042 100644 --- a/themes/nu-themes/onedark.nu +++ b/themes/nu-themes/onedark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#abb2bf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98c379" attr: "b" } - empty: "#61afef" - bool: {|| if $in { "#56b6c2" } else { "light_gray" } } - int: "#abb2bf" - filesize: {|e| - if $e == 0b { - "#abb2bf" - } else if $e < 1mb { - "#56b6c2" - } else {{ fg: "#61afef" }} - } - duration: "#abb2bf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e06c75" attr: "b" } - } else if $in < 6hr { - "#e06c75" - } else if $in < 1day { - "#e5c07b" - } else if $in < 3day { - "#98c379" - } else if $in < 1wk { - { fg: "#98c379" attr: "b" } - } else if $in < 6wk { - "#56b6c2" - } else if $in < 52wk { - "#61afef" - } else { "dark_gray" } - } - range: "#abb2bf" - float: "#abb2bf" - string: "#abb2bf" - nothing: "#abb2bf" - binary: "#abb2bf" - cellpath: "#abb2bf" - row_index: { fg: "#98c379" attr: "b" } - record: "#abb2bf" - list: "#abb2bf" - block: "#abb2bf" - hints: "dark_gray" - search_result: { fg: "#e06c75" bg: "#abb2bf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c678dd" attr: "b" } - shape_binary: { fg: "#c678dd" attr: "b" } - shape_block: { fg: "#61afef" attr: "b" } - shape_bool: "#56b6c2" - shape_custom: "#98c379" - shape_datetime: { fg: "#56b6c2" attr: "b" } - shape_directory: "#56b6c2" - shape_external: "#56b6c2" - shape_externalarg: { fg: "#98c379" attr: "b" } - shape_filepath: "#56b6c2" - shape_flag: { fg: "#61afef" attr: "b" } - shape_float: { fg: "#c678dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#56b6c2" attr: "b" } - shape_int: { fg: "#c678dd" attr: "b" } - shape_internalcall: { fg: "#56b6c2" attr: "b" } - shape_list: { fg: "#56b6c2" attr: "b" } - shape_literal: "#61afef" - shape_match_pattern: "#98c379" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56b6c2" - shape_operator: "#e5c07b" - shape_or: { fg: "#c678dd" attr: "b" } - shape_pipe: { fg: "#c678dd" attr: "b" } - shape_range: { fg: "#e5c07b" attr: "b" } - shape_record: { fg: "#56b6c2" attr: "b" } - shape_redirection: { fg: "#c678dd" attr: "b" } - shape_signature: { fg: "#98c379" attr: "b" } - shape_string: "#98c379" - shape_string_interpolation: { fg: "#56b6c2" attr: "b" } - shape_table: { fg: "#61afef" attr: "b" } - shape_variable: "#c678dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282c34" - foreground: "#abb2bf" - cursor: "#abb2bf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#abb2bf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98c379' attr: 'b' } + empty: '#61afef' + bool: {|| if $in { '#56b6c2' } else { 'light_gray' } } + int: '#abb2bf' + filesize: {|e| + if $e == 0b { + '#abb2bf' + } else if $e < 1mb { + '#56b6c2' + } else {{ fg: '#61afef' }} + } + duration: '#abb2bf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e06c75' attr: 'b' } + } else if $in < 6hr { + '#e06c75' + } else if $in < 1day { + '#e5c07b' + } else if $in < 3day { + '#98c379' + } else if $in < 1wk { + { fg: '#98c379' attr: 'b' } + } else if $in < 6wk { + '#56b6c2' + } else if $in < 52wk { + '#61afef' + } else { 'dark_gray' } + } + range: '#abb2bf' + float: '#abb2bf' + string: '#abb2bf' + nothing: '#abb2bf' + binary: '#abb2bf' + cellpath: '#abb2bf' + row_index: { fg: '#98c379' attr: 'b' } + record: '#abb2bf' + list: '#abb2bf' + block: '#abb2bf' + hints: 'dark_gray' + search_result: { fg: '#e06c75' bg: '#abb2bf' } + + shape_and: { fg: '#c678dd' attr: 'b' } + shape_binary: { fg: '#c678dd' attr: 'b' } + shape_block: { fg: '#61afef' attr: 'b' } + shape_bool: '#56b6c2' + shape_custom: '#98c379' + shape_datetime: { fg: '#56b6c2' attr: 'b' } + shape_directory: '#56b6c2' + shape_external: '#56b6c2' + shape_externalarg: { fg: '#98c379' attr: 'b' } + shape_filepath: '#56b6c2' + shape_flag: { fg: '#61afef' attr: 'b' } + shape_float: { fg: '#c678dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#56b6c2' attr: 'b' } + shape_int: { fg: '#c678dd' attr: 'b' } + shape_internalcall: { fg: '#56b6c2' attr: 'b' } + shape_list: { fg: '#56b6c2' attr: 'b' } + shape_literal: '#61afef' + shape_match_pattern: '#98c379' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56b6c2' + shape_operator: '#e5c07b' + shape_or: { fg: '#c678dd' attr: 'b' } + shape_pipe: { fg: '#c678dd' attr: 'b' } + shape_range: { fg: '#e5c07b' attr: 'b' } + shape_record: { fg: '#56b6c2' attr: 'b' } + shape_redirection: { fg: '#c678dd' attr: 'b' } + shape_signature: { fg: '#98c379' attr: 'b' } + shape_string: '#98c379' + shape_string_interpolation: { fg: '#56b6c2' attr: 'b' } + shape_table: { fg: '#61afef' attr: 'b' } + shape_variable: '#c678dd' + + background: '#282c34' + foreground: '#abb2bf' + cursor: '#abb2bf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/orbital.nu b/themes/nu-themes/orbital.nu index 101e139..76a8fd7 100644 --- a/themes/nu-themes/orbital.nu +++ b/themes/nu-themes/orbital.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#0000d7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#bcbcbc" attr: "b" } - empty: "#5f87d7" - bool: {|| if $in { "#005faf" } else { "light_gray" } } - int: "#0000d7" - filesize: {|e| - if $e == 0b { - "#0000d7" - } else if $e < 1mb { - "#0087d7" - } else {{ fg: "#5f87d7" }} - } - duration: "#0000d7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#5f5f5f" attr: "b" } - } else if $in < 6hr { - "#5f5f5f" - } else if $in < 1day { - "#d7af87" - } else if $in < 3day { - "#bcbcbc" - } else if $in < 1wk { - { fg: "#bcbcbc" attr: "b" } - } else if $in < 6wk { - "#0087d7" - } else if $in < 52wk { - "#5f87d7" - } else { "dark_gray" } - } - range: "#0000d7" - float: "#0000d7" - string: "#0000d7" - nothing: "#0000d7" - binary: "#0000d7" - cellpath: "#0000d7" - row_index: { fg: "#bcbcbc" attr: "b" } - record: "#0000d7" - list: "#0000d7" - block: "#0000d7" - hints: "dark_gray" - search_result: { fg: "#5f5f5f" bg: "#0000d7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#87afd7" attr: "b" } - shape_binary: { fg: "#87afd7" attr: "b" } - shape_block: { fg: "#5f87d7" attr: "b" } - shape_bool: "#005faf" - shape_custom: "#bcbcbc" - shape_datetime: { fg: "#0087d7" attr: "b" } - shape_directory: "#0087d7" - shape_external: "#0087d7" - shape_externalarg: { fg: "#bcbcbc" attr: "b" } - shape_filepath: "#0087d7" - shape_flag: { fg: "#5f87d7" attr: "b" } - shape_float: { fg: "#87afd7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0087d7" attr: "b" } - shape_int: { fg: "#87afd7" attr: "b" } - shape_internalcall: { fg: "#0087d7" attr: "b" } - shape_list: { fg: "#0087d7" attr: "b" } - shape_literal: "#5f87d7" - shape_match_pattern: "#bcbcbc" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#005faf" - shape_operator: "#d7af87" - shape_or: { fg: "#87afd7" attr: "b" } - shape_pipe: { fg: "#87afd7" attr: "b" } - shape_range: { fg: "#d7af87" attr: "b" } - shape_record: { fg: "#0087d7" attr: "b" } - shape_redirection: { fg: "#87afd7" attr: "b" } - shape_signature: { fg: "#bcbcbc" attr: "b" } - shape_string: "#bcbcbc" - shape_string_interpolation: { fg: "#0087d7" attr: "b" } - shape_table: { fg: "#5f87d7" attr: "b" } - shape_variable: "#87afd7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#e4e4e4" - cursor: "#5fafff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#0000d7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#bcbcbc' attr: 'b' } + empty: '#5f87d7' + bool: {|| if $in { '#005faf' } else { 'light_gray' } } + int: '#0000d7' + filesize: {|e| + if $e == 0b { + '#0000d7' + } else if $e < 1mb { + '#0087d7' + } else {{ fg: '#5f87d7' }} + } + duration: '#0000d7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#5f5f5f' attr: 'b' } + } else if $in < 6hr { + '#5f5f5f' + } else if $in < 1day { + '#d7af87' + } else if $in < 3day { + '#bcbcbc' + } else if $in < 1wk { + { fg: '#bcbcbc' attr: 'b' } + } else if $in < 6wk { + '#0087d7' + } else if $in < 52wk { + '#5f87d7' + } else { 'dark_gray' } + } + range: '#0000d7' + float: '#0000d7' + string: '#0000d7' + nothing: '#0000d7' + binary: '#0000d7' + cellpath: '#0000d7' + row_index: { fg: '#bcbcbc' attr: 'b' } + record: '#0000d7' + list: '#0000d7' + block: '#0000d7' + hints: 'dark_gray' + search_result: { fg: '#5f5f5f' bg: '#0000d7' } + + shape_and: { fg: '#87afd7' attr: 'b' } + shape_binary: { fg: '#87afd7' attr: 'b' } + shape_block: { fg: '#5f87d7' attr: 'b' } + shape_bool: '#005faf' + shape_custom: '#bcbcbc' + shape_datetime: { fg: '#0087d7' attr: 'b' } + shape_directory: '#0087d7' + shape_external: '#0087d7' + shape_externalarg: { fg: '#bcbcbc' attr: 'b' } + shape_filepath: '#0087d7' + shape_flag: { fg: '#5f87d7' attr: 'b' } + shape_float: { fg: '#87afd7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0087d7' attr: 'b' } + shape_int: { fg: '#87afd7' attr: 'b' } + shape_internalcall: { fg: '#0087d7' attr: 'b' } + shape_list: { fg: '#0087d7' attr: 'b' } + shape_literal: '#5f87d7' + shape_match_pattern: '#bcbcbc' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#005faf' + shape_operator: '#d7af87' + shape_or: { fg: '#87afd7' attr: 'b' } + shape_pipe: { fg: '#87afd7' attr: 'b' } + shape_range: { fg: '#d7af87' attr: 'b' } + shape_record: { fg: '#0087d7' attr: 'b' } + shape_redirection: { fg: '#87afd7' attr: 'b' } + shape_signature: { fg: '#bcbcbc' attr: 'b' } + shape_string: '#bcbcbc' + shape_string_interpolation: { fg: '#0087d7' attr: 'b' } + shape_table: { fg: '#5f87d7' attr: 'b' } + shape_variable: '#87afd7' + + background: '#000000' + foreground: '#e4e4e4' + cursor: '#5fafff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/outrun-dark.nu b/themes/nu-themes/outrun-dark.nu index e8e442d..973c3e9 100644 --- a/themes/nu-themes/outrun-dark.nu +++ b/themes/nu-themes/outrun-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0fa" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#59f176" attr: "b" } - empty: "#66b0ff" - bool: {|| if $in { "#0ef0f0" } else { "light_gray" } } - int: "#d0d0fa" - filesize: {|e| - if $e == 0b { - "#d0d0fa" - } else if $e < 1mb { - "#0ef0f0" - } else {{ fg: "#66b0ff" }} - } - duration: "#d0d0fa" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff4242" attr: "b" } - } else if $in < 6hr { - "#ff4242" - } else if $in < 1day { - "#f3e877" - } else if $in < 3day { - "#59f176" - } else if $in < 1wk { - { fg: "#59f176" attr: "b" } - } else if $in < 6wk { - "#0ef0f0" - } else if $in < 52wk { - "#66b0ff" - } else { "dark_gray" } - } - range: "#d0d0fa" - float: "#d0d0fa" - string: "#d0d0fa" - nothing: "#d0d0fa" - binary: "#d0d0fa" - cellpath: "#d0d0fa" - row_index: { fg: "#59f176" attr: "b" } - record: "#d0d0fa" - list: "#d0d0fa" - block: "#d0d0fa" - hints: "dark_gray" - search_result: { fg: "#ff4242" bg: "#d0d0fa" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f10596" attr: "b" } - shape_binary: { fg: "#f10596" attr: "b" } - shape_block: { fg: "#66b0ff" attr: "b" } - shape_bool: "#0ef0f0" - shape_custom: "#59f176" - shape_datetime: { fg: "#0ef0f0" attr: "b" } - shape_directory: "#0ef0f0" - shape_external: "#0ef0f0" - shape_externalarg: { fg: "#59f176" attr: "b" } - shape_filepath: "#0ef0f0" - shape_flag: { fg: "#66b0ff" attr: "b" } - shape_float: { fg: "#f10596" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0ef0f0" attr: "b" } - shape_int: { fg: "#f10596" attr: "b" } - shape_internalcall: { fg: "#0ef0f0" attr: "b" } - shape_list: { fg: "#0ef0f0" attr: "b" } - shape_literal: "#66b0ff" - shape_match_pattern: "#59f176" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#0ef0f0" - shape_operator: "#f3e877" - shape_or: { fg: "#f10596" attr: "b" } - shape_pipe: { fg: "#f10596" attr: "b" } - shape_range: { fg: "#f3e877" attr: "b" } - shape_record: { fg: "#0ef0f0" attr: "b" } - shape_redirection: { fg: "#f10596" attr: "b" } - shape_signature: { fg: "#59f176" attr: "b" } - shape_string: "#59f176" - shape_string_interpolation: { fg: "#0ef0f0" attr: "b" } - shape_table: { fg: "#66b0ff" attr: "b" } - shape_variable: "#f10596" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#00002a" - foreground: "#d0d0fa" - cursor: "#d0d0fa" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0fa' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#59f176' attr: 'b' } + empty: '#66b0ff' + bool: {|| if $in { '#0ef0f0' } else { 'light_gray' } } + int: '#d0d0fa' + filesize: {|e| + if $e == 0b { + '#d0d0fa' + } else if $e < 1mb { + '#0ef0f0' + } else {{ fg: '#66b0ff' }} + } + duration: '#d0d0fa' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff4242' attr: 'b' } + } else if $in < 6hr { + '#ff4242' + } else if $in < 1day { + '#f3e877' + } else if $in < 3day { + '#59f176' + } else if $in < 1wk { + { fg: '#59f176' attr: 'b' } + } else if $in < 6wk { + '#0ef0f0' + } else if $in < 52wk { + '#66b0ff' + } else { 'dark_gray' } + } + range: '#d0d0fa' + float: '#d0d0fa' + string: '#d0d0fa' + nothing: '#d0d0fa' + binary: '#d0d0fa' + cellpath: '#d0d0fa' + row_index: { fg: '#59f176' attr: 'b' } + record: '#d0d0fa' + list: '#d0d0fa' + block: '#d0d0fa' + hints: 'dark_gray' + search_result: { fg: '#ff4242' bg: '#d0d0fa' } + + shape_and: { fg: '#f10596' attr: 'b' } + shape_binary: { fg: '#f10596' attr: 'b' } + shape_block: { fg: '#66b0ff' attr: 'b' } + shape_bool: '#0ef0f0' + shape_custom: '#59f176' + shape_datetime: { fg: '#0ef0f0' attr: 'b' } + shape_directory: '#0ef0f0' + shape_external: '#0ef0f0' + shape_externalarg: { fg: '#59f176' attr: 'b' } + shape_filepath: '#0ef0f0' + shape_flag: { fg: '#66b0ff' attr: 'b' } + shape_float: { fg: '#f10596' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0ef0f0' attr: 'b' } + shape_int: { fg: '#f10596' attr: 'b' } + shape_internalcall: { fg: '#0ef0f0' attr: 'b' } + shape_list: { fg: '#0ef0f0' attr: 'b' } + shape_literal: '#66b0ff' + shape_match_pattern: '#59f176' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#0ef0f0' + shape_operator: '#f3e877' + shape_or: { fg: '#f10596' attr: 'b' } + shape_pipe: { fg: '#f10596' attr: 'b' } + shape_range: { fg: '#f3e877' attr: 'b' } + shape_record: { fg: '#0ef0f0' attr: 'b' } + shape_redirection: { fg: '#f10596' attr: 'b' } + shape_signature: { fg: '#59f176' attr: 'b' } + shape_string: '#59f176' + shape_string_interpolation: { fg: '#0ef0f0' attr: 'b' } + shape_table: { fg: '#66b0ff' attr: 'b' } + shape_variable: '#f10596' + + background: '#00002a' + foreground: '#d0d0fa' + cursor: '#d0d0fa' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pali.nu b/themes/nu-themes/pali.nu index 841bd6c..553dd6f 100644 --- a/themes/nu-themes/pali.nu +++ b/themes/nu-themes/pali.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#74ab8f" attr: "b" } - empty: "#8f74ab" - bool: {|| if $in { "#4bb8fd" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#748fab" - } else {{ fg: "#8f74ab" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ab8f74" attr: "b" } - } else if $in < 6hr { - "#ab8f74" - } else if $in < 1day { - "#8fab74" - } else if $in < 3day { - "#74ab8f" - } else if $in < 1wk { - { fg: "#74ab8f" attr: "b" } - } else if $in < 6wk { - "#748fab" - } else if $in < 52wk { - "#8f74ab" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#74ab8f" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#ab8f74" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ab748f" attr: "b" } - shape_binary: { fg: "#ab748f" attr: "b" } - shape_block: { fg: "#8f74ab" attr: "b" } - shape_bool: "#4bb8fd" - shape_custom: "#74ab8f" - shape_datetime: { fg: "#748fab" attr: "b" } - shape_directory: "#748fab" - shape_external: "#748fab" - shape_externalarg: { fg: "#74ab8f" attr: "b" } - shape_filepath: "#748fab" - shape_flag: { fg: "#8f74ab" attr: "b" } - shape_float: { fg: "#ab748f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#748fab" attr: "b" } - shape_int: { fg: "#ab748f" attr: "b" } - shape_internalcall: { fg: "#748fab" attr: "b" } - shape_list: { fg: "#748fab" attr: "b" } - shape_literal: "#8f74ab" - shape_match_pattern: "#74ab8f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4bb8fd" - shape_operator: "#8fab74" - shape_or: { fg: "#ab748f" attr: "b" } - shape_pipe: { fg: "#ab748f" attr: "b" } - shape_range: { fg: "#8fab74" attr: "b" } - shape_record: { fg: "#748fab" attr: "b" } - shape_redirection: { fg: "#ab748f" attr: "b" } - shape_signature: { fg: "#74ab8f" attr: "b" } - shape_string: "#74ab8f" - shape_string_interpolation: { fg: "#748fab" attr: "b" } - shape_table: { fg: "#8f74ab" attr: "b" } - shape_variable: "#ab748f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232e37" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#74ab8f' attr: 'b' } + empty: '#8f74ab' + bool: {|| if $in { '#4bb8fd' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#748fab' + } else {{ fg: '#8f74ab' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ab8f74' attr: 'b' } + } else if $in < 6hr { + '#ab8f74' + } else if $in < 1day { + '#8fab74' + } else if $in < 3day { + '#74ab8f' + } else if $in < 1wk { + { fg: '#74ab8f' attr: 'b' } + } else if $in < 6wk { + '#748fab' + } else if $in < 52wk { + '#8f74ab' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#74ab8f' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#ab8f74' bg: '#f2f2f2' } + + shape_and: { fg: '#ab748f' attr: 'b' } + shape_binary: { fg: '#ab748f' attr: 'b' } + shape_block: { fg: '#8f74ab' attr: 'b' } + shape_bool: '#4bb8fd' + shape_custom: '#74ab8f' + shape_datetime: { fg: '#748fab' attr: 'b' } + shape_directory: '#748fab' + shape_external: '#748fab' + shape_externalarg: { fg: '#74ab8f' attr: 'b' } + shape_filepath: '#748fab' + shape_flag: { fg: '#8f74ab' attr: 'b' } + shape_float: { fg: '#ab748f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#748fab' attr: 'b' } + shape_int: { fg: '#ab748f' attr: 'b' } + shape_internalcall: { fg: '#748fab' attr: 'b' } + shape_list: { fg: '#748fab' attr: 'b' } + shape_literal: '#8f74ab' + shape_match_pattern: '#74ab8f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4bb8fd' + shape_operator: '#8fab74' + shape_or: { fg: '#ab748f' attr: 'b' } + shape_pipe: { fg: '#ab748f' attr: 'b' } + shape_range: { fg: '#8fab74' attr: 'b' } + shape_record: { fg: '#748fab' attr: 'b' } + shape_redirection: { fg: '#ab748f' attr: 'b' } + shape_signature: { fg: '#74ab8f' attr: 'b' } + shape_string: '#74ab8f' + shape_string_interpolation: { fg: '#748fab' attr: 'b' } + shape_table: { fg: '#8f74ab' attr: 'b' } + shape_variable: '#ab748f' + + background: '#232e37' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/palmtree.nu b/themes/nu-themes/palmtree.nu index dd1463f..a22b61c 100644 --- a/themes/nu-themes/palmtree.nu +++ b/themes/nu-themes/palmtree.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fdfdfd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5adecd" attr: "b" } - empty: "#8897f4" - bool: {|| if $in { "#3fdcee" } else { "light_gray" } } - int: "#fdfdfd" - filesize: {|e| - if $e == 0b { - "#fdfdfd" - } else if $e < 1mb { - "#79e6f3" - } else {{ fg: "#8897f4" }} - } - duration: "#fdfdfd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f37f97" attr: "b" } - } else if $in < 6hr { - "#f37f97" - } else if $in < 1day { - "#f2a272" - } else if $in < 3day { - "#5adecd" - } else if $in < 1wk { - { fg: "#5adecd" attr: "b" } - } else if $in < 6wk { - "#79e6f3" - } else if $in < 52wk { - "#8897f4" - } else { "dark_gray" } - } - range: "#fdfdfd" - float: "#fdfdfd" - string: "#fdfdfd" - nothing: "#fdfdfd" - binary: "#fdfdfd" - cellpath: "#fdfdfd" - row_index: { fg: "#5adecd" attr: "b" } - record: "#fdfdfd" - list: "#fdfdfd" - block: "#fdfdfd" - hints: "dark_gray" - search_result: { fg: "#f37f97" bg: "#fdfdfd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c574dd" attr: "b" } - shape_binary: { fg: "#c574dd" attr: "b" } - shape_block: { fg: "#8897f4" attr: "b" } - shape_bool: "#3fdcee" - shape_custom: "#5adecd" - shape_datetime: { fg: "#79e6f3" attr: "b" } - shape_directory: "#79e6f3" - shape_external: "#79e6f3" - shape_externalarg: { fg: "#5adecd" attr: "b" } - shape_filepath: "#79e6f3" - shape_flag: { fg: "#8897f4" attr: "b" } - shape_float: { fg: "#c574dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#79e6f3" attr: "b" } - shape_int: { fg: "#c574dd" attr: "b" } - shape_internalcall: { fg: "#79e6f3" attr: "b" } - shape_list: { fg: "#79e6f3" attr: "b" } - shape_literal: "#8897f4" - shape_match_pattern: "#5adecd" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3fdcee" - shape_operator: "#f2a272" - shape_or: { fg: "#c574dd" attr: "b" } - shape_pipe: { fg: "#c574dd" attr: "b" } - shape_range: { fg: "#f2a272" attr: "b" } - shape_record: { fg: "#79e6f3" attr: "b" } - shape_redirection: { fg: "#c574dd" attr: "b" } - shape_signature: { fg: "#5adecd" attr: "b" } - shape_string: "#5adecd" - shape_string_interpolation: { fg: "#79e6f3" attr: "b" } - shape_table: { fg: "#8897f4" attr: "b" } - shape_variable: "#c574dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282a36" - foreground: "#b043d1" - cursor: "#3fdcee" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fdfdfd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5adecd' attr: 'b' } + empty: '#8897f4' + bool: {|| if $in { '#3fdcee' } else { 'light_gray' } } + int: '#fdfdfd' + filesize: {|e| + if $e == 0b { + '#fdfdfd' + } else if $e < 1mb { + '#79e6f3' + } else {{ fg: '#8897f4' }} + } + duration: '#fdfdfd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f37f97' attr: 'b' } + } else if $in < 6hr { + '#f37f97' + } else if $in < 1day { + '#f2a272' + } else if $in < 3day { + '#5adecd' + } else if $in < 1wk { + { fg: '#5adecd' attr: 'b' } + } else if $in < 6wk { + '#79e6f3' + } else if $in < 52wk { + '#8897f4' + } else { 'dark_gray' } + } + range: '#fdfdfd' + float: '#fdfdfd' + string: '#fdfdfd' + nothing: '#fdfdfd' + binary: '#fdfdfd' + cellpath: '#fdfdfd' + row_index: { fg: '#5adecd' attr: 'b' } + record: '#fdfdfd' + list: '#fdfdfd' + block: '#fdfdfd' + hints: 'dark_gray' + search_result: { fg: '#f37f97' bg: '#fdfdfd' } + + shape_and: { fg: '#c574dd' attr: 'b' } + shape_binary: { fg: '#c574dd' attr: 'b' } + shape_block: { fg: '#8897f4' attr: 'b' } + shape_bool: '#3fdcee' + shape_custom: '#5adecd' + shape_datetime: { fg: '#79e6f3' attr: 'b' } + shape_directory: '#79e6f3' + shape_external: '#79e6f3' + shape_externalarg: { fg: '#5adecd' attr: 'b' } + shape_filepath: '#79e6f3' + shape_flag: { fg: '#8897f4' attr: 'b' } + shape_float: { fg: '#c574dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#79e6f3' attr: 'b' } + shape_int: { fg: '#c574dd' attr: 'b' } + shape_internalcall: { fg: '#79e6f3' attr: 'b' } + shape_list: { fg: '#79e6f3' attr: 'b' } + shape_literal: '#8897f4' + shape_match_pattern: '#5adecd' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3fdcee' + shape_operator: '#f2a272' + shape_or: { fg: '#c574dd' attr: 'b' } + shape_pipe: { fg: '#c574dd' attr: 'b' } + shape_range: { fg: '#f2a272' attr: 'b' } + shape_record: { fg: '#79e6f3' attr: 'b' } + shape_redirection: { fg: '#c574dd' attr: 'b' } + shape_signature: { fg: '#5adecd' attr: 'b' } + shape_string: '#5adecd' + shape_string_interpolation: { fg: '#79e6f3' attr: 'b' } + shape_table: { fg: '#8897f4' attr: 'b' } + shape_variable: '#c574dd' + + background: '#282a36' + foreground: '#b043d1' + cursor: '#3fdcee' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/papercolor-dark.nu b/themes/nu-themes/papercolor-dark.nu index e35de3c..83aba9b 100644 --- a/themes/nu-themes/papercolor-dark.nu +++ b/themes/nu-themes/papercolor-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#808080" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#af87d7" attr: "b" } - empty: "#ff5faf" - bool: {|| if $in { "#ffaf00" } else { "light_gray" } } - int: "#808080" - filesize: {|e| - if $e == 0b { - "#808080" - } else if $e < 1mb { - "#ffaf00" - } else {{ fg: "#ff5faf" }} - } - duration: "#808080" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#585858" attr: "b" } - } else if $in < 6hr { - "#585858" - } else if $in < 1day { - "#afd700" - } else if $in < 3day { - "#af87d7" - } else if $in < 1wk { - { fg: "#af87d7" attr: "b" } - } else if $in < 6wk { - "#ffaf00" - } else if $in < 52wk { - "#ff5faf" - } else { "dark_gray" } - } - range: "#808080" - float: "#808080" - string: "#808080" - nothing: "#808080" - binary: "#808080" - cellpath: "#808080" - row_index: { fg: "#af87d7" attr: "b" } - record: "#808080" - list: "#808080" - block: "#808080" - hints: "dark_gray" - search_result: { fg: "#585858" bg: "#808080" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#00afaf" attr: "b" } - shape_binary: { fg: "#00afaf" attr: "b" } - shape_block: { fg: "#ff5faf" attr: "b" } - shape_bool: "#ffaf00" - shape_custom: "#af87d7" - shape_datetime: { fg: "#ffaf00" attr: "b" } - shape_directory: "#ffaf00" - shape_external: "#ffaf00" - shape_externalarg: { fg: "#af87d7" attr: "b" } - shape_filepath: "#ffaf00" - shape_flag: { fg: "#ff5faf" attr: "b" } - shape_float: { fg: "#00afaf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ffaf00" attr: "b" } - shape_int: { fg: "#00afaf" attr: "b" } - shape_internalcall: { fg: "#ffaf00" attr: "b" } - shape_list: { fg: "#ffaf00" attr: "b" } - shape_literal: "#ff5faf" - shape_match_pattern: "#af87d7" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ffaf00" - shape_operator: "#afd700" - shape_or: { fg: "#00afaf" attr: "b" } - shape_pipe: { fg: "#00afaf" attr: "b" } - shape_range: { fg: "#afd700" attr: "b" } - shape_record: { fg: "#ffaf00" attr: "b" } - shape_redirection: { fg: "#00afaf" attr: "b" } - shape_signature: { fg: "#af87d7" attr: "b" } - shape_string: "#af87d7" - shape_string_interpolation: { fg: "#ffaf00" attr: "b" } - shape_table: { fg: "#ff5faf" attr: "b" } - shape_variable: "#00afaf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1c1c" - foreground: "#808080" - cursor: "#808080" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#808080' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#af87d7' attr: 'b' } + empty: '#ff5faf' + bool: {|| if $in { '#ffaf00' } else { 'light_gray' } } + int: '#808080' + filesize: {|e| + if $e == 0b { + '#808080' + } else if $e < 1mb { + '#ffaf00' + } else {{ fg: '#ff5faf' }} + } + duration: '#808080' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#585858' attr: 'b' } + } else if $in < 6hr { + '#585858' + } else if $in < 1day { + '#afd700' + } else if $in < 3day { + '#af87d7' + } else if $in < 1wk { + { fg: '#af87d7' attr: 'b' } + } else if $in < 6wk { + '#ffaf00' + } else if $in < 52wk { + '#ff5faf' + } else { 'dark_gray' } + } + range: '#808080' + float: '#808080' + string: '#808080' + nothing: '#808080' + binary: '#808080' + cellpath: '#808080' + row_index: { fg: '#af87d7' attr: 'b' } + record: '#808080' + list: '#808080' + block: '#808080' + hints: 'dark_gray' + search_result: { fg: '#585858' bg: '#808080' } + + shape_and: { fg: '#00afaf' attr: 'b' } + shape_binary: { fg: '#00afaf' attr: 'b' } + shape_block: { fg: '#ff5faf' attr: 'b' } + shape_bool: '#ffaf00' + shape_custom: '#af87d7' + shape_datetime: { fg: '#ffaf00' attr: 'b' } + shape_directory: '#ffaf00' + shape_external: '#ffaf00' + shape_externalarg: { fg: '#af87d7' attr: 'b' } + shape_filepath: '#ffaf00' + shape_flag: { fg: '#ff5faf' attr: 'b' } + shape_float: { fg: '#00afaf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ffaf00' attr: 'b' } + shape_int: { fg: '#00afaf' attr: 'b' } + shape_internalcall: { fg: '#ffaf00' attr: 'b' } + shape_list: { fg: '#ffaf00' attr: 'b' } + shape_literal: '#ff5faf' + shape_match_pattern: '#af87d7' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ffaf00' + shape_operator: '#afd700' + shape_or: { fg: '#00afaf' attr: 'b' } + shape_pipe: { fg: '#00afaf' attr: 'b' } + shape_range: { fg: '#afd700' attr: 'b' } + shape_record: { fg: '#ffaf00' attr: 'b' } + shape_redirection: { fg: '#00afaf' attr: 'b' } + shape_signature: { fg: '#af87d7' attr: 'b' } + shape_string: '#af87d7' + shape_string_interpolation: { fg: '#ffaf00' attr: 'b' } + shape_table: { fg: '#ff5faf' attr: 'b' } + shape_variable: '#00afaf' + + background: '#1c1c1c' + foreground: '#808080' + cursor: '#808080' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/papercolor-light.nu b/themes/nu-themes/papercolor-light.nu index 013ed0a..0856388 100644 --- a/themes/nu-themes/papercolor-light.nu +++ b/themes/nu-themes/papercolor-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#444444" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8700af" attr: "b" } - empty: "#d75f00" - bool: {|| if $in { "#d75f00" } else { "light_gray" } } - int: "#444444" - filesize: {|e| - if $e == 0b { - "#444444" - } else if $e < 1mb { - "#d75f00" - } else {{ fg: "#d75f00" }} - } - duration: "#444444" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bcbcbc" attr: "b" } - } else if $in < 6hr { - "#bcbcbc" - } else if $in < 1day { - "#d70087" - } else if $in < 3day { - "#8700af" - } else if $in < 1wk { - { fg: "#8700af" attr: "b" } - } else if $in < 6wk { - "#d75f00" - } else if $in < 52wk { - "#d75f00" - } else { "dark_gray" } - } - range: "#444444" - float: "#444444" - string: "#444444" - nothing: "#444444" - binary: "#444444" - cellpath: "#444444" - row_index: { fg: "#8700af" attr: "b" } - record: "#444444" - list: "#444444" - block: "#444444" - hints: "dark_gray" - search_result: { fg: "#bcbcbc" bg: "#444444" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#005faf" attr: "b" } - shape_binary: { fg: "#005faf" attr: "b" } - shape_block: { fg: "#d75f00" attr: "b" } - shape_bool: "#d75f00" - shape_custom: "#8700af" - shape_datetime: { fg: "#d75f00" attr: "b" } - shape_directory: "#d75f00" - shape_external: "#d75f00" - shape_externalarg: { fg: "#8700af" attr: "b" } - shape_filepath: "#d75f00" - shape_flag: { fg: "#d75f00" attr: "b" } - shape_float: { fg: "#005faf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#d75f00" attr: "b" } - shape_int: { fg: "#005faf" attr: "b" } - shape_internalcall: { fg: "#d75f00" attr: "b" } - shape_list: { fg: "#d75f00" attr: "b" } - shape_literal: "#d75f00" - shape_match_pattern: "#8700af" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#d75f00" - shape_operator: "#d70087" - shape_or: { fg: "#005faf" attr: "b" } - shape_pipe: { fg: "#005faf" attr: "b" } - shape_range: { fg: "#d70087" attr: "b" } - shape_record: { fg: "#d75f00" attr: "b" } - shape_redirection: { fg: "#005faf" attr: "b" } - shape_signature: { fg: "#8700af" attr: "b" } - shape_string: "#8700af" - shape_string_interpolation: { fg: "#d75f00" attr: "b" } - shape_table: { fg: "#d75f00" attr: "b" } - shape_variable: "#005faf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#eeeeee" - foreground: "#444444" - cursor: "#444444" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#444444' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8700af' attr: 'b' } + empty: '#d75f00' + bool: {|| if $in { '#d75f00' } else { 'light_gray' } } + int: '#444444' + filesize: {|e| + if $e == 0b { + '#444444' + } else if $e < 1mb { + '#d75f00' + } else {{ fg: '#d75f00' }} + } + duration: '#444444' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bcbcbc' attr: 'b' } + } else if $in < 6hr { + '#bcbcbc' + } else if $in < 1day { + '#d70087' + } else if $in < 3day { + '#8700af' + } else if $in < 1wk { + { fg: '#8700af' attr: 'b' } + } else if $in < 6wk { + '#d75f00' + } else if $in < 52wk { + '#d75f00' + } else { 'dark_gray' } + } + range: '#444444' + float: '#444444' + string: '#444444' + nothing: '#444444' + binary: '#444444' + cellpath: '#444444' + row_index: { fg: '#8700af' attr: 'b' } + record: '#444444' + list: '#444444' + block: '#444444' + hints: 'dark_gray' + search_result: { fg: '#bcbcbc' bg: '#444444' } + + shape_and: { fg: '#005faf' attr: 'b' } + shape_binary: { fg: '#005faf' attr: 'b' } + shape_block: { fg: '#d75f00' attr: 'b' } + shape_bool: '#d75f00' + shape_custom: '#8700af' + shape_datetime: { fg: '#d75f00' attr: 'b' } + shape_directory: '#d75f00' + shape_external: '#d75f00' + shape_externalarg: { fg: '#8700af' attr: 'b' } + shape_filepath: '#d75f00' + shape_flag: { fg: '#d75f00' attr: 'b' } + shape_float: { fg: '#005faf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#d75f00' attr: 'b' } + shape_int: { fg: '#005faf' attr: 'b' } + shape_internalcall: { fg: '#d75f00' attr: 'b' } + shape_list: { fg: '#d75f00' attr: 'b' } + shape_literal: '#d75f00' + shape_match_pattern: '#8700af' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#d75f00' + shape_operator: '#d70087' + shape_or: { fg: '#005faf' attr: 'b' } + shape_pipe: { fg: '#005faf' attr: 'b' } + shape_range: { fg: '#d70087' attr: 'b' } + shape_record: { fg: '#d75f00' attr: 'b' } + shape_redirection: { fg: '#005faf' attr: 'b' } + shape_signature: { fg: '#8700af' attr: 'b' } + shape_string: '#8700af' + shape_string_interpolation: { fg: '#d75f00' attr: 'b' } + shape_table: { fg: '#d75f00' attr: 'b' } + shape_variable: '#005faf' + + background: '#eeeeee' + foreground: '#444444' + cursor: '#444444' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/paraiso-dark.nu b/themes/nu-themes/paraiso-dark.nu index 0286f24..d57c03a 100644 --- a/themes/nu-themes/paraiso-dark.nu +++ b/themes/nu-themes/paraiso-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a39e9b" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#48b685" attr: "b" } - empty: "#06b6ef" - bool: {|| if $in { "#5bc4bf" } else { "light_gray" } } - int: "#a39e9b" - filesize: {|e| - if $e == 0b { - "#a39e9b" - } else if $e < 1mb { - "#5bc4bf" - } else {{ fg: "#06b6ef" }} - } - duration: "#a39e9b" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ef6155" attr: "b" } - } else if $in < 6hr { - "#ef6155" - } else if $in < 1day { - "#fec418" - } else if $in < 3day { - "#48b685" - } else if $in < 1wk { - { fg: "#48b685" attr: "b" } - } else if $in < 6wk { - "#5bc4bf" - } else if $in < 52wk { - "#06b6ef" - } else { "dark_gray" } - } - range: "#a39e9b" - float: "#a39e9b" - string: "#a39e9b" - nothing: "#a39e9b" - binary: "#a39e9b" - cellpath: "#a39e9b" - row_index: { fg: "#48b685" attr: "b" } - record: "#a39e9b" - list: "#a39e9b" - block: "#a39e9b" - hints: "dark_gray" - search_result: { fg: "#ef6155" bg: "#a39e9b" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#815ba4" attr: "b" } - shape_binary: { fg: "#815ba4" attr: "b" } - shape_block: { fg: "#06b6ef" attr: "b" } - shape_bool: "#5bc4bf" - shape_custom: "#48b685" - shape_datetime: { fg: "#5bc4bf" attr: "b" } - shape_directory: "#5bc4bf" - shape_external: "#5bc4bf" - shape_externalarg: { fg: "#48b685" attr: "b" } - shape_filepath: "#5bc4bf" - shape_flag: { fg: "#06b6ef" attr: "b" } - shape_float: { fg: "#815ba4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5bc4bf" attr: "b" } - shape_int: { fg: "#815ba4" attr: "b" } - shape_internalcall: { fg: "#5bc4bf" attr: "b" } - shape_list: { fg: "#5bc4bf" attr: "b" } - shape_literal: "#06b6ef" - shape_match_pattern: "#48b685" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5bc4bf" - shape_operator: "#fec418" - shape_or: { fg: "#815ba4" attr: "b" } - shape_pipe: { fg: "#815ba4" attr: "b" } - shape_range: { fg: "#fec418" attr: "b" } - shape_record: { fg: "#5bc4bf" attr: "b" } - shape_redirection: { fg: "#815ba4" attr: "b" } - shape_signature: { fg: "#48b685" attr: "b" } - shape_string: "#48b685" - shape_string_interpolation: { fg: "#5bc4bf" attr: "b" } - shape_table: { fg: "#06b6ef" attr: "b" } - shape_variable: "#815ba4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2f1e2e" - foreground: "#a39e9b" - cursor: "#a39e9b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a39e9b' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#48b685' attr: 'b' } + empty: '#06b6ef' + bool: {|| if $in { '#5bc4bf' } else { 'light_gray' } } + int: '#a39e9b' + filesize: {|e| + if $e == 0b { + '#a39e9b' + } else if $e < 1mb { + '#5bc4bf' + } else {{ fg: '#06b6ef' }} + } + duration: '#a39e9b' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ef6155' attr: 'b' } + } else if $in < 6hr { + '#ef6155' + } else if $in < 1day { + '#fec418' + } else if $in < 3day { + '#48b685' + } else if $in < 1wk { + { fg: '#48b685' attr: 'b' } + } else if $in < 6wk { + '#5bc4bf' + } else if $in < 52wk { + '#06b6ef' + } else { 'dark_gray' } + } + range: '#a39e9b' + float: '#a39e9b' + string: '#a39e9b' + nothing: '#a39e9b' + binary: '#a39e9b' + cellpath: '#a39e9b' + row_index: { fg: '#48b685' attr: 'b' } + record: '#a39e9b' + list: '#a39e9b' + block: '#a39e9b' + hints: 'dark_gray' + search_result: { fg: '#ef6155' bg: '#a39e9b' } + + shape_and: { fg: '#815ba4' attr: 'b' } + shape_binary: { fg: '#815ba4' attr: 'b' } + shape_block: { fg: '#06b6ef' attr: 'b' } + shape_bool: '#5bc4bf' + shape_custom: '#48b685' + shape_datetime: { fg: '#5bc4bf' attr: 'b' } + shape_directory: '#5bc4bf' + shape_external: '#5bc4bf' + shape_externalarg: { fg: '#48b685' attr: 'b' } + shape_filepath: '#5bc4bf' + shape_flag: { fg: '#06b6ef' attr: 'b' } + shape_float: { fg: '#815ba4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5bc4bf' attr: 'b' } + shape_int: { fg: '#815ba4' attr: 'b' } + shape_internalcall: { fg: '#5bc4bf' attr: 'b' } + shape_list: { fg: '#5bc4bf' attr: 'b' } + shape_literal: '#06b6ef' + shape_match_pattern: '#48b685' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5bc4bf' + shape_operator: '#fec418' + shape_or: { fg: '#815ba4' attr: 'b' } + shape_pipe: { fg: '#815ba4' attr: 'b' } + shape_range: { fg: '#fec418' attr: 'b' } + shape_record: { fg: '#5bc4bf' attr: 'b' } + shape_redirection: { fg: '#815ba4' attr: 'b' } + shape_signature: { fg: '#48b685' attr: 'b' } + shape_string: '#48b685' + shape_string_interpolation: { fg: '#5bc4bf' attr: 'b' } + shape_table: { fg: '#06b6ef' attr: 'b' } + shape_variable: '#815ba4' + + background: '#2f1e2e' + foreground: '#a39e9b' + cursor: '#a39e9b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/paraiso.nu b/themes/nu-themes/paraiso.nu index 0286f24..d57c03a 100644 --- a/themes/nu-themes/paraiso.nu +++ b/themes/nu-themes/paraiso.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a39e9b" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#48b685" attr: "b" } - empty: "#06b6ef" - bool: {|| if $in { "#5bc4bf" } else { "light_gray" } } - int: "#a39e9b" - filesize: {|e| - if $e == 0b { - "#a39e9b" - } else if $e < 1mb { - "#5bc4bf" - } else {{ fg: "#06b6ef" }} - } - duration: "#a39e9b" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ef6155" attr: "b" } - } else if $in < 6hr { - "#ef6155" - } else if $in < 1day { - "#fec418" - } else if $in < 3day { - "#48b685" - } else if $in < 1wk { - { fg: "#48b685" attr: "b" } - } else if $in < 6wk { - "#5bc4bf" - } else if $in < 52wk { - "#06b6ef" - } else { "dark_gray" } - } - range: "#a39e9b" - float: "#a39e9b" - string: "#a39e9b" - nothing: "#a39e9b" - binary: "#a39e9b" - cellpath: "#a39e9b" - row_index: { fg: "#48b685" attr: "b" } - record: "#a39e9b" - list: "#a39e9b" - block: "#a39e9b" - hints: "dark_gray" - search_result: { fg: "#ef6155" bg: "#a39e9b" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#815ba4" attr: "b" } - shape_binary: { fg: "#815ba4" attr: "b" } - shape_block: { fg: "#06b6ef" attr: "b" } - shape_bool: "#5bc4bf" - shape_custom: "#48b685" - shape_datetime: { fg: "#5bc4bf" attr: "b" } - shape_directory: "#5bc4bf" - shape_external: "#5bc4bf" - shape_externalarg: { fg: "#48b685" attr: "b" } - shape_filepath: "#5bc4bf" - shape_flag: { fg: "#06b6ef" attr: "b" } - shape_float: { fg: "#815ba4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5bc4bf" attr: "b" } - shape_int: { fg: "#815ba4" attr: "b" } - shape_internalcall: { fg: "#5bc4bf" attr: "b" } - shape_list: { fg: "#5bc4bf" attr: "b" } - shape_literal: "#06b6ef" - shape_match_pattern: "#48b685" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5bc4bf" - shape_operator: "#fec418" - shape_or: { fg: "#815ba4" attr: "b" } - shape_pipe: { fg: "#815ba4" attr: "b" } - shape_range: { fg: "#fec418" attr: "b" } - shape_record: { fg: "#5bc4bf" attr: "b" } - shape_redirection: { fg: "#815ba4" attr: "b" } - shape_signature: { fg: "#48b685" attr: "b" } - shape_string: "#48b685" - shape_string_interpolation: { fg: "#5bc4bf" attr: "b" } - shape_table: { fg: "#06b6ef" attr: "b" } - shape_variable: "#815ba4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2f1e2e" - foreground: "#a39e9b" - cursor: "#a39e9b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a39e9b' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#48b685' attr: 'b' } + empty: '#06b6ef' + bool: {|| if $in { '#5bc4bf' } else { 'light_gray' } } + int: '#a39e9b' + filesize: {|e| + if $e == 0b { + '#a39e9b' + } else if $e < 1mb { + '#5bc4bf' + } else {{ fg: '#06b6ef' }} + } + duration: '#a39e9b' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ef6155' attr: 'b' } + } else if $in < 6hr { + '#ef6155' + } else if $in < 1day { + '#fec418' + } else if $in < 3day { + '#48b685' + } else if $in < 1wk { + { fg: '#48b685' attr: 'b' } + } else if $in < 6wk { + '#5bc4bf' + } else if $in < 52wk { + '#06b6ef' + } else { 'dark_gray' } + } + range: '#a39e9b' + float: '#a39e9b' + string: '#a39e9b' + nothing: '#a39e9b' + binary: '#a39e9b' + cellpath: '#a39e9b' + row_index: { fg: '#48b685' attr: 'b' } + record: '#a39e9b' + list: '#a39e9b' + block: '#a39e9b' + hints: 'dark_gray' + search_result: { fg: '#ef6155' bg: '#a39e9b' } + + shape_and: { fg: '#815ba4' attr: 'b' } + shape_binary: { fg: '#815ba4' attr: 'b' } + shape_block: { fg: '#06b6ef' attr: 'b' } + shape_bool: '#5bc4bf' + shape_custom: '#48b685' + shape_datetime: { fg: '#5bc4bf' attr: 'b' } + shape_directory: '#5bc4bf' + shape_external: '#5bc4bf' + shape_externalarg: { fg: '#48b685' attr: 'b' } + shape_filepath: '#5bc4bf' + shape_flag: { fg: '#06b6ef' attr: 'b' } + shape_float: { fg: '#815ba4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5bc4bf' attr: 'b' } + shape_int: { fg: '#815ba4' attr: 'b' } + shape_internalcall: { fg: '#5bc4bf' attr: 'b' } + shape_list: { fg: '#5bc4bf' attr: 'b' } + shape_literal: '#06b6ef' + shape_match_pattern: '#48b685' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5bc4bf' + shape_operator: '#fec418' + shape_or: { fg: '#815ba4' attr: 'b' } + shape_pipe: { fg: '#815ba4' attr: 'b' } + shape_range: { fg: '#fec418' attr: 'b' } + shape_record: { fg: '#5bc4bf' attr: 'b' } + shape_redirection: { fg: '#815ba4' attr: 'b' } + shape_signature: { fg: '#48b685' attr: 'b' } + shape_string: '#48b685' + shape_string_interpolation: { fg: '#5bc4bf' attr: 'b' } + shape_table: { fg: '#06b6ef' attr: 'b' } + shape_variable: '#815ba4' + + background: '#2f1e2e' + foreground: '#a39e9b' + cursor: '#a39e9b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pasque.nu b/themes/nu-themes/pasque.nu index b412010..b28da57 100644 --- a/themes/nu-themes/pasque.nu +++ b/themes/nu-themes/pasque.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dedcdf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c6914b" attr: "b" } - empty: "#8e7dc6" - bool: {|| if $in { "#7263aa" } else { "light_gray" } } - int: "#dedcdf" - filesize: {|e| - if $e == 0b { - "#dedcdf" - } else if $e < 1mb { - "#7263aa" - } else {{ fg: "#8e7dc6" }} - } - duration: "#dedcdf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a92258" attr: "b" } - } else if $in < 6hr { - "#a92258" - } else if $in < 1day { - "#804ead" - } else if $in < 3day { - "#c6914b" - } else if $in < 1wk { - { fg: "#c6914b" attr: "b" } - } else if $in < 6wk { - "#7263aa" - } else if $in < 52wk { - "#8e7dc6" - } else { "dark_gray" } - } - range: "#dedcdf" - float: "#dedcdf" - string: "#dedcdf" - nothing: "#dedcdf" - binary: "#dedcdf" - cellpath: "#dedcdf" - row_index: { fg: "#c6914b" attr: "b" } - record: "#dedcdf" - list: "#dedcdf" - block: "#dedcdf" - hints: "dark_gray" - search_result: { fg: "#a92258" bg: "#dedcdf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#953b9d" attr: "b" } - shape_binary: { fg: "#953b9d" attr: "b" } - shape_block: { fg: "#8e7dc6" attr: "b" } - shape_bool: "#7263aa" - shape_custom: "#c6914b" - shape_datetime: { fg: "#7263aa" attr: "b" } - shape_directory: "#7263aa" - shape_external: "#7263aa" - shape_externalarg: { fg: "#c6914b" attr: "b" } - shape_filepath: "#7263aa" - shape_flag: { fg: "#8e7dc6" attr: "b" } - shape_float: { fg: "#953b9d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7263aa" attr: "b" } - shape_int: { fg: "#953b9d" attr: "b" } - shape_internalcall: { fg: "#7263aa" attr: "b" } - shape_list: { fg: "#7263aa" attr: "b" } - shape_literal: "#8e7dc6" - shape_match_pattern: "#c6914b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7263aa" - shape_operator: "#804ead" - shape_or: { fg: "#953b9d" attr: "b" } - shape_pipe: { fg: "#953b9d" attr: "b" } - shape_range: { fg: "#804ead" attr: "b" } - shape_record: { fg: "#7263aa" attr: "b" } - shape_redirection: { fg: "#953b9d" attr: "b" } - shape_signature: { fg: "#c6914b" attr: "b" } - shape_string: "#c6914b" - shape_string_interpolation: { fg: "#7263aa" attr: "b" } - shape_table: { fg: "#8e7dc6" attr: "b" } - shape_variable: "#953b9d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#271c3a" - foreground: "#dedcdf" - cursor: "#dedcdf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dedcdf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c6914b' attr: 'b' } + empty: '#8e7dc6' + bool: {|| if $in { '#7263aa' } else { 'light_gray' } } + int: '#dedcdf' + filesize: {|e| + if $e == 0b { + '#dedcdf' + } else if $e < 1mb { + '#7263aa' + } else {{ fg: '#8e7dc6' }} + } + duration: '#dedcdf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a92258' attr: 'b' } + } else if $in < 6hr { + '#a92258' + } else if $in < 1day { + '#804ead' + } else if $in < 3day { + '#c6914b' + } else if $in < 1wk { + { fg: '#c6914b' attr: 'b' } + } else if $in < 6wk { + '#7263aa' + } else if $in < 52wk { + '#8e7dc6' + } else { 'dark_gray' } + } + range: '#dedcdf' + float: '#dedcdf' + string: '#dedcdf' + nothing: '#dedcdf' + binary: '#dedcdf' + cellpath: '#dedcdf' + row_index: { fg: '#c6914b' attr: 'b' } + record: '#dedcdf' + list: '#dedcdf' + block: '#dedcdf' + hints: 'dark_gray' + search_result: { fg: '#a92258' bg: '#dedcdf' } + + shape_and: { fg: '#953b9d' attr: 'b' } + shape_binary: { fg: '#953b9d' attr: 'b' } + shape_block: { fg: '#8e7dc6' attr: 'b' } + shape_bool: '#7263aa' + shape_custom: '#c6914b' + shape_datetime: { fg: '#7263aa' attr: 'b' } + shape_directory: '#7263aa' + shape_external: '#7263aa' + shape_externalarg: { fg: '#c6914b' attr: 'b' } + shape_filepath: '#7263aa' + shape_flag: { fg: '#8e7dc6' attr: 'b' } + shape_float: { fg: '#953b9d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7263aa' attr: 'b' } + shape_int: { fg: '#953b9d' attr: 'b' } + shape_internalcall: { fg: '#7263aa' attr: 'b' } + shape_list: { fg: '#7263aa' attr: 'b' } + shape_literal: '#8e7dc6' + shape_match_pattern: '#c6914b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7263aa' + shape_operator: '#804ead' + shape_or: { fg: '#953b9d' attr: 'b' } + shape_pipe: { fg: '#953b9d' attr: 'b' } + shape_range: { fg: '#804ead' attr: 'b' } + shape_record: { fg: '#7263aa' attr: 'b' } + shape_redirection: { fg: '#953b9d' attr: 'b' } + shape_signature: { fg: '#c6914b' attr: 'b' } + shape_string: '#c6914b' + shape_string_interpolation: { fg: '#7263aa' attr: 'b' } + shape_table: { fg: '#8e7dc6' attr: 'b' } + shape_variable: '#953b9d' + + background: '#271c3a' + foreground: '#dedcdf' + cursor: '#dedcdf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/paul-millr.nu b/themes/nu-themes/paul-millr.nu index a61dea5..142d254 100644 --- a/themes/nu-themes/paul-millr.nu +++ b/themes/nu-themes/paul-millr.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#79ff0f" attr: "b" } - empty: "#396bd7" - bool: {|| if $in { "#7adff2" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#66ccff" - } else {{ fg: "#396bd7" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0000" attr: "b" } - } else if $in < 6hr { - "#ff0000" - } else if $in < 1day { - "#d3bf00" - } else if $in < 3day { - "#79ff0f" - } else if $in < 1wk { - { fg: "#79ff0f" attr: "b" } - } else if $in < 6wk { - "#66ccff" - } else if $in < 52wk { - "#396bd7" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#79ff0f" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#ff0000" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b449be" attr: "b" } - shape_binary: { fg: "#b449be" attr: "b" } - shape_block: { fg: "#396bd7" attr: "b" } - shape_bool: "#7adff2" - shape_custom: "#79ff0f" - shape_datetime: { fg: "#66ccff" attr: "b" } - shape_directory: "#66ccff" - shape_external: "#66ccff" - shape_externalarg: { fg: "#79ff0f" attr: "b" } - shape_filepath: "#66ccff" - shape_flag: { fg: "#396bd7" attr: "b" } - shape_float: { fg: "#b449be" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#66ccff" attr: "b" } - shape_int: { fg: "#b449be" attr: "b" } - shape_internalcall: { fg: "#66ccff" attr: "b" } - shape_list: { fg: "#66ccff" attr: "b" } - shape_literal: "#396bd7" - shape_match_pattern: "#79ff0f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7adff2" - shape_operator: "#d3bf00" - shape_or: { fg: "#b449be" attr: "b" } - shape_pipe: { fg: "#b449be" attr: "b" } - shape_range: { fg: "#d3bf00" attr: "b" } - shape_record: { fg: "#66ccff" attr: "b" } - shape_redirection: { fg: "#b449be" attr: "b" } - shape_signature: { fg: "#79ff0f" attr: "b" } - shape_string: "#79ff0f" - shape_string_interpolation: { fg: "#66ccff" attr: "b" } - shape_table: { fg: "#396bd7" attr: "b" } - shape_variable: "#b449be" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#f2f2f2" - cursor: "#f2f2f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#79ff0f' attr: 'b' } + empty: '#396bd7' + bool: {|| if $in { '#7adff2' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#66ccff' + } else {{ fg: '#396bd7' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0000' attr: 'b' } + } else if $in < 6hr { + '#ff0000' + } else if $in < 1day { + '#d3bf00' + } else if $in < 3day { + '#79ff0f' + } else if $in < 1wk { + { fg: '#79ff0f' attr: 'b' } + } else if $in < 6wk { + '#66ccff' + } else if $in < 52wk { + '#396bd7' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#79ff0f' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#ff0000' bg: '#bbbbbb' } + + shape_and: { fg: '#b449be' attr: 'b' } + shape_binary: { fg: '#b449be' attr: 'b' } + shape_block: { fg: '#396bd7' attr: 'b' } + shape_bool: '#7adff2' + shape_custom: '#79ff0f' + shape_datetime: { fg: '#66ccff' attr: 'b' } + shape_directory: '#66ccff' + shape_external: '#66ccff' + shape_externalarg: { fg: '#79ff0f' attr: 'b' } + shape_filepath: '#66ccff' + shape_flag: { fg: '#396bd7' attr: 'b' } + shape_float: { fg: '#b449be' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#66ccff' attr: 'b' } + shape_int: { fg: '#b449be' attr: 'b' } + shape_internalcall: { fg: '#66ccff' attr: 'b' } + shape_list: { fg: '#66ccff' attr: 'b' } + shape_literal: '#396bd7' + shape_match_pattern: '#79ff0f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7adff2' + shape_operator: '#d3bf00' + shape_or: { fg: '#b449be' attr: 'b' } + shape_pipe: { fg: '#b449be' attr: 'b' } + shape_range: { fg: '#d3bf00' attr: 'b' } + shape_record: { fg: '#66ccff' attr: 'b' } + shape_redirection: { fg: '#b449be' attr: 'b' } + shape_signature: { fg: '#79ff0f' attr: 'b' } + shape_string: '#79ff0f' + shape_string_interpolation: { fg: '#66ccff' attr: 'b' } + shape_table: { fg: '#396bd7' attr: 'b' } + shape_variable: '#b449be' + + background: '#000000' + foreground: '#f2f2f2' + cursor: '#f2f2f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pencil-dark.nu b/themes/nu-themes/pencil-dark.nu index a2e39c9..d8c4ecf 100644 --- a/themes/nu-themes/pencil-dark.nu +++ b/themes/nu-themes/pencil-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d9d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#10a778" attr: "b" } - empty: "#008ec4" - bool: {|| if $in { "#4fb8cc" } else { "light_gray" } } - int: "#d9d9d9" - filesize: {|e| - if $e == 0b { - "#d9d9d9" - } else if $e < 1mb { - "#20a5ba" - } else {{ fg: "#008ec4" }} - } - duration: "#d9d9d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c30771" attr: "b" } - } else if $in < 6hr { - "#c30771" - } else if $in < 1day { - "#a89c14" - } else if $in < 3day { - "#10a778" - } else if $in < 1wk { - { fg: "#10a778" attr: "b" } - } else if $in < 6wk { - "#20a5ba" - } else if $in < 52wk { - "#008ec4" - } else { "dark_gray" } - } - range: "#d9d9d9" - float: "#d9d9d9" - string: "#d9d9d9" - nothing: "#d9d9d9" - binary: "#d9d9d9" - cellpath: "#d9d9d9" - row_index: { fg: "#10a778" attr: "b" } - record: "#d9d9d9" - list: "#d9d9d9" - block: "#d9d9d9" - hints: "dark_gray" - search_result: { fg: "#c30771" bg: "#d9d9d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#523c79" attr: "b" } - shape_binary: { fg: "#523c79" attr: "b" } - shape_block: { fg: "#008ec4" attr: "b" } - shape_bool: "#4fb8cc" - shape_custom: "#10a778" - shape_datetime: { fg: "#20a5ba" attr: "b" } - shape_directory: "#20a5ba" - shape_external: "#20a5ba" - shape_externalarg: { fg: "#10a778" attr: "b" } - shape_filepath: "#20a5ba" - shape_flag: { fg: "#008ec4" attr: "b" } - shape_float: { fg: "#523c79" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#20a5ba" attr: "b" } - shape_int: { fg: "#523c79" attr: "b" } - shape_internalcall: { fg: "#20a5ba" attr: "b" } - shape_list: { fg: "#20a5ba" attr: "b" } - shape_literal: "#008ec4" - shape_match_pattern: "#10a778" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4fb8cc" - shape_operator: "#a89c14" - shape_or: { fg: "#523c79" attr: "b" } - shape_pipe: { fg: "#523c79" attr: "b" } - shape_range: { fg: "#a89c14" attr: "b" } - shape_record: { fg: "#20a5ba" attr: "b" } - shape_redirection: { fg: "#523c79" attr: "b" } - shape_signature: { fg: "#10a778" attr: "b" } - shape_string: "#10a778" - shape_string_interpolation: { fg: "#20a5ba" attr: "b" } - shape_table: { fg: "#008ec4" attr: "b" } - shape_variable: "#523c79" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#212121" - foreground: "#f1f1f1" - cursor: "#f1f1f1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d9d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#10a778' attr: 'b' } + empty: '#008ec4' + bool: {|| if $in { '#4fb8cc' } else { 'light_gray' } } + int: '#d9d9d9' + filesize: {|e| + if $e == 0b { + '#d9d9d9' + } else if $e < 1mb { + '#20a5ba' + } else {{ fg: '#008ec4' }} + } + duration: '#d9d9d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c30771' attr: 'b' } + } else if $in < 6hr { + '#c30771' + } else if $in < 1day { + '#a89c14' + } else if $in < 3day { + '#10a778' + } else if $in < 1wk { + { fg: '#10a778' attr: 'b' } + } else if $in < 6wk { + '#20a5ba' + } else if $in < 52wk { + '#008ec4' + } else { 'dark_gray' } + } + range: '#d9d9d9' + float: '#d9d9d9' + string: '#d9d9d9' + nothing: '#d9d9d9' + binary: '#d9d9d9' + cellpath: '#d9d9d9' + row_index: { fg: '#10a778' attr: 'b' } + record: '#d9d9d9' + list: '#d9d9d9' + block: '#d9d9d9' + hints: 'dark_gray' + search_result: { fg: '#c30771' bg: '#d9d9d9' } + + shape_and: { fg: '#523c79' attr: 'b' } + shape_binary: { fg: '#523c79' attr: 'b' } + shape_block: { fg: '#008ec4' attr: 'b' } + shape_bool: '#4fb8cc' + shape_custom: '#10a778' + shape_datetime: { fg: '#20a5ba' attr: 'b' } + shape_directory: '#20a5ba' + shape_external: '#20a5ba' + shape_externalarg: { fg: '#10a778' attr: 'b' } + shape_filepath: '#20a5ba' + shape_flag: { fg: '#008ec4' attr: 'b' } + shape_float: { fg: '#523c79' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#20a5ba' attr: 'b' } + shape_int: { fg: '#523c79' attr: 'b' } + shape_internalcall: { fg: '#20a5ba' attr: 'b' } + shape_list: { fg: '#20a5ba' attr: 'b' } + shape_literal: '#008ec4' + shape_match_pattern: '#10a778' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4fb8cc' + shape_operator: '#a89c14' + shape_or: { fg: '#523c79' attr: 'b' } + shape_pipe: { fg: '#523c79' attr: 'b' } + shape_range: { fg: '#a89c14' attr: 'b' } + shape_record: { fg: '#20a5ba' attr: 'b' } + shape_redirection: { fg: '#523c79' attr: 'b' } + shape_signature: { fg: '#10a778' attr: 'b' } + shape_string: '#10a778' + shape_string_interpolation: { fg: '#20a5ba' attr: 'b' } + shape_table: { fg: '#008ec4' attr: 'b' } + shape_variable: '#523c79' + + background: '#212121' + foreground: '#f1f1f1' + cursor: '#f1f1f1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pencil-light.nu b/themes/nu-themes/pencil-light.nu index 08ad705..3c08ecc 100644 --- a/themes/nu-themes/pencil-light.nu +++ b/themes/nu-themes/pencil-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d9d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#10a778" attr: "b" } - empty: "#008ec4" - bool: {|| if $in { "#4fb8cc" } else { "light_gray" } } - int: "#d9d9d9" - filesize: {|e| - if $e == 0b { - "#d9d9d9" - } else if $e < 1mb { - "#20a5ba" - } else {{ fg: "#008ec4" }} - } - duration: "#d9d9d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c30771" attr: "b" } - } else if $in < 6hr { - "#c30771" - } else if $in < 1day { - "#a89c14" - } else if $in < 3day { - "#10a778" - } else if $in < 1wk { - { fg: "#10a778" attr: "b" } - } else if $in < 6wk { - "#20a5ba" - } else if $in < 52wk { - "#008ec4" - } else { "dark_gray" } - } - range: "#d9d9d9" - float: "#d9d9d9" - string: "#d9d9d9" - nothing: "#d9d9d9" - binary: "#d9d9d9" - cellpath: "#d9d9d9" - row_index: { fg: "#10a778" attr: "b" } - record: "#d9d9d9" - list: "#d9d9d9" - block: "#d9d9d9" - hints: "dark_gray" - search_result: { fg: "#c30771" bg: "#d9d9d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#523c79" attr: "b" } - shape_binary: { fg: "#523c79" attr: "b" } - shape_block: { fg: "#008ec4" attr: "b" } - shape_bool: "#4fb8cc" - shape_custom: "#10a778" - shape_datetime: { fg: "#20a5ba" attr: "b" } - shape_directory: "#20a5ba" - shape_external: "#20a5ba" - shape_externalarg: { fg: "#10a778" attr: "b" } - shape_filepath: "#20a5ba" - shape_flag: { fg: "#008ec4" attr: "b" } - shape_float: { fg: "#523c79" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#20a5ba" attr: "b" } - shape_int: { fg: "#523c79" attr: "b" } - shape_internalcall: { fg: "#20a5ba" attr: "b" } - shape_list: { fg: "#20a5ba" attr: "b" } - shape_literal: "#008ec4" - shape_match_pattern: "#10a778" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#4fb8cc" - shape_operator: "#a89c14" - shape_or: { fg: "#523c79" attr: "b" } - shape_pipe: { fg: "#523c79" attr: "b" } - shape_range: { fg: "#a89c14" attr: "b" } - shape_record: { fg: "#20a5ba" attr: "b" } - shape_redirection: { fg: "#523c79" attr: "b" } - shape_signature: { fg: "#10a778" attr: "b" } - shape_string: "#10a778" - shape_string_interpolation: { fg: "#20a5ba" attr: "b" } - shape_table: { fg: "#008ec4" attr: "b" } - shape_variable: "#523c79" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f1f1f1" - foreground: "#424242" - cursor: "#424242" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d9d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#10a778' attr: 'b' } + empty: '#008ec4' + bool: {|| if $in { '#4fb8cc' } else { 'light_gray' } } + int: '#d9d9d9' + filesize: {|e| + if $e == 0b { + '#d9d9d9' + } else if $e < 1mb { + '#20a5ba' + } else {{ fg: '#008ec4' }} + } + duration: '#d9d9d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c30771' attr: 'b' } + } else if $in < 6hr { + '#c30771' + } else if $in < 1day { + '#a89c14' + } else if $in < 3day { + '#10a778' + } else if $in < 1wk { + { fg: '#10a778' attr: 'b' } + } else if $in < 6wk { + '#20a5ba' + } else if $in < 52wk { + '#008ec4' + } else { 'dark_gray' } + } + range: '#d9d9d9' + float: '#d9d9d9' + string: '#d9d9d9' + nothing: '#d9d9d9' + binary: '#d9d9d9' + cellpath: '#d9d9d9' + row_index: { fg: '#10a778' attr: 'b' } + record: '#d9d9d9' + list: '#d9d9d9' + block: '#d9d9d9' + hints: 'dark_gray' + search_result: { fg: '#c30771' bg: '#d9d9d9' } + + shape_and: { fg: '#523c79' attr: 'b' } + shape_binary: { fg: '#523c79' attr: 'b' } + shape_block: { fg: '#008ec4' attr: 'b' } + shape_bool: '#4fb8cc' + shape_custom: '#10a778' + shape_datetime: { fg: '#20a5ba' attr: 'b' } + shape_directory: '#20a5ba' + shape_external: '#20a5ba' + shape_externalarg: { fg: '#10a778' attr: 'b' } + shape_filepath: '#20a5ba' + shape_flag: { fg: '#008ec4' attr: 'b' } + shape_float: { fg: '#523c79' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#20a5ba' attr: 'b' } + shape_int: { fg: '#523c79' attr: 'b' } + shape_internalcall: { fg: '#20a5ba' attr: 'b' } + shape_list: { fg: '#20a5ba' attr: 'b' } + shape_literal: '#008ec4' + shape_match_pattern: '#10a778' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#4fb8cc' + shape_operator: '#a89c14' + shape_or: { fg: '#523c79' attr: 'b' } + shape_pipe: { fg: '#523c79' attr: 'b' } + shape_range: { fg: '#a89c14' attr: 'b' } + shape_record: { fg: '#20a5ba' attr: 'b' } + shape_redirection: { fg: '#523c79' attr: 'b' } + shape_signature: { fg: '#10a778' attr: 'b' } + shape_string: '#10a778' + shape_string_interpolation: { fg: '#20a5ba' attr: 'b' } + shape_table: { fg: '#008ec4' attr: 'b' } + shape_variable: '#523c79' + + background: '#f1f1f1' + foreground: '#424242' + cursor: '#424242' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/peppermint.nu b/themes/nu-themes/peppermint.nu index 740f687..6acd18b 100644 --- a/themes/nu-themes/peppermint.nu +++ b/themes/nu-themes/peppermint.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b3b3b3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#89d287" attr: "b" } - empty: "#439ecf" - bool: {|| if $in { "#96dcda" } else { "light_gray" } } - int: "#b3b3b3" - filesize: {|e| - if $e == 0b { - "#b3b3b3" - } else if $e < 1mb { - "#64aaaf" - } else {{ fg: "#439ecf" }} - } - duration: "#b3b3b3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e64569" attr: "b" } - } else if $in < 6hr { - "#e64569" - } else if $in < 1day { - "#dab752" - } else if $in < 3day { - "#89d287" - } else if $in < 1wk { - { fg: "#89d287" attr: "b" } - } else if $in < 6wk { - "#64aaaf" - } else if $in < 52wk { - "#439ecf" - } else { "dark_gray" } - } - range: "#b3b3b3" - float: "#b3b3b3" - string: "#b3b3b3" - nothing: "#b3b3b3" - binary: "#b3b3b3" - cellpath: "#b3b3b3" - row_index: { fg: "#89d287" attr: "b" } - record: "#b3b3b3" - list: "#b3b3b3" - block: "#b3b3b3" - hints: "dark_gray" - search_result: { fg: "#e64569" bg: "#b3b3b3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d961dc" attr: "b" } - shape_binary: { fg: "#d961dc" attr: "b" } - shape_block: { fg: "#439ecf" attr: "b" } - shape_bool: "#96dcda" - shape_custom: "#89d287" - shape_datetime: { fg: "#64aaaf" attr: "b" } - shape_directory: "#64aaaf" - shape_external: "#64aaaf" - shape_externalarg: { fg: "#89d287" attr: "b" } - shape_filepath: "#64aaaf" - shape_flag: { fg: "#439ecf" attr: "b" } - shape_float: { fg: "#d961dc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#64aaaf" attr: "b" } - shape_int: { fg: "#d961dc" attr: "b" } - shape_internalcall: { fg: "#64aaaf" attr: "b" } - shape_list: { fg: "#64aaaf" attr: "b" } - shape_literal: "#439ecf" - shape_match_pattern: "#89d287" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#96dcda" - shape_operator: "#dab752" - shape_or: { fg: "#d961dc" attr: "b" } - shape_pipe: { fg: "#d961dc" attr: "b" } - shape_range: { fg: "#dab752" attr: "b" } - shape_record: { fg: "#64aaaf" attr: "b" } - shape_redirection: { fg: "#d961dc" attr: "b" } - shape_signature: { fg: "#89d287" attr: "b" } - shape_string: "#89d287" - shape_string_interpolation: { fg: "#64aaaf" attr: "b" } - shape_table: { fg: "#439ecf" attr: "b" } - shape_variable: "#d961dc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c7c7c7" - cursor: "#bbbbbb" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b3b3b3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#89d287' attr: 'b' } + empty: '#439ecf' + bool: {|| if $in { '#96dcda' } else { 'light_gray' } } + int: '#b3b3b3' + filesize: {|e| + if $e == 0b { + '#b3b3b3' + } else if $e < 1mb { + '#64aaaf' + } else {{ fg: '#439ecf' }} + } + duration: '#b3b3b3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e64569' attr: 'b' } + } else if $in < 6hr { + '#e64569' + } else if $in < 1day { + '#dab752' + } else if $in < 3day { + '#89d287' + } else if $in < 1wk { + { fg: '#89d287' attr: 'b' } + } else if $in < 6wk { + '#64aaaf' + } else if $in < 52wk { + '#439ecf' + } else { 'dark_gray' } + } + range: '#b3b3b3' + float: '#b3b3b3' + string: '#b3b3b3' + nothing: '#b3b3b3' + binary: '#b3b3b3' + cellpath: '#b3b3b3' + row_index: { fg: '#89d287' attr: 'b' } + record: '#b3b3b3' + list: '#b3b3b3' + block: '#b3b3b3' + hints: 'dark_gray' + search_result: { fg: '#e64569' bg: '#b3b3b3' } + + shape_and: { fg: '#d961dc' attr: 'b' } + shape_binary: { fg: '#d961dc' attr: 'b' } + shape_block: { fg: '#439ecf' attr: 'b' } + shape_bool: '#96dcda' + shape_custom: '#89d287' + shape_datetime: { fg: '#64aaaf' attr: 'b' } + shape_directory: '#64aaaf' + shape_external: '#64aaaf' + shape_externalarg: { fg: '#89d287' attr: 'b' } + shape_filepath: '#64aaaf' + shape_flag: { fg: '#439ecf' attr: 'b' } + shape_float: { fg: '#d961dc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#64aaaf' attr: 'b' } + shape_int: { fg: '#d961dc' attr: 'b' } + shape_internalcall: { fg: '#64aaaf' attr: 'b' } + shape_list: { fg: '#64aaaf' attr: 'b' } + shape_literal: '#439ecf' + shape_match_pattern: '#89d287' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#96dcda' + shape_operator: '#dab752' + shape_or: { fg: '#d961dc' attr: 'b' } + shape_pipe: { fg: '#d961dc' attr: 'b' } + shape_range: { fg: '#dab752' attr: 'b' } + shape_record: { fg: '#64aaaf' attr: 'b' } + shape_redirection: { fg: '#d961dc' attr: 'b' } + shape_signature: { fg: '#89d287' attr: 'b' } + shape_string: '#89d287' + shape_string_interpolation: { fg: '#64aaaf' attr: 'b' } + shape_table: { fg: '#439ecf' attr: 'b' } + shape_variable: '#d961dc' + + background: '#000000' + foreground: '#c7c7c7' + cursor: '#bbbbbb' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/phd.nu b/themes/nu-themes/phd.nu index 1c8c064..cc54f6f 100644 --- a/themes/nu-themes/phd.nu +++ b/themes/nu-themes/phd.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b8bbc2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#99bf52" attr: "b" } - empty: "#5299bf" - bool: {|| if $in { "#72b9bf" } else { "light_gray" } } - int: "#b8bbc2" - filesize: {|e| - if $e == 0b { - "#b8bbc2" - } else if $e < 1mb { - "#72b9bf" - } else {{ fg: "#5299bf" }} - } - duration: "#b8bbc2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d07346" attr: "b" } - } else if $in < 6hr { - "#d07346" - } else if $in < 1day { - "#fbd461" - } else if $in < 3day { - "#99bf52" - } else if $in < 1wk { - { fg: "#99bf52" attr: "b" } - } else if $in < 6wk { - "#72b9bf" - } else if $in < 52wk { - "#5299bf" - } else { "dark_gray" } - } - range: "#b8bbc2" - float: "#b8bbc2" - string: "#b8bbc2" - nothing: "#b8bbc2" - binary: "#b8bbc2" - cellpath: "#b8bbc2" - row_index: { fg: "#99bf52" attr: "b" } - record: "#b8bbc2" - list: "#b8bbc2" - block: "#b8bbc2" - hints: "dark_gray" - search_result: { fg: "#d07346" bg: "#b8bbc2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9989cc" attr: "b" } - shape_binary: { fg: "#9989cc" attr: "b" } - shape_block: { fg: "#5299bf" attr: "b" } - shape_bool: "#72b9bf" - shape_custom: "#99bf52" - shape_datetime: { fg: "#72b9bf" attr: "b" } - shape_directory: "#72b9bf" - shape_external: "#72b9bf" - shape_externalarg: { fg: "#99bf52" attr: "b" } - shape_filepath: "#72b9bf" - shape_flag: { fg: "#5299bf" attr: "b" } - shape_float: { fg: "#9989cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#72b9bf" attr: "b" } - shape_int: { fg: "#9989cc" attr: "b" } - shape_internalcall: { fg: "#72b9bf" attr: "b" } - shape_list: { fg: "#72b9bf" attr: "b" } - shape_literal: "#5299bf" - shape_match_pattern: "#99bf52" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#72b9bf" - shape_operator: "#fbd461" - shape_or: { fg: "#9989cc" attr: "b" } - shape_pipe: { fg: "#9989cc" attr: "b" } - shape_range: { fg: "#fbd461" attr: "b" } - shape_record: { fg: "#72b9bf" attr: "b" } - shape_redirection: { fg: "#9989cc" attr: "b" } - shape_signature: { fg: "#99bf52" attr: "b" } - shape_string: "#99bf52" - shape_string_interpolation: { fg: "#72b9bf" attr: "b" } - shape_table: { fg: "#5299bf" attr: "b" } - shape_variable: "#9989cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#061229" - foreground: "#b8bbc2" - cursor: "#b8bbc2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b8bbc2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#99bf52' attr: 'b' } + empty: '#5299bf' + bool: {|| if $in { '#72b9bf' } else { 'light_gray' } } + int: '#b8bbc2' + filesize: {|e| + if $e == 0b { + '#b8bbc2' + } else if $e < 1mb { + '#72b9bf' + } else {{ fg: '#5299bf' }} + } + duration: '#b8bbc2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d07346' attr: 'b' } + } else if $in < 6hr { + '#d07346' + } else if $in < 1day { + '#fbd461' + } else if $in < 3day { + '#99bf52' + } else if $in < 1wk { + { fg: '#99bf52' attr: 'b' } + } else if $in < 6wk { + '#72b9bf' + } else if $in < 52wk { + '#5299bf' + } else { 'dark_gray' } + } + range: '#b8bbc2' + float: '#b8bbc2' + string: '#b8bbc2' + nothing: '#b8bbc2' + binary: '#b8bbc2' + cellpath: '#b8bbc2' + row_index: { fg: '#99bf52' attr: 'b' } + record: '#b8bbc2' + list: '#b8bbc2' + block: '#b8bbc2' + hints: 'dark_gray' + search_result: { fg: '#d07346' bg: '#b8bbc2' } + + shape_and: { fg: '#9989cc' attr: 'b' } + shape_binary: { fg: '#9989cc' attr: 'b' } + shape_block: { fg: '#5299bf' attr: 'b' } + shape_bool: '#72b9bf' + shape_custom: '#99bf52' + shape_datetime: { fg: '#72b9bf' attr: 'b' } + shape_directory: '#72b9bf' + shape_external: '#72b9bf' + shape_externalarg: { fg: '#99bf52' attr: 'b' } + shape_filepath: '#72b9bf' + shape_flag: { fg: '#5299bf' attr: 'b' } + shape_float: { fg: '#9989cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#72b9bf' attr: 'b' } + shape_int: { fg: '#9989cc' attr: 'b' } + shape_internalcall: { fg: '#72b9bf' attr: 'b' } + shape_list: { fg: '#72b9bf' attr: 'b' } + shape_literal: '#5299bf' + shape_match_pattern: '#99bf52' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#72b9bf' + shape_operator: '#fbd461' + shape_or: { fg: '#9989cc' attr: 'b' } + shape_pipe: { fg: '#9989cc' attr: 'b' } + shape_range: { fg: '#fbd461' attr: 'b' } + shape_record: { fg: '#72b9bf' attr: 'b' } + shape_redirection: { fg: '#9989cc' attr: 'b' } + shape_signature: { fg: '#99bf52' attr: 'b' } + shape_string: '#99bf52' + shape_string_interpolation: { fg: '#72b9bf' attr: 'b' } + shape_table: { fg: '#5299bf' attr: 'b' } + shape_variable: '#9989cc' + + background: '#061229' + foreground: '#b8bbc2' + cursor: '#b8bbc2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/piatto-light.nu b/themes/nu-themes/piatto-light.nu index 684449e..cd7679d 100644 --- a/themes/nu-themes/piatto-light.nu +++ b/themes/nu-themes/piatto-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#66781d" attr: "b" } - empty: "#3b5ea7" - bool: {|| if $in { "#829428" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#66781d" - } else {{ fg: "#3b5ea7" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b23670" attr: "b" } - } else if $in < 6hr { - "#b23670" - } else if $in < 1day { - "#cc6e33" - } else if $in < 3day { - "#66781d" - } else if $in < 1wk { - { fg: "#66781d" attr: "b" } - } else if $in < 6wk { - "#66781d" - } else if $in < 52wk { - "#3b5ea7" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#66781d" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#b23670" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a353b2" attr: "b" } - shape_binary: { fg: "#a353b2" attr: "b" } - shape_block: { fg: "#3b5ea7" attr: "b" } - shape_bool: "#829428" - shape_custom: "#66781d" - shape_datetime: { fg: "#66781d" attr: "b" } - shape_directory: "#66781d" - shape_external: "#66781d" - shape_externalarg: { fg: "#66781d" attr: "b" } - shape_filepath: "#66781d" - shape_flag: { fg: "#3b5ea7" attr: "b" } - shape_float: { fg: "#a353b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#66781d" attr: "b" } - shape_int: { fg: "#a353b2" attr: "b" } - shape_internalcall: { fg: "#66781d" attr: "b" } - shape_list: { fg: "#66781d" attr: "b" } - shape_literal: "#3b5ea7" - shape_match_pattern: "#66781d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#829428" - shape_operator: "#cc6e33" - shape_or: { fg: "#a353b2" attr: "b" } - shape_pipe: { fg: "#a353b2" attr: "b" } - shape_range: { fg: "#cc6e33" attr: "b" } - shape_record: { fg: "#66781d" attr: "b" } - shape_redirection: { fg: "#a353b2" attr: "b" } - shape_signature: { fg: "#66781d" attr: "b" } - shape_string: "#66781d" - shape_string_interpolation: { fg: "#66781d" attr: "b" } - shape_table: { fg: "#3b5ea7" attr: "b" } - shape_variable: "#a353b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#414141" - cursor: "#5e76c7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#66781d' attr: 'b' } + empty: '#3b5ea7' + bool: {|| if $in { '#829428' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#66781d' + } else {{ fg: '#3b5ea7' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b23670' attr: 'b' } + } else if $in < 6hr { + '#b23670' + } else if $in < 1day { + '#cc6e33' + } else if $in < 3day { + '#66781d' + } else if $in < 1wk { + { fg: '#66781d' attr: 'b' } + } else if $in < 6wk { + '#66781d' + } else if $in < 52wk { + '#3b5ea7' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#66781d' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#b23670' bg: '#ffffff' } + + shape_and: { fg: '#a353b2' attr: 'b' } + shape_binary: { fg: '#a353b2' attr: 'b' } + shape_block: { fg: '#3b5ea7' attr: 'b' } + shape_bool: '#829428' + shape_custom: '#66781d' + shape_datetime: { fg: '#66781d' attr: 'b' } + shape_directory: '#66781d' + shape_external: '#66781d' + shape_externalarg: { fg: '#66781d' attr: 'b' } + shape_filepath: '#66781d' + shape_flag: { fg: '#3b5ea7' attr: 'b' } + shape_float: { fg: '#a353b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#66781d' attr: 'b' } + shape_int: { fg: '#a353b2' attr: 'b' } + shape_internalcall: { fg: '#66781d' attr: 'b' } + shape_list: { fg: '#66781d' attr: 'b' } + shape_literal: '#3b5ea7' + shape_match_pattern: '#66781d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#829428' + shape_operator: '#cc6e33' + shape_or: { fg: '#a353b2' attr: 'b' } + shape_pipe: { fg: '#a353b2' attr: 'b' } + shape_range: { fg: '#cc6e33' attr: 'b' } + shape_record: { fg: '#66781d' attr: 'b' } + shape_redirection: { fg: '#a353b2' attr: 'b' } + shape_signature: { fg: '#66781d' attr: 'b' } + shape_string: '#66781d' + shape_string_interpolation: { fg: '#66781d' attr: 'b' } + shape_table: { fg: '#3b5ea7' attr: 'b' } + shape_variable: '#a353b2' + + background: '#ffffff' + foreground: '#414141' + cursor: '#5e76c7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pico.nu b/themes/nu-themes/pico.nu index 6471806..8bb6055 100644 --- a/themes/nu-themes/pico.nu +++ b/themes/nu-themes/pico.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5f574f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00e756" attr: "b" } - empty: "#83769c" - bool: {|| if $in { "#29adff" } else { "light_gray" } } - int: "#5f574f" - filesize: {|e| - if $e == 0b { - "#5f574f" - } else if $e < 1mb { - "#29adff" - } else {{ fg: "#83769c" }} - } - duration: "#5f574f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff004d" attr: "b" } - } else if $in < 6hr { - "#ff004d" - } else if $in < 1day { - "#fff024" - } else if $in < 3day { - "#00e756" - } else if $in < 1wk { - { fg: "#00e756" attr: "b" } - } else if $in < 6wk { - "#29adff" - } else if $in < 52wk { - "#83769c" - } else { "dark_gray" } - } - range: "#5f574f" - float: "#5f574f" - string: "#5f574f" - nothing: "#5f574f" - binary: "#5f574f" - cellpath: "#5f574f" - row_index: { fg: "#00e756" attr: "b" } - record: "#5f574f" - list: "#5f574f" - block: "#5f574f" - hints: "dark_gray" - search_result: { fg: "#ff004d" bg: "#5f574f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff77a8" attr: "b" } - shape_binary: { fg: "#ff77a8" attr: "b" } - shape_block: { fg: "#83769c" attr: "b" } - shape_bool: "#29adff" - shape_custom: "#00e756" - shape_datetime: { fg: "#29adff" attr: "b" } - shape_directory: "#29adff" - shape_external: "#29adff" - shape_externalarg: { fg: "#00e756" attr: "b" } - shape_filepath: "#29adff" - shape_flag: { fg: "#83769c" attr: "b" } - shape_float: { fg: "#ff77a8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#29adff" attr: "b" } - shape_int: { fg: "#ff77a8" attr: "b" } - shape_internalcall: { fg: "#29adff" attr: "b" } - shape_list: { fg: "#29adff" attr: "b" } - shape_literal: "#83769c" - shape_match_pattern: "#00e756" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#29adff" - shape_operator: "#fff024" - shape_or: { fg: "#ff77a8" attr: "b" } - shape_pipe: { fg: "#ff77a8" attr: "b" } - shape_range: { fg: "#fff024" attr: "b" } - shape_record: { fg: "#29adff" attr: "b" } - shape_redirection: { fg: "#ff77a8" attr: "b" } - shape_signature: { fg: "#00e756" attr: "b" } - shape_string: "#00e756" - shape_string_interpolation: { fg: "#29adff" attr: "b" } - shape_table: { fg: "#83769c" attr: "b" } - shape_variable: "#ff77a8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#5f574f" - cursor: "#5f574f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5f574f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00e756' attr: 'b' } + empty: '#83769c' + bool: {|| if $in { '#29adff' } else { 'light_gray' } } + int: '#5f574f' + filesize: {|e| + if $e == 0b { + '#5f574f' + } else if $e < 1mb { + '#29adff' + } else {{ fg: '#83769c' }} + } + duration: '#5f574f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff004d' attr: 'b' } + } else if $in < 6hr { + '#ff004d' + } else if $in < 1day { + '#fff024' + } else if $in < 3day { + '#00e756' + } else if $in < 1wk { + { fg: '#00e756' attr: 'b' } + } else if $in < 6wk { + '#29adff' + } else if $in < 52wk { + '#83769c' + } else { 'dark_gray' } + } + range: '#5f574f' + float: '#5f574f' + string: '#5f574f' + nothing: '#5f574f' + binary: '#5f574f' + cellpath: '#5f574f' + row_index: { fg: '#00e756' attr: 'b' } + record: '#5f574f' + list: '#5f574f' + block: '#5f574f' + hints: 'dark_gray' + search_result: { fg: '#ff004d' bg: '#5f574f' } + + shape_and: { fg: '#ff77a8' attr: 'b' } + shape_binary: { fg: '#ff77a8' attr: 'b' } + shape_block: { fg: '#83769c' attr: 'b' } + shape_bool: '#29adff' + shape_custom: '#00e756' + shape_datetime: { fg: '#29adff' attr: 'b' } + shape_directory: '#29adff' + shape_external: '#29adff' + shape_externalarg: { fg: '#00e756' attr: 'b' } + shape_filepath: '#29adff' + shape_flag: { fg: '#83769c' attr: 'b' } + shape_float: { fg: '#ff77a8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#29adff' attr: 'b' } + shape_int: { fg: '#ff77a8' attr: 'b' } + shape_internalcall: { fg: '#29adff' attr: 'b' } + shape_list: { fg: '#29adff' attr: 'b' } + shape_literal: '#83769c' + shape_match_pattern: '#00e756' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#29adff' + shape_operator: '#fff024' + shape_or: { fg: '#ff77a8' attr: 'b' } + shape_pipe: { fg: '#ff77a8' attr: 'b' } + shape_range: { fg: '#fff024' attr: 'b' } + shape_record: { fg: '#29adff' attr: 'b' } + shape_redirection: { fg: '#ff77a8' attr: 'b' } + shape_signature: { fg: '#00e756' attr: 'b' } + shape_string: '#00e756' + shape_string_interpolation: { fg: '#29adff' attr: 'b' } + shape_table: { fg: '#83769c' attr: 'b' } + shape_variable: '#ff77a8' + + background: '#000000' + foreground: '#5f574f' + cursor: '#5f574f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pnevma.nu b/themes/nu-themes/pnevma.nu index d357e04..eeb5858 100644 --- a/themes/nu-themes/pnevma.nu +++ b/themes/nu-themes/pnevma.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#90a57d" attr: "b" } - empty: "#7fa5bd" - bool: {|| if $in { "#b1e7dd" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#8adbb4" - } else {{ fg: "#7fa5bd" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a36666" attr: "b" } - } else if $in < 6hr { - "#a36666" - } else if $in < 1day { - "#d7af87" - } else if $in < 3day { - "#90a57d" - } else if $in < 1wk { - { fg: "#90a57d" attr: "b" } - } else if $in < 6wk { - "#8adbb4" - } else if $in < 52wk { - "#7fa5bd" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#90a57d" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#a36666" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c79ec4" attr: "b" } - shape_binary: { fg: "#c79ec4" attr: "b" } - shape_block: { fg: "#7fa5bd" attr: "b" } - shape_bool: "#b1e7dd" - shape_custom: "#90a57d" - shape_datetime: { fg: "#8adbb4" attr: "b" } - shape_directory: "#8adbb4" - shape_external: "#8adbb4" - shape_externalarg: { fg: "#90a57d" attr: "b" } - shape_filepath: "#8adbb4" - shape_flag: { fg: "#7fa5bd" attr: "b" } - shape_float: { fg: "#c79ec4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8adbb4" attr: "b" } - shape_int: { fg: "#c79ec4" attr: "b" } - shape_internalcall: { fg: "#8adbb4" attr: "b" } - shape_list: { fg: "#8adbb4" attr: "b" } - shape_literal: "#7fa5bd" - shape_match_pattern: "#90a57d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b1e7dd" - shape_operator: "#d7af87" - shape_or: { fg: "#c79ec4" attr: "b" } - shape_pipe: { fg: "#c79ec4" attr: "b" } - shape_range: { fg: "#d7af87" attr: "b" } - shape_record: { fg: "#8adbb4" attr: "b" } - shape_redirection: { fg: "#c79ec4" attr: "b" } - shape_signature: { fg: "#90a57d" attr: "b" } - shape_string: "#90a57d" - shape_string_interpolation: { fg: "#8adbb4" attr: "b" } - shape_table: { fg: "#7fa5bd" attr: "b" } - shape_variable: "#c79ec4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1c1c" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#90a57d' attr: 'b' } + empty: '#7fa5bd' + bool: {|| if $in { '#b1e7dd' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#8adbb4' + } else {{ fg: '#7fa5bd' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a36666' attr: 'b' } + } else if $in < 6hr { + '#a36666' + } else if $in < 1day { + '#d7af87' + } else if $in < 3day { + '#90a57d' + } else if $in < 1wk { + { fg: '#90a57d' attr: 'b' } + } else if $in < 6wk { + '#8adbb4' + } else if $in < 52wk { + '#7fa5bd' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#90a57d' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#a36666' bg: '#d0d0d0' } + + shape_and: { fg: '#c79ec4' attr: 'b' } + shape_binary: { fg: '#c79ec4' attr: 'b' } + shape_block: { fg: '#7fa5bd' attr: 'b' } + shape_bool: '#b1e7dd' + shape_custom: '#90a57d' + shape_datetime: { fg: '#8adbb4' attr: 'b' } + shape_directory: '#8adbb4' + shape_external: '#8adbb4' + shape_externalarg: { fg: '#90a57d' attr: 'b' } + shape_filepath: '#8adbb4' + shape_flag: { fg: '#7fa5bd' attr: 'b' } + shape_float: { fg: '#c79ec4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8adbb4' attr: 'b' } + shape_int: { fg: '#c79ec4' attr: 'b' } + shape_internalcall: { fg: '#8adbb4' attr: 'b' } + shape_list: { fg: '#8adbb4' attr: 'b' } + shape_literal: '#7fa5bd' + shape_match_pattern: '#90a57d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b1e7dd' + shape_operator: '#d7af87' + shape_or: { fg: '#c79ec4' attr: 'b' } + shape_pipe: { fg: '#c79ec4' attr: 'b' } + shape_range: { fg: '#d7af87' attr: 'b' } + shape_record: { fg: '#8adbb4' attr: 'b' } + shape_redirection: { fg: '#c79ec4' attr: 'b' } + shape_signature: { fg: '#90a57d' attr: 'b' } + shape_string: '#90a57d' + shape_string_interpolation: { fg: '#8adbb4' attr: 'b' } + shape_table: { fg: '#7fa5bd' attr: 'b' } + shape_variable: '#c79ec4' + + background: '#1c1c1c' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pop.nu b/themes/nu-themes/pop.nu index 3715a67..964983c 100644 --- a/themes/nu-themes/pop.nu +++ b/themes/nu-themes/pop.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#37b349" attr: "b" } - empty: "#0e5a94" - bool: {|| if $in { "#00aabb" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#00aabb" - } else {{ fg: "#0e5a94" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#eb008a" attr: "b" } - } else if $in < 6hr { - "#eb008a" - } else if $in < 1day { - "#f8ca12" - } else if $in < 3day { - "#37b349" - } else if $in < 1wk { - { fg: "#37b349" attr: "b" } - } else if $in < 6wk { - "#00aabb" - } else if $in < 52wk { - "#0e5a94" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#37b349" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#eb008a" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b31e8d" attr: "b" } - shape_binary: { fg: "#b31e8d" attr: "b" } - shape_block: { fg: "#0e5a94" attr: "b" } - shape_bool: "#00aabb" - shape_custom: "#37b349" - shape_datetime: { fg: "#00aabb" attr: "b" } - shape_directory: "#00aabb" - shape_external: "#00aabb" - shape_externalarg: { fg: "#37b349" attr: "b" } - shape_filepath: "#00aabb" - shape_flag: { fg: "#0e5a94" attr: "b" } - shape_float: { fg: "#b31e8d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00aabb" attr: "b" } - shape_int: { fg: "#b31e8d" attr: "b" } - shape_internalcall: { fg: "#00aabb" attr: "b" } - shape_list: { fg: "#00aabb" attr: "b" } - shape_literal: "#0e5a94" - shape_match_pattern: "#37b349" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00aabb" - shape_operator: "#f8ca12" - shape_or: { fg: "#b31e8d" attr: "b" } - shape_pipe: { fg: "#b31e8d" attr: "b" } - shape_range: { fg: "#f8ca12" attr: "b" } - shape_record: { fg: "#00aabb" attr: "b" } - shape_redirection: { fg: "#b31e8d" attr: "b" } - shape_signature: { fg: "#37b349" attr: "b" } - shape_string: "#37b349" - shape_string_interpolation: { fg: "#00aabb" attr: "b" } - shape_table: { fg: "#0e5a94" attr: "b" } - shape_variable: "#b31e8d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#37b349' attr: 'b' } + empty: '#0e5a94' + bool: {|| if $in { '#00aabb' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#00aabb' + } else {{ fg: '#0e5a94' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#eb008a' attr: 'b' } + } else if $in < 6hr { + '#eb008a' + } else if $in < 1day { + '#f8ca12' + } else if $in < 3day { + '#37b349' + } else if $in < 1wk { + { fg: '#37b349' attr: 'b' } + } else if $in < 6wk { + '#00aabb' + } else if $in < 52wk { + '#0e5a94' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#37b349' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#eb008a' bg: '#d0d0d0' } + + shape_and: { fg: '#b31e8d' attr: 'b' } + shape_binary: { fg: '#b31e8d' attr: 'b' } + shape_block: { fg: '#0e5a94' attr: 'b' } + shape_bool: '#00aabb' + shape_custom: '#37b349' + shape_datetime: { fg: '#00aabb' attr: 'b' } + shape_directory: '#00aabb' + shape_external: '#00aabb' + shape_externalarg: { fg: '#37b349' attr: 'b' } + shape_filepath: '#00aabb' + shape_flag: { fg: '#0e5a94' attr: 'b' } + shape_float: { fg: '#b31e8d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00aabb' attr: 'b' } + shape_int: { fg: '#b31e8d' attr: 'b' } + shape_internalcall: { fg: '#00aabb' attr: 'b' } + shape_list: { fg: '#00aabb' attr: 'b' } + shape_literal: '#0e5a94' + shape_match_pattern: '#37b349' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00aabb' + shape_operator: '#f8ca12' + shape_or: { fg: '#b31e8d' attr: 'b' } + shape_pipe: { fg: '#b31e8d' attr: 'b' } + shape_range: { fg: '#f8ca12' attr: 'b' } + shape_record: { fg: '#00aabb' attr: 'b' } + shape_redirection: { fg: '#b31e8d' attr: 'b' } + shape_signature: { fg: '#37b349' attr: 'b' } + shape_string: '#37b349' + shape_string_interpolation: { fg: '#00aabb' attr: 'b' } + shape_table: { fg: '#0e5a94' attr: 'b' } + shape_variable: '#b31e8d' + + background: '#000000' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/porple.nu b/themes/nu-themes/porple.nu index 61f46c1..1d9daa4 100644 --- a/themes/nu-themes/porple.nu +++ b/themes/nu-themes/porple.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d8d8d8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#95c76f" attr: "b" } - empty: "#8485ce" - bool: {|| if $in { "#64878f" } else { "light_gray" } } - int: "#d8d8d8" - filesize: {|e| - if $e == 0b { - "#d8d8d8" - } else if $e < 1mb { - "#64878f" - } else {{ fg: "#8485ce" }} - } - duration: "#d8d8d8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f84547" attr: "b" } - } else if $in < 6hr { - "#f84547" - } else if $in < 1day { - "#efa16b" - } else if $in < 3day { - "#95c76f" - } else if $in < 1wk { - { fg: "#95c76f" attr: "b" } - } else if $in < 6wk { - "#64878f" - } else if $in < 52wk { - "#8485ce" - } else { "dark_gray" } - } - range: "#d8d8d8" - float: "#d8d8d8" - string: "#d8d8d8" - nothing: "#d8d8d8" - binary: "#d8d8d8" - cellpath: "#d8d8d8" - row_index: { fg: "#95c76f" attr: "b" } - record: "#d8d8d8" - list: "#d8d8d8" - block: "#d8d8d8" - hints: "dark_gray" - search_result: { fg: "#f84547" bg: "#d8d8d8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b74989" attr: "b" } - shape_binary: { fg: "#b74989" attr: "b" } - shape_block: { fg: "#8485ce" attr: "b" } - shape_bool: "#64878f" - shape_custom: "#95c76f" - shape_datetime: { fg: "#64878f" attr: "b" } - shape_directory: "#64878f" - shape_external: "#64878f" - shape_externalarg: { fg: "#95c76f" attr: "b" } - shape_filepath: "#64878f" - shape_flag: { fg: "#8485ce" attr: "b" } - shape_float: { fg: "#b74989" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#64878f" attr: "b" } - shape_int: { fg: "#b74989" attr: "b" } - shape_internalcall: { fg: "#64878f" attr: "b" } - shape_list: { fg: "#64878f" attr: "b" } - shape_literal: "#8485ce" - shape_match_pattern: "#95c76f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#64878f" - shape_operator: "#efa16b" - shape_or: { fg: "#b74989" attr: "b" } - shape_pipe: { fg: "#b74989" attr: "b" } - shape_range: { fg: "#efa16b" attr: "b" } - shape_record: { fg: "#64878f" attr: "b" } - shape_redirection: { fg: "#b74989" attr: "b" } - shape_signature: { fg: "#95c76f" attr: "b" } - shape_string: "#95c76f" - shape_string_interpolation: { fg: "#64878f" attr: "b" } - shape_table: { fg: "#8485ce" attr: "b" } - shape_variable: "#b74989" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#292c36" - foreground: "#d8d8d8" - cursor: "#d8d8d8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d8d8d8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#95c76f' attr: 'b' } + empty: '#8485ce' + bool: {|| if $in { '#64878f' } else { 'light_gray' } } + int: '#d8d8d8' + filesize: {|e| + if $e == 0b { + '#d8d8d8' + } else if $e < 1mb { + '#64878f' + } else {{ fg: '#8485ce' }} + } + duration: '#d8d8d8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f84547' attr: 'b' } + } else if $in < 6hr { + '#f84547' + } else if $in < 1day { + '#efa16b' + } else if $in < 3day { + '#95c76f' + } else if $in < 1wk { + { fg: '#95c76f' attr: 'b' } + } else if $in < 6wk { + '#64878f' + } else if $in < 52wk { + '#8485ce' + } else { 'dark_gray' } + } + range: '#d8d8d8' + float: '#d8d8d8' + string: '#d8d8d8' + nothing: '#d8d8d8' + binary: '#d8d8d8' + cellpath: '#d8d8d8' + row_index: { fg: '#95c76f' attr: 'b' } + record: '#d8d8d8' + list: '#d8d8d8' + block: '#d8d8d8' + hints: 'dark_gray' + search_result: { fg: '#f84547' bg: '#d8d8d8' } + + shape_and: { fg: '#b74989' attr: 'b' } + shape_binary: { fg: '#b74989' attr: 'b' } + shape_block: { fg: '#8485ce' attr: 'b' } + shape_bool: '#64878f' + shape_custom: '#95c76f' + shape_datetime: { fg: '#64878f' attr: 'b' } + shape_directory: '#64878f' + shape_external: '#64878f' + shape_externalarg: { fg: '#95c76f' attr: 'b' } + shape_filepath: '#64878f' + shape_flag: { fg: '#8485ce' attr: 'b' } + shape_float: { fg: '#b74989' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#64878f' attr: 'b' } + shape_int: { fg: '#b74989' attr: 'b' } + shape_internalcall: { fg: '#64878f' attr: 'b' } + shape_list: { fg: '#64878f' attr: 'b' } + shape_literal: '#8485ce' + shape_match_pattern: '#95c76f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#64878f' + shape_operator: '#efa16b' + shape_or: { fg: '#b74989' attr: 'b' } + shape_pipe: { fg: '#b74989' attr: 'b' } + shape_range: { fg: '#efa16b' attr: 'b' } + shape_record: { fg: '#64878f' attr: 'b' } + shape_redirection: { fg: '#b74989' attr: 'b' } + shape_signature: { fg: '#95c76f' attr: 'b' } + shape_string: '#95c76f' + shape_string_interpolation: { fg: '#64878f' attr: 'b' } + shape_table: { fg: '#8485ce' attr: 'b' } + shape_variable: '#b74989' + + background: '#292c36' + foreground: '#d8d8d8' + cursor: '#d8d8d8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/pro.nu b/themes/nu-themes/pro.nu index d1d194a..d5e472c 100644 --- a/themes/nu-themes/pro.nu +++ b/themes/nu-themes/pro.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a600" attr: "b" } - empty: "#2009db" - bool: {|| if $in { "#00e5e5" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#00a6b2" - } else {{ fg: "#2009db" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#990000" attr: "b" } - } else if $in < 6hr { - "#990000" - } else if $in < 1day { - "#999900" - } else if $in < 3day { - "#00a600" - } else if $in < 1wk { - { fg: "#00a600" attr: "b" } - } else if $in < 6wk { - "#00a6b2" - } else if $in < 52wk { - "#2009db" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#00a600" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#990000" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b200b2" attr: "b" } - shape_binary: { fg: "#b200b2" attr: "b" } - shape_block: { fg: "#2009db" attr: "b" } - shape_bool: "#00e5e5" - shape_custom: "#00a600" - shape_datetime: { fg: "#00a6b2" attr: "b" } - shape_directory: "#00a6b2" - shape_external: "#00a6b2" - shape_externalarg: { fg: "#00a600" attr: "b" } - shape_filepath: "#00a6b2" - shape_flag: { fg: "#2009db" attr: "b" } - shape_float: { fg: "#b200b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a6b2" attr: "b" } - shape_int: { fg: "#b200b2" attr: "b" } - shape_internalcall: { fg: "#00a6b2" attr: "b" } - shape_list: { fg: "#00a6b2" attr: "b" } - shape_literal: "#2009db" - shape_match_pattern: "#00a600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e5e5" - shape_operator: "#999900" - shape_or: { fg: "#b200b2" attr: "b" } - shape_pipe: { fg: "#b200b2" attr: "b" } - shape_range: { fg: "#999900" attr: "b" } - shape_record: { fg: "#00a6b2" attr: "b" } - shape_redirection: { fg: "#b200b2" attr: "b" } - shape_signature: { fg: "#00a600" attr: "b" } - shape_string: "#00a600" - shape_string_interpolation: { fg: "#00a6b2" attr: "b" } - shape_table: { fg: "#2009db" attr: "b" } - shape_variable: "#b200b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#f2f2f2" - cursor: "#f2f2f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a600' attr: 'b' } + empty: '#2009db' + bool: {|| if $in { '#00e5e5' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#00a6b2' + } else {{ fg: '#2009db' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#990000' attr: 'b' } + } else if $in < 6hr { + '#990000' + } else if $in < 1day { + '#999900' + } else if $in < 3day { + '#00a600' + } else if $in < 1wk { + { fg: '#00a600' attr: 'b' } + } else if $in < 6wk { + '#00a6b2' + } else if $in < 52wk { + '#2009db' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#00a600' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#990000' bg: '#bfbfbf' } + + shape_and: { fg: '#b200b2' attr: 'b' } + shape_binary: { fg: '#b200b2' attr: 'b' } + shape_block: { fg: '#2009db' attr: 'b' } + shape_bool: '#00e5e5' + shape_custom: '#00a600' + shape_datetime: { fg: '#00a6b2' attr: 'b' } + shape_directory: '#00a6b2' + shape_external: '#00a6b2' + shape_externalarg: { fg: '#00a600' attr: 'b' } + shape_filepath: '#00a6b2' + shape_flag: { fg: '#2009db' attr: 'b' } + shape_float: { fg: '#b200b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a6b2' attr: 'b' } + shape_int: { fg: '#b200b2' attr: 'b' } + shape_internalcall: { fg: '#00a6b2' attr: 'b' } + shape_list: { fg: '#00a6b2' attr: 'b' } + shape_literal: '#2009db' + shape_match_pattern: '#00a600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e5e5' + shape_operator: '#999900' + shape_or: { fg: '#b200b2' attr: 'b' } + shape_pipe: { fg: '#b200b2' attr: 'b' } + shape_range: { fg: '#999900' attr: 'b' } + shape_record: { fg: '#00a6b2' attr: 'b' } + shape_redirection: { fg: '#b200b2' attr: 'b' } + shape_signature: { fg: '#00a600' attr: 'b' } + shape_string: '#00a600' + shape_string_interpolation: { fg: '#00a6b2' attr: 'b' } + shape_table: { fg: '#2009db' attr: 'b' } + shape_variable: '#b200b2' + + background: '#000000' + foreground: '#f2f2f2' + cursor: '#f2f2f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/railscasts.nu b/themes/nu-themes/railscasts.nu index 640f319..59bd18a 100644 --- a/themes/nu-themes/railscasts.nu +++ b/themes/nu-themes/railscasts.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e6e1dc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a5c261" attr: "b" } - empty: "#6d9cbe" - bool: {|| if $in { "#519f50" } else { "light_gray" } } - int: "#e6e1dc" - filesize: {|e| - if $e == 0b { - "#e6e1dc" - } else if $e < 1mb { - "#519f50" - } else {{ fg: "#6d9cbe" }} - } - duration: "#e6e1dc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#da4939" attr: "b" } - } else if $in < 6hr { - "#da4939" - } else if $in < 1day { - "#ffc66d" - } else if $in < 3day { - "#a5c261" - } else if $in < 1wk { - { fg: "#a5c261" attr: "b" } - } else if $in < 6wk { - "#519f50" - } else if $in < 52wk { - "#6d9cbe" - } else { "dark_gray" } - } - range: "#e6e1dc" - float: "#e6e1dc" - string: "#e6e1dc" - nothing: "#e6e1dc" - binary: "#e6e1dc" - cellpath: "#e6e1dc" - row_index: { fg: "#a5c261" attr: "b" } - record: "#e6e1dc" - list: "#e6e1dc" - block: "#e6e1dc" - hints: "dark_gray" - search_result: { fg: "#da4939" bg: "#e6e1dc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b6b3eb" attr: "b" } - shape_binary: { fg: "#b6b3eb" attr: "b" } - shape_block: { fg: "#6d9cbe" attr: "b" } - shape_bool: "#519f50" - shape_custom: "#a5c261" - shape_datetime: { fg: "#519f50" attr: "b" } - shape_directory: "#519f50" - shape_external: "#519f50" - shape_externalarg: { fg: "#a5c261" attr: "b" } - shape_filepath: "#519f50" - shape_flag: { fg: "#6d9cbe" attr: "b" } - shape_float: { fg: "#b6b3eb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#519f50" attr: "b" } - shape_int: { fg: "#b6b3eb" attr: "b" } - shape_internalcall: { fg: "#519f50" attr: "b" } - shape_list: { fg: "#519f50" attr: "b" } - shape_literal: "#6d9cbe" - shape_match_pattern: "#a5c261" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#519f50" - shape_operator: "#ffc66d" - shape_or: { fg: "#b6b3eb" attr: "b" } - shape_pipe: { fg: "#b6b3eb" attr: "b" } - shape_range: { fg: "#ffc66d" attr: "b" } - shape_record: { fg: "#519f50" attr: "b" } - shape_redirection: { fg: "#b6b3eb" attr: "b" } - shape_signature: { fg: "#a5c261" attr: "b" } - shape_string: "#a5c261" - shape_string_interpolation: { fg: "#519f50" attr: "b" } - shape_table: { fg: "#6d9cbe" attr: "b" } - shape_variable: "#b6b3eb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b2b2b" - foreground: "#e6e1dc" - cursor: "#e6e1dc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e6e1dc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a5c261' attr: 'b' } + empty: '#6d9cbe' + bool: {|| if $in { '#519f50' } else { 'light_gray' } } + int: '#e6e1dc' + filesize: {|e| + if $e == 0b { + '#e6e1dc' + } else if $e < 1mb { + '#519f50' + } else {{ fg: '#6d9cbe' }} + } + duration: '#e6e1dc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#da4939' attr: 'b' } + } else if $in < 6hr { + '#da4939' + } else if $in < 1day { + '#ffc66d' + } else if $in < 3day { + '#a5c261' + } else if $in < 1wk { + { fg: '#a5c261' attr: 'b' } + } else if $in < 6wk { + '#519f50' + } else if $in < 52wk { + '#6d9cbe' + } else { 'dark_gray' } + } + range: '#e6e1dc' + float: '#e6e1dc' + string: '#e6e1dc' + nothing: '#e6e1dc' + binary: '#e6e1dc' + cellpath: '#e6e1dc' + row_index: { fg: '#a5c261' attr: 'b' } + record: '#e6e1dc' + list: '#e6e1dc' + block: '#e6e1dc' + hints: 'dark_gray' + search_result: { fg: '#da4939' bg: '#e6e1dc' } + + shape_and: { fg: '#b6b3eb' attr: 'b' } + shape_binary: { fg: '#b6b3eb' attr: 'b' } + shape_block: { fg: '#6d9cbe' attr: 'b' } + shape_bool: '#519f50' + shape_custom: '#a5c261' + shape_datetime: { fg: '#519f50' attr: 'b' } + shape_directory: '#519f50' + shape_external: '#519f50' + shape_externalarg: { fg: '#a5c261' attr: 'b' } + shape_filepath: '#519f50' + shape_flag: { fg: '#6d9cbe' attr: 'b' } + shape_float: { fg: '#b6b3eb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#519f50' attr: 'b' } + shape_int: { fg: '#b6b3eb' attr: 'b' } + shape_internalcall: { fg: '#519f50' attr: 'b' } + shape_list: { fg: '#519f50' attr: 'b' } + shape_literal: '#6d9cbe' + shape_match_pattern: '#a5c261' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#519f50' + shape_operator: '#ffc66d' + shape_or: { fg: '#b6b3eb' attr: 'b' } + shape_pipe: { fg: '#b6b3eb' attr: 'b' } + shape_range: { fg: '#ffc66d' attr: 'b' } + shape_record: { fg: '#519f50' attr: 'b' } + shape_redirection: { fg: '#b6b3eb' attr: 'b' } + shape_signature: { fg: '#a5c261' attr: 'b' } + shape_string: '#a5c261' + shape_string_interpolation: { fg: '#519f50' attr: 'b' } + shape_table: { fg: '#6d9cbe' attr: 'b' } + shape_variable: '#b6b3eb' + + background: '#2b2b2b' + foreground: '#e6e1dc' + cursor: '#e6e1dc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/rebecca.nu b/themes/nu-themes/rebecca.nu index d7ef1b9..e13d875 100644 --- a/themes/nu-themes/rebecca.nu +++ b/themes/nu-themes/rebecca.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f1eff8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6dfedf" attr: "b" } - empty: "#2de0a7" - bool: {|| if $in { "#8eaee0" } else { "light_gray" } } - int: "#f1eff8" - filesize: {|e| - if $e == 0b { - "#f1eff8" - } else if $e < 1mb { - "#8eaee0" - } else {{ fg: "#2de0a7" }} - } - duration: "#f1eff8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a0a0c5" attr: "b" } - } else if $in < 6hr { - "#a0a0c5" - } else if $in < 1day { - "#ae81ff" - } else if $in < 3day { - "#6dfedf" - } else if $in < 1wk { - { fg: "#6dfedf" attr: "b" } - } else if $in < 6wk { - "#8eaee0" - } else if $in < 52wk { - "#2de0a7" - } else { "dark_gray" } - } - range: "#f1eff8" - float: "#f1eff8" - string: "#f1eff8" - nothing: "#f1eff8" - binary: "#f1eff8" - cellpath: "#f1eff8" - row_index: { fg: "#6dfedf" attr: "b" } - record: "#f1eff8" - list: "#f1eff8" - block: "#f1eff8" - hints: "dark_gray" - search_result: { fg: "#a0a0c5" bg: "#f1eff8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#7aa5ff" attr: "b" } - shape_binary: { fg: "#7aa5ff" attr: "b" } - shape_block: { fg: "#2de0a7" attr: "b" } - shape_bool: "#8eaee0" - shape_custom: "#6dfedf" - shape_datetime: { fg: "#8eaee0" attr: "b" } - shape_directory: "#8eaee0" - shape_external: "#8eaee0" - shape_externalarg: { fg: "#6dfedf" attr: "b" } - shape_filepath: "#8eaee0" - shape_flag: { fg: "#2de0a7" attr: "b" } - shape_float: { fg: "#7aa5ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8eaee0" attr: "b" } - shape_int: { fg: "#7aa5ff" attr: "b" } - shape_internalcall: { fg: "#8eaee0" attr: "b" } - shape_list: { fg: "#8eaee0" attr: "b" } - shape_literal: "#2de0a7" - shape_match_pattern: "#6dfedf" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8eaee0" - shape_operator: "#ae81ff" - shape_or: { fg: "#7aa5ff" attr: "b" } - shape_pipe: { fg: "#7aa5ff" attr: "b" } - shape_range: { fg: "#ae81ff" attr: "b" } - shape_record: { fg: "#8eaee0" attr: "b" } - shape_redirection: { fg: "#7aa5ff" attr: "b" } - shape_signature: { fg: "#6dfedf" attr: "b" } - shape_string: "#6dfedf" - shape_string_interpolation: { fg: "#8eaee0" attr: "b" } - shape_table: { fg: "#2de0a7" attr: "b" } - shape_variable: "#7aa5ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#292a44" - foreground: "#f1eff8" - cursor: "#f1eff8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f1eff8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6dfedf' attr: 'b' } + empty: '#2de0a7' + bool: {|| if $in { '#8eaee0' } else { 'light_gray' } } + int: '#f1eff8' + filesize: {|e| + if $e == 0b { + '#f1eff8' + } else if $e < 1mb { + '#8eaee0' + } else {{ fg: '#2de0a7' }} + } + duration: '#f1eff8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a0a0c5' attr: 'b' } + } else if $in < 6hr { + '#a0a0c5' + } else if $in < 1day { + '#ae81ff' + } else if $in < 3day { + '#6dfedf' + } else if $in < 1wk { + { fg: '#6dfedf' attr: 'b' } + } else if $in < 6wk { + '#8eaee0' + } else if $in < 52wk { + '#2de0a7' + } else { 'dark_gray' } + } + range: '#f1eff8' + float: '#f1eff8' + string: '#f1eff8' + nothing: '#f1eff8' + binary: '#f1eff8' + cellpath: '#f1eff8' + row_index: { fg: '#6dfedf' attr: 'b' } + record: '#f1eff8' + list: '#f1eff8' + block: '#f1eff8' + hints: 'dark_gray' + search_result: { fg: '#a0a0c5' bg: '#f1eff8' } + + shape_and: { fg: '#7aa5ff' attr: 'b' } + shape_binary: { fg: '#7aa5ff' attr: 'b' } + shape_block: { fg: '#2de0a7' attr: 'b' } + shape_bool: '#8eaee0' + shape_custom: '#6dfedf' + shape_datetime: { fg: '#8eaee0' attr: 'b' } + shape_directory: '#8eaee0' + shape_external: '#8eaee0' + shape_externalarg: { fg: '#6dfedf' attr: 'b' } + shape_filepath: '#8eaee0' + shape_flag: { fg: '#2de0a7' attr: 'b' } + shape_float: { fg: '#7aa5ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8eaee0' attr: 'b' } + shape_int: { fg: '#7aa5ff' attr: 'b' } + shape_internalcall: { fg: '#8eaee0' attr: 'b' } + shape_list: { fg: '#8eaee0' attr: 'b' } + shape_literal: '#2de0a7' + shape_match_pattern: '#6dfedf' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8eaee0' + shape_operator: '#ae81ff' + shape_or: { fg: '#7aa5ff' attr: 'b' } + shape_pipe: { fg: '#7aa5ff' attr: 'b' } + shape_range: { fg: '#ae81ff' attr: 'b' } + shape_record: { fg: '#8eaee0' attr: 'b' } + shape_redirection: { fg: '#7aa5ff' attr: 'b' } + shape_signature: { fg: '#6dfedf' attr: 'b' } + shape_string: '#6dfedf' + shape_string_interpolation: { fg: '#8eaee0' attr: 'b' } + shape_table: { fg: '#2de0a7' attr: 'b' } + shape_variable: '#7aa5ff' + + background: '#292a44' + foreground: '#f1eff8' + cursor: '#f1eff8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/red-alert.nu b/themes/nu-themes/red-alert.nu index 89ca684..73481a4 100644 --- a/themes/nu-themes/red-alert.nu +++ b/themes/nu-themes/red-alert.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d6d6d6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#71be6b" attr: "b" } - empty: "#489bee" - bool: {|| if $in { "#b7dfdd" } else { "light_gray" } } - int: "#d6d6d6" - filesize: {|e| - if $e == 0b { - "#d6d6d6" - } else if $e < 1mb { - "#6bbeb8" - } else {{ fg: "#489bee" }} - } - duration: "#d6d6d6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d62e4e" attr: "b" } - } else if $in < 6hr { - "#d62e4e" - } else if $in < 1day { - "#beb86b" - } else if $in < 3day { - "#71be6b" - } else if $in < 1wk { - { fg: "#71be6b" attr: "b" } - } else if $in < 6wk { - "#6bbeb8" - } else if $in < 52wk { - "#489bee" - } else { "dark_gray" } - } - range: "#d6d6d6" - float: "#d6d6d6" - string: "#d6d6d6" - nothing: "#d6d6d6" - binary: "#d6d6d6" - cellpath: "#d6d6d6" - row_index: { fg: "#71be6b" attr: "b" } - record: "#d6d6d6" - list: "#d6d6d6" - block: "#d6d6d6" - hints: "dark_gray" - search_result: { fg: "#d62e4e" bg: "#d6d6d6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e979d7" attr: "b" } - shape_binary: { fg: "#e979d7" attr: "b" } - shape_block: { fg: "#489bee" attr: "b" } - shape_bool: "#b7dfdd" - shape_custom: "#71be6b" - shape_datetime: { fg: "#6bbeb8" attr: "b" } - shape_directory: "#6bbeb8" - shape_external: "#6bbeb8" - shape_externalarg: { fg: "#71be6b" attr: "b" } - shape_filepath: "#6bbeb8" - shape_flag: { fg: "#489bee" attr: "b" } - shape_float: { fg: "#e979d7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6bbeb8" attr: "b" } - shape_int: { fg: "#e979d7" attr: "b" } - shape_internalcall: { fg: "#6bbeb8" attr: "b" } - shape_list: { fg: "#6bbeb8" attr: "b" } - shape_literal: "#489bee" - shape_match_pattern: "#71be6b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b7dfdd" - shape_operator: "#beb86b" - shape_or: { fg: "#e979d7" attr: "b" } - shape_pipe: { fg: "#e979d7" attr: "b" } - shape_range: { fg: "#beb86b" attr: "b" } - shape_record: { fg: "#6bbeb8" attr: "b" } - shape_redirection: { fg: "#e979d7" attr: "b" } - shape_signature: { fg: "#71be6b" attr: "b" } - shape_string: "#71be6b" - shape_string_interpolation: { fg: "#6bbeb8" attr: "b" } - shape_table: { fg: "#489bee" attr: "b" } - shape_variable: "#e979d7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#762423" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d6d6d6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#71be6b' attr: 'b' } + empty: '#489bee' + bool: {|| if $in { '#b7dfdd' } else { 'light_gray' } } + int: '#d6d6d6' + filesize: {|e| + if $e == 0b { + '#d6d6d6' + } else if $e < 1mb { + '#6bbeb8' + } else {{ fg: '#489bee' }} + } + duration: '#d6d6d6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d62e4e' attr: 'b' } + } else if $in < 6hr { + '#d62e4e' + } else if $in < 1day { + '#beb86b' + } else if $in < 3day { + '#71be6b' + } else if $in < 1wk { + { fg: '#71be6b' attr: 'b' } + } else if $in < 6wk { + '#6bbeb8' + } else if $in < 52wk { + '#489bee' + } else { 'dark_gray' } + } + range: '#d6d6d6' + float: '#d6d6d6' + string: '#d6d6d6' + nothing: '#d6d6d6' + binary: '#d6d6d6' + cellpath: '#d6d6d6' + row_index: { fg: '#71be6b' attr: 'b' } + record: '#d6d6d6' + list: '#d6d6d6' + block: '#d6d6d6' + hints: 'dark_gray' + search_result: { fg: '#d62e4e' bg: '#d6d6d6' } + + shape_and: { fg: '#e979d7' attr: 'b' } + shape_binary: { fg: '#e979d7' attr: 'b' } + shape_block: { fg: '#489bee' attr: 'b' } + shape_bool: '#b7dfdd' + shape_custom: '#71be6b' + shape_datetime: { fg: '#6bbeb8' attr: 'b' } + shape_directory: '#6bbeb8' + shape_external: '#6bbeb8' + shape_externalarg: { fg: '#71be6b' attr: 'b' } + shape_filepath: '#6bbeb8' + shape_flag: { fg: '#489bee' attr: 'b' } + shape_float: { fg: '#e979d7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6bbeb8' attr: 'b' } + shape_int: { fg: '#e979d7' attr: 'b' } + shape_internalcall: { fg: '#6bbeb8' attr: 'b' } + shape_list: { fg: '#6bbeb8' attr: 'b' } + shape_literal: '#489bee' + shape_match_pattern: '#71be6b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b7dfdd' + shape_operator: '#beb86b' + shape_or: { fg: '#e979d7' attr: 'b' } + shape_pipe: { fg: '#e979d7' attr: 'b' } + shape_range: { fg: '#beb86b' attr: 'b' } + shape_record: { fg: '#6bbeb8' attr: 'b' } + shape_redirection: { fg: '#e979d7' attr: 'b' } + shape_signature: { fg: '#71be6b' attr: 'b' } + shape_string: '#71be6b' + shape_string_interpolation: { fg: '#6bbeb8' attr: 'b' } + shape_table: { fg: '#489bee' attr: 'b' } + shape_variable: '#e979d7' + + background: '#762423' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/red-sands.nu b/themes/nu-themes/red-sands.nu index 1399508..4c26454 100644 --- a/themes/nu-themes/red-sands.nu +++ b/themes/nu-themes/red-sands.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bbbbbb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00bb00" attr: "b" } - empty: "#0072ff" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#bbbbbb" - filesize: {|e| - if $e == 0b { - "#bbbbbb" - } else if $e < 1mb { - "#00bbbb" - } else {{ fg: "#0072ff" }} - } - duration: "#bbbbbb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff3f00" attr: "b" } - } else if $in < 6hr { - "#ff3f00" - } else if $in < 1day { - "#e7b000" - } else if $in < 3day { - "#00bb00" - } else if $in < 1wk { - { fg: "#00bb00" attr: "b" } - } else if $in < 6wk { - "#00bbbb" - } else if $in < 52wk { - "#0072ff" - } else { "dark_gray" } - } - range: "#bbbbbb" - float: "#bbbbbb" - string: "#bbbbbb" - nothing: "#bbbbbb" - binary: "#bbbbbb" - cellpath: "#bbbbbb" - row_index: { fg: "#00bb00" attr: "b" } - record: "#bbbbbb" - list: "#bbbbbb" - block: "#bbbbbb" - hints: "dark_gray" - search_result: { fg: "#ff3f00" bg: "#bbbbbb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb00bb" attr: "b" } - shape_binary: { fg: "#bb00bb" attr: "b" } - shape_block: { fg: "#0072ff" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#00bb00" - shape_datetime: { fg: "#00bbbb" attr: "b" } - shape_directory: "#00bbbb" - shape_external: "#00bbbb" - shape_externalarg: { fg: "#00bb00" attr: "b" } - shape_filepath: "#00bbbb" - shape_flag: { fg: "#0072ff" attr: "b" } - shape_float: { fg: "#bb00bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00bbbb" attr: "b" } - shape_int: { fg: "#bb00bb" attr: "b" } - shape_internalcall: { fg: "#00bbbb" attr: "b" } - shape_list: { fg: "#00bbbb" attr: "b" } - shape_literal: "#0072ff" - shape_match_pattern: "#00bb00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#e7b000" - shape_or: { fg: "#bb00bb" attr: "b" } - shape_pipe: { fg: "#bb00bb" attr: "b" } - shape_range: { fg: "#e7b000" attr: "b" } - shape_record: { fg: "#00bbbb" attr: "b" } - shape_redirection: { fg: "#bb00bb" attr: "b" } - shape_signature: { fg: "#00bb00" attr: "b" } - shape_string: "#00bb00" - shape_string_interpolation: { fg: "#00bbbb" attr: "b" } - shape_table: { fg: "#0072ff" attr: "b" } - shape_variable: "#bb00bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#7a251e" - foreground: "#d7c9a7" - cursor: "#d7c9a7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bbbbbb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00bb00' attr: 'b' } + empty: '#0072ff' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#bbbbbb' + filesize: {|e| + if $e == 0b { + '#bbbbbb' + } else if $e < 1mb { + '#00bbbb' + } else {{ fg: '#0072ff' }} + } + duration: '#bbbbbb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff3f00' attr: 'b' } + } else if $in < 6hr { + '#ff3f00' + } else if $in < 1day { + '#e7b000' + } else if $in < 3day { + '#00bb00' + } else if $in < 1wk { + { fg: '#00bb00' attr: 'b' } + } else if $in < 6wk { + '#00bbbb' + } else if $in < 52wk { + '#0072ff' + } else { 'dark_gray' } + } + range: '#bbbbbb' + float: '#bbbbbb' + string: '#bbbbbb' + nothing: '#bbbbbb' + binary: '#bbbbbb' + cellpath: '#bbbbbb' + row_index: { fg: '#00bb00' attr: 'b' } + record: '#bbbbbb' + list: '#bbbbbb' + block: '#bbbbbb' + hints: 'dark_gray' + search_result: { fg: '#ff3f00' bg: '#bbbbbb' } + + shape_and: { fg: '#bb00bb' attr: 'b' } + shape_binary: { fg: '#bb00bb' attr: 'b' } + shape_block: { fg: '#0072ff' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#00bb00' + shape_datetime: { fg: '#00bbbb' attr: 'b' } + shape_directory: '#00bbbb' + shape_external: '#00bbbb' + shape_externalarg: { fg: '#00bb00' attr: 'b' } + shape_filepath: '#00bbbb' + shape_flag: { fg: '#0072ff' attr: 'b' } + shape_float: { fg: '#bb00bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00bbbb' attr: 'b' } + shape_int: { fg: '#bb00bb' attr: 'b' } + shape_internalcall: { fg: '#00bbbb' attr: 'b' } + shape_list: { fg: '#00bbbb' attr: 'b' } + shape_literal: '#0072ff' + shape_match_pattern: '#00bb00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#e7b000' + shape_or: { fg: '#bb00bb' attr: 'b' } + shape_pipe: { fg: '#bb00bb' attr: 'b' } + shape_range: { fg: '#e7b000' attr: 'b' } + shape_record: { fg: '#00bbbb' attr: 'b' } + shape_redirection: { fg: '#bb00bb' attr: 'b' } + shape_signature: { fg: '#00bb00' attr: 'b' } + shape_string: '#00bb00' + shape_string_interpolation: { fg: '#00bbbb' attr: 'b' } + shape_table: { fg: '#0072ff' attr: 'b' } + shape_variable: '#bb00bb' + + background: '#7a251e' + foreground: '#d7c9a7' + cursor: '#d7c9a7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/relaxed-afterglow.nu b/themes/nu-themes/relaxed-afterglow.nu index 50a2cf8..6541d3f 100644 --- a/themes/nu-themes/relaxed-afterglow.nu +++ b/themes/nu-themes/relaxed-afterglow.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d9d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#909d63" attr: "b" } - empty: "#6a8799" - bool: {|| if $in { "#acbbd0" } else { "light_gray" } } - int: "#d9d9d9" - filesize: {|e| - if $e == 0b { - "#d9d9d9" - } else if $e < 1mb { - "#c9dfff" - } else {{ fg: "#6a8799" }} - } - duration: "#d9d9d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#bc5653" attr: "b" } - } else if $in < 6hr { - "#bc5653" - } else if $in < 1day { - "#ebc17a" - } else if $in < 3day { - "#909d63" - } else if $in < 1wk { - { fg: "#909d63" attr: "b" } - } else if $in < 6wk { - "#c9dfff" - } else if $in < 52wk { - "#6a8799" - } else { "dark_gray" } - } - range: "#d9d9d9" - float: "#d9d9d9" - string: "#d9d9d9" - nothing: "#d9d9d9" - binary: "#d9d9d9" - cellpath: "#d9d9d9" - row_index: { fg: "#909d63" attr: "b" } - record: "#d9d9d9" - list: "#d9d9d9" - block: "#d9d9d9" - hints: "dark_gray" - search_result: { fg: "#bc5653" bg: "#d9d9d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b06698" attr: "b" } - shape_binary: { fg: "#b06698" attr: "b" } - shape_block: { fg: "#6a8799" attr: "b" } - shape_bool: "#acbbd0" - shape_custom: "#909d63" - shape_datetime: { fg: "#c9dfff" attr: "b" } - shape_directory: "#c9dfff" - shape_external: "#c9dfff" - shape_externalarg: { fg: "#909d63" attr: "b" } - shape_filepath: "#c9dfff" - shape_flag: { fg: "#6a8799" attr: "b" } - shape_float: { fg: "#b06698" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c9dfff" attr: "b" } - shape_int: { fg: "#b06698" attr: "b" } - shape_internalcall: { fg: "#c9dfff" attr: "b" } - shape_list: { fg: "#c9dfff" attr: "b" } - shape_literal: "#6a8799" - shape_match_pattern: "#909d63" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#acbbd0" - shape_operator: "#ebc17a" - shape_or: { fg: "#b06698" attr: "b" } - shape_pipe: { fg: "#b06698" attr: "b" } - shape_range: { fg: "#ebc17a" attr: "b" } - shape_record: { fg: "#c9dfff" attr: "b" } - shape_redirection: { fg: "#b06698" attr: "b" } - shape_signature: { fg: "#909d63" attr: "b" } - shape_string: "#909d63" - shape_string_interpolation: { fg: "#c9dfff" attr: "b" } - shape_table: { fg: "#6a8799" attr: "b" } - shape_variable: "#b06698" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#353a44" - foreground: "#d9d9d9" - cursor: "#d9d9d9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d9d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#909d63' attr: 'b' } + empty: '#6a8799' + bool: {|| if $in { '#acbbd0' } else { 'light_gray' } } + int: '#d9d9d9' + filesize: {|e| + if $e == 0b { + '#d9d9d9' + } else if $e < 1mb { + '#c9dfff' + } else {{ fg: '#6a8799' }} + } + duration: '#d9d9d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#bc5653' attr: 'b' } + } else if $in < 6hr { + '#bc5653' + } else if $in < 1day { + '#ebc17a' + } else if $in < 3day { + '#909d63' + } else if $in < 1wk { + { fg: '#909d63' attr: 'b' } + } else if $in < 6wk { + '#c9dfff' + } else if $in < 52wk { + '#6a8799' + } else { 'dark_gray' } + } + range: '#d9d9d9' + float: '#d9d9d9' + string: '#d9d9d9' + nothing: '#d9d9d9' + binary: '#d9d9d9' + cellpath: '#d9d9d9' + row_index: { fg: '#909d63' attr: 'b' } + record: '#d9d9d9' + list: '#d9d9d9' + block: '#d9d9d9' + hints: 'dark_gray' + search_result: { fg: '#bc5653' bg: '#d9d9d9' } + + shape_and: { fg: '#b06698' attr: 'b' } + shape_binary: { fg: '#b06698' attr: 'b' } + shape_block: { fg: '#6a8799' attr: 'b' } + shape_bool: '#acbbd0' + shape_custom: '#909d63' + shape_datetime: { fg: '#c9dfff' attr: 'b' } + shape_directory: '#c9dfff' + shape_external: '#c9dfff' + shape_externalarg: { fg: '#909d63' attr: 'b' } + shape_filepath: '#c9dfff' + shape_flag: { fg: '#6a8799' attr: 'b' } + shape_float: { fg: '#b06698' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c9dfff' attr: 'b' } + shape_int: { fg: '#b06698' attr: 'b' } + shape_internalcall: { fg: '#c9dfff' attr: 'b' } + shape_list: { fg: '#c9dfff' attr: 'b' } + shape_literal: '#6a8799' + shape_match_pattern: '#909d63' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#acbbd0' + shape_operator: '#ebc17a' + shape_or: { fg: '#b06698' attr: 'b' } + shape_pipe: { fg: '#b06698' attr: 'b' } + shape_range: { fg: '#ebc17a' attr: 'b' } + shape_record: { fg: '#c9dfff' attr: 'b' } + shape_redirection: { fg: '#b06698' attr: 'b' } + shape_signature: { fg: '#909d63' attr: 'b' } + shape_string: '#909d63' + shape_string_interpolation: { fg: '#c9dfff' attr: 'b' } + shape_table: { fg: '#6a8799' attr: 'b' } + shape_variable: '#b06698' + + background: '#353a44' + foreground: '#d9d9d9' + cursor: '#d9d9d9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/renault-style-light.nu b/themes/nu-themes/renault-style-light.nu index 6875f3a..34d8458 100644 --- a/themes/nu-themes/renault-style-light.nu +++ b/themes/nu-themes/renault-style-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#509f50" attr: "b" } - empty: "#46657d" - bool: {|| if $in { "#a4d4f8" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#87c1f1" - } else {{ fg: "#46657d" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#da4839" attr: "b" } - } else if $in < 6hr { - "#da4839" - } else if $in < 1day { - "#ffd249" - } else if $in < 3day { - "#509f50" - } else if $in < 1wk { - { fg: "#509f50" attr: "b" } - } else if $in < 6wk { - "#87c1f1" - } else if $in < 52wk { - "#46657d" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#509f50" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#da4839" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cfcfff" attr: "b" } - shape_binary: { fg: "#cfcfff" attr: "b" } - shape_block: { fg: "#46657d" attr: "b" } - shape_bool: "#a4d4f8" - shape_custom: "#509f50" - shape_datetime: { fg: "#87c1f1" attr: "b" } - shape_directory: "#87c1f1" - shape_external: "#87c1f1" - shape_externalarg: { fg: "#509f50" attr: "b" } - shape_filepath: "#87c1f1" - shape_flag: { fg: "#46657d" attr: "b" } - shape_float: { fg: "#cfcfff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#87c1f1" attr: "b" } - shape_int: { fg: "#cfcfff" attr: "b" } - shape_internalcall: { fg: "#87c1f1" attr: "b" } - shape_list: { fg: "#87c1f1" attr: "b" } - shape_literal: "#46657d" - shape_match_pattern: "#509f50" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a4d4f8" - shape_operator: "#ffd249" - shape_or: { fg: "#cfcfff" attr: "b" } - shape_pipe: { fg: "#cfcfff" attr: "b" } - shape_range: { fg: "#ffd249" attr: "b" } - shape_record: { fg: "#87c1f1" attr: "b" } - shape_redirection: { fg: "#cfcfff" attr: "b" } - shape_signature: { fg: "#509f50" attr: "b" } - shape_string: "#509f50" - shape_string_interpolation: { fg: "#87c1f1" attr: "b" } - shape_table: { fg: "#46657d" attr: "b" } - shape_variable: "#cfcfff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3a3a3a" - foreground: "#e9cb7b" - cursor: "#7f7f7f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#509f50' attr: 'b' } + empty: '#46657d' + bool: {|| if $in { '#a4d4f8' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#87c1f1' + } else {{ fg: '#46657d' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#da4839' attr: 'b' } + } else if $in < 6hr { + '#da4839' + } else if $in < 1day { + '#ffd249' + } else if $in < 3day { + '#509f50' + } else if $in < 1wk { + { fg: '#509f50' attr: 'b' } + } else if $in < 6wk { + '#87c1f1' + } else if $in < 52wk { + '#46657d' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#509f50' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#da4839' bg: '#ffffff' } + + shape_and: { fg: '#cfcfff' attr: 'b' } + shape_binary: { fg: '#cfcfff' attr: 'b' } + shape_block: { fg: '#46657d' attr: 'b' } + shape_bool: '#a4d4f8' + shape_custom: '#509f50' + shape_datetime: { fg: '#87c1f1' attr: 'b' } + shape_directory: '#87c1f1' + shape_external: '#87c1f1' + shape_externalarg: { fg: '#509f50' attr: 'b' } + shape_filepath: '#87c1f1' + shape_flag: { fg: '#46657d' attr: 'b' } + shape_float: { fg: '#cfcfff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#87c1f1' attr: 'b' } + shape_int: { fg: '#cfcfff' attr: 'b' } + shape_internalcall: { fg: '#87c1f1' attr: 'b' } + shape_list: { fg: '#87c1f1' attr: 'b' } + shape_literal: '#46657d' + shape_match_pattern: '#509f50' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a4d4f8' + shape_operator: '#ffd249' + shape_or: { fg: '#cfcfff' attr: 'b' } + shape_pipe: { fg: '#cfcfff' attr: 'b' } + shape_range: { fg: '#ffd249' attr: 'b' } + shape_record: { fg: '#87c1f1' attr: 'b' } + shape_redirection: { fg: '#cfcfff' attr: 'b' } + shape_signature: { fg: '#509f50' attr: 'b' } + shape_string: '#509f50' + shape_string_interpolation: { fg: '#87c1f1' attr: 'b' } + shape_table: { fg: '#46657d' attr: 'b' } + shape_variable: '#cfcfff' + + background: '#3a3a3a' + foreground: '#e9cb7b' + cursor: '#7f7f7f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/rippedcasts.nu b/themes/nu-themes/rippedcasts.nu index 7f0e587..b0716d6 100644 --- a/themes/nu-themes/rippedcasts.nu +++ b/themes/nu-themes/rippedcasts.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a8ff60" attr: "b" } - empty: "#75a5b0" - bool: {|| if $in { "#8c9bc4" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#5a647e" - } else {{ fg: "#75a5b0" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cdaf95" attr: "b" } - } else if $in < 6hr { - "#cdaf95" - } else if $in < 1day { - "#bfbb1f" - } else if $in < 3day { - "#a8ff60" - } else if $in < 1wk { - { fg: "#a8ff60" attr: "b" } - } else if $in < 6wk { - "#5a647e" - } else if $in < 52wk { - "#75a5b0" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#a8ff60" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#cdaf95" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff73fd" attr: "b" } - shape_binary: { fg: "#ff73fd" attr: "b" } - shape_block: { fg: "#75a5b0" attr: "b" } - shape_bool: "#8c9bc4" - shape_custom: "#a8ff60" - shape_datetime: { fg: "#5a647e" attr: "b" } - shape_directory: "#5a647e" - shape_external: "#5a647e" - shape_externalarg: { fg: "#a8ff60" attr: "b" } - shape_filepath: "#5a647e" - shape_flag: { fg: "#75a5b0" attr: "b" } - shape_float: { fg: "#ff73fd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5a647e" attr: "b" } - shape_int: { fg: "#ff73fd" attr: "b" } - shape_internalcall: { fg: "#5a647e" attr: "b" } - shape_list: { fg: "#5a647e" attr: "b" } - shape_literal: "#75a5b0" - shape_match_pattern: "#a8ff60" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8c9bc4" - shape_operator: "#bfbb1f" - shape_or: { fg: "#ff73fd" attr: "b" } - shape_pipe: { fg: "#ff73fd" attr: "b" } - shape_range: { fg: "#bfbb1f" attr: "b" } - shape_record: { fg: "#5a647e" attr: "b" } - shape_redirection: { fg: "#ff73fd" attr: "b" } - shape_signature: { fg: "#a8ff60" attr: "b" } - shape_string: "#a8ff60" - shape_string_interpolation: { fg: "#5a647e" attr: "b" } - shape_table: { fg: "#75a5b0" attr: "b" } - shape_variable: "#ff73fd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2b2b2b" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a8ff60' attr: 'b' } + empty: '#75a5b0' + bool: {|| if $in { '#8c9bc4' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#5a647e' + } else {{ fg: '#75a5b0' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cdaf95' attr: 'b' } + } else if $in < 6hr { + '#cdaf95' + } else if $in < 1day { + '#bfbb1f' + } else if $in < 3day { + '#a8ff60' + } else if $in < 1wk { + { fg: '#a8ff60' attr: 'b' } + } else if $in < 6wk { + '#5a647e' + } else if $in < 52wk { + '#75a5b0' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#a8ff60' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#cdaf95' bg: '#bfbfbf' } + + shape_and: { fg: '#ff73fd' attr: 'b' } + shape_binary: { fg: '#ff73fd' attr: 'b' } + shape_block: { fg: '#75a5b0' attr: 'b' } + shape_bool: '#8c9bc4' + shape_custom: '#a8ff60' + shape_datetime: { fg: '#5a647e' attr: 'b' } + shape_directory: '#5a647e' + shape_external: '#5a647e' + shape_externalarg: { fg: '#a8ff60' attr: 'b' } + shape_filepath: '#5a647e' + shape_flag: { fg: '#75a5b0' attr: 'b' } + shape_float: { fg: '#ff73fd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5a647e' attr: 'b' } + shape_int: { fg: '#ff73fd' attr: 'b' } + shape_internalcall: { fg: '#5a647e' attr: 'b' } + shape_list: { fg: '#5a647e' attr: 'b' } + shape_literal: '#75a5b0' + shape_match_pattern: '#a8ff60' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8c9bc4' + shape_operator: '#bfbb1f' + shape_or: { fg: '#ff73fd' attr: 'b' } + shape_pipe: { fg: '#ff73fd' attr: 'b' } + shape_range: { fg: '#bfbb1f' attr: 'b' } + shape_record: { fg: '#5a647e' attr: 'b' } + shape_redirection: { fg: '#ff73fd' attr: 'b' } + shape_signature: { fg: '#a8ff60' attr: 'b' } + shape_string: '#a8ff60' + shape_string_interpolation: { fg: '#5a647e' attr: 'b' } + shape_table: { fg: '#75a5b0' attr: 'b' } + shape_variable: '#ff73fd' + + background: '#2b2b2b' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/rose-pine-dawn.nu b/themes/nu-themes/rose-pine-dawn.nu index 3e8fd61..39a0055 100644 --- a/themes/nu-themes/rose-pine-dawn.nu +++ b/themes/nu-themes/rose-pine-dawn.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#575279" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#d7827e" attr: "b" } - empty: "#56949f" - bool: {|| if $in { "#286983" } else { "light_gray" } } - int: "#575279" - filesize: {|e| - if $e == 0b { - "#575279" - } else if $e < 1mb { - "#286983" - } else {{ fg: "#56949f" }} - } - duration: "#575279" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#1f1d2e" attr: "b" } - } else if $in < 6hr { - "#1f1d2e" - } else if $in < 1day { - "#ea9d34" - } else if $in < 3day { - "#d7827e" - } else if $in < 1wk { - { fg: "#d7827e" attr: "b" } - } else if $in < 6wk { - "#286983" - } else if $in < 52wk { - "#56949f" - } else { "dark_gray" } - } - range: "#575279" - float: "#575279" - string: "#575279" - nothing: "#575279" - binary: "#575279" - cellpath: "#575279" - row_index: { fg: "#d7827e" attr: "b" } - record: "#575279" - list: "#575279" - block: "#575279" - hints: "dark_gray" - search_result: { fg: "#1f1d2e" bg: "#575279" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#907aa9" attr: "b" } - shape_binary: { fg: "#907aa9" attr: "b" } - shape_block: { fg: "#56949f" attr: "b" } - shape_bool: "#286983" - shape_custom: "#d7827e" - shape_datetime: { fg: "#286983" attr: "b" } - shape_directory: "#286983" - shape_external: "#286983" - shape_externalarg: { fg: "#d7827e" attr: "b" } - shape_filepath: "#286983" - shape_flag: { fg: "#56949f" attr: "b" } - shape_float: { fg: "#907aa9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#286983" attr: "b" } - shape_int: { fg: "#907aa9" attr: "b" } - shape_internalcall: { fg: "#286983" attr: "b" } - shape_list: { fg: "#286983" attr: "b" } - shape_literal: "#56949f" - shape_match_pattern: "#d7827e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#286983" - shape_operator: "#ea9d34" - shape_or: { fg: "#907aa9" attr: "b" } - shape_pipe: { fg: "#907aa9" attr: "b" } - shape_range: { fg: "#ea9d34" attr: "b" } - shape_record: { fg: "#286983" attr: "b" } - shape_redirection: { fg: "#907aa9" attr: "b" } - shape_signature: { fg: "#d7827e" attr: "b" } - shape_string: "#d7827e" - shape_string_interpolation: { fg: "#286983" attr: "b" } - shape_table: { fg: "#56949f" attr: "b" } - shape_variable: "#907aa9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#faf4ed" - foreground: "#575279" - cursor: "#575279" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#575279' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#d7827e' attr: 'b' } + empty: '#56949f' + bool: {|| if $in { '#286983' } else { 'light_gray' } } + int: '#575279' + filesize: {|e| + if $e == 0b { + '#575279' + } else if $e < 1mb { + '#286983' + } else {{ fg: '#56949f' }} + } + duration: '#575279' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#1f1d2e' attr: 'b' } + } else if $in < 6hr { + '#1f1d2e' + } else if $in < 1day { + '#ea9d34' + } else if $in < 3day { + '#d7827e' + } else if $in < 1wk { + { fg: '#d7827e' attr: 'b' } + } else if $in < 6wk { + '#286983' + } else if $in < 52wk { + '#56949f' + } else { 'dark_gray' } + } + range: '#575279' + float: '#575279' + string: '#575279' + nothing: '#575279' + binary: '#575279' + cellpath: '#575279' + row_index: { fg: '#d7827e' attr: 'b' } + record: '#575279' + list: '#575279' + block: '#575279' + hints: 'dark_gray' + search_result: { fg: '#1f1d2e' bg: '#575279' } + + shape_and: { fg: '#907aa9' attr: 'b' } + shape_binary: { fg: '#907aa9' attr: 'b' } + shape_block: { fg: '#56949f' attr: 'b' } + shape_bool: '#286983' + shape_custom: '#d7827e' + shape_datetime: { fg: '#286983' attr: 'b' } + shape_directory: '#286983' + shape_external: '#286983' + shape_externalarg: { fg: '#d7827e' attr: 'b' } + shape_filepath: '#286983' + shape_flag: { fg: '#56949f' attr: 'b' } + shape_float: { fg: '#907aa9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#286983' attr: 'b' } + shape_int: { fg: '#907aa9' attr: 'b' } + shape_internalcall: { fg: '#286983' attr: 'b' } + shape_list: { fg: '#286983' attr: 'b' } + shape_literal: '#56949f' + shape_match_pattern: '#d7827e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#286983' + shape_operator: '#ea9d34' + shape_or: { fg: '#907aa9' attr: 'b' } + shape_pipe: { fg: '#907aa9' attr: 'b' } + shape_range: { fg: '#ea9d34' attr: 'b' } + shape_record: { fg: '#286983' attr: 'b' } + shape_redirection: { fg: '#907aa9' attr: 'b' } + shape_signature: { fg: '#d7827e' attr: 'b' } + shape_string: '#d7827e' + shape_string_interpolation: { fg: '#286983' attr: 'b' } + shape_table: { fg: '#56949f' attr: 'b' } + shape_variable: '#907aa9' + + background: '#faf4ed' + foreground: '#575279' + cursor: '#575279' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/rose-pine-moon.nu b/themes/nu-themes/rose-pine-moon.nu index 26d6dea..798e396 100644 --- a/themes/nu-themes/rose-pine-moon.nu +++ b/themes/nu-themes/rose-pine-moon.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0def4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ea9a97" attr: "b" } - empty: "#9ccfd8" - bool: {|| if $in { "#3e8fb0" } else { "light_gray" } } - int: "#e0def4" - filesize: {|e| - if $e == 0b { - "#e0def4" - } else if $e < 1mb { - "#3e8fb0" - } else {{ fg: "#9ccfd8" }} - } - duration: "#e0def4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ecebf0" attr: "b" } - } else if $in < 6hr { - "#ecebf0" - } else if $in < 1day { - "#f6c177" - } else if $in < 3day { - "#ea9a97" - } else if $in < 1wk { - { fg: "#ea9a97" attr: "b" } - } else if $in < 6wk { - "#3e8fb0" - } else if $in < 52wk { - "#9ccfd8" - } else { "dark_gray" } - } - range: "#e0def4" - float: "#e0def4" - string: "#e0def4" - nothing: "#e0def4" - binary: "#e0def4" - cellpath: "#e0def4" - row_index: { fg: "#ea9a97" attr: "b" } - record: "#e0def4" - list: "#e0def4" - block: "#e0def4" - hints: "dark_gray" - search_result: { fg: "#ecebf0" bg: "#e0def4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c4a7e7" attr: "b" } - shape_binary: { fg: "#c4a7e7" attr: "b" } - shape_block: { fg: "#9ccfd8" attr: "b" } - shape_bool: "#3e8fb0" - shape_custom: "#ea9a97" - shape_datetime: { fg: "#3e8fb0" attr: "b" } - shape_directory: "#3e8fb0" - shape_external: "#3e8fb0" - shape_externalarg: { fg: "#ea9a97" attr: "b" } - shape_filepath: "#3e8fb0" - shape_flag: { fg: "#9ccfd8" attr: "b" } - shape_float: { fg: "#c4a7e7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3e8fb0" attr: "b" } - shape_int: { fg: "#c4a7e7" attr: "b" } - shape_internalcall: { fg: "#3e8fb0" attr: "b" } - shape_list: { fg: "#3e8fb0" attr: "b" } - shape_literal: "#9ccfd8" - shape_match_pattern: "#ea9a97" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3e8fb0" - shape_operator: "#f6c177" - shape_or: { fg: "#c4a7e7" attr: "b" } - shape_pipe: { fg: "#c4a7e7" attr: "b" } - shape_range: { fg: "#f6c177" attr: "b" } - shape_record: { fg: "#3e8fb0" attr: "b" } - shape_redirection: { fg: "#c4a7e7" attr: "b" } - shape_signature: { fg: "#ea9a97" attr: "b" } - shape_string: "#ea9a97" - shape_string_interpolation: { fg: "#3e8fb0" attr: "b" } - shape_table: { fg: "#9ccfd8" attr: "b" } - shape_variable: "#c4a7e7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232136" - foreground: "#e0def4" - cursor: "#e0def4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0def4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ea9a97' attr: 'b' } + empty: '#9ccfd8' + bool: {|| if $in { '#3e8fb0' } else { 'light_gray' } } + int: '#e0def4' + filesize: {|e| + if $e == 0b { + '#e0def4' + } else if $e < 1mb { + '#3e8fb0' + } else {{ fg: '#9ccfd8' }} + } + duration: '#e0def4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ecebf0' attr: 'b' } + } else if $in < 6hr { + '#ecebf0' + } else if $in < 1day { + '#f6c177' + } else if $in < 3day { + '#ea9a97' + } else if $in < 1wk { + { fg: '#ea9a97' attr: 'b' } + } else if $in < 6wk { + '#3e8fb0' + } else if $in < 52wk { + '#9ccfd8' + } else { 'dark_gray' } + } + range: '#e0def4' + float: '#e0def4' + string: '#e0def4' + nothing: '#e0def4' + binary: '#e0def4' + cellpath: '#e0def4' + row_index: { fg: '#ea9a97' attr: 'b' } + record: '#e0def4' + list: '#e0def4' + block: '#e0def4' + hints: 'dark_gray' + search_result: { fg: '#ecebf0' bg: '#e0def4' } + + shape_and: { fg: '#c4a7e7' attr: 'b' } + shape_binary: { fg: '#c4a7e7' attr: 'b' } + shape_block: { fg: '#9ccfd8' attr: 'b' } + shape_bool: '#3e8fb0' + shape_custom: '#ea9a97' + shape_datetime: { fg: '#3e8fb0' attr: 'b' } + shape_directory: '#3e8fb0' + shape_external: '#3e8fb0' + shape_externalarg: { fg: '#ea9a97' attr: 'b' } + shape_filepath: '#3e8fb0' + shape_flag: { fg: '#9ccfd8' attr: 'b' } + shape_float: { fg: '#c4a7e7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3e8fb0' attr: 'b' } + shape_int: { fg: '#c4a7e7' attr: 'b' } + shape_internalcall: { fg: '#3e8fb0' attr: 'b' } + shape_list: { fg: '#3e8fb0' attr: 'b' } + shape_literal: '#9ccfd8' + shape_match_pattern: '#ea9a97' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3e8fb0' + shape_operator: '#f6c177' + shape_or: { fg: '#c4a7e7' attr: 'b' } + shape_pipe: { fg: '#c4a7e7' attr: 'b' } + shape_range: { fg: '#f6c177' attr: 'b' } + shape_record: { fg: '#3e8fb0' attr: 'b' } + shape_redirection: { fg: '#c4a7e7' attr: 'b' } + shape_signature: { fg: '#ea9a97' attr: 'b' } + shape_string: '#ea9a97' + shape_string_interpolation: { fg: '#3e8fb0' attr: 'b' } + shape_table: { fg: '#9ccfd8' attr: 'b' } + shape_variable: '#c4a7e7' + + background: '#232136' + foreground: '#e0def4' + cursor: '#e0def4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/rose-pine.nu b/themes/nu-themes/rose-pine.nu index ae0e8c8..aaf2ca6 100644 --- a/themes/nu-themes/rose-pine.nu +++ b/themes/nu-themes/rose-pine.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0def4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ebbcba" attr: "b" } - empty: "#9ccfd8" - bool: {|| if $in { "#31748f" } else { "light_gray" } } - int: "#e0def4" - filesize: {|e| - if $e == 0b { - "#e0def4" - } else if $e < 1mb { - "#31748f" - } else {{ fg: "#9ccfd8" }} - } - duration: "#e0def4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e2e1e7" attr: "b" } - } else if $in < 6hr { - "#e2e1e7" - } else if $in < 1day { - "#f6c177" - } else if $in < 3day { - "#ebbcba" - } else if $in < 1wk { - { fg: "#ebbcba" attr: "b" } - } else if $in < 6wk { - "#31748f" - } else if $in < 52wk { - "#9ccfd8" - } else { "dark_gray" } - } - range: "#e0def4" - float: "#e0def4" - string: "#e0def4" - nothing: "#e0def4" - binary: "#e0def4" - cellpath: "#e0def4" - row_index: { fg: "#ebbcba" attr: "b" } - record: "#e0def4" - list: "#e0def4" - block: "#e0def4" - hints: "dark_gray" - search_result: { fg: "#e2e1e7" bg: "#e0def4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c4a7e7" attr: "b" } - shape_binary: { fg: "#c4a7e7" attr: "b" } - shape_block: { fg: "#9ccfd8" attr: "b" } - shape_bool: "#31748f" - shape_custom: "#ebbcba" - shape_datetime: { fg: "#31748f" attr: "b" } - shape_directory: "#31748f" - shape_external: "#31748f" - shape_externalarg: { fg: "#ebbcba" attr: "b" } - shape_filepath: "#31748f" - shape_flag: { fg: "#9ccfd8" attr: "b" } - shape_float: { fg: "#c4a7e7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#31748f" attr: "b" } - shape_int: { fg: "#c4a7e7" attr: "b" } - shape_internalcall: { fg: "#31748f" attr: "b" } - shape_list: { fg: "#31748f" attr: "b" } - shape_literal: "#9ccfd8" - shape_match_pattern: "#ebbcba" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#31748f" - shape_operator: "#f6c177" - shape_or: { fg: "#c4a7e7" attr: "b" } - shape_pipe: { fg: "#c4a7e7" attr: "b" } - shape_range: { fg: "#f6c177" attr: "b" } - shape_record: { fg: "#31748f" attr: "b" } - shape_redirection: { fg: "#c4a7e7" attr: "b" } - shape_signature: { fg: "#ebbcba" attr: "b" } - shape_string: "#ebbcba" - shape_string_interpolation: { fg: "#31748f" attr: "b" } - shape_table: { fg: "#9ccfd8" attr: "b" } - shape_variable: "#c4a7e7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191724" - foreground: "#e0def4" - cursor: "#e0def4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0def4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ebbcba' attr: 'b' } + empty: '#9ccfd8' + bool: {|| if $in { '#31748f' } else { 'light_gray' } } + int: '#e0def4' + filesize: {|e| + if $e == 0b { + '#e0def4' + } else if $e < 1mb { + '#31748f' + } else {{ fg: '#9ccfd8' }} + } + duration: '#e0def4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e2e1e7' attr: 'b' } + } else if $in < 6hr { + '#e2e1e7' + } else if $in < 1day { + '#f6c177' + } else if $in < 3day { + '#ebbcba' + } else if $in < 1wk { + { fg: '#ebbcba' attr: 'b' } + } else if $in < 6wk { + '#31748f' + } else if $in < 52wk { + '#9ccfd8' + } else { 'dark_gray' } + } + range: '#e0def4' + float: '#e0def4' + string: '#e0def4' + nothing: '#e0def4' + binary: '#e0def4' + cellpath: '#e0def4' + row_index: { fg: '#ebbcba' attr: 'b' } + record: '#e0def4' + list: '#e0def4' + block: '#e0def4' + hints: 'dark_gray' + search_result: { fg: '#e2e1e7' bg: '#e0def4' } + + shape_and: { fg: '#c4a7e7' attr: 'b' } + shape_binary: { fg: '#c4a7e7' attr: 'b' } + shape_block: { fg: '#9ccfd8' attr: 'b' } + shape_bool: '#31748f' + shape_custom: '#ebbcba' + shape_datetime: { fg: '#31748f' attr: 'b' } + shape_directory: '#31748f' + shape_external: '#31748f' + shape_externalarg: { fg: '#ebbcba' attr: 'b' } + shape_filepath: '#31748f' + shape_flag: { fg: '#9ccfd8' attr: 'b' } + shape_float: { fg: '#c4a7e7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#31748f' attr: 'b' } + shape_int: { fg: '#c4a7e7' attr: 'b' } + shape_internalcall: { fg: '#31748f' attr: 'b' } + shape_list: { fg: '#31748f' attr: 'b' } + shape_literal: '#9ccfd8' + shape_match_pattern: '#ebbcba' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#31748f' + shape_operator: '#f6c177' + shape_or: { fg: '#c4a7e7' attr: 'b' } + shape_pipe: { fg: '#c4a7e7' attr: 'b' } + shape_range: { fg: '#f6c177' attr: 'b' } + shape_record: { fg: '#31748f' attr: 'b' } + shape_redirection: { fg: '#c4a7e7' attr: 'b' } + shape_signature: { fg: '#ebbcba' attr: 'b' } + shape_string: '#ebbcba' + shape_string_interpolation: { fg: '#31748f' attr: 'b' } + shape_table: { fg: '#9ccfd8' attr: 'b' } + shape_variable: '#c4a7e7' + + background: '#191724' + foreground: '#e0def4' + cursor: '#e0def4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/royal.nu b/themes/nu-themes/royal.nu index 7f3ca0d..c6c9acd 100644 --- a/themes/nu-themes/royal.nu +++ b/themes/nu-themes/royal.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#524966" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#23801c" attr: "b" } - empty: "#6580b0" - bool: {|| if $in { "#acd4eb" } else { "light_gray" } } - int: "#524966" - filesize: {|e| - if $e == 0b { - "#524966" - } else if $e < 1mb { - "#8aaabe" - } else {{ fg: "#6580b0" }} - } - duration: "#524966" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#91284c" attr: "b" } - } else if $in < 6hr { - "#91284c" - } else if $in < 1day { - "#b49d27" - } else if $in < 3day { - "#23801c" - } else if $in < 1wk { - { fg: "#23801c" attr: "b" } - } else if $in < 6wk { - "#8aaabe" - } else if $in < 52wk { - "#6580b0" - } else { "dark_gray" } - } - range: "#524966" - float: "#524966" - string: "#524966" - nothing: "#524966" - binary: "#524966" - cellpath: "#524966" - row_index: { fg: "#23801c" attr: "b" } - record: "#524966" - list: "#524966" - block: "#524966" - hints: "dark_gray" - search_result: { fg: "#91284c" bg: "#524966" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#674d96" attr: "b" } - shape_binary: { fg: "#674d96" attr: "b" } - shape_block: { fg: "#6580b0" attr: "b" } - shape_bool: "#acd4eb" - shape_custom: "#23801c" - shape_datetime: { fg: "#8aaabe" attr: "b" } - shape_directory: "#8aaabe" - shape_external: "#8aaabe" - shape_externalarg: { fg: "#23801c" attr: "b" } - shape_filepath: "#8aaabe" - shape_flag: { fg: "#6580b0" attr: "b" } - shape_float: { fg: "#674d96" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8aaabe" attr: "b" } - shape_int: { fg: "#674d96" attr: "b" } - shape_internalcall: { fg: "#8aaabe" attr: "b" } - shape_list: { fg: "#8aaabe" attr: "b" } - shape_literal: "#6580b0" - shape_match_pattern: "#23801c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#acd4eb" - shape_operator: "#b49d27" - shape_or: { fg: "#674d96" attr: "b" } - shape_pipe: { fg: "#674d96" attr: "b" } - shape_range: { fg: "#b49d27" attr: "b" } - shape_record: { fg: "#8aaabe" attr: "b" } - shape_redirection: { fg: "#674d96" attr: "b" } - shape_signature: { fg: "#23801c" attr: "b" } - shape_string: "#23801c" - shape_string_interpolation: { fg: "#8aaabe" attr: "b" } - shape_table: { fg: "#6580b0" attr: "b" } - shape_variable: "#674d96" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#100815" - foreground: "#514968" - cursor: "#514968" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#524966' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#23801c' attr: 'b' } + empty: '#6580b0' + bool: {|| if $in { '#acd4eb' } else { 'light_gray' } } + int: '#524966' + filesize: {|e| + if $e == 0b { + '#524966' + } else if $e < 1mb { + '#8aaabe' + } else {{ fg: '#6580b0' }} + } + duration: '#524966' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#91284c' attr: 'b' } + } else if $in < 6hr { + '#91284c' + } else if $in < 1day { + '#b49d27' + } else if $in < 3day { + '#23801c' + } else if $in < 1wk { + { fg: '#23801c' attr: 'b' } + } else if $in < 6wk { + '#8aaabe' + } else if $in < 52wk { + '#6580b0' + } else { 'dark_gray' } + } + range: '#524966' + float: '#524966' + string: '#524966' + nothing: '#524966' + binary: '#524966' + cellpath: '#524966' + row_index: { fg: '#23801c' attr: 'b' } + record: '#524966' + list: '#524966' + block: '#524966' + hints: 'dark_gray' + search_result: { fg: '#91284c' bg: '#524966' } + + shape_and: { fg: '#674d96' attr: 'b' } + shape_binary: { fg: '#674d96' attr: 'b' } + shape_block: { fg: '#6580b0' attr: 'b' } + shape_bool: '#acd4eb' + shape_custom: '#23801c' + shape_datetime: { fg: '#8aaabe' attr: 'b' } + shape_directory: '#8aaabe' + shape_external: '#8aaabe' + shape_externalarg: { fg: '#23801c' attr: 'b' } + shape_filepath: '#8aaabe' + shape_flag: { fg: '#6580b0' attr: 'b' } + shape_float: { fg: '#674d96' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8aaabe' attr: 'b' } + shape_int: { fg: '#674d96' attr: 'b' } + shape_internalcall: { fg: '#8aaabe' attr: 'b' } + shape_list: { fg: '#8aaabe' attr: 'b' } + shape_literal: '#6580b0' + shape_match_pattern: '#23801c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#acd4eb' + shape_operator: '#b49d27' + shape_or: { fg: '#674d96' attr: 'b' } + shape_pipe: { fg: '#674d96' attr: 'b' } + shape_range: { fg: '#b49d27' attr: 'b' } + shape_record: { fg: '#8aaabe' attr: 'b' } + shape_redirection: { fg: '#674d96' attr: 'b' } + shape_signature: { fg: '#23801c' attr: 'b' } + shape_string: '#23801c' + shape_string_interpolation: { fg: '#8aaabe' attr: 'b' } + shape_table: { fg: '#6580b0' attr: 'b' } + shape_variable: '#674d96' + + background: '#100815' + foreground: '#514968' + cursor: '#514968' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sagelight.nu b/themes/nu-themes/sagelight.nu index 6d19034..a972760 100644 --- a/themes/nu-themes/sagelight.nu +++ b/themes/nu-themes/sagelight.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#383838" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a0d2c8" attr: "b" } - empty: "#a0a7d2" - bool: {|| if $in { "#a2d6f5" } else { "light_gray" } } - int: "#383838" - filesize: {|e| - if $e == 0b { - "#383838" - } else if $e < 1mb { - "#a2d6f5" - } else {{ fg: "#a0a7d2" }} - } - duration: "#383838" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fa8480" attr: "b" } - } else if $in < 6hr { - "#fa8480" - } else if $in < 1day { - "#ffdc61" - } else if $in < 3day { - "#a0d2c8" - } else if $in < 1wk { - { fg: "#a0d2c8" attr: "b" } - } else if $in < 6wk { - "#a2d6f5" - } else if $in < 52wk { - "#a0a7d2" - } else { "dark_gray" } - } - range: "#383838" - float: "#383838" - string: "#383838" - nothing: "#383838" - binary: "#383838" - cellpath: "#383838" - row_index: { fg: "#a0d2c8" attr: "b" } - record: "#383838" - list: "#383838" - block: "#383838" - hints: "dark_gray" - search_result: { fg: "#fa8480" bg: "#383838" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c8a0d2" attr: "b" } - shape_binary: { fg: "#c8a0d2" attr: "b" } - shape_block: { fg: "#a0a7d2" attr: "b" } - shape_bool: "#a2d6f5" - shape_custom: "#a0d2c8" - shape_datetime: { fg: "#a2d6f5" attr: "b" } - shape_directory: "#a2d6f5" - shape_external: "#a2d6f5" - shape_externalarg: { fg: "#a0d2c8" attr: "b" } - shape_filepath: "#a2d6f5" - shape_flag: { fg: "#a0a7d2" attr: "b" } - shape_float: { fg: "#c8a0d2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#a2d6f5" attr: "b" } - shape_int: { fg: "#c8a0d2" attr: "b" } - shape_internalcall: { fg: "#a2d6f5" attr: "b" } - shape_list: { fg: "#a2d6f5" attr: "b" } - shape_literal: "#a0a7d2" - shape_match_pattern: "#a0d2c8" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a2d6f5" - shape_operator: "#ffdc61" - shape_or: { fg: "#c8a0d2" attr: "b" } - shape_pipe: { fg: "#c8a0d2" attr: "b" } - shape_range: { fg: "#ffdc61" attr: "b" } - shape_record: { fg: "#a2d6f5" attr: "b" } - shape_redirection: { fg: "#c8a0d2" attr: "b" } - shape_signature: { fg: "#a0d2c8" attr: "b" } - shape_string: "#a0d2c8" - shape_string_interpolation: { fg: "#a2d6f5" attr: "b" } - shape_table: { fg: "#a0a7d2" attr: "b" } - shape_variable: "#c8a0d2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f8f8" - foreground: "#383838" - cursor: "#383838" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#383838' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a0d2c8' attr: 'b' } + empty: '#a0a7d2' + bool: {|| if $in { '#a2d6f5' } else { 'light_gray' } } + int: '#383838' + filesize: {|e| + if $e == 0b { + '#383838' + } else if $e < 1mb { + '#a2d6f5' + } else {{ fg: '#a0a7d2' }} + } + duration: '#383838' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fa8480' attr: 'b' } + } else if $in < 6hr { + '#fa8480' + } else if $in < 1day { + '#ffdc61' + } else if $in < 3day { + '#a0d2c8' + } else if $in < 1wk { + { fg: '#a0d2c8' attr: 'b' } + } else if $in < 6wk { + '#a2d6f5' + } else if $in < 52wk { + '#a0a7d2' + } else { 'dark_gray' } + } + range: '#383838' + float: '#383838' + string: '#383838' + nothing: '#383838' + binary: '#383838' + cellpath: '#383838' + row_index: { fg: '#a0d2c8' attr: 'b' } + record: '#383838' + list: '#383838' + block: '#383838' + hints: 'dark_gray' + search_result: { fg: '#fa8480' bg: '#383838' } + + shape_and: { fg: '#c8a0d2' attr: 'b' } + shape_binary: { fg: '#c8a0d2' attr: 'b' } + shape_block: { fg: '#a0a7d2' attr: 'b' } + shape_bool: '#a2d6f5' + shape_custom: '#a0d2c8' + shape_datetime: { fg: '#a2d6f5' attr: 'b' } + shape_directory: '#a2d6f5' + shape_external: '#a2d6f5' + shape_externalarg: { fg: '#a0d2c8' attr: 'b' } + shape_filepath: '#a2d6f5' + shape_flag: { fg: '#a0a7d2' attr: 'b' } + shape_float: { fg: '#c8a0d2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#a2d6f5' attr: 'b' } + shape_int: { fg: '#c8a0d2' attr: 'b' } + shape_internalcall: { fg: '#a2d6f5' attr: 'b' } + shape_list: { fg: '#a2d6f5' attr: 'b' } + shape_literal: '#a0a7d2' + shape_match_pattern: '#a0d2c8' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a2d6f5' + shape_operator: '#ffdc61' + shape_or: { fg: '#c8a0d2' attr: 'b' } + shape_pipe: { fg: '#c8a0d2' attr: 'b' } + shape_range: { fg: '#ffdc61' attr: 'b' } + shape_record: { fg: '#a2d6f5' attr: 'b' } + shape_redirection: { fg: '#c8a0d2' attr: 'b' } + shape_signature: { fg: '#a0d2c8' attr: 'b' } + shape_string: '#a0d2c8' + shape_string_interpolation: { fg: '#a2d6f5' attr: 'b' } + shape_table: { fg: '#a0a7d2' attr: 'b' } + shape_variable: '#c8a0d2' + + background: '#f8f8f8' + foreground: '#383838' + cursor: '#383838' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sandcastle.nu b/themes/nu-themes/sandcastle.nu index 7722efe..f3c5123 100644 --- a/themes/nu-themes/sandcastle.nu +++ b/themes/nu-themes/sandcastle.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a89984" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#528b8b" attr: "b" } - empty: "#83a598" - bool: {|| if $in { "#83a598" } else { "light_gray" } } - int: "#a89984" - filesize: {|e| - if $e == 0b { - "#a89984" - } else if $e < 1mb { - "#83a598" - } else {{ fg: "#83a598" }} - } - duration: "#a89984" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#83a598" attr: "b" } - } else if $in < 6hr { - "#83a598" - } else if $in < 1day { - "#a07e3b" - } else if $in < 3day { - "#528b8b" - } else if $in < 1wk { - { fg: "#528b8b" attr: "b" } - } else if $in < 6wk { - "#83a598" - } else if $in < 52wk { - "#83a598" - } else { "dark_gray" } - } - range: "#a89984" - float: "#a89984" - string: "#a89984" - nothing: "#a89984" - binary: "#a89984" - cellpath: "#a89984" - row_index: { fg: "#528b8b" attr: "b" } - record: "#a89984" - list: "#a89984" - block: "#a89984" - hints: "dark_gray" - search_result: { fg: "#83a598" bg: "#a89984" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d75f5f" attr: "b" } - shape_binary: { fg: "#d75f5f" attr: "b" } - shape_block: { fg: "#83a598" attr: "b" } - shape_bool: "#83a598" - shape_custom: "#528b8b" - shape_datetime: { fg: "#83a598" attr: "b" } - shape_directory: "#83a598" - shape_external: "#83a598" - shape_externalarg: { fg: "#528b8b" attr: "b" } - shape_filepath: "#83a598" - shape_flag: { fg: "#83a598" attr: "b" } - shape_float: { fg: "#d75f5f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#83a598" attr: "b" } - shape_int: { fg: "#d75f5f" attr: "b" } - shape_internalcall: { fg: "#83a598" attr: "b" } - shape_list: { fg: "#83a598" attr: "b" } - shape_literal: "#83a598" - shape_match_pattern: "#528b8b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#83a598" - shape_operator: "#a07e3b" - shape_or: { fg: "#d75f5f" attr: "b" } - shape_pipe: { fg: "#d75f5f" attr: "b" } - shape_range: { fg: "#a07e3b" attr: "b" } - shape_record: { fg: "#83a598" attr: "b" } - shape_redirection: { fg: "#d75f5f" attr: "b" } - shape_signature: { fg: "#528b8b" attr: "b" } - shape_string: "#528b8b" - shape_string_interpolation: { fg: "#83a598" attr: "b" } - shape_table: { fg: "#83a598" attr: "b" } - shape_variable: "#d75f5f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282c34" - foreground: "#a89984" - cursor: "#a89984" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a89984' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#528b8b' attr: 'b' } + empty: '#83a598' + bool: {|| if $in { '#83a598' } else { 'light_gray' } } + int: '#a89984' + filesize: {|e| + if $e == 0b { + '#a89984' + } else if $e < 1mb { + '#83a598' + } else {{ fg: '#83a598' }} + } + duration: '#a89984' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#83a598' attr: 'b' } + } else if $in < 6hr { + '#83a598' + } else if $in < 1day { + '#a07e3b' + } else if $in < 3day { + '#528b8b' + } else if $in < 1wk { + { fg: '#528b8b' attr: 'b' } + } else if $in < 6wk { + '#83a598' + } else if $in < 52wk { + '#83a598' + } else { 'dark_gray' } + } + range: '#a89984' + float: '#a89984' + string: '#a89984' + nothing: '#a89984' + binary: '#a89984' + cellpath: '#a89984' + row_index: { fg: '#528b8b' attr: 'b' } + record: '#a89984' + list: '#a89984' + block: '#a89984' + hints: 'dark_gray' + search_result: { fg: '#83a598' bg: '#a89984' } + + shape_and: { fg: '#d75f5f' attr: 'b' } + shape_binary: { fg: '#d75f5f' attr: 'b' } + shape_block: { fg: '#83a598' attr: 'b' } + shape_bool: '#83a598' + shape_custom: '#528b8b' + shape_datetime: { fg: '#83a598' attr: 'b' } + shape_directory: '#83a598' + shape_external: '#83a598' + shape_externalarg: { fg: '#528b8b' attr: 'b' } + shape_filepath: '#83a598' + shape_flag: { fg: '#83a598' attr: 'b' } + shape_float: { fg: '#d75f5f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#83a598' attr: 'b' } + shape_int: { fg: '#d75f5f' attr: 'b' } + shape_internalcall: { fg: '#83a598' attr: 'b' } + shape_list: { fg: '#83a598' attr: 'b' } + shape_literal: '#83a598' + shape_match_pattern: '#528b8b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#83a598' + shape_operator: '#a07e3b' + shape_or: { fg: '#d75f5f' attr: 'b' } + shape_pipe: { fg: '#d75f5f' attr: 'b' } + shape_range: { fg: '#a07e3b' attr: 'b' } + shape_record: { fg: '#83a598' attr: 'b' } + shape_redirection: { fg: '#d75f5f' attr: 'b' } + shape_signature: { fg: '#528b8b' attr: 'b' } + shape_string: '#528b8b' + shape_string_interpolation: { fg: '#83a598' attr: 'b' } + shape_table: { fg: '#83a598' attr: 'b' } + shape_variable: '#d75f5f' + + background: '#282c34' + foreground: '#a89984' + cursor: '#a89984' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sat.nu b/themes/nu-themes/sat.nu index 2af7805..f294d02 100644 --- a/themes/nu-themes/sat.nu +++ b/themes/nu-themes/sat.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#07dd00" attr: "b" } - empty: "#0007dd" - bool: {|| if $in { "#74fffa" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#00ddd6" - } else {{ fg: "#0007dd" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dd0007" attr: "b" } - } else if $in < 6hr { - "#dd0007" - } else if $in < 1day { - "#ddd600" - } else if $in < 3day { - "#07dd00" - } else if $in < 1wk { - { fg: "#07dd00" attr: "b" } - } else if $in < 6wk { - "#00ddd6" - } else if $in < 52wk { - "#0007dd" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#07dd00" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#dd0007" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d600dd" attr: "b" } - shape_binary: { fg: "#d600dd" attr: "b" } - shape_block: { fg: "#0007dd" attr: "b" } - shape_bool: "#74fffa" - shape_custom: "#07dd00" - shape_datetime: { fg: "#00ddd6" attr: "b" } - shape_directory: "#00ddd6" - shape_external: "#00ddd6" - shape_externalarg: { fg: "#07dd00" attr: "b" } - shape_filepath: "#00ddd6" - shape_flag: { fg: "#0007dd" attr: "b" } - shape_float: { fg: "#d600dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00ddd6" attr: "b" } - shape_int: { fg: "#d600dd" attr: "b" } - shape_internalcall: { fg: "#00ddd6" attr: "b" } - shape_list: { fg: "#00ddd6" attr: "b" } - shape_literal: "#0007dd" - shape_match_pattern: "#07dd00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#74fffa" - shape_operator: "#ddd600" - shape_or: { fg: "#d600dd" attr: "b" } - shape_pipe: { fg: "#d600dd" attr: "b" } - shape_range: { fg: "#ddd600" attr: "b" } - shape_record: { fg: "#00ddd6" attr: "b" } - shape_redirection: { fg: "#d600dd" attr: "b" } - shape_signature: { fg: "#07dd00" attr: "b" } - shape_string: "#07dd00" - shape_string_interpolation: { fg: "#00ddd6" attr: "b" } - shape_table: { fg: "#0007dd" attr: "b" } - shape_variable: "#d600dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#758480" - foreground: "#23476a" - cursor: "#23476a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#07dd00' attr: 'b' } + empty: '#0007dd' + bool: {|| if $in { '#74fffa' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#00ddd6' + } else {{ fg: '#0007dd' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dd0007' attr: 'b' } + } else if $in < 6hr { + '#dd0007' + } else if $in < 1day { + '#ddd600' + } else if $in < 3day { + '#07dd00' + } else if $in < 1wk { + { fg: '#07dd00' attr: 'b' } + } else if $in < 6wk { + '#00ddd6' + } else if $in < 52wk { + '#0007dd' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#07dd00' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#dd0007' bg: '#f2f2f2' } + + shape_and: { fg: '#d600dd' attr: 'b' } + shape_binary: { fg: '#d600dd' attr: 'b' } + shape_block: { fg: '#0007dd' attr: 'b' } + shape_bool: '#74fffa' + shape_custom: '#07dd00' + shape_datetime: { fg: '#00ddd6' attr: 'b' } + shape_directory: '#00ddd6' + shape_external: '#00ddd6' + shape_externalarg: { fg: '#07dd00' attr: 'b' } + shape_filepath: '#00ddd6' + shape_flag: { fg: '#0007dd' attr: 'b' } + shape_float: { fg: '#d600dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00ddd6' attr: 'b' } + shape_int: { fg: '#d600dd' attr: 'b' } + shape_internalcall: { fg: '#00ddd6' attr: 'b' } + shape_list: { fg: '#00ddd6' attr: 'b' } + shape_literal: '#0007dd' + shape_match_pattern: '#07dd00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#74fffa' + shape_operator: '#ddd600' + shape_or: { fg: '#d600dd' attr: 'b' } + shape_pipe: { fg: '#d600dd' attr: 'b' } + shape_range: { fg: '#ddd600' attr: 'b' } + shape_record: { fg: '#00ddd6' attr: 'b' } + shape_redirection: { fg: '#d600dd' attr: 'b' } + shape_signature: { fg: '#07dd00' attr: 'b' } + shape_string: '#07dd00' + shape_string_interpolation: { fg: '#00ddd6' attr: 'b' } + shape_table: { fg: '#0007dd' attr: 'b' } + shape_variable: '#d600dd' + + background: '#758480' + foreground: '#23476a' + cursor: '#23476a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sea-shells.nu b/themes/nu-themes/sea-shells.nu index ded305c..b52cedd 100644 --- a/themes/nu-themes/sea-shells.nu +++ b/themes/nu-themes/sea-shells.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#deb88d" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#027c9b" attr: "b" } - empty: "#1e4950" - bool: {|| if $in { "#87acb4" } else { "light_gray" } } - int: "#deb88d" - filesize: {|e| - if $e == 0b { - "#deb88d" - } else if $e < 1mb { - "#50a3b5" - } else {{ fg: "#1e4950" }} - } - duration: "#deb88d" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d15123" attr: "b" } - } else if $in < 6hr { - "#d15123" - } else if $in < 1day { - "#fca02f" - } else if $in < 3day { - "#027c9b" - } else if $in < 1wk { - { fg: "#027c9b" attr: "b" } - } else if $in < 6wk { - "#50a3b5" - } else if $in < 52wk { - "#1e4950" - } else { "dark_gray" } - } - range: "#deb88d" - float: "#deb88d" - string: "#deb88d" - nothing: "#deb88d" - binary: "#deb88d" - cellpath: "#deb88d" - row_index: { fg: "#027c9b" attr: "b" } - record: "#deb88d" - list: "#deb88d" - block: "#deb88d" - hints: "dark_gray" - search_result: { fg: "#d15123" bg: "#deb88d" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#68d4f1" attr: "b" } - shape_binary: { fg: "#68d4f1" attr: "b" } - shape_block: { fg: "#1e4950" attr: "b" } - shape_bool: "#87acb4" - shape_custom: "#027c9b" - shape_datetime: { fg: "#50a3b5" attr: "b" } - shape_directory: "#50a3b5" - shape_external: "#50a3b5" - shape_externalarg: { fg: "#027c9b" attr: "b" } - shape_filepath: "#50a3b5" - shape_flag: { fg: "#1e4950" attr: "b" } - shape_float: { fg: "#68d4f1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#50a3b5" attr: "b" } - shape_int: { fg: "#68d4f1" attr: "b" } - shape_internalcall: { fg: "#50a3b5" attr: "b" } - shape_list: { fg: "#50a3b5" attr: "b" } - shape_literal: "#1e4950" - shape_match_pattern: "#027c9b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#87acb4" - shape_operator: "#fca02f" - shape_or: { fg: "#68d4f1" attr: "b" } - shape_pipe: { fg: "#68d4f1" attr: "b" } - shape_range: { fg: "#fca02f" attr: "b" } - shape_record: { fg: "#50a3b5" attr: "b" } - shape_redirection: { fg: "#68d4f1" attr: "b" } - shape_signature: { fg: "#027c9b" attr: "b" } - shape_string: "#027c9b" - shape_string_interpolation: { fg: "#50a3b5" attr: "b" } - shape_table: { fg: "#1e4950" attr: "b" } - shape_variable: "#68d4f1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#09141b" - foreground: "#deb88d" - cursor: "#deb88d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#deb88d' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#027c9b' attr: 'b' } + empty: '#1e4950' + bool: {|| if $in { '#87acb4' } else { 'light_gray' } } + int: '#deb88d' + filesize: {|e| + if $e == 0b { + '#deb88d' + } else if $e < 1mb { + '#50a3b5' + } else {{ fg: '#1e4950' }} + } + duration: '#deb88d' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d15123' attr: 'b' } + } else if $in < 6hr { + '#d15123' + } else if $in < 1day { + '#fca02f' + } else if $in < 3day { + '#027c9b' + } else if $in < 1wk { + { fg: '#027c9b' attr: 'b' } + } else if $in < 6wk { + '#50a3b5' + } else if $in < 52wk { + '#1e4950' + } else { 'dark_gray' } + } + range: '#deb88d' + float: '#deb88d' + string: '#deb88d' + nothing: '#deb88d' + binary: '#deb88d' + cellpath: '#deb88d' + row_index: { fg: '#027c9b' attr: 'b' } + record: '#deb88d' + list: '#deb88d' + block: '#deb88d' + hints: 'dark_gray' + search_result: { fg: '#d15123' bg: '#deb88d' } + + shape_and: { fg: '#68d4f1' attr: 'b' } + shape_binary: { fg: '#68d4f1' attr: 'b' } + shape_block: { fg: '#1e4950' attr: 'b' } + shape_bool: '#87acb4' + shape_custom: '#027c9b' + shape_datetime: { fg: '#50a3b5' attr: 'b' } + shape_directory: '#50a3b5' + shape_external: '#50a3b5' + shape_externalarg: { fg: '#027c9b' attr: 'b' } + shape_filepath: '#50a3b5' + shape_flag: { fg: '#1e4950' attr: 'b' } + shape_float: { fg: '#68d4f1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#50a3b5' attr: 'b' } + shape_int: { fg: '#68d4f1' attr: 'b' } + shape_internalcall: { fg: '#50a3b5' attr: 'b' } + shape_list: { fg: '#50a3b5' attr: 'b' } + shape_literal: '#1e4950' + shape_match_pattern: '#027c9b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#87acb4' + shape_operator: '#fca02f' + shape_or: { fg: '#68d4f1' attr: 'b' } + shape_pipe: { fg: '#68d4f1' attr: 'b' } + shape_range: { fg: '#fca02f' attr: 'b' } + shape_record: { fg: '#50a3b5' attr: 'b' } + shape_redirection: { fg: '#68d4f1' attr: 'b' } + shape_signature: { fg: '#027c9b' attr: 'b' } + shape_string: '#027c9b' + shape_string_interpolation: { fg: '#50a3b5' attr: 'b' } + shape_table: { fg: '#1e4950' attr: 'b' } + shape_variable: '#68d4f1' + + background: '#09141b' + foreground: '#deb88d' + cursor: '#deb88d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/seafoam-pastel.nu b/themes/nu-themes/seafoam-pastel.nu index 3506932..838d12c 100644 --- a/themes/nu-themes/seafoam-pastel.nu +++ b/themes/nu-themes/seafoam-pastel.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e0e0e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#728c62" attr: "b" } - empty: "#4d7b82" - bool: {|| if $in { "#ade0e0" } else { "light_gray" } } - int: "#e0e0e0" - filesize: {|e| - if $e == 0b { - "#e0e0e0" - } else if $e < 1mb { - "#729494" - } else {{ fg: "#4d7b82" }} - } - duration: "#e0e0e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#825d4d" attr: "b" } - } else if $in < 6hr { - "#825d4d" - } else if $in < 1day { - "#ada16d" - } else if $in < 3day { - "#728c62" - } else if $in < 1wk { - { fg: "#728c62" attr: "b" } - } else if $in < 6wk { - "#729494" - } else if $in < 52wk { - "#4d7b82" - } else { "dark_gray" } - } - range: "#e0e0e0" - float: "#e0e0e0" - string: "#e0e0e0" - nothing: "#e0e0e0" - binary: "#e0e0e0" - cellpath: "#e0e0e0" - row_index: { fg: "#728c62" attr: "b" } - record: "#e0e0e0" - list: "#e0e0e0" - block: "#e0e0e0" - hints: "dark_gray" - search_result: { fg: "#825d4d" bg: "#e0e0e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8a7267" attr: "b" } - shape_binary: { fg: "#8a7267" attr: "b" } - shape_block: { fg: "#4d7b82" attr: "b" } - shape_bool: "#ade0e0" - shape_custom: "#728c62" - shape_datetime: { fg: "#729494" attr: "b" } - shape_directory: "#729494" - shape_external: "#729494" - shape_externalarg: { fg: "#728c62" attr: "b" } - shape_filepath: "#729494" - shape_flag: { fg: "#4d7b82" attr: "b" } - shape_float: { fg: "#8a7267" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#729494" attr: "b" } - shape_int: { fg: "#8a7267" attr: "b" } - shape_internalcall: { fg: "#729494" attr: "b" } - shape_list: { fg: "#729494" attr: "b" } - shape_literal: "#4d7b82" - shape_match_pattern: "#728c62" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ade0e0" - shape_operator: "#ada16d" - shape_or: { fg: "#8a7267" attr: "b" } - shape_pipe: { fg: "#8a7267" attr: "b" } - shape_range: { fg: "#ada16d" attr: "b" } - shape_record: { fg: "#729494" attr: "b" } - shape_redirection: { fg: "#8a7267" attr: "b" } - shape_signature: { fg: "#728c62" attr: "b" } - shape_string: "#728c62" - shape_string_interpolation: { fg: "#729494" attr: "b" } - shape_table: { fg: "#4d7b82" attr: "b" } - shape_variable: "#8a7267" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#243435" - foreground: "#d4e7d4" - cursor: "#d4e7d4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e0e0e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#728c62' attr: 'b' } + empty: '#4d7b82' + bool: {|| if $in { '#ade0e0' } else { 'light_gray' } } + int: '#e0e0e0' + filesize: {|e| + if $e == 0b { + '#e0e0e0' + } else if $e < 1mb { + '#729494' + } else {{ fg: '#4d7b82' }} + } + duration: '#e0e0e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#825d4d' attr: 'b' } + } else if $in < 6hr { + '#825d4d' + } else if $in < 1day { + '#ada16d' + } else if $in < 3day { + '#728c62' + } else if $in < 1wk { + { fg: '#728c62' attr: 'b' } + } else if $in < 6wk { + '#729494' + } else if $in < 52wk { + '#4d7b82' + } else { 'dark_gray' } + } + range: '#e0e0e0' + float: '#e0e0e0' + string: '#e0e0e0' + nothing: '#e0e0e0' + binary: '#e0e0e0' + cellpath: '#e0e0e0' + row_index: { fg: '#728c62' attr: 'b' } + record: '#e0e0e0' + list: '#e0e0e0' + block: '#e0e0e0' + hints: 'dark_gray' + search_result: { fg: '#825d4d' bg: '#e0e0e0' } + + shape_and: { fg: '#8a7267' attr: 'b' } + shape_binary: { fg: '#8a7267' attr: 'b' } + shape_block: { fg: '#4d7b82' attr: 'b' } + shape_bool: '#ade0e0' + shape_custom: '#728c62' + shape_datetime: { fg: '#729494' attr: 'b' } + shape_directory: '#729494' + shape_external: '#729494' + shape_externalarg: { fg: '#728c62' attr: 'b' } + shape_filepath: '#729494' + shape_flag: { fg: '#4d7b82' attr: 'b' } + shape_float: { fg: '#8a7267' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#729494' attr: 'b' } + shape_int: { fg: '#8a7267' attr: 'b' } + shape_internalcall: { fg: '#729494' attr: 'b' } + shape_list: { fg: '#729494' attr: 'b' } + shape_literal: '#4d7b82' + shape_match_pattern: '#728c62' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ade0e0' + shape_operator: '#ada16d' + shape_or: { fg: '#8a7267' attr: 'b' } + shape_pipe: { fg: '#8a7267' attr: 'b' } + shape_range: { fg: '#ada16d' attr: 'b' } + shape_record: { fg: '#729494' attr: 'b' } + shape_redirection: { fg: '#8a7267' attr: 'b' } + shape_signature: { fg: '#728c62' attr: 'b' } + shape_string: '#728c62' + shape_string_interpolation: { fg: '#729494' attr: 'b' } + shape_table: { fg: '#4d7b82' attr: 'b' } + shape_variable: '#8a7267' + + background: '#243435' + foreground: '#d4e7d4' + cursor: '#d4e7d4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/selenized-black.nu b/themes/nu-themes/selenized-black.nu index 141cec8..9e26beb 100644 --- a/themes/nu-themes/selenized-black.nu +++ b/themes/nu-themes/selenized-black.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#777777" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#70b433" attr: "b" } - empty: "#368aeb" - bool: {|| if $in { "#56d8c9" } else { "light_gray" } } - int: "#777777" - filesize: {|e| - if $e == 0b { - "#777777" - } else if $e < 1mb { - "#3fc5b7" - } else {{ fg: "#368aeb" }} - } - duration: "#777777" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ed4a46" attr: "b" } - } else if $in < 6hr { - "#ed4a46" - } else if $in < 1day { - "#dbb32d" - } else if $in < 3day { - "#70b433" - } else if $in < 1wk { - { fg: "#70b433" attr: "b" } - } else if $in < 6wk { - "#3fc5b7" - } else if $in < 52wk { - "#368aeb" - } else { "dark_gray" } - } - range: "#777777" - float: "#777777" - string: "#777777" - nothing: "#777777" - binary: "#777777" - cellpath: "#777777" - row_index: { fg: "#70b433" attr: "b" } - record: "#777777" - list: "#777777" - block: "#777777" - hints: "dark_gray" - search_result: { fg: "#ed4a46" bg: "#777777" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#eb6eb7" attr: "b" } - shape_binary: { fg: "#eb6eb7" attr: "b" } - shape_block: { fg: "#368aeb" attr: "b" } - shape_bool: "#56d8c9" - shape_custom: "#70b433" - shape_datetime: { fg: "#3fc5b7" attr: "b" } - shape_directory: "#3fc5b7" - shape_external: "#3fc5b7" - shape_externalarg: { fg: "#70b433" attr: "b" } - shape_filepath: "#3fc5b7" - shape_flag: { fg: "#368aeb" attr: "b" } - shape_float: { fg: "#eb6eb7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3fc5b7" attr: "b" } - shape_int: { fg: "#eb6eb7" attr: "b" } - shape_internalcall: { fg: "#3fc5b7" attr: "b" } - shape_list: { fg: "#3fc5b7" attr: "b" } - shape_literal: "#368aeb" - shape_match_pattern: "#70b433" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56d8c9" - shape_operator: "#dbb32d" - shape_or: { fg: "#eb6eb7" attr: "b" } - shape_pipe: { fg: "#eb6eb7" attr: "b" } - shape_range: { fg: "#dbb32d" attr: "b" } - shape_record: { fg: "#3fc5b7" attr: "b" } - shape_redirection: { fg: "#eb6eb7" attr: "b" } - shape_signature: { fg: "#70b433" attr: "b" } - shape_string: "#70b433" - shape_string_interpolation: { fg: "#3fc5b7" attr: "b" } - shape_table: { fg: "#368aeb" attr: "b" } - shape_variable: "#eb6eb7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#181818" - foreground: "#b9b9b9" - cursor: "#b9b9b9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#777777' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#70b433' attr: 'b' } + empty: '#368aeb' + bool: {|| if $in { '#56d8c9' } else { 'light_gray' } } + int: '#777777' + filesize: {|e| + if $e == 0b { + '#777777' + } else if $e < 1mb { + '#3fc5b7' + } else {{ fg: '#368aeb' }} + } + duration: '#777777' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ed4a46' attr: 'b' } + } else if $in < 6hr { + '#ed4a46' + } else if $in < 1day { + '#dbb32d' + } else if $in < 3day { + '#70b433' + } else if $in < 1wk { + { fg: '#70b433' attr: 'b' } + } else if $in < 6wk { + '#3fc5b7' + } else if $in < 52wk { + '#368aeb' + } else { 'dark_gray' } + } + range: '#777777' + float: '#777777' + string: '#777777' + nothing: '#777777' + binary: '#777777' + cellpath: '#777777' + row_index: { fg: '#70b433' attr: 'b' } + record: '#777777' + list: '#777777' + block: '#777777' + hints: 'dark_gray' + search_result: { fg: '#ed4a46' bg: '#777777' } + + shape_and: { fg: '#eb6eb7' attr: 'b' } + shape_binary: { fg: '#eb6eb7' attr: 'b' } + shape_block: { fg: '#368aeb' attr: 'b' } + shape_bool: '#56d8c9' + shape_custom: '#70b433' + shape_datetime: { fg: '#3fc5b7' attr: 'b' } + shape_directory: '#3fc5b7' + shape_external: '#3fc5b7' + shape_externalarg: { fg: '#70b433' attr: 'b' } + shape_filepath: '#3fc5b7' + shape_flag: { fg: '#368aeb' attr: 'b' } + shape_float: { fg: '#eb6eb7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3fc5b7' attr: 'b' } + shape_int: { fg: '#eb6eb7' attr: 'b' } + shape_internalcall: { fg: '#3fc5b7' attr: 'b' } + shape_list: { fg: '#3fc5b7' attr: 'b' } + shape_literal: '#368aeb' + shape_match_pattern: '#70b433' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56d8c9' + shape_operator: '#dbb32d' + shape_or: { fg: '#eb6eb7' attr: 'b' } + shape_pipe: { fg: '#eb6eb7' attr: 'b' } + shape_range: { fg: '#dbb32d' attr: 'b' } + shape_record: { fg: '#3fc5b7' attr: 'b' } + shape_redirection: { fg: '#eb6eb7' attr: 'b' } + shape_signature: { fg: '#70b433' attr: 'b' } + shape_string: '#70b433' + shape_string_interpolation: { fg: '#3fc5b7' attr: 'b' } + shape_table: { fg: '#368aeb' attr: 'b' } + shape_variable: '#eb6eb7' + + background: '#181818' + foreground: '#b9b9b9' + cursor: '#b9b9b9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/selenized-dark.nu b/themes/nu-themes/selenized-dark.nu index 0073853..13e5b01 100644 --- a/themes/nu-themes/selenized-dark.nu +++ b/themes/nu-themes/selenized-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#72898f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#75b938" attr: "b" } - empty: "#4695f7" - bool: {|| if $in { "#53d6c7" } else { "light_gray" } } - int: "#72898f" - filesize: {|e| - if $e == 0b { - "#72898f" - } else if $e < 1mb { - "#41c7b9" - } else {{ fg: "#4695f7" }} - } - duration: "#72898f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fa5750" attr: "b" } - } else if $in < 6hr { - "#fa5750" - } else if $in < 1day { - "#dbb32d" - } else if $in < 3day { - "#75b938" - } else if $in < 1wk { - { fg: "#75b938" attr: "b" } - } else if $in < 6wk { - "#41c7b9" - } else if $in < 52wk { - "#4695f7" - } else { "dark_gray" } - } - range: "#72898f" - float: "#72898f" - string: "#72898f" - nothing: "#72898f" - binary: "#72898f" - cellpath: "#72898f" - row_index: { fg: "#75b938" attr: "b" } - record: "#72898f" - list: "#72898f" - block: "#72898f" - hints: "dark_gray" - search_result: { fg: "#fa5750" bg: "#72898f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f275be" attr: "b" } - shape_binary: { fg: "#f275be" attr: "b" } - shape_block: { fg: "#4695f7" attr: "b" } - shape_bool: "#53d6c7" - shape_custom: "#75b938" - shape_datetime: { fg: "#41c7b9" attr: "b" } - shape_directory: "#41c7b9" - shape_external: "#41c7b9" - shape_externalarg: { fg: "#75b938" attr: "b" } - shape_filepath: "#41c7b9" - shape_flag: { fg: "#4695f7" attr: "b" } - shape_float: { fg: "#f275be" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#41c7b9" attr: "b" } - shape_int: { fg: "#f275be" attr: "b" } - shape_internalcall: { fg: "#41c7b9" attr: "b" } - shape_list: { fg: "#41c7b9" attr: "b" } - shape_literal: "#4695f7" - shape_match_pattern: "#75b938" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#53d6c7" - shape_operator: "#dbb32d" - shape_or: { fg: "#f275be" attr: "b" } - shape_pipe: { fg: "#f275be" attr: "b" } - shape_range: { fg: "#dbb32d" attr: "b" } - shape_record: { fg: "#41c7b9" attr: "b" } - shape_redirection: { fg: "#f275be" attr: "b" } - shape_signature: { fg: "#75b938" attr: "b" } - shape_string: "#75b938" - shape_string_interpolation: { fg: "#41c7b9" attr: "b" } - shape_table: { fg: "#4695f7" attr: "b" } - shape_variable: "#f275be" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#103c48" - foreground: "#adbcbc" - cursor: "#adbcbc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#72898f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#75b938' attr: 'b' } + empty: '#4695f7' + bool: {|| if $in { '#53d6c7' } else { 'light_gray' } } + int: '#72898f' + filesize: {|e| + if $e == 0b { + '#72898f' + } else if $e < 1mb { + '#41c7b9' + } else {{ fg: '#4695f7' }} + } + duration: '#72898f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fa5750' attr: 'b' } + } else if $in < 6hr { + '#fa5750' + } else if $in < 1day { + '#dbb32d' + } else if $in < 3day { + '#75b938' + } else if $in < 1wk { + { fg: '#75b938' attr: 'b' } + } else if $in < 6wk { + '#41c7b9' + } else if $in < 52wk { + '#4695f7' + } else { 'dark_gray' } + } + range: '#72898f' + float: '#72898f' + string: '#72898f' + nothing: '#72898f' + binary: '#72898f' + cellpath: '#72898f' + row_index: { fg: '#75b938' attr: 'b' } + record: '#72898f' + list: '#72898f' + block: '#72898f' + hints: 'dark_gray' + search_result: { fg: '#fa5750' bg: '#72898f' } + + shape_and: { fg: '#f275be' attr: 'b' } + shape_binary: { fg: '#f275be' attr: 'b' } + shape_block: { fg: '#4695f7' attr: 'b' } + shape_bool: '#53d6c7' + shape_custom: '#75b938' + shape_datetime: { fg: '#41c7b9' attr: 'b' } + shape_directory: '#41c7b9' + shape_external: '#41c7b9' + shape_externalarg: { fg: '#75b938' attr: 'b' } + shape_filepath: '#41c7b9' + shape_flag: { fg: '#4695f7' attr: 'b' } + shape_float: { fg: '#f275be' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#41c7b9' attr: 'b' } + shape_int: { fg: '#f275be' attr: 'b' } + shape_internalcall: { fg: '#41c7b9' attr: 'b' } + shape_list: { fg: '#41c7b9' attr: 'b' } + shape_literal: '#4695f7' + shape_match_pattern: '#75b938' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#53d6c7' + shape_operator: '#dbb32d' + shape_or: { fg: '#f275be' attr: 'b' } + shape_pipe: { fg: '#f275be' attr: 'b' } + shape_range: { fg: '#dbb32d' attr: 'b' } + shape_record: { fg: '#41c7b9' attr: 'b' } + shape_redirection: { fg: '#f275be' attr: 'b' } + shape_signature: { fg: '#75b938' attr: 'b' } + shape_string: '#75b938' + shape_string_interpolation: { fg: '#41c7b9' attr: 'b' } + shape_table: { fg: '#4695f7' attr: 'b' } + shape_variable: '#f275be' + + background: '#103c48' + foreground: '#adbcbc' + cursor: '#adbcbc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/selenized-light.nu b/themes/nu-themes/selenized-light.nu index 815c954..94bf0d7 100644 --- a/themes/nu-themes/selenized-light.nu +++ b/themes/nu-themes/selenized-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#909995" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#489100" attr: "b" } - empty: "#0072d4" - bool: {|| if $in { "#00978a" } else { "light_gray" } } - int: "#909995" - filesize: {|e| - if $e == 0b { - "#909995" - } else if $e < 1mb { - "#009c8f" - } else {{ fg: "#0072d4" }} - } - duration: "#909995" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d2212d" attr: "b" } - } else if $in < 6hr { - "#d2212d" - } else if $in < 1day { - "#ad8900" - } else if $in < 3day { - "#489100" - } else if $in < 1wk { - { fg: "#489100" attr: "b" } - } else if $in < 6wk { - "#009c8f" - } else if $in < 52wk { - "#0072d4" - } else { "dark_gray" } - } - range: "#909995" - float: "#909995" - string: "#909995" - nothing: "#909995" - binary: "#909995" - cellpath: "#909995" - row_index: { fg: "#489100" attr: "b" } - record: "#909995" - list: "#909995" - block: "#909995" - hints: "dark_gray" - search_result: { fg: "#d2212d" bg: "#909995" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ca4898" attr: "b" } - shape_binary: { fg: "#ca4898" attr: "b" } - shape_block: { fg: "#0072d4" attr: "b" } - shape_bool: "#00978a" - shape_custom: "#489100" - shape_datetime: { fg: "#009c8f" attr: "b" } - shape_directory: "#009c8f" - shape_external: "#009c8f" - shape_externalarg: { fg: "#489100" attr: "b" } - shape_filepath: "#009c8f" - shape_flag: { fg: "#0072d4" attr: "b" } - shape_float: { fg: "#ca4898" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#009c8f" attr: "b" } - shape_int: { fg: "#ca4898" attr: "b" } - shape_internalcall: { fg: "#009c8f" attr: "b" } - shape_list: { fg: "#009c8f" attr: "b" } - shape_literal: "#0072d4" - shape_match_pattern: "#489100" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00978a" - shape_operator: "#ad8900" - shape_or: { fg: "#ca4898" attr: "b" } - shape_pipe: { fg: "#ca4898" attr: "b" } - shape_range: { fg: "#ad8900" attr: "b" } - shape_record: { fg: "#009c8f" attr: "b" } - shape_redirection: { fg: "#ca4898" attr: "b" } - shape_signature: { fg: "#489100" attr: "b" } - shape_string: "#489100" - shape_string_interpolation: { fg: "#009c8f" attr: "b" } - shape_table: { fg: "#0072d4" attr: "b" } - shape_variable: "#ca4898" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbf3db" - foreground: "#53676d" - cursor: "#53676d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#909995' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#489100' attr: 'b' } + empty: '#0072d4' + bool: {|| if $in { '#00978a' } else { 'light_gray' } } + int: '#909995' + filesize: {|e| + if $e == 0b { + '#909995' + } else if $e < 1mb { + '#009c8f' + } else {{ fg: '#0072d4' }} + } + duration: '#909995' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d2212d' attr: 'b' } + } else if $in < 6hr { + '#d2212d' + } else if $in < 1day { + '#ad8900' + } else if $in < 3day { + '#489100' + } else if $in < 1wk { + { fg: '#489100' attr: 'b' } + } else if $in < 6wk { + '#009c8f' + } else if $in < 52wk { + '#0072d4' + } else { 'dark_gray' } + } + range: '#909995' + float: '#909995' + string: '#909995' + nothing: '#909995' + binary: '#909995' + cellpath: '#909995' + row_index: { fg: '#489100' attr: 'b' } + record: '#909995' + list: '#909995' + block: '#909995' + hints: 'dark_gray' + search_result: { fg: '#d2212d' bg: '#909995' } + + shape_and: { fg: '#ca4898' attr: 'b' } + shape_binary: { fg: '#ca4898' attr: 'b' } + shape_block: { fg: '#0072d4' attr: 'b' } + shape_bool: '#00978a' + shape_custom: '#489100' + shape_datetime: { fg: '#009c8f' attr: 'b' } + shape_directory: '#009c8f' + shape_external: '#009c8f' + shape_externalarg: { fg: '#489100' attr: 'b' } + shape_filepath: '#009c8f' + shape_flag: { fg: '#0072d4' attr: 'b' } + shape_float: { fg: '#ca4898' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#009c8f' attr: 'b' } + shape_int: { fg: '#ca4898' attr: 'b' } + shape_internalcall: { fg: '#009c8f' attr: 'b' } + shape_list: { fg: '#009c8f' attr: 'b' } + shape_literal: '#0072d4' + shape_match_pattern: '#489100' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00978a' + shape_operator: '#ad8900' + shape_or: { fg: '#ca4898' attr: 'b' } + shape_pipe: { fg: '#ca4898' attr: 'b' } + shape_range: { fg: '#ad8900' attr: 'b' } + shape_record: { fg: '#009c8f' attr: 'b' } + shape_redirection: { fg: '#ca4898' attr: 'b' } + shape_signature: { fg: '#489100' attr: 'b' } + shape_string: '#489100' + shape_string_interpolation: { fg: '#009c8f' attr: 'b' } + shape_table: { fg: '#0072d4' attr: 'b' } + shape_variable: '#ca4898' + + background: '#fbf3db' + foreground: '#53676d' + cursor: '#53676d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/selenized-white.nu b/themes/nu-themes/selenized-white.nu index 7f7fecc..5f64afa 100644 --- a/themes/nu-themes/selenized-white.nu +++ b/themes/nu-themes/selenized-white.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#878787" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#1d9700" attr: "b" } - empty: "#0064e4" - bool: {|| if $in { "#009a8a" } else { "light_gray" } } - int: "#878787" - filesize: {|e| - if $e == 0b { - "#878787" - } else if $e < 1mb { - "#00ad9c" - } else {{ fg: "#0064e4" }} - } - duration: "#878787" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d6000c" attr: "b" } - } else if $in < 6hr { - "#d6000c" - } else if $in < 1day { - "#c49700" - } else if $in < 3day { - "#1d9700" - } else if $in < 1wk { - { fg: "#1d9700" attr: "b" } - } else if $in < 6wk { - "#00ad9c" - } else if $in < 52wk { - "#0064e4" - } else { "dark_gray" } - } - range: "#878787" - float: "#878787" - string: "#878787" - nothing: "#878787" - binary: "#878787" - cellpath: "#878787" - row_index: { fg: "#1d9700" attr: "b" } - record: "#878787" - list: "#878787" - block: "#878787" - hints: "dark_gray" - search_result: { fg: "#d6000c" bg: "#878787" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#dd0f9d" attr: "b" } - shape_binary: { fg: "#dd0f9d" attr: "b" } - shape_block: { fg: "#0064e4" attr: "b" } - shape_bool: "#009a8a" - shape_custom: "#1d9700" - shape_datetime: { fg: "#00ad9c" attr: "b" } - shape_directory: "#00ad9c" - shape_external: "#00ad9c" - shape_externalarg: { fg: "#1d9700" attr: "b" } - shape_filepath: "#00ad9c" - shape_flag: { fg: "#0064e4" attr: "b" } - shape_float: { fg: "#dd0f9d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00ad9c" attr: "b" } - shape_int: { fg: "#dd0f9d" attr: "b" } - shape_internalcall: { fg: "#00ad9c" attr: "b" } - shape_list: { fg: "#00ad9c" attr: "b" } - shape_literal: "#0064e4" - shape_match_pattern: "#1d9700" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#009a8a" - shape_operator: "#c49700" - shape_or: { fg: "#dd0f9d" attr: "b" } - shape_pipe: { fg: "#dd0f9d" attr: "b" } - shape_range: { fg: "#c49700" attr: "b" } - shape_record: { fg: "#00ad9c" attr: "b" } - shape_redirection: { fg: "#dd0f9d" attr: "b" } - shape_signature: { fg: "#1d9700" attr: "b" } - shape_string: "#1d9700" - shape_string_interpolation: { fg: "#00ad9c" attr: "b" } - shape_table: { fg: "#0064e4" attr: "b" } - shape_variable: "#dd0f9d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#474747" - cursor: "#474747" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#878787' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#1d9700' attr: 'b' } + empty: '#0064e4' + bool: {|| if $in { '#009a8a' } else { 'light_gray' } } + int: '#878787' + filesize: {|e| + if $e == 0b { + '#878787' + } else if $e < 1mb { + '#00ad9c' + } else {{ fg: '#0064e4' }} + } + duration: '#878787' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d6000c' attr: 'b' } + } else if $in < 6hr { + '#d6000c' + } else if $in < 1day { + '#c49700' + } else if $in < 3day { + '#1d9700' + } else if $in < 1wk { + { fg: '#1d9700' attr: 'b' } + } else if $in < 6wk { + '#00ad9c' + } else if $in < 52wk { + '#0064e4' + } else { 'dark_gray' } + } + range: '#878787' + float: '#878787' + string: '#878787' + nothing: '#878787' + binary: '#878787' + cellpath: '#878787' + row_index: { fg: '#1d9700' attr: 'b' } + record: '#878787' + list: '#878787' + block: '#878787' + hints: 'dark_gray' + search_result: { fg: '#d6000c' bg: '#878787' } + + shape_and: { fg: '#dd0f9d' attr: 'b' } + shape_binary: { fg: '#dd0f9d' attr: 'b' } + shape_block: { fg: '#0064e4' attr: 'b' } + shape_bool: '#009a8a' + shape_custom: '#1d9700' + shape_datetime: { fg: '#00ad9c' attr: 'b' } + shape_directory: '#00ad9c' + shape_external: '#00ad9c' + shape_externalarg: { fg: '#1d9700' attr: 'b' } + shape_filepath: '#00ad9c' + shape_flag: { fg: '#0064e4' attr: 'b' } + shape_float: { fg: '#dd0f9d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00ad9c' attr: 'b' } + shape_int: { fg: '#dd0f9d' attr: 'b' } + shape_internalcall: { fg: '#00ad9c' attr: 'b' } + shape_list: { fg: '#00ad9c' attr: 'b' } + shape_literal: '#0064e4' + shape_match_pattern: '#1d9700' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#009a8a' + shape_operator: '#c49700' + shape_or: { fg: '#dd0f9d' attr: 'b' } + shape_pipe: { fg: '#dd0f9d' attr: 'b' } + shape_range: { fg: '#c49700' attr: 'b' } + shape_record: { fg: '#00ad9c' attr: 'b' } + shape_redirection: { fg: '#dd0f9d' attr: 'b' } + shape_signature: { fg: '#1d9700' attr: 'b' } + shape_string: '#1d9700' + shape_string_interpolation: { fg: '#00ad9c' attr: 'b' } + shape_table: { fg: '#0064e4' attr: 'b' } + shape_variable: '#dd0f9d' + + background: '#ffffff' + foreground: '#474747' + cursor: '#474747' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/seoul256.nu b/themes/nu-themes/seoul256.nu index 45bd307..5fda33c 100644 --- a/themes/nu-themes/seoul256.nu +++ b/themes/nu-themes/seoul256.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5f865f" attr: "b" } - empty: "#85add4" - bool: {|| if $in { "#87d7d7" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#87afaf" - } else {{ fg: "#85add4" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d68787" attr: "b" } - } else if $in < 6hr { - "#d68787" - } else if $in < 1day { - "#d8af5f" - } else if $in < 3day { - "#5f865f" - } else if $in < 1wk { - { fg: "#5f865f" attr: "b" } - } else if $in < 6wk { - "#87afaf" - } else if $in < 52wk { - "#85add4" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#5f865f" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#d68787" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d7afaf" attr: "b" } - shape_binary: { fg: "#d7afaf" attr: "b" } - shape_block: { fg: "#85add4" attr: "b" } - shape_bool: "#87d7d7" - shape_custom: "#5f865f" - shape_datetime: { fg: "#87afaf" attr: "b" } - shape_directory: "#87afaf" - shape_external: "#87afaf" - shape_externalarg: { fg: "#5f865f" attr: "b" } - shape_filepath: "#87afaf" - shape_flag: { fg: "#85add4" attr: "b" } - shape_float: { fg: "#d7afaf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#87afaf" attr: "b" } - shape_int: { fg: "#d7afaf" attr: "b" } - shape_internalcall: { fg: "#87afaf" attr: "b" } - shape_list: { fg: "#87afaf" attr: "b" } - shape_literal: "#85add4" - shape_match_pattern: "#5f865f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#87d7d7" - shape_operator: "#d8af5f" - shape_or: { fg: "#d7afaf" attr: "b" } - shape_pipe: { fg: "#d7afaf" attr: "b" } - shape_range: { fg: "#d8af5f" attr: "b" } - shape_record: { fg: "#87afaf" attr: "b" } - shape_redirection: { fg: "#d7afaf" attr: "b" } - shape_signature: { fg: "#5f865f" attr: "b" } - shape_string: "#5f865f" - shape_string_interpolation: { fg: "#87afaf" attr: "b" } - shape_table: { fg: "#85add4" attr: "b" } - shape_variable: "#d7afaf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3a3a3a" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5f865f' attr: 'b' } + empty: '#85add4' + bool: {|| if $in { '#87d7d7' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#87afaf' + } else {{ fg: '#85add4' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d68787' attr: 'b' } + } else if $in < 6hr { + '#d68787' + } else if $in < 1day { + '#d8af5f' + } else if $in < 3day { + '#5f865f' + } else if $in < 1wk { + { fg: '#5f865f' attr: 'b' } + } else if $in < 6wk { + '#87afaf' + } else if $in < 52wk { + '#85add4' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#5f865f' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#d68787' bg: '#d0d0d0' } + + shape_and: { fg: '#d7afaf' attr: 'b' } + shape_binary: { fg: '#d7afaf' attr: 'b' } + shape_block: { fg: '#85add4' attr: 'b' } + shape_bool: '#87d7d7' + shape_custom: '#5f865f' + shape_datetime: { fg: '#87afaf' attr: 'b' } + shape_directory: '#87afaf' + shape_external: '#87afaf' + shape_externalarg: { fg: '#5f865f' attr: 'b' } + shape_filepath: '#87afaf' + shape_flag: { fg: '#85add4' attr: 'b' } + shape_float: { fg: '#d7afaf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#87afaf' attr: 'b' } + shape_int: { fg: '#d7afaf' attr: 'b' } + shape_internalcall: { fg: '#87afaf' attr: 'b' } + shape_list: { fg: '#87afaf' attr: 'b' } + shape_literal: '#85add4' + shape_match_pattern: '#5f865f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#87d7d7' + shape_operator: '#d8af5f' + shape_or: { fg: '#d7afaf' attr: 'b' } + shape_pipe: { fg: '#d7afaf' attr: 'b' } + shape_range: { fg: '#d8af5f' attr: 'b' } + shape_record: { fg: '#87afaf' attr: 'b' } + shape_redirection: { fg: '#d7afaf' attr: 'b' } + shape_signature: { fg: '#5f865f' attr: 'b' } + shape_string: '#5f865f' + shape_string_interpolation: { fg: '#87afaf' attr: 'b' } + shape_table: { fg: '#85add4' attr: 'b' } + shape_variable: '#d7afaf' + + background: '#3a3a3a' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/seti-ui.nu b/themes/nu-themes/seti-ui.nu index bcd2b3f..225389a 100644 --- a/themes/nu-themes/seti-ui.nu +++ b/themes/nu-themes/seti-ui.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d6d6d6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9fca56" attr: "b" } - empty: "#55b5db" - bool: {|| if $in { "#55dbbe" } else { "light_gray" } } - int: "#d6d6d6" - filesize: {|e| - if $e == 0b { - "#d6d6d6" - } else if $e < 1mb { - "#55dbbe" - } else {{ fg: "#55b5db" }} - } - duration: "#d6d6d6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#Cd3f45" attr: "b" } - } else if $in < 6hr { - "#Cd3f45" - } else if $in < 1day { - "#e6cd69" - } else if $in < 3day { - "#9fca56" - } else if $in < 1wk { - { fg: "#9fca56" attr: "b" } - } else if $in < 6wk { - "#55dbbe" - } else if $in < 52wk { - "#55b5db" - } else { "dark_gray" } - } - range: "#d6d6d6" - float: "#d6d6d6" - string: "#d6d6d6" - nothing: "#d6d6d6" - binary: "#d6d6d6" - cellpath: "#d6d6d6" - row_index: { fg: "#9fca56" attr: "b" } - record: "#d6d6d6" - list: "#d6d6d6" - block: "#d6d6d6" - hints: "dark_gray" - search_result: { fg: "#Cd3f45" bg: "#d6d6d6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a074c4" attr: "b" } - shape_binary: { fg: "#a074c4" attr: "b" } - shape_block: { fg: "#55b5db" attr: "b" } - shape_bool: "#55dbbe" - shape_custom: "#9fca56" - shape_datetime: { fg: "#55dbbe" attr: "b" } - shape_directory: "#55dbbe" - shape_external: "#55dbbe" - shape_externalarg: { fg: "#9fca56" attr: "b" } - shape_filepath: "#55dbbe" - shape_flag: { fg: "#55b5db" attr: "b" } - shape_float: { fg: "#a074c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#55dbbe" attr: "b" } - shape_int: { fg: "#a074c4" attr: "b" } - shape_internalcall: { fg: "#55dbbe" attr: "b" } - shape_list: { fg: "#55dbbe" attr: "b" } - shape_literal: "#55b5db" - shape_match_pattern: "#9fca56" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55dbbe" - shape_operator: "#e6cd69" - shape_or: { fg: "#a074c4" attr: "b" } - shape_pipe: { fg: "#a074c4" attr: "b" } - shape_range: { fg: "#e6cd69" attr: "b" } - shape_record: { fg: "#55dbbe" attr: "b" } - shape_redirection: { fg: "#a074c4" attr: "b" } - shape_signature: { fg: "#9fca56" attr: "b" } - shape_string: "#9fca56" - shape_string_interpolation: { fg: "#55dbbe" attr: "b" } - shape_table: { fg: "#55b5db" attr: "b" } - shape_variable: "#a074c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#151718" - foreground: "#d6d6d6" - cursor: "#d6d6d6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d6d6d6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9fca56' attr: 'b' } + empty: '#55b5db' + bool: {|| if $in { '#55dbbe' } else { 'light_gray' } } + int: '#d6d6d6' + filesize: {|e| + if $e == 0b { + '#d6d6d6' + } else if $e < 1mb { + '#55dbbe' + } else {{ fg: '#55b5db' }} + } + duration: '#d6d6d6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#Cd3f45' attr: 'b' } + } else if $in < 6hr { + '#Cd3f45' + } else if $in < 1day { + '#e6cd69' + } else if $in < 3day { + '#9fca56' + } else if $in < 1wk { + { fg: '#9fca56' attr: 'b' } + } else if $in < 6wk { + '#55dbbe' + } else if $in < 52wk { + '#55b5db' + } else { 'dark_gray' } + } + range: '#d6d6d6' + float: '#d6d6d6' + string: '#d6d6d6' + nothing: '#d6d6d6' + binary: '#d6d6d6' + cellpath: '#d6d6d6' + row_index: { fg: '#9fca56' attr: 'b' } + record: '#d6d6d6' + list: '#d6d6d6' + block: '#d6d6d6' + hints: 'dark_gray' + search_result: { fg: '#Cd3f45' bg: '#d6d6d6' } + + shape_and: { fg: '#a074c4' attr: 'b' } + shape_binary: { fg: '#a074c4' attr: 'b' } + shape_block: { fg: '#55b5db' attr: 'b' } + shape_bool: '#55dbbe' + shape_custom: '#9fca56' + shape_datetime: { fg: '#55dbbe' attr: 'b' } + shape_directory: '#55dbbe' + shape_external: '#55dbbe' + shape_externalarg: { fg: '#9fca56' attr: 'b' } + shape_filepath: '#55dbbe' + shape_flag: { fg: '#55b5db' attr: 'b' } + shape_float: { fg: '#a074c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#55dbbe' attr: 'b' } + shape_int: { fg: '#a074c4' attr: 'b' } + shape_internalcall: { fg: '#55dbbe' attr: 'b' } + shape_list: { fg: '#55dbbe' attr: 'b' } + shape_literal: '#55b5db' + shape_match_pattern: '#9fca56' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55dbbe' + shape_operator: '#e6cd69' + shape_or: { fg: '#a074c4' attr: 'b' } + shape_pipe: { fg: '#a074c4' attr: 'b' } + shape_range: { fg: '#e6cd69' attr: 'b' } + shape_record: { fg: '#55dbbe' attr: 'b' } + shape_redirection: { fg: '#a074c4' attr: 'b' } + shape_signature: { fg: '#9fca56' attr: 'b' } + shape_string: '#9fca56' + shape_string_interpolation: { fg: '#55dbbe' attr: 'b' } + shape_table: { fg: '#55b5db' attr: 'b' } + shape_variable: '#a074c4' + + background: '#151718' + foreground: '#d6d6d6' + cursor: '#d6d6d6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/seti.nu b/themes/nu-themes/seti.nu index d74738e..68b154b 100644 --- a/themes/nu-themes/seti.nu +++ b/themes/nu-themes/seti.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d6d6d6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9fca56" attr: "b" } - empty: "#55b5db" - bool: {|| if $in { "#55dbbe" } else { "light_gray" } } - int: "#d6d6d6" - filesize: {|e| - if $e == 0b { - "#d6d6d6" - } else if $e < 1mb { - "#55dbbe" - } else {{ fg: "#55b5db" }} - } - duration: "#d6d6d6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cd3f45" attr: "b" } - } else if $in < 6hr { - "#cd3f45" - } else if $in < 1day { - "#e6cd69" - } else if $in < 3day { - "#9fca56" - } else if $in < 1wk { - { fg: "#9fca56" attr: "b" } - } else if $in < 6wk { - "#55dbbe" - } else if $in < 52wk { - "#55b5db" - } else { "dark_gray" } - } - range: "#d6d6d6" - float: "#d6d6d6" - string: "#d6d6d6" - nothing: "#d6d6d6" - binary: "#d6d6d6" - cellpath: "#d6d6d6" - row_index: { fg: "#9fca56" attr: "b" } - record: "#d6d6d6" - list: "#d6d6d6" - block: "#d6d6d6" - hints: "dark_gray" - search_result: { fg: "#cd3f45" bg: "#d6d6d6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a074c4" attr: "b" } - shape_binary: { fg: "#a074c4" attr: "b" } - shape_block: { fg: "#55b5db" attr: "b" } - shape_bool: "#55dbbe" - shape_custom: "#9fca56" - shape_datetime: { fg: "#55dbbe" attr: "b" } - shape_directory: "#55dbbe" - shape_external: "#55dbbe" - shape_externalarg: { fg: "#9fca56" attr: "b" } - shape_filepath: "#55dbbe" - shape_flag: { fg: "#55b5db" attr: "b" } - shape_float: { fg: "#a074c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#55dbbe" attr: "b" } - shape_int: { fg: "#a074c4" attr: "b" } - shape_internalcall: { fg: "#55dbbe" attr: "b" } - shape_list: { fg: "#55dbbe" attr: "b" } - shape_literal: "#55b5db" - shape_match_pattern: "#9fca56" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55dbbe" - shape_operator: "#e6cd69" - shape_or: { fg: "#a074c4" attr: "b" } - shape_pipe: { fg: "#a074c4" attr: "b" } - shape_range: { fg: "#e6cd69" attr: "b" } - shape_record: { fg: "#55dbbe" attr: "b" } - shape_redirection: { fg: "#a074c4" attr: "b" } - shape_signature: { fg: "#9fca56" attr: "b" } - shape_string: "#9fca56" - shape_string_interpolation: { fg: "#55dbbe" attr: "b" } - shape_table: { fg: "#55b5db" attr: "b" } - shape_variable: "#a074c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#151718" - foreground: "#d6d6d6" - cursor: "#d6d6d6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d6d6d6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9fca56' attr: 'b' } + empty: '#55b5db' + bool: {|| if $in { '#55dbbe' } else { 'light_gray' } } + int: '#d6d6d6' + filesize: {|e| + if $e == 0b { + '#d6d6d6' + } else if $e < 1mb { + '#55dbbe' + } else {{ fg: '#55b5db' }} + } + duration: '#d6d6d6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cd3f45' attr: 'b' } + } else if $in < 6hr { + '#cd3f45' + } else if $in < 1day { + '#e6cd69' + } else if $in < 3day { + '#9fca56' + } else if $in < 1wk { + { fg: '#9fca56' attr: 'b' } + } else if $in < 6wk { + '#55dbbe' + } else if $in < 52wk { + '#55b5db' + } else { 'dark_gray' } + } + range: '#d6d6d6' + float: '#d6d6d6' + string: '#d6d6d6' + nothing: '#d6d6d6' + binary: '#d6d6d6' + cellpath: '#d6d6d6' + row_index: { fg: '#9fca56' attr: 'b' } + record: '#d6d6d6' + list: '#d6d6d6' + block: '#d6d6d6' + hints: 'dark_gray' + search_result: { fg: '#cd3f45' bg: '#d6d6d6' } + + shape_and: { fg: '#a074c4' attr: 'b' } + shape_binary: { fg: '#a074c4' attr: 'b' } + shape_block: { fg: '#55b5db' attr: 'b' } + shape_bool: '#55dbbe' + shape_custom: '#9fca56' + shape_datetime: { fg: '#55dbbe' attr: 'b' } + shape_directory: '#55dbbe' + shape_external: '#55dbbe' + shape_externalarg: { fg: '#9fca56' attr: 'b' } + shape_filepath: '#55dbbe' + shape_flag: { fg: '#55b5db' attr: 'b' } + shape_float: { fg: '#a074c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#55dbbe' attr: 'b' } + shape_int: { fg: '#a074c4' attr: 'b' } + shape_internalcall: { fg: '#55dbbe' attr: 'b' } + shape_list: { fg: '#55dbbe' attr: 'b' } + shape_literal: '#55b5db' + shape_match_pattern: '#9fca56' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55dbbe' + shape_operator: '#e6cd69' + shape_or: { fg: '#a074c4' attr: 'b' } + shape_pipe: { fg: '#a074c4' attr: 'b' } + shape_range: { fg: '#e6cd69' attr: 'b' } + shape_record: { fg: '#55dbbe' attr: 'b' } + shape_redirection: { fg: '#a074c4' attr: 'b' } + shape_signature: { fg: '#9fca56' attr: 'b' } + shape_string: '#9fca56' + shape_string_interpolation: { fg: '#55dbbe' attr: 'b' } + shape_table: { fg: '#55b5db' attr: 'b' } + shape_variable: '#a074c4' + + background: '#151718' + foreground: '#d6d6d6' + cursor: '#d6d6d6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/shaman.nu b/themes/nu-themes/shaman.nu index e9fbbaf..a8f878a 100644 --- a/themes/nu-themes/shaman.nu +++ b/themes/nu-themes/shaman.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#405555" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a941" attr: "b" } - empty: "#449a86" - bool: {|| if $in { "#98d028" } else { "light_gray" } } - int: "#405555" - filesize: {|e| - if $e == 0b { - "#405555" - } else if $e < 1mb { - "#5d7e19" - } else {{ fg: "#449a86" }} - } - duration: "#405555" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b2302d" attr: "b" } - } else if $in < 6hr { - "#b2302d" - } else if $in < 1day { - "#5e8baa" - } else if $in < 3day { - "#00a941" - } else if $in < 1wk { - { fg: "#00a941" attr: "b" } - } else if $in < 6wk { - "#5d7e19" - } else if $in < 52wk { - "#449a86" - } else { "dark_gray" } - } - range: "#405555" - float: "#405555" - string: "#405555" - nothing: "#405555" - binary: "#405555" - cellpath: "#405555" - row_index: { fg: "#00a941" attr: "b" } - record: "#405555" - list: "#405555" - block: "#405555" - hints: "dark_gray" - search_result: { fg: "#b2302d" bg: "#405555" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#00599d" attr: "b" } - shape_binary: { fg: "#00599d" attr: "b" } - shape_block: { fg: "#449a86" attr: "b" } - shape_bool: "#98d028" - shape_custom: "#00a941" - shape_datetime: { fg: "#5d7e19" attr: "b" } - shape_directory: "#5d7e19" - shape_external: "#5d7e19" - shape_externalarg: { fg: "#00a941" attr: "b" } - shape_filepath: "#5d7e19" - shape_flag: { fg: "#449a86" attr: "b" } - shape_float: { fg: "#00599d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5d7e19" attr: "b" } - shape_int: { fg: "#00599d" attr: "b" } - shape_internalcall: { fg: "#5d7e19" attr: "b" } - shape_list: { fg: "#5d7e19" attr: "b" } - shape_literal: "#449a86" - shape_match_pattern: "#00a941" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#98d028" - shape_operator: "#5e8baa" - shape_or: { fg: "#00599d" attr: "b" } - shape_pipe: { fg: "#00599d" attr: "b" } - shape_range: { fg: "#5e8baa" attr: "b" } - shape_record: { fg: "#5d7e19" attr: "b" } - shape_redirection: { fg: "#00599d" attr: "b" } - shape_signature: { fg: "#00a941" attr: "b" } - shape_string: "#00a941" - shape_string_interpolation: { fg: "#5d7e19" attr: "b" } - shape_table: { fg: "#449a86" attr: "b" } - shape_variable: "#00599d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#001015" - foreground: "#405555" - cursor: "#405555" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#405555' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a941' attr: 'b' } + empty: '#449a86' + bool: {|| if $in { '#98d028' } else { 'light_gray' } } + int: '#405555' + filesize: {|e| + if $e == 0b { + '#405555' + } else if $e < 1mb { + '#5d7e19' + } else {{ fg: '#449a86' }} + } + duration: '#405555' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b2302d' attr: 'b' } + } else if $in < 6hr { + '#b2302d' + } else if $in < 1day { + '#5e8baa' + } else if $in < 3day { + '#00a941' + } else if $in < 1wk { + { fg: '#00a941' attr: 'b' } + } else if $in < 6wk { + '#5d7e19' + } else if $in < 52wk { + '#449a86' + } else { 'dark_gray' } + } + range: '#405555' + float: '#405555' + string: '#405555' + nothing: '#405555' + binary: '#405555' + cellpath: '#405555' + row_index: { fg: '#00a941' attr: 'b' } + record: '#405555' + list: '#405555' + block: '#405555' + hints: 'dark_gray' + search_result: { fg: '#b2302d' bg: '#405555' } + + shape_and: { fg: '#00599d' attr: 'b' } + shape_binary: { fg: '#00599d' attr: 'b' } + shape_block: { fg: '#449a86' attr: 'b' } + shape_bool: '#98d028' + shape_custom: '#00a941' + shape_datetime: { fg: '#5d7e19' attr: 'b' } + shape_directory: '#5d7e19' + shape_external: '#5d7e19' + shape_externalarg: { fg: '#00a941' attr: 'b' } + shape_filepath: '#5d7e19' + shape_flag: { fg: '#449a86' attr: 'b' } + shape_float: { fg: '#00599d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5d7e19' attr: 'b' } + shape_int: { fg: '#00599d' attr: 'b' } + shape_internalcall: { fg: '#5d7e19' attr: 'b' } + shape_list: { fg: '#5d7e19' attr: 'b' } + shape_literal: '#449a86' + shape_match_pattern: '#00a941' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#98d028' + shape_operator: '#5e8baa' + shape_or: { fg: '#00599d' attr: 'b' } + shape_pipe: { fg: '#00599d' attr: 'b' } + shape_range: { fg: '#5e8baa' attr: 'b' } + shape_record: { fg: '#5d7e19' attr: 'b' } + shape_redirection: { fg: '#00599d' attr: 'b' } + shape_signature: { fg: '#00a941' attr: 'b' } + shape_string: '#00a941' + shape_string_interpolation: { fg: '#5d7e19' attr: 'b' } + shape_table: { fg: '#449a86' attr: 'b' } + shape_variable: '#00599d' + + background: '#001015' + foreground: '#405555' + cursor: '#405555' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/shapeshifter.nu b/themes/nu-themes/shapeshifter.nu index f326d7c..6937db3 100644 --- a/themes/nu-themes/shapeshifter.nu +++ b/themes/nu-themes/shapeshifter.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#102015" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#0ed839" attr: "b" } - empty: "#3b48e3" - bool: {|| if $in { "#23edda" } else { "light_gray" } } - int: "#102015" - filesize: {|e| - if $e == 0b { - "#102015" - } else if $e < 1mb { - "#23edda" - } else {{ fg: "#3b48e3" }} - } - duration: "#102015" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e92f2f" attr: "b" } - } else if $in < 6hr { - "#e92f2f" - } else if $in < 1day { - "#dddd13" - } else if $in < 3day { - "#0ed839" - } else if $in < 1wk { - { fg: "#0ed839" attr: "b" } - } else if $in < 6wk { - "#23edda" - } else if $in < 52wk { - "#3b48e3" - } else { "dark_gray" } - } - range: "#102015" - float: "#102015" - string: "#102015" - nothing: "#102015" - binary: "#102015" - cellpath: "#102015" - row_index: { fg: "#0ed839" attr: "b" } - record: "#102015" - list: "#102015" - block: "#102015" - hints: "dark_gray" - search_result: { fg: "#e92f2f" bg: "#102015" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f996e2" attr: "b" } - shape_binary: { fg: "#f996e2" attr: "b" } - shape_block: { fg: "#3b48e3" attr: "b" } - shape_bool: "#23edda" - shape_custom: "#0ed839" - shape_datetime: { fg: "#23edda" attr: "b" } - shape_directory: "#23edda" - shape_external: "#23edda" - shape_externalarg: { fg: "#0ed839" attr: "b" } - shape_filepath: "#23edda" - shape_flag: { fg: "#3b48e3" attr: "b" } - shape_float: { fg: "#f996e2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#23edda" attr: "b" } - shape_int: { fg: "#f996e2" attr: "b" } - shape_internalcall: { fg: "#23edda" attr: "b" } - shape_list: { fg: "#23edda" attr: "b" } - shape_literal: "#3b48e3" - shape_match_pattern: "#0ed839" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#23edda" - shape_operator: "#dddd13" - shape_or: { fg: "#f996e2" attr: "b" } - shape_pipe: { fg: "#f996e2" attr: "b" } - shape_range: { fg: "#dddd13" attr: "b" } - shape_record: { fg: "#23edda" attr: "b" } - shape_redirection: { fg: "#f996e2" attr: "b" } - shape_signature: { fg: "#0ed839" attr: "b" } - shape_string: "#0ed839" - shape_string_interpolation: { fg: "#23edda" attr: "b" } - shape_table: { fg: "#3b48e3" attr: "b" } - shape_variable: "#f996e2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f9f9f9" - foreground: "#102015" - cursor: "#102015" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#102015' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#0ed839' attr: 'b' } + empty: '#3b48e3' + bool: {|| if $in { '#23edda' } else { 'light_gray' } } + int: '#102015' + filesize: {|e| + if $e == 0b { + '#102015' + } else if $e < 1mb { + '#23edda' + } else {{ fg: '#3b48e3' }} + } + duration: '#102015' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e92f2f' attr: 'b' } + } else if $in < 6hr { + '#e92f2f' + } else if $in < 1day { + '#dddd13' + } else if $in < 3day { + '#0ed839' + } else if $in < 1wk { + { fg: '#0ed839' attr: 'b' } + } else if $in < 6wk { + '#23edda' + } else if $in < 52wk { + '#3b48e3' + } else { 'dark_gray' } + } + range: '#102015' + float: '#102015' + string: '#102015' + nothing: '#102015' + binary: '#102015' + cellpath: '#102015' + row_index: { fg: '#0ed839' attr: 'b' } + record: '#102015' + list: '#102015' + block: '#102015' + hints: 'dark_gray' + search_result: { fg: '#e92f2f' bg: '#102015' } + + shape_and: { fg: '#f996e2' attr: 'b' } + shape_binary: { fg: '#f996e2' attr: 'b' } + shape_block: { fg: '#3b48e3' attr: 'b' } + shape_bool: '#23edda' + shape_custom: '#0ed839' + shape_datetime: { fg: '#23edda' attr: 'b' } + shape_directory: '#23edda' + shape_external: '#23edda' + shape_externalarg: { fg: '#0ed839' attr: 'b' } + shape_filepath: '#23edda' + shape_flag: { fg: '#3b48e3' attr: 'b' } + shape_float: { fg: '#f996e2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#23edda' attr: 'b' } + shape_int: { fg: '#f996e2' attr: 'b' } + shape_internalcall: { fg: '#23edda' attr: 'b' } + shape_list: { fg: '#23edda' attr: 'b' } + shape_literal: '#3b48e3' + shape_match_pattern: '#0ed839' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#23edda' + shape_operator: '#dddd13' + shape_or: { fg: '#f996e2' attr: 'b' } + shape_pipe: { fg: '#f996e2' attr: 'b' } + shape_range: { fg: '#dddd13' attr: 'b' } + shape_record: { fg: '#23edda' attr: 'b' } + shape_redirection: { fg: '#f996e2' attr: 'b' } + shape_signature: { fg: '#0ed839' attr: 'b' } + shape_string: '#0ed839' + shape_string_interpolation: { fg: '#23edda' attr: 'b' } + shape_table: { fg: '#3b48e3' attr: 'b' } + shape_variable: '#f996e2' + + background: '#f9f9f9' + foreground: '#102015' + cursor: '#102015' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/shel.nu b/themes/nu-themes/shel.nu index 4f6c0e9..9c44a24 100644 --- a/themes/nu-themes/shel.nu +++ b/themes/nu-themes/shel.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#918988" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ca323" attr: "b" } - empty: "#2c64a2" - bool: {|| if $in { "#8feeb9" } else { "light_gray" } } - int: "#918988" - filesize: {|e| - if $e == 0b { - "#918988" - } else if $e < 1mb { - "#2ca363" - } else {{ fg: "#2c64a2" }} - } - duration: "#918988" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ab2463" attr: "b" } - } else if $in < 6hr { - "#ab2463" - } else if $in < 1day { - "#ab6423" - } else if $in < 3day { - "#6ca323" - } else if $in < 1wk { - { fg: "#6ca323" attr: "b" } - } else if $in < 6wk { - "#2ca363" - } else if $in < 52wk { - "#2c64a2" - } else { "dark_gray" } - } - range: "#918988" - float: "#918988" - string: "#918988" - nothing: "#918988" - binary: "#918988" - cellpath: "#918988" - row_index: { fg: "#6ca323" attr: "b" } - record: "#918988" - list: "#918988" - block: "#918988" - hints: "dark_gray" - search_result: { fg: "#ab2463" bg: "#918988" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6c24a2" attr: "b" } - shape_binary: { fg: "#6c24a2" attr: "b" } - shape_block: { fg: "#2c64a2" attr: "b" } - shape_bool: "#8feeb9" - shape_custom: "#6ca323" - shape_datetime: { fg: "#2ca363" attr: "b" } - shape_directory: "#2ca363" - shape_external: "#2ca363" - shape_externalarg: { fg: "#6ca323" attr: "b" } - shape_filepath: "#2ca363" - shape_flag: { fg: "#2c64a2" attr: "b" } - shape_float: { fg: "#6c24a2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2ca363" attr: "b" } - shape_int: { fg: "#6c24a2" attr: "b" } - shape_internalcall: { fg: "#2ca363" attr: "b" } - shape_list: { fg: "#2ca363" attr: "b" } - shape_literal: "#2c64a2" - shape_match_pattern: "#6ca323" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8feeb9" - shape_operator: "#ab6423" - shape_or: { fg: "#6c24a2" attr: "b" } - shape_pipe: { fg: "#6c24a2" attr: "b" } - shape_range: { fg: "#ab6423" attr: "b" } - shape_record: { fg: "#2ca363" attr: "b" } - shape_redirection: { fg: "#6c24a2" attr: "b" } - shape_signature: { fg: "#6ca323" attr: "b" } - shape_string: "#6ca323" - shape_string_interpolation: { fg: "#2ca363" attr: "b" } - shape_table: { fg: "#2c64a2" attr: "b" } - shape_variable: "#6c24a2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2a201f" - foreground: "#4882cd" - cursor: "#4882cd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#918988' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ca323' attr: 'b' } + empty: '#2c64a2' + bool: {|| if $in { '#8feeb9' } else { 'light_gray' } } + int: '#918988' + filesize: {|e| + if $e == 0b { + '#918988' + } else if $e < 1mb { + '#2ca363' + } else {{ fg: '#2c64a2' }} + } + duration: '#918988' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ab2463' attr: 'b' } + } else if $in < 6hr { + '#ab2463' + } else if $in < 1day { + '#ab6423' + } else if $in < 3day { + '#6ca323' + } else if $in < 1wk { + { fg: '#6ca323' attr: 'b' } + } else if $in < 6wk { + '#2ca363' + } else if $in < 52wk { + '#2c64a2' + } else { 'dark_gray' } + } + range: '#918988' + float: '#918988' + string: '#918988' + nothing: '#918988' + binary: '#918988' + cellpath: '#918988' + row_index: { fg: '#6ca323' attr: 'b' } + record: '#918988' + list: '#918988' + block: '#918988' + hints: 'dark_gray' + search_result: { fg: '#ab2463' bg: '#918988' } + + shape_and: { fg: '#6c24a2' attr: 'b' } + shape_binary: { fg: '#6c24a2' attr: 'b' } + shape_block: { fg: '#2c64a2' attr: 'b' } + shape_bool: '#8feeb9' + shape_custom: '#6ca323' + shape_datetime: { fg: '#2ca363' attr: 'b' } + shape_directory: '#2ca363' + shape_external: '#2ca363' + shape_externalarg: { fg: '#6ca323' attr: 'b' } + shape_filepath: '#2ca363' + shape_flag: { fg: '#2c64a2' attr: 'b' } + shape_float: { fg: '#6c24a2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2ca363' attr: 'b' } + shape_int: { fg: '#6c24a2' attr: 'b' } + shape_internalcall: { fg: '#2ca363' attr: 'b' } + shape_list: { fg: '#2ca363' attr: 'b' } + shape_literal: '#2c64a2' + shape_match_pattern: '#6ca323' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8feeb9' + shape_operator: '#ab6423' + shape_or: { fg: '#6c24a2' attr: 'b' } + shape_pipe: { fg: '#6c24a2' attr: 'b' } + shape_range: { fg: '#ab6423' attr: 'b' } + shape_record: { fg: '#2ca363' attr: 'b' } + shape_redirection: { fg: '#6c24a2' attr: 'b' } + shape_signature: { fg: '#6ca323' attr: 'b' } + shape_string: '#6ca323' + shape_string_interpolation: { fg: '#2ca363' attr: 'b' } + shape_table: { fg: '#2c64a2' attr: 'b' } + shape_variable: '#6c24a2' + + background: '#2a201f' + foreground: '#4882cd' + cursor: '#4882cd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sierra.nu b/themes/nu-themes/sierra.nu index e86a4e2..c12c0fa 100644 --- a/themes/nu-themes/sierra.nu +++ b/themes/nu-themes/sierra.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bb7774" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#68694f" attr: "b" } - empty: "#989876" - bool: {|| if $in { "#a17140" } else { "light_gray" } } - int: "#bb7774" - filesize: {|e| - if $e == 0b { - "#bb7774" - } else if $e < 1mb { - "#a18e60" - } else {{ fg: "#989876" }} - } - duration: "#bb7774" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#515a45" attr: "b" } - } else if $in < 6hr { - "#515a45" - } else if $in < 1day { - "#7f7f60" - } else if $in < 3day { - "#68694f" - } else if $in < 1wk { - { fg: "#68694f" attr: "b" } - } else if $in < 6wk { - "#a18e60" - } else if $in < 52wk { - "#989876" - } else { "dark_gray" } - } - range: "#bb7774" - float: "#bb7774" - string: "#bb7774" - nothing: "#bb7774" - binary: "#bb7774" - cellpath: "#bb7774" - row_index: { fg: "#68694f" attr: "b" } - record: "#bb7774" - list: "#bb7774" - block: "#bb7774" - hints: "dark_gray" - search_result: { fg: "#515a45" bg: "#bb7774" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#897c5b" attr: "b" } - shape_binary: { fg: "#897c5b" attr: "b" } - shape_block: { fg: "#989876" attr: "b" } - shape_bool: "#a17140" - shape_custom: "#68694f" - shape_datetime: { fg: "#a18e60" attr: "b" } - shape_directory: "#a18e60" - shape_external: "#a18e60" - shape_externalarg: { fg: "#68694f" attr: "b" } - shape_filepath: "#a18e60" - shape_flag: { fg: "#989876" attr: "b" } - shape_float: { fg: "#897c5b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#a18e60" attr: "b" } - shape_int: { fg: "#897c5b" attr: "b" } - shape_internalcall: { fg: "#a18e60" attr: "b" } - shape_list: { fg: "#a18e60" attr: "b" } - shape_literal: "#989876" - shape_match_pattern: "#68694f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#a17140" - shape_operator: "#7f7f60" - shape_or: { fg: "#897c5b" attr: "b" } - shape_pipe: { fg: "#897c5b" attr: "b" } - shape_range: { fg: "#7f7f60" attr: "b" } - shape_record: { fg: "#a18e60" attr: "b" } - shape_redirection: { fg: "#897c5b" attr: "b" } - shape_signature: { fg: "#68694f" attr: "b" } - shape_string: "#68694f" - shape_string_interpolation: { fg: "#a18e60" attr: "b" } - shape_table: { fg: "#989876" attr: "b" } - shape_variable: "#897c5b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1a14" - foreground: "#cacbb9" - cursor: "#cacbb9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bb7774' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#68694f' attr: 'b' } + empty: '#989876' + bool: {|| if $in { '#a17140' } else { 'light_gray' } } + int: '#bb7774' + filesize: {|e| + if $e == 0b { + '#bb7774' + } else if $e < 1mb { + '#a18e60' + } else {{ fg: '#989876' }} + } + duration: '#bb7774' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#515a45' attr: 'b' } + } else if $in < 6hr { + '#515a45' + } else if $in < 1day { + '#7f7f60' + } else if $in < 3day { + '#68694f' + } else if $in < 1wk { + { fg: '#68694f' attr: 'b' } + } else if $in < 6wk { + '#a18e60' + } else if $in < 52wk { + '#989876' + } else { 'dark_gray' } + } + range: '#bb7774' + float: '#bb7774' + string: '#bb7774' + nothing: '#bb7774' + binary: '#bb7774' + cellpath: '#bb7774' + row_index: { fg: '#68694f' attr: 'b' } + record: '#bb7774' + list: '#bb7774' + block: '#bb7774' + hints: 'dark_gray' + search_result: { fg: '#515a45' bg: '#bb7774' } + + shape_and: { fg: '#897c5b' attr: 'b' } + shape_binary: { fg: '#897c5b' attr: 'b' } + shape_block: { fg: '#989876' attr: 'b' } + shape_bool: '#a17140' + shape_custom: '#68694f' + shape_datetime: { fg: '#a18e60' attr: 'b' } + shape_directory: '#a18e60' + shape_external: '#a18e60' + shape_externalarg: { fg: '#68694f' attr: 'b' } + shape_filepath: '#a18e60' + shape_flag: { fg: '#989876' attr: 'b' } + shape_float: { fg: '#897c5b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#a18e60' attr: 'b' } + shape_int: { fg: '#897c5b' attr: 'b' } + shape_internalcall: { fg: '#a18e60' attr: 'b' } + shape_list: { fg: '#a18e60' attr: 'b' } + shape_literal: '#989876' + shape_match_pattern: '#68694f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#a17140' + shape_operator: '#7f7f60' + shape_or: { fg: '#897c5b' attr: 'b' } + shape_pipe: { fg: '#897c5b' attr: 'b' } + shape_range: { fg: '#7f7f60' attr: 'b' } + shape_record: { fg: '#a18e60' attr: 'b' } + shape_redirection: { fg: '#897c5b' attr: 'b' } + shape_signature: { fg: '#68694f' attr: 'b' } + shape_string: '#68694f' + shape_string_interpolation: { fg: '#a18e60' attr: 'b' } + shape_table: { fg: '#989876' attr: 'b' } + shape_variable: '#897c5b' + + background: '#1c1a14' + foreground: '#cacbb9' + cursor: '#cacbb9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/silk-dark.nu b/themes/nu-themes/silk-dark.nu index ec7c86f..5ab0772 100644 --- a/themes/nu-themes/silk-dark.nu +++ b/themes/nu-themes/silk-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c7dbdd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#73d8ad" attr: "b" } - empty: "#46bddd" - bool: {|| if $in { "#3fb2b9" } else { "light_gray" } } - int: "#c7dbdd" - filesize: {|e| - if $e == 0b { - "#c7dbdd" - } else if $e < 1mb { - "#3fb2b9" - } else {{ fg: "#46bddd" }} - } - duration: "#c7dbdd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb6953" attr: "b" } - } else if $in < 6hr { - "#fb6953" - } else if $in < 1day { - "#fce380" - } else if $in < 3day { - "#73d8ad" - } else if $in < 1wk { - { fg: "#73d8ad" attr: "b" } - } else if $in < 6wk { - "#3fb2b9" - } else if $in < 52wk { - "#46bddd" - } else { "dark_gray" } - } - range: "#c7dbdd" - float: "#c7dbdd" - string: "#c7dbdd" - nothing: "#c7dbdd" - binary: "#c7dbdd" - cellpath: "#c7dbdd" - row_index: { fg: "#73d8ad" attr: "b" } - record: "#c7dbdd" - list: "#c7dbdd" - block: "#c7dbdd" - hints: "dark_gray" - search_result: { fg: "#fb6953" bg: "#c7dbdd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#756b8a" attr: "b" } - shape_binary: { fg: "#756b8a" attr: "b" } - shape_block: { fg: "#46bddd" attr: "b" } - shape_bool: "#3fb2b9" - shape_custom: "#73d8ad" - shape_datetime: { fg: "#3fb2b9" attr: "b" } - shape_directory: "#3fb2b9" - shape_external: "#3fb2b9" - shape_externalarg: { fg: "#73d8ad" attr: "b" } - shape_filepath: "#3fb2b9" - shape_flag: { fg: "#46bddd" attr: "b" } - shape_float: { fg: "#756b8a" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3fb2b9" attr: "b" } - shape_int: { fg: "#756b8a" attr: "b" } - shape_internalcall: { fg: "#3fb2b9" attr: "b" } - shape_list: { fg: "#3fb2b9" attr: "b" } - shape_literal: "#46bddd" - shape_match_pattern: "#73d8ad" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3fb2b9" - shape_operator: "#fce380" - shape_or: { fg: "#756b8a" attr: "b" } - shape_pipe: { fg: "#756b8a" attr: "b" } - shape_range: { fg: "#fce380" attr: "b" } - shape_record: { fg: "#3fb2b9" attr: "b" } - shape_redirection: { fg: "#756b8a" attr: "b" } - shape_signature: { fg: "#73d8ad" attr: "b" } - shape_string: "#73d8ad" - shape_string_interpolation: { fg: "#3fb2b9" attr: "b" } - shape_table: { fg: "#46bddd" attr: "b" } - shape_variable: "#756b8a" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0e3c46" - foreground: "#c7dbdd" - cursor: "#c7dbdd" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c7dbdd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#73d8ad' attr: 'b' } + empty: '#46bddd' + bool: {|| if $in { '#3fb2b9' } else { 'light_gray' } } + int: '#c7dbdd' + filesize: {|e| + if $e == 0b { + '#c7dbdd' + } else if $e < 1mb { + '#3fb2b9' + } else {{ fg: '#46bddd' }} + } + duration: '#c7dbdd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb6953' attr: 'b' } + } else if $in < 6hr { + '#fb6953' + } else if $in < 1day { + '#fce380' + } else if $in < 3day { + '#73d8ad' + } else if $in < 1wk { + { fg: '#73d8ad' attr: 'b' } + } else if $in < 6wk { + '#3fb2b9' + } else if $in < 52wk { + '#46bddd' + } else { 'dark_gray' } + } + range: '#c7dbdd' + float: '#c7dbdd' + string: '#c7dbdd' + nothing: '#c7dbdd' + binary: '#c7dbdd' + cellpath: '#c7dbdd' + row_index: { fg: '#73d8ad' attr: 'b' } + record: '#c7dbdd' + list: '#c7dbdd' + block: '#c7dbdd' + hints: 'dark_gray' + search_result: { fg: '#fb6953' bg: '#c7dbdd' } + + shape_and: { fg: '#756b8a' attr: 'b' } + shape_binary: { fg: '#756b8a' attr: 'b' } + shape_block: { fg: '#46bddd' attr: 'b' } + shape_bool: '#3fb2b9' + shape_custom: '#73d8ad' + shape_datetime: { fg: '#3fb2b9' attr: 'b' } + shape_directory: '#3fb2b9' + shape_external: '#3fb2b9' + shape_externalarg: { fg: '#73d8ad' attr: 'b' } + shape_filepath: '#3fb2b9' + shape_flag: { fg: '#46bddd' attr: 'b' } + shape_float: { fg: '#756b8a' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3fb2b9' attr: 'b' } + shape_int: { fg: '#756b8a' attr: 'b' } + shape_internalcall: { fg: '#3fb2b9' attr: 'b' } + shape_list: { fg: '#3fb2b9' attr: 'b' } + shape_literal: '#46bddd' + shape_match_pattern: '#73d8ad' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3fb2b9' + shape_operator: '#fce380' + shape_or: { fg: '#756b8a' attr: 'b' } + shape_pipe: { fg: '#756b8a' attr: 'b' } + shape_range: { fg: '#fce380' attr: 'b' } + shape_record: { fg: '#3fb2b9' attr: 'b' } + shape_redirection: { fg: '#756b8a' attr: 'b' } + shape_signature: { fg: '#73d8ad' attr: 'b' } + shape_string: '#73d8ad' + shape_string_interpolation: { fg: '#3fb2b9' attr: 'b' } + shape_table: { fg: '#46bddd' attr: 'b' } + shape_variable: '#756b8a' + + background: '#0e3c46' + foreground: '#c7dbdd' + cursor: '#c7dbdd' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/silk-light.nu b/themes/nu-themes/silk-light.nu index 4da29cf..62250f3 100644 --- a/themes/nu-themes/silk-light.nu +++ b/themes/nu-themes/silk-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#385156" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ca38c" attr: "b" } - empty: "#39aac9" - bool: {|| if $in { "#329ca2" } else { "light_gray" } } - int: "#385156" - filesize: {|e| - if $e == 0b { - "#385156" - } else if $e < 1mb { - "#329ca2" - } else {{ fg: "#39aac9" }} - } - duration: "#385156" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf432e" attr: "b" } - } else if $in < 6hr { - "#cf432e" - } else if $in < 1day { - "#cfad25" - } else if $in < 3day { - "#6ca38c" - } else if $in < 1wk { - { fg: "#6ca38c" attr: "b" } - } else if $in < 6wk { - "#329ca2" - } else if $in < 52wk { - "#39aac9" - } else { "dark_gray" } - } - range: "#385156" - float: "#385156" - string: "#385156" - nothing: "#385156" - binary: "#385156" - cellpath: "#385156" - row_index: { fg: "#6ca38c" attr: "b" } - record: "#385156" - list: "#385156" - block: "#385156" - hints: "dark_gray" - search_result: { fg: "#cf432e" bg: "#385156" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6e6582" attr: "b" } - shape_binary: { fg: "#6e6582" attr: "b" } - shape_block: { fg: "#39aac9" attr: "b" } - shape_bool: "#329ca2" - shape_custom: "#6ca38c" - shape_datetime: { fg: "#329ca2" attr: "b" } - shape_directory: "#329ca2" - shape_external: "#329ca2" - shape_externalarg: { fg: "#6ca38c" attr: "b" } - shape_filepath: "#329ca2" - shape_flag: { fg: "#39aac9" attr: "b" } - shape_float: { fg: "#6e6582" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#329ca2" attr: "b" } - shape_int: { fg: "#6e6582" attr: "b" } - shape_internalcall: { fg: "#329ca2" attr: "b" } - shape_list: { fg: "#329ca2" attr: "b" } - shape_literal: "#39aac9" - shape_match_pattern: "#6ca38c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#329ca2" - shape_operator: "#cfad25" - shape_or: { fg: "#6e6582" attr: "b" } - shape_pipe: { fg: "#6e6582" attr: "b" } - shape_range: { fg: "#cfad25" attr: "b" } - shape_record: { fg: "#329ca2" attr: "b" } - shape_redirection: { fg: "#6e6582" attr: "b" } - shape_signature: { fg: "#6ca38c" attr: "b" } - shape_string: "#6ca38c" - shape_string_interpolation: { fg: "#329ca2" attr: "b" } - shape_table: { fg: "#39aac9" attr: "b" } - shape_variable: "#6e6582" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#e9f1ef" - foreground: "#385156" - cursor: "#385156" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#385156' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ca38c' attr: 'b' } + empty: '#39aac9' + bool: {|| if $in { '#329ca2' } else { 'light_gray' } } + int: '#385156' + filesize: {|e| + if $e == 0b { + '#385156' + } else if $e < 1mb { + '#329ca2' + } else {{ fg: '#39aac9' }} + } + duration: '#385156' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf432e' attr: 'b' } + } else if $in < 6hr { + '#cf432e' + } else if $in < 1day { + '#cfad25' + } else if $in < 3day { + '#6ca38c' + } else if $in < 1wk { + { fg: '#6ca38c' attr: 'b' } + } else if $in < 6wk { + '#329ca2' + } else if $in < 52wk { + '#39aac9' + } else { 'dark_gray' } + } + range: '#385156' + float: '#385156' + string: '#385156' + nothing: '#385156' + binary: '#385156' + cellpath: '#385156' + row_index: { fg: '#6ca38c' attr: 'b' } + record: '#385156' + list: '#385156' + block: '#385156' + hints: 'dark_gray' + search_result: { fg: '#cf432e' bg: '#385156' } + + shape_and: { fg: '#6e6582' attr: 'b' } + shape_binary: { fg: '#6e6582' attr: 'b' } + shape_block: { fg: '#39aac9' attr: 'b' } + shape_bool: '#329ca2' + shape_custom: '#6ca38c' + shape_datetime: { fg: '#329ca2' attr: 'b' } + shape_directory: '#329ca2' + shape_external: '#329ca2' + shape_externalarg: { fg: '#6ca38c' attr: 'b' } + shape_filepath: '#329ca2' + shape_flag: { fg: '#39aac9' attr: 'b' } + shape_float: { fg: '#6e6582' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#329ca2' attr: 'b' } + shape_int: { fg: '#6e6582' attr: 'b' } + shape_internalcall: { fg: '#329ca2' attr: 'b' } + shape_list: { fg: '#329ca2' attr: 'b' } + shape_literal: '#39aac9' + shape_match_pattern: '#6ca38c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#329ca2' + shape_operator: '#cfad25' + shape_or: { fg: '#6e6582' attr: 'b' } + shape_pipe: { fg: '#6e6582' attr: 'b' } + shape_range: { fg: '#cfad25' attr: 'b' } + shape_record: { fg: '#329ca2' attr: 'b' } + shape_redirection: { fg: '#6e6582' attr: 'b' } + shape_signature: { fg: '#6ca38c' attr: 'b' } + shape_string: '#6ca38c' + shape_string_interpolation: { fg: '#329ca2' attr: 'b' } + shape_table: { fg: '#39aac9' attr: 'b' } + shape_variable: '#6e6582' + + background: '#e9f1ef' + foreground: '#385156' + cursor: '#385156' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/slate.nu b/themes/nu-themes/slate.nu index b23c98e..c395703 100644 --- a/themes/nu-themes/slate.nu +++ b/themes/nu-themes/slate.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#02c5e0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#81d778" attr: "b" } - empty: "#264b49" - bool: {|| if $in { "#8cdfe0" } else { "light_gray" } } - int: "#02c5e0" - filesize: {|e| - if $e == 0b { - "#02c5e0" - } else if $e < 1mb { - "#15ab9c" - } else {{ fg: "#264b49" }} - } - duration: "#02c5e0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e2a8bf" attr: "b" } - } else if $in < 6hr { - "#e2a8bf" - } else if $in < 1day { - "#c4c9c0" - } else if $in < 3day { - "#81d778" - } else if $in < 1wk { - { fg: "#81d778" attr: "b" } - } else if $in < 6wk { - "#15ab9c" - } else if $in < 52wk { - "#264b49" - } else { "dark_gray" } - } - range: "#02c5e0" - float: "#02c5e0" - string: "#02c5e0" - nothing: "#02c5e0" - binary: "#02c5e0" - cellpath: "#02c5e0" - row_index: { fg: "#81d778" attr: "b" } - record: "#02c5e0" - list: "#02c5e0" - block: "#02c5e0" - hints: "dark_gray" - search_result: { fg: "#e2a8bf" bg: "#02c5e0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a481d3" attr: "b" } - shape_binary: { fg: "#a481d3" attr: "b" } - shape_block: { fg: "#264b49" attr: "b" } - shape_bool: "#8cdfe0" - shape_custom: "#81d778" - shape_datetime: { fg: "#15ab9c" attr: "b" } - shape_directory: "#15ab9c" - shape_external: "#15ab9c" - shape_externalarg: { fg: "#81d778" attr: "b" } - shape_filepath: "#15ab9c" - shape_flag: { fg: "#264b49" attr: "b" } - shape_float: { fg: "#a481d3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#15ab9c" attr: "b" } - shape_int: { fg: "#a481d3" attr: "b" } - shape_internalcall: { fg: "#15ab9c" attr: "b" } - shape_list: { fg: "#15ab9c" attr: "b" } - shape_literal: "#264b49" - shape_match_pattern: "#81d778" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8cdfe0" - shape_operator: "#c4c9c0" - shape_or: { fg: "#a481d3" attr: "b" } - shape_pipe: { fg: "#a481d3" attr: "b" } - shape_range: { fg: "#c4c9c0" attr: "b" } - shape_record: { fg: "#15ab9c" attr: "b" } - shape_redirection: { fg: "#a481d3" attr: "b" } - shape_signature: { fg: "#81d778" attr: "b" } - shape_string: "#81d778" - shape_string_interpolation: { fg: "#15ab9c" attr: "b" } - shape_table: { fg: "#264b49" attr: "b" } - shape_variable: "#a481d3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#35b1d2" - cursor: "#35b1d2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#02c5e0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#81d778' attr: 'b' } + empty: '#264b49' + bool: {|| if $in { '#8cdfe0' } else { 'light_gray' } } + int: '#02c5e0' + filesize: {|e| + if $e == 0b { + '#02c5e0' + } else if $e < 1mb { + '#15ab9c' + } else {{ fg: '#264b49' }} + } + duration: '#02c5e0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e2a8bf' attr: 'b' } + } else if $in < 6hr { + '#e2a8bf' + } else if $in < 1day { + '#c4c9c0' + } else if $in < 3day { + '#81d778' + } else if $in < 1wk { + { fg: '#81d778' attr: 'b' } + } else if $in < 6wk { + '#15ab9c' + } else if $in < 52wk { + '#264b49' + } else { 'dark_gray' } + } + range: '#02c5e0' + float: '#02c5e0' + string: '#02c5e0' + nothing: '#02c5e0' + binary: '#02c5e0' + cellpath: '#02c5e0' + row_index: { fg: '#81d778' attr: 'b' } + record: '#02c5e0' + list: '#02c5e0' + block: '#02c5e0' + hints: 'dark_gray' + search_result: { fg: '#e2a8bf' bg: '#02c5e0' } + + shape_and: { fg: '#a481d3' attr: 'b' } + shape_binary: { fg: '#a481d3' attr: 'b' } + shape_block: { fg: '#264b49' attr: 'b' } + shape_bool: '#8cdfe0' + shape_custom: '#81d778' + shape_datetime: { fg: '#15ab9c' attr: 'b' } + shape_directory: '#15ab9c' + shape_external: '#15ab9c' + shape_externalarg: { fg: '#81d778' attr: 'b' } + shape_filepath: '#15ab9c' + shape_flag: { fg: '#264b49' attr: 'b' } + shape_float: { fg: '#a481d3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#15ab9c' attr: 'b' } + shape_int: { fg: '#a481d3' attr: 'b' } + shape_internalcall: { fg: '#15ab9c' attr: 'b' } + shape_list: { fg: '#15ab9c' attr: 'b' } + shape_literal: '#264b49' + shape_match_pattern: '#81d778' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8cdfe0' + shape_operator: '#c4c9c0' + shape_or: { fg: '#a481d3' attr: 'b' } + shape_pipe: { fg: '#a481d3' attr: 'b' } + shape_range: { fg: '#c4c9c0' attr: 'b' } + shape_record: { fg: '#15ab9c' attr: 'b' } + shape_redirection: { fg: '#a481d3' attr: 'b' } + shape_signature: { fg: '#81d778' attr: 'b' } + shape_string: '#81d778' + shape_string_interpolation: { fg: '#15ab9c' attr: 'b' } + shape_table: { fg: '#264b49' attr: 'b' } + shape_variable: '#a481d3' + + background: '#222222' + foreground: '#35b1d2' + cursor: '#35b1d2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/smyck.nu b/themes/nu-themes/smyck.nu index 3398143..b1bb40a 100644 --- a/themes/nu-themes/smyck.nu +++ b/themes/nu-themes/smyck.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b0b0b0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8eb33b" attr: "b" } - empty: "#72b3cc" - bool: {|| if $in { "#77dfd8" } else { "light_gray" } } - int: "#b0b0b0" - filesize: {|e| - if $e == 0b { - "#b0b0b0" - } else if $e < 1mb { - "#218693" - } else {{ fg: "#72b3cc" }} - } - duration: "#b0b0b0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c75646" attr: "b" } - } else if $in < 6hr { - "#c75646" - } else if $in < 1day { - "#d0b03c" - } else if $in < 3day { - "#8eb33b" - } else if $in < 1wk { - { fg: "#8eb33b" attr: "b" } - } else if $in < 6wk { - "#218693" - } else if $in < 52wk { - "#72b3cc" - } else { "dark_gray" } - } - range: "#b0b0b0" - float: "#b0b0b0" - string: "#b0b0b0" - nothing: "#b0b0b0" - binary: "#b0b0b0" - cellpath: "#b0b0b0" - row_index: { fg: "#8eb33b" attr: "b" } - record: "#b0b0b0" - list: "#b0b0b0" - block: "#b0b0b0" - hints: "dark_gray" - search_result: { fg: "#c75646" bg: "#b0b0b0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c8a0d1" attr: "b" } - shape_binary: { fg: "#c8a0d1" attr: "b" } - shape_block: { fg: "#72b3cc" attr: "b" } - shape_bool: "#77dfd8" - shape_custom: "#8eb33b" - shape_datetime: { fg: "#218693" attr: "b" } - shape_directory: "#218693" - shape_external: "#218693" - shape_externalarg: { fg: "#8eb33b" attr: "b" } - shape_filepath: "#218693" - shape_flag: { fg: "#72b3cc" attr: "b" } - shape_float: { fg: "#c8a0d1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#218693" attr: "b" } - shape_int: { fg: "#c8a0d1" attr: "b" } - shape_internalcall: { fg: "#218693" attr: "b" } - shape_list: { fg: "#218693" attr: "b" } - shape_literal: "#72b3cc" - shape_match_pattern: "#8eb33b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#77dfd8" - shape_operator: "#d0b03c" - shape_or: { fg: "#c8a0d1" attr: "b" } - shape_pipe: { fg: "#c8a0d1" attr: "b" } - shape_range: { fg: "#d0b03c" attr: "b" } - shape_record: { fg: "#218693" attr: "b" } - shape_redirection: { fg: "#c8a0d1" attr: "b" } - shape_signature: { fg: "#8eb33b" attr: "b" } - shape_string: "#8eb33b" - shape_string_interpolation: { fg: "#218693" attr: "b" } - shape_table: { fg: "#72b3cc" attr: "b" } - shape_variable: "#c8a0d1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#242424" - foreground: "#f7f7f7" - cursor: "#f7f7f7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b0b0b0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8eb33b' attr: 'b' } + empty: '#72b3cc' + bool: {|| if $in { '#77dfd8' } else { 'light_gray' } } + int: '#b0b0b0' + filesize: {|e| + if $e == 0b { + '#b0b0b0' + } else if $e < 1mb { + '#218693' + } else {{ fg: '#72b3cc' }} + } + duration: '#b0b0b0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c75646' attr: 'b' } + } else if $in < 6hr { + '#c75646' + } else if $in < 1day { + '#d0b03c' + } else if $in < 3day { + '#8eb33b' + } else if $in < 1wk { + { fg: '#8eb33b' attr: 'b' } + } else if $in < 6wk { + '#218693' + } else if $in < 52wk { + '#72b3cc' + } else { 'dark_gray' } + } + range: '#b0b0b0' + float: '#b0b0b0' + string: '#b0b0b0' + nothing: '#b0b0b0' + binary: '#b0b0b0' + cellpath: '#b0b0b0' + row_index: { fg: '#8eb33b' attr: 'b' } + record: '#b0b0b0' + list: '#b0b0b0' + block: '#b0b0b0' + hints: 'dark_gray' + search_result: { fg: '#c75646' bg: '#b0b0b0' } + + shape_and: { fg: '#c8a0d1' attr: 'b' } + shape_binary: { fg: '#c8a0d1' attr: 'b' } + shape_block: { fg: '#72b3cc' attr: 'b' } + shape_bool: '#77dfd8' + shape_custom: '#8eb33b' + shape_datetime: { fg: '#218693' attr: 'b' } + shape_directory: '#218693' + shape_external: '#218693' + shape_externalarg: { fg: '#8eb33b' attr: 'b' } + shape_filepath: '#218693' + shape_flag: { fg: '#72b3cc' attr: 'b' } + shape_float: { fg: '#c8a0d1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#218693' attr: 'b' } + shape_int: { fg: '#c8a0d1' attr: 'b' } + shape_internalcall: { fg: '#218693' attr: 'b' } + shape_list: { fg: '#218693' attr: 'b' } + shape_literal: '#72b3cc' + shape_match_pattern: '#8eb33b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#77dfd8' + shape_operator: '#d0b03c' + shape_or: { fg: '#c8a0d1' attr: 'b' } + shape_pipe: { fg: '#c8a0d1' attr: 'b' } + shape_range: { fg: '#d0b03c' attr: 'b' } + shape_record: { fg: '#218693' attr: 'b' } + shape_redirection: { fg: '#c8a0d1' attr: 'b' } + shape_signature: { fg: '#8eb33b' attr: 'b' } + shape_string: '#8eb33b' + shape_string_interpolation: { fg: '#218693' attr: 'b' } + shape_table: { fg: '#72b3cc' attr: 'b' } + shape_variable: '#c8a0d1' + + background: '#242424' + foreground: '#f7f7f7' + cursor: '#f7f7f7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/snazzy.nu b/themes/nu-themes/snazzy.nu index 04ee155..c735263 100644 --- a/themes/nu-themes/snazzy.nu +++ b/themes/nu-themes/snazzy.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e2e4e5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5af78e" attr: "b" } - empty: "#57c7ff" - bool: {|| if $in { "#9aedfe" } else { "light_gray" } } - int: "#e2e4e5" - filesize: {|e| - if $e == 0b { - "#e2e4e5" - } else if $e < 1mb { - "#9aedfe" - } else {{ fg: "#57c7ff" }} - } - duration: "#e2e4e5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff5c57" attr: "b" } - } else if $in < 6hr { - "#ff5c57" - } else if $in < 1day { - "#f3f99d" - } else if $in < 3day { - "#5af78e" - } else if $in < 1wk { - { fg: "#5af78e" attr: "b" } - } else if $in < 6wk { - "#9aedfe" - } else if $in < 52wk { - "#57c7ff" - } else { "dark_gray" } - } - range: "#e2e4e5" - float: "#e2e4e5" - string: "#e2e4e5" - nothing: "#e2e4e5" - binary: "#e2e4e5" - cellpath: "#e2e4e5" - row_index: { fg: "#5af78e" attr: "b" } - record: "#e2e4e5" - list: "#e2e4e5" - block: "#e2e4e5" - hints: "dark_gray" - search_result: { fg: "#ff5c57" bg: "#e2e4e5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff6ac1" attr: "b" } - shape_binary: { fg: "#ff6ac1" attr: "b" } - shape_block: { fg: "#57c7ff" attr: "b" } - shape_bool: "#9aedfe" - shape_custom: "#5af78e" - shape_datetime: { fg: "#9aedfe" attr: "b" } - shape_directory: "#9aedfe" - shape_external: "#9aedfe" - shape_externalarg: { fg: "#5af78e" attr: "b" } - shape_filepath: "#9aedfe" - shape_flag: { fg: "#57c7ff" attr: "b" } - shape_float: { fg: "#ff6ac1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#9aedfe" attr: "b" } - shape_int: { fg: "#ff6ac1" attr: "b" } - shape_internalcall: { fg: "#9aedfe" attr: "b" } - shape_list: { fg: "#9aedfe" attr: "b" } - shape_literal: "#57c7ff" - shape_match_pattern: "#5af78e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#9aedfe" - shape_operator: "#f3f99d" - shape_or: { fg: "#ff6ac1" attr: "b" } - shape_pipe: { fg: "#ff6ac1" attr: "b" } - shape_range: { fg: "#f3f99d" attr: "b" } - shape_record: { fg: "#9aedfe" attr: "b" } - shape_redirection: { fg: "#ff6ac1" attr: "b" } - shape_signature: { fg: "#5af78e" attr: "b" } - shape_string: "#5af78e" - shape_string_interpolation: { fg: "#9aedfe" attr: "b" } - shape_table: { fg: "#57c7ff" attr: "b" } - shape_variable: "#ff6ac1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282a36" - foreground: "#e2e4e5" - cursor: "#e2e4e5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e2e4e5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5af78e' attr: 'b' } + empty: '#57c7ff' + bool: {|| if $in { '#9aedfe' } else { 'light_gray' } } + int: '#e2e4e5' + filesize: {|e| + if $e == 0b { + '#e2e4e5' + } else if $e < 1mb { + '#9aedfe' + } else {{ fg: '#57c7ff' }} + } + duration: '#e2e4e5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff5c57' attr: 'b' } + } else if $in < 6hr { + '#ff5c57' + } else if $in < 1day { + '#f3f99d' + } else if $in < 3day { + '#5af78e' + } else if $in < 1wk { + { fg: '#5af78e' attr: 'b' } + } else if $in < 6wk { + '#9aedfe' + } else if $in < 52wk { + '#57c7ff' + } else { 'dark_gray' } + } + range: '#e2e4e5' + float: '#e2e4e5' + string: '#e2e4e5' + nothing: '#e2e4e5' + binary: '#e2e4e5' + cellpath: '#e2e4e5' + row_index: { fg: '#5af78e' attr: 'b' } + record: '#e2e4e5' + list: '#e2e4e5' + block: '#e2e4e5' + hints: 'dark_gray' + search_result: { fg: '#ff5c57' bg: '#e2e4e5' } + + shape_and: { fg: '#ff6ac1' attr: 'b' } + shape_binary: { fg: '#ff6ac1' attr: 'b' } + shape_block: { fg: '#57c7ff' attr: 'b' } + shape_bool: '#9aedfe' + shape_custom: '#5af78e' + shape_datetime: { fg: '#9aedfe' attr: 'b' } + shape_directory: '#9aedfe' + shape_external: '#9aedfe' + shape_externalarg: { fg: '#5af78e' attr: 'b' } + shape_filepath: '#9aedfe' + shape_flag: { fg: '#57c7ff' attr: 'b' } + shape_float: { fg: '#ff6ac1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#9aedfe' attr: 'b' } + shape_int: { fg: '#ff6ac1' attr: 'b' } + shape_internalcall: { fg: '#9aedfe' attr: 'b' } + shape_list: { fg: '#9aedfe' attr: 'b' } + shape_literal: '#57c7ff' + shape_match_pattern: '#5af78e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#9aedfe' + shape_operator: '#f3f99d' + shape_or: { fg: '#ff6ac1' attr: 'b' } + shape_pipe: { fg: '#ff6ac1' attr: 'b' } + shape_range: { fg: '#f3f99d' attr: 'b' } + shape_record: { fg: '#9aedfe' attr: 'b' } + shape_redirection: { fg: '#ff6ac1' attr: 'b' } + shape_signature: { fg: '#5af78e' attr: 'b' } + shape_string: '#5af78e' + shape_string_interpolation: { fg: '#9aedfe' attr: 'b' } + shape_table: { fg: '#57c7ff' attr: 'b' } + shape_variable: '#ff6ac1' + + background: '#282a36' + foreground: '#e2e4e5' + cursor: '#e2e4e5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/snow-dark.nu b/themes/nu-themes/snow-dark.nu index 7d9a3d9..6da039d 100644 --- a/themes/nu-themes/snow-dark.nu +++ b/themes/nu-themes/snow-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#afb7c0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7f9d77" attr: "b" } - empty: "#759abd" - bool: {|| if $in { "#5da19f" } else { "light_gray" } } - int: "#afb7c0" - filesize: {|e| - if $e == 0b { - "#afb7c0" - } else if $e < 1mb { - "#5da19f" - } else {{ fg: "#759abd" }} - } - duration: "#afb7c0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be868c" attr: "b" } - } else if $in < 6hr { - "#be868c" - } else if $in < 1day { - "#ab916d" - } else if $in < 3day { - "#7f9d77" - } else if $in < 1wk { - { fg: "#7f9d77" attr: "b" } - } else if $in < 6wk { - "#5da19f" - } else if $in < 52wk { - "#759abd" - } else { "dark_gray" } - } - range: "#afb7c0" - float: "#afb7c0" - string: "#afb7c0" - nothing: "#afb7c0" - binary: "#afb7c0" - cellpath: "#afb7c0" - row_index: { fg: "#7f9d77" attr: "b" } - record: "#afb7c0" - list: "#afb7c0" - block: "#afb7c0" - hints: "dark_gray" - search_result: { fg: "#be868c" bg: "#afb7c0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a88cb3" attr: "b" } - shape_binary: { fg: "#a88cb3" attr: "b" } - shape_block: { fg: "#759abd" attr: "b" } - shape_bool: "#5da19f" - shape_custom: "#7f9d77" - shape_datetime: { fg: "#5da19f" attr: "b" } - shape_directory: "#5da19f" - shape_external: "#5da19f" - shape_externalarg: { fg: "#7f9d77" attr: "b" } - shape_filepath: "#5da19f" - shape_flag: { fg: "#759abd" attr: "b" } - shape_float: { fg: "#a88cb3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5da19f" attr: "b" } - shape_int: { fg: "#a88cb3" attr: "b" } - shape_internalcall: { fg: "#5da19f" attr: "b" } - shape_list: { fg: "#5da19f" attr: "b" } - shape_literal: "#759abd" - shape_match_pattern: "#7f9d77" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5da19f" - shape_operator: "#ab916d" - shape_or: { fg: "#a88cb3" attr: "b" } - shape_pipe: { fg: "#a88cb3" attr: "b" } - shape_range: { fg: "#ab916d" attr: "b" } - shape_record: { fg: "#5da19f" attr: "b" } - shape_redirection: { fg: "#a88cb3" attr: "b" } - shape_signature: { fg: "#7f9d77" attr: "b" } - shape_string: "#7f9d77" - shape_string_interpolation: { fg: "#5da19f" attr: "b" } - shape_table: { fg: "#759abd" attr: "b" } - shape_variable: "#a88cb3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2c2d30" - foreground: "#afb7c0" - cursor: "#cbd2d9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#afb7c0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7f9d77' attr: 'b' } + empty: '#759abd' + bool: {|| if $in { '#5da19f' } else { 'light_gray' } } + int: '#afb7c0' + filesize: {|e| + if $e == 0b { + '#afb7c0' + } else if $e < 1mb { + '#5da19f' + } else {{ fg: '#759abd' }} + } + duration: '#afb7c0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be868c' attr: 'b' } + } else if $in < 6hr { + '#be868c' + } else if $in < 1day { + '#ab916d' + } else if $in < 3day { + '#7f9d77' + } else if $in < 1wk { + { fg: '#7f9d77' attr: 'b' } + } else if $in < 6wk { + '#5da19f' + } else if $in < 52wk { + '#759abd' + } else { 'dark_gray' } + } + range: '#afb7c0' + float: '#afb7c0' + string: '#afb7c0' + nothing: '#afb7c0' + binary: '#afb7c0' + cellpath: '#afb7c0' + row_index: { fg: '#7f9d77' attr: 'b' } + record: '#afb7c0' + list: '#afb7c0' + block: '#afb7c0' + hints: 'dark_gray' + search_result: { fg: '#be868c' bg: '#afb7c0' } + + shape_and: { fg: '#a88cb3' attr: 'b' } + shape_binary: { fg: '#a88cb3' attr: 'b' } + shape_block: { fg: '#759abd' attr: 'b' } + shape_bool: '#5da19f' + shape_custom: '#7f9d77' + shape_datetime: { fg: '#5da19f' attr: 'b' } + shape_directory: '#5da19f' + shape_external: '#5da19f' + shape_externalarg: { fg: '#7f9d77' attr: 'b' } + shape_filepath: '#5da19f' + shape_flag: { fg: '#759abd' attr: 'b' } + shape_float: { fg: '#a88cb3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5da19f' attr: 'b' } + shape_int: { fg: '#a88cb3' attr: 'b' } + shape_internalcall: { fg: '#5da19f' attr: 'b' } + shape_list: { fg: '#5da19f' attr: 'b' } + shape_literal: '#759abd' + shape_match_pattern: '#7f9d77' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5da19f' + shape_operator: '#ab916d' + shape_or: { fg: '#a88cb3' attr: 'b' } + shape_pipe: { fg: '#a88cb3' attr: 'b' } + shape_range: { fg: '#ab916d' attr: 'b' } + shape_record: { fg: '#5da19f' attr: 'b' } + shape_redirection: { fg: '#a88cb3' attr: 'b' } + shape_signature: { fg: '#7f9d77' attr: 'b' } + shape_string: '#7f9d77' + shape_string_interpolation: { fg: '#5da19f' attr: 'b' } + shape_table: { fg: '#759abd' attr: 'b' } + shape_variable: '#a88cb3' + + background: '#2c2d30' + foreground: '#afb7c0' + cursor: '#cbd2d9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/snow-light.nu b/themes/nu-themes/snow-light.nu index 2d3c72a..056d0b6 100644 --- a/themes/nu-themes/snow-light.nu +++ b/themes/nu-themes/snow-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#535c65" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4d7f43" attr: "b" } - empty: "#2b7ab2" - bool: {|| if $in { "#008483" } else { "light_gray" } } - int: "#535c65" - filesize: {|e| - if $e == 0b { - "#535c65" - } else if $e < 1mb { - "#008483" - } else {{ fg: "#2b7ab2" }} - } - duration: "#535c65" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ae5865" attr: "b" } - } else if $in < 6hr { - "#ae5865" - } else if $in < 1day { - "#906c33" - } else if $in < 3day { - "#4d7f43" - } else if $in < 1wk { - { fg: "#4d7f43" attr: "b" } - } else if $in < 6wk { - "#008483" - } else if $in < 52wk { - "#2b7ab2" - } else { "dark_gray" } - } - range: "#535c65" - float: "#535c65" - string: "#535c65" - nothing: "#535c65" - binary: "#535c65" - cellpath: "#535c65" - row_index: { fg: "#4d7f43" attr: "b" } - record: "#535c65" - list: "#535c65" - block: "#535c65" - hints: "dark_gray" - search_result: { fg: "#ae5865" bg: "#535c65" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f63a2" attr: "b" } - shape_binary: { fg: "#8f63a2" attr: "b" } - shape_block: { fg: "#2b7ab2" attr: "b" } - shape_bool: "#008483" - shape_custom: "#4d7f43" - shape_datetime: { fg: "#008483" attr: "b" } - shape_directory: "#008483" - shape_external: "#008483" - shape_externalarg: { fg: "#4d7f43" attr: "b" } - shape_filepath: "#008483" - shape_flag: { fg: "#2b7ab2" attr: "b" } - shape_float: { fg: "#8f63a2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#008483" attr: "b" } - shape_int: { fg: "#8f63a2" attr: "b" } - shape_internalcall: { fg: "#008483" attr: "b" } - shape_list: { fg: "#008483" attr: "b" } - shape_literal: "#2b7ab2" - shape_match_pattern: "#4d7f43" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#008483" - shape_operator: "#906c33" - shape_or: { fg: "#8f63a2" attr: "b" } - shape_pipe: { fg: "#8f63a2" attr: "b" } - shape_range: { fg: "#906c33" attr: "b" } - shape_record: { fg: "#008483" attr: "b" } - shape_redirection: { fg: "#8f63a2" attr: "b" } - shape_signature: { fg: "#4d7f43" attr: "b" } - shape_string: "#4d7f43" - shape_string_interpolation: { fg: "#008483" attr: "b" } - shape_table: { fg: "#2b7ab2" attr: "b" } - shape_variable: "#8f63a2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fbffff" - foreground: "#535c65" - cursor: "#434951" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#535c65' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4d7f43' attr: 'b' } + empty: '#2b7ab2' + bool: {|| if $in { '#008483' } else { 'light_gray' } } + int: '#535c65' + filesize: {|e| + if $e == 0b { + '#535c65' + } else if $e < 1mb { + '#008483' + } else {{ fg: '#2b7ab2' }} + } + duration: '#535c65' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ae5865' attr: 'b' } + } else if $in < 6hr { + '#ae5865' + } else if $in < 1day { + '#906c33' + } else if $in < 3day { + '#4d7f43' + } else if $in < 1wk { + { fg: '#4d7f43' attr: 'b' } + } else if $in < 6wk { + '#008483' + } else if $in < 52wk { + '#2b7ab2' + } else { 'dark_gray' } + } + range: '#535c65' + float: '#535c65' + string: '#535c65' + nothing: '#535c65' + binary: '#535c65' + cellpath: '#535c65' + row_index: { fg: '#4d7f43' attr: 'b' } + record: '#535c65' + list: '#535c65' + block: '#535c65' + hints: 'dark_gray' + search_result: { fg: '#ae5865' bg: '#535c65' } + + shape_and: { fg: '#8f63a2' attr: 'b' } + shape_binary: { fg: '#8f63a2' attr: 'b' } + shape_block: { fg: '#2b7ab2' attr: 'b' } + shape_bool: '#008483' + shape_custom: '#4d7f43' + shape_datetime: { fg: '#008483' attr: 'b' } + shape_directory: '#008483' + shape_external: '#008483' + shape_externalarg: { fg: '#4d7f43' attr: 'b' } + shape_filepath: '#008483' + shape_flag: { fg: '#2b7ab2' attr: 'b' } + shape_float: { fg: '#8f63a2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#008483' attr: 'b' } + shape_int: { fg: '#8f63a2' attr: 'b' } + shape_internalcall: { fg: '#008483' attr: 'b' } + shape_list: { fg: '#008483' attr: 'b' } + shape_literal: '#2b7ab2' + shape_match_pattern: '#4d7f43' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#008483' + shape_operator: '#906c33' + shape_or: { fg: '#8f63a2' attr: 'b' } + shape_pipe: { fg: '#8f63a2' attr: 'b' } + shape_range: { fg: '#906c33' attr: 'b' } + shape_record: { fg: '#008483' attr: 'b' } + shape_redirection: { fg: '#8f63a2' attr: 'b' } + shape_signature: { fg: '#4d7f43' attr: 'b' } + shape_string: '#4d7f43' + shape_string_interpolation: { fg: '#008483' attr: 'b' } + shape_table: { fg: '#2b7ab2' attr: 'b' } + shape_variable: '#8f63a2' + + background: '#fbffff' + foreground: '#535c65' + cursor: '#434951' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/soft-server.nu b/themes/nu-themes/soft-server.nu index f2f4b6c..05a4e7c 100644 --- a/themes/nu-themes/soft-server.nu +++ b/themes/nu-themes/soft-server.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#99a3a2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9aa56a" attr: "b" } - empty: "#6b8fa3" - bool: {|| if $in { "#64e39c" } else { "light_gray" } } - int: "#99a3a2" - filesize: {|e| - if $e == 0b { - "#99a3a2" - } else if $e < 1mb { - "#6ba58f" - } else {{ fg: "#6b8fa3" }} - } - duration: "#99a3a2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a2686a" attr: "b" } - } else if $in < 6hr { - "#a2686a" - } else if $in < 1day { - "#a3906a" - } else if $in < 3day { - "#9aa56a" - } else if $in < 1wk { - { fg: "#9aa56a" attr: "b" } - } else if $in < 6wk { - "#6ba58f" - } else if $in < 52wk { - "#6b8fa3" - } else { "dark_gray" } - } - range: "#99a3a2" - float: "#99a3a2" - string: "#99a3a2" - nothing: "#99a3a2" - binary: "#99a3a2" - cellpath: "#99a3a2" - row_index: { fg: "#9aa56a" attr: "b" } - record: "#99a3a2" - list: "#99a3a2" - block: "#99a3a2" - hints: "dark_gray" - search_result: { fg: "#a2686a" bg: "#99a3a2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6a71a3" attr: "b" } - shape_binary: { fg: "#6a71a3" attr: "b" } - shape_block: { fg: "#6b8fa3" attr: "b" } - shape_bool: "#64e39c" - shape_custom: "#9aa56a" - shape_datetime: { fg: "#6ba58f" attr: "b" } - shape_directory: "#6ba58f" - shape_external: "#6ba58f" - shape_externalarg: { fg: "#9aa56a" attr: "b" } - shape_filepath: "#6ba58f" - shape_flag: { fg: "#6b8fa3" attr: "b" } - shape_float: { fg: "#6a71a3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6ba58f" attr: "b" } - shape_int: { fg: "#6a71a3" attr: "b" } - shape_internalcall: { fg: "#6ba58f" attr: "b" } - shape_list: { fg: "#6ba58f" attr: "b" } - shape_literal: "#6b8fa3" - shape_match_pattern: "#9aa56a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#64e39c" - shape_operator: "#a3906a" - shape_or: { fg: "#6a71a3" attr: "b" } - shape_pipe: { fg: "#6a71a3" attr: "b" } - shape_range: { fg: "#a3906a" attr: "b" } - shape_record: { fg: "#6ba58f" attr: "b" } - shape_redirection: { fg: "#6a71a3" attr: "b" } - shape_signature: { fg: "#9aa56a" attr: "b" } - shape_string: "#9aa56a" - shape_string_interpolation: { fg: "#6ba58f" attr: "b" } - shape_table: { fg: "#6b8fa3" attr: "b" } - shape_variable: "#6a71a3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#242626" - foreground: "#99a3a2" - cursor: "#99a3a2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#99a3a2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9aa56a' attr: 'b' } + empty: '#6b8fa3' + bool: {|| if $in { '#64e39c' } else { 'light_gray' } } + int: '#99a3a2' + filesize: {|e| + if $e == 0b { + '#99a3a2' + } else if $e < 1mb { + '#6ba58f' + } else {{ fg: '#6b8fa3' }} + } + duration: '#99a3a2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a2686a' attr: 'b' } + } else if $in < 6hr { + '#a2686a' + } else if $in < 1day { + '#a3906a' + } else if $in < 3day { + '#9aa56a' + } else if $in < 1wk { + { fg: '#9aa56a' attr: 'b' } + } else if $in < 6wk { + '#6ba58f' + } else if $in < 52wk { + '#6b8fa3' + } else { 'dark_gray' } + } + range: '#99a3a2' + float: '#99a3a2' + string: '#99a3a2' + nothing: '#99a3a2' + binary: '#99a3a2' + cellpath: '#99a3a2' + row_index: { fg: '#9aa56a' attr: 'b' } + record: '#99a3a2' + list: '#99a3a2' + block: '#99a3a2' + hints: 'dark_gray' + search_result: { fg: '#a2686a' bg: '#99a3a2' } + + shape_and: { fg: '#6a71a3' attr: 'b' } + shape_binary: { fg: '#6a71a3' attr: 'b' } + shape_block: { fg: '#6b8fa3' attr: 'b' } + shape_bool: '#64e39c' + shape_custom: '#9aa56a' + shape_datetime: { fg: '#6ba58f' attr: 'b' } + shape_directory: '#6ba58f' + shape_external: '#6ba58f' + shape_externalarg: { fg: '#9aa56a' attr: 'b' } + shape_filepath: '#6ba58f' + shape_flag: { fg: '#6b8fa3' attr: 'b' } + shape_float: { fg: '#6a71a3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6ba58f' attr: 'b' } + shape_int: { fg: '#6a71a3' attr: 'b' } + shape_internalcall: { fg: '#6ba58f' attr: 'b' } + shape_list: { fg: '#6ba58f' attr: 'b' } + shape_literal: '#6b8fa3' + shape_match_pattern: '#9aa56a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#64e39c' + shape_operator: '#a3906a' + shape_or: { fg: '#6a71a3' attr: 'b' } + shape_pipe: { fg: '#6a71a3' attr: 'b' } + shape_range: { fg: '#a3906a' attr: 'b' } + shape_record: { fg: '#6ba58f' attr: 'b' } + shape_redirection: { fg: '#6a71a3' attr: 'b' } + shape_signature: { fg: '#9aa56a' attr: 'b' } + shape_string: '#9aa56a' + shape_string_interpolation: { fg: '#6ba58f' attr: 'b' } + shape_table: { fg: '#6b8fa3' attr: 'b' } + shape_variable: '#6a71a3' + + background: '#242626' + foreground: '#99a3a2' + cursor: '#99a3a2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solar-flare.nu b/themes/nu-themes/solar-flare.nu index 40c7a37..7782679 100644 --- a/themes/nu-themes/solar-flare.nu +++ b/themes/nu-themes/solar-flare.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#A6AFB8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7CC844" attr: "b" } - empty: "#33B5E1" - bool: {|| if $in { "#52CBB0" } else { "light_gray" } } - int: "#A6AFB8" - filesize: {|e| - if $e == 0b { - "#A6AFB8" - } else if $e < 1mb { - "#52CBB0" - } else {{ fg: "#33B5E1" }} - } - duration: "#A6AFB8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#EF5253" attr: "b" } - } else if $in < 6hr { - "#EF5253" - } else if $in < 1day { - "#E4B51C" - } else if $in < 3day { - "#7CC844" - } else if $in < 1wk { - { fg: "#7CC844" attr: "b" } - } else if $in < 6wk { - "#52CBB0" - } else if $in < 52wk { - "#33B5E1" - } else { "dark_gray" } - } - range: "#A6AFB8" - float: "#A6AFB8" - string: "#A6AFB8" - nothing: "#A6AFB8" - binary: "#A6AFB8" - cellpath: "#A6AFB8" - row_index: { fg: "#7CC844" attr: "b" } - record: "#A6AFB8" - list: "#A6AFB8" - block: "#A6AFB8" - hints: "dark_gray" - search_result: { fg: "#EF5253" bg: "#A6AFB8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#A363D5" attr: "b" } - shape_binary: { fg: "#A363D5" attr: "b" } - shape_block: { fg: "#33B5E1" attr: "b" } - shape_bool: "#52CBB0" - shape_custom: "#7CC844" - shape_datetime: { fg: "#52CBB0" attr: "b" } - shape_directory: "#52CBB0" - shape_external: "#52CBB0" - shape_externalarg: { fg: "#7CC844" attr: "b" } - shape_filepath: "#52CBB0" - shape_flag: { fg: "#33B5E1" attr: "b" } - shape_float: { fg: "#A363D5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#52CBB0" attr: "b" } - shape_int: { fg: "#A363D5" attr: "b" } - shape_internalcall: { fg: "#52CBB0" attr: "b" } - shape_list: { fg: "#52CBB0" attr: "b" } - shape_literal: "#33B5E1" - shape_match_pattern: "#7CC844" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#52CBB0" - shape_operator: "#E4B51C" - shape_or: { fg: "#A363D5" attr: "b" } - shape_pipe: { fg: "#A363D5" attr: "b" } - shape_range: { fg: "#E4B51C" attr: "b" } - shape_record: { fg: "#52CBB0" attr: "b" } - shape_redirection: { fg: "#A363D5" attr: "b" } - shape_signature: { fg: "#7CC844" attr: "b" } - shape_string: "#7CC844" - shape_string_interpolation: { fg: "#52CBB0" attr: "b" } - shape_table: { fg: "#33B5E1" attr: "b" } - shape_variable: "#A363D5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#18262F" - foreground: "#A6AFB8" - cursor: "#A6AFB8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#A6AFB8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7CC844' attr: 'b' } + empty: '#33B5E1' + bool: {|| if $in { '#52CBB0' } else { 'light_gray' } } + int: '#A6AFB8' + filesize: {|e| + if $e == 0b { + '#A6AFB8' + } else if $e < 1mb { + '#52CBB0' + } else {{ fg: '#33B5E1' }} + } + duration: '#A6AFB8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#EF5253' attr: 'b' } + } else if $in < 6hr { + '#EF5253' + } else if $in < 1day { + '#E4B51C' + } else if $in < 3day { + '#7CC844' + } else if $in < 1wk { + { fg: '#7CC844' attr: 'b' } + } else if $in < 6wk { + '#52CBB0' + } else if $in < 52wk { + '#33B5E1' + } else { 'dark_gray' } + } + range: '#A6AFB8' + float: '#A6AFB8' + string: '#A6AFB8' + nothing: '#A6AFB8' + binary: '#A6AFB8' + cellpath: '#A6AFB8' + row_index: { fg: '#7CC844' attr: 'b' } + record: '#A6AFB8' + list: '#A6AFB8' + block: '#A6AFB8' + hints: 'dark_gray' + search_result: { fg: '#EF5253' bg: '#A6AFB8' } + + shape_and: { fg: '#A363D5' attr: 'b' } + shape_binary: { fg: '#A363D5' attr: 'b' } + shape_block: { fg: '#33B5E1' attr: 'b' } + shape_bool: '#52CBB0' + shape_custom: '#7CC844' + shape_datetime: { fg: '#52CBB0' attr: 'b' } + shape_directory: '#52CBB0' + shape_external: '#52CBB0' + shape_externalarg: { fg: '#7CC844' attr: 'b' } + shape_filepath: '#52CBB0' + shape_flag: { fg: '#33B5E1' attr: 'b' } + shape_float: { fg: '#A363D5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#52CBB0' attr: 'b' } + shape_int: { fg: '#A363D5' attr: 'b' } + shape_internalcall: { fg: '#52CBB0' attr: 'b' } + shape_list: { fg: '#52CBB0' attr: 'b' } + shape_literal: '#33B5E1' + shape_match_pattern: '#7CC844' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#52CBB0' + shape_operator: '#E4B51C' + shape_or: { fg: '#A363D5' attr: 'b' } + shape_pipe: { fg: '#A363D5' attr: 'b' } + shape_range: { fg: '#E4B51C' attr: 'b' } + shape_record: { fg: '#52CBB0' attr: 'b' } + shape_redirection: { fg: '#A363D5' attr: 'b' } + shape_signature: { fg: '#7CC844' attr: 'b' } + shape_string: '#7CC844' + shape_string_interpolation: { fg: '#52CBB0' attr: 'b' } + shape_table: { fg: '#33B5E1' attr: 'b' } + shape_variable: '#A363D5' + + background: '#18262F' + foreground: '#A6AFB8' + cursor: '#A6AFB8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solarflare-light.nu b/themes/nu-themes/solarflare-light.nu index a74d8a0..d3ae62f 100644 --- a/themes/nu-themes/solarflare-light.nu +++ b/themes/nu-themes/solarflare-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#586875" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7cc844" attr: "b" } - empty: "#33b5e1" - bool: {|| if $in { "#52cbb0" } else { "light_gray" } } - int: "#586875" - filesize: {|e| - if $e == 0b { - "#586875" - } else if $e < 1mb { - "#52cbb0" - } else {{ fg: "#33b5e1" }} - } - duration: "#586875" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ef5253" attr: "b" } - } else if $in < 6hr { - "#ef5253" - } else if $in < 1day { - "#e4b51c" - } else if $in < 3day { - "#7cc844" - } else if $in < 1wk { - { fg: "#7cc844" attr: "b" } - } else if $in < 6wk { - "#52cbb0" - } else if $in < 52wk { - "#33b5e1" - } else { "dark_gray" } - } - range: "#586875" - float: "#586875" - string: "#586875" - nothing: "#586875" - binary: "#586875" - cellpath: "#586875" - row_index: { fg: "#7cc844" attr: "b" } - record: "#586875" - list: "#586875" - block: "#586875" - hints: "dark_gray" - search_result: { fg: "#ef5253" bg: "#586875" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a363d5" attr: "b" } - shape_binary: { fg: "#a363d5" attr: "b" } - shape_block: { fg: "#33b5e1" attr: "b" } - shape_bool: "#52cbb0" - shape_custom: "#7cc844" - shape_datetime: { fg: "#52cbb0" attr: "b" } - shape_directory: "#52cbb0" - shape_external: "#52cbb0" - shape_externalarg: { fg: "#7cc844" attr: "b" } - shape_filepath: "#52cbb0" - shape_flag: { fg: "#33b5e1" attr: "b" } - shape_float: { fg: "#a363d5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#52cbb0" attr: "b" } - shape_int: { fg: "#a363d5" attr: "b" } - shape_internalcall: { fg: "#52cbb0" attr: "b" } - shape_list: { fg: "#52cbb0" attr: "b" } - shape_literal: "#33b5e1" - shape_match_pattern: "#7cc844" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#52cbb0" - shape_operator: "#e4b51c" - shape_or: { fg: "#a363d5" attr: "b" } - shape_pipe: { fg: "#a363d5" attr: "b" } - shape_range: { fg: "#e4b51c" attr: "b" } - shape_record: { fg: "#52cbb0" attr: "b" } - shape_redirection: { fg: "#a363d5" attr: "b" } - shape_signature: { fg: "#7cc844" attr: "b" } - shape_string: "#7cc844" - shape_string_interpolation: { fg: "#52cbb0" attr: "b" } - shape_table: { fg: "#33b5e1" attr: "b" } - shape_variable: "#a363d5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f5f7fa" - foreground: "#586875" - cursor: "#586875" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#586875' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7cc844' attr: 'b' } + empty: '#33b5e1' + bool: {|| if $in { '#52cbb0' } else { 'light_gray' } } + int: '#586875' + filesize: {|e| + if $e == 0b { + '#586875' + } else if $e < 1mb { + '#52cbb0' + } else {{ fg: '#33b5e1' }} + } + duration: '#586875' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ef5253' attr: 'b' } + } else if $in < 6hr { + '#ef5253' + } else if $in < 1day { + '#e4b51c' + } else if $in < 3day { + '#7cc844' + } else if $in < 1wk { + { fg: '#7cc844' attr: 'b' } + } else if $in < 6wk { + '#52cbb0' + } else if $in < 52wk { + '#33b5e1' + } else { 'dark_gray' } + } + range: '#586875' + float: '#586875' + string: '#586875' + nothing: '#586875' + binary: '#586875' + cellpath: '#586875' + row_index: { fg: '#7cc844' attr: 'b' } + record: '#586875' + list: '#586875' + block: '#586875' + hints: 'dark_gray' + search_result: { fg: '#ef5253' bg: '#586875' } + + shape_and: { fg: '#a363d5' attr: 'b' } + shape_binary: { fg: '#a363d5' attr: 'b' } + shape_block: { fg: '#33b5e1' attr: 'b' } + shape_bool: '#52cbb0' + shape_custom: '#7cc844' + shape_datetime: { fg: '#52cbb0' attr: 'b' } + shape_directory: '#52cbb0' + shape_external: '#52cbb0' + shape_externalarg: { fg: '#7cc844' attr: 'b' } + shape_filepath: '#52cbb0' + shape_flag: { fg: '#33b5e1' attr: 'b' } + shape_float: { fg: '#a363d5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#52cbb0' attr: 'b' } + shape_int: { fg: '#a363d5' attr: 'b' } + shape_internalcall: { fg: '#52cbb0' attr: 'b' } + shape_list: { fg: '#52cbb0' attr: 'b' } + shape_literal: '#33b5e1' + shape_match_pattern: '#7cc844' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#52cbb0' + shape_operator: '#e4b51c' + shape_or: { fg: '#a363d5' attr: 'b' } + shape_pipe: { fg: '#a363d5' attr: 'b' } + shape_range: { fg: '#e4b51c' attr: 'b' } + shape_record: { fg: '#52cbb0' attr: 'b' } + shape_redirection: { fg: '#a363d5' attr: 'b' } + shape_signature: { fg: '#7cc844' attr: 'b' } + shape_string: '#7cc844' + shape_string_interpolation: { fg: '#52cbb0' attr: 'b' } + shape_table: { fg: '#33b5e1' attr: 'b' } + shape_variable: '#a363d5' + + background: '#f5f7fa' + foreground: '#586875' + cursor: '#586875' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solarflare.nu b/themes/nu-themes/solarflare.nu index f8d03d0..433649d 100644 --- a/themes/nu-themes/solarflare.nu +++ b/themes/nu-themes/solarflare.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a6afb8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7cc844" attr: "b" } - empty: "#33b5e1" - bool: {|| if $in { "#52cbb0" } else { "light_gray" } } - int: "#a6afb8" - filesize: {|e| - if $e == 0b { - "#a6afb8" - } else if $e < 1mb { - "#52cbb0" - } else {{ fg: "#33b5e1" }} - } - duration: "#a6afb8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ef5253" attr: "b" } - } else if $in < 6hr { - "#ef5253" - } else if $in < 1day { - "#e4b51c" - } else if $in < 3day { - "#7cc844" - } else if $in < 1wk { - { fg: "#7cc844" attr: "b" } - } else if $in < 6wk { - "#52cbb0" - } else if $in < 52wk { - "#33b5e1" - } else { "dark_gray" } - } - range: "#a6afb8" - float: "#a6afb8" - string: "#a6afb8" - nothing: "#a6afb8" - binary: "#a6afb8" - cellpath: "#a6afb8" - row_index: { fg: "#7cc844" attr: "b" } - record: "#a6afb8" - list: "#a6afb8" - block: "#a6afb8" - hints: "dark_gray" - search_result: { fg: "#ef5253" bg: "#a6afb8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a363d5" attr: "b" } - shape_binary: { fg: "#a363d5" attr: "b" } - shape_block: { fg: "#33b5e1" attr: "b" } - shape_bool: "#52cbb0" - shape_custom: "#7cc844" - shape_datetime: { fg: "#52cbb0" attr: "b" } - shape_directory: "#52cbb0" - shape_external: "#52cbb0" - shape_externalarg: { fg: "#7cc844" attr: "b" } - shape_filepath: "#52cbb0" - shape_flag: { fg: "#33b5e1" attr: "b" } - shape_float: { fg: "#a363d5" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#52cbb0" attr: "b" } - shape_int: { fg: "#a363d5" attr: "b" } - shape_internalcall: { fg: "#52cbb0" attr: "b" } - shape_list: { fg: "#52cbb0" attr: "b" } - shape_literal: "#33b5e1" - shape_match_pattern: "#7cc844" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#52cbb0" - shape_operator: "#e4b51c" - shape_or: { fg: "#a363d5" attr: "b" } - shape_pipe: { fg: "#a363d5" attr: "b" } - shape_range: { fg: "#e4b51c" attr: "b" } - shape_record: { fg: "#52cbb0" attr: "b" } - shape_redirection: { fg: "#a363d5" attr: "b" } - shape_signature: { fg: "#7cc844" attr: "b" } - shape_string: "#7cc844" - shape_string_interpolation: { fg: "#52cbb0" attr: "b" } - shape_table: { fg: "#33b5e1" attr: "b" } - shape_variable: "#a363d5" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#18262f" - foreground: "#a6afb8" - cursor: "#a6afb8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a6afb8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7cc844' attr: 'b' } + empty: '#33b5e1' + bool: {|| if $in { '#52cbb0' } else { 'light_gray' } } + int: '#a6afb8' + filesize: {|e| + if $e == 0b { + '#a6afb8' + } else if $e < 1mb { + '#52cbb0' + } else {{ fg: '#33b5e1' }} + } + duration: '#a6afb8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ef5253' attr: 'b' } + } else if $in < 6hr { + '#ef5253' + } else if $in < 1day { + '#e4b51c' + } else if $in < 3day { + '#7cc844' + } else if $in < 1wk { + { fg: '#7cc844' attr: 'b' } + } else if $in < 6wk { + '#52cbb0' + } else if $in < 52wk { + '#33b5e1' + } else { 'dark_gray' } + } + range: '#a6afb8' + float: '#a6afb8' + string: '#a6afb8' + nothing: '#a6afb8' + binary: '#a6afb8' + cellpath: '#a6afb8' + row_index: { fg: '#7cc844' attr: 'b' } + record: '#a6afb8' + list: '#a6afb8' + block: '#a6afb8' + hints: 'dark_gray' + search_result: { fg: '#ef5253' bg: '#a6afb8' } + + shape_and: { fg: '#a363d5' attr: 'b' } + shape_binary: { fg: '#a363d5' attr: 'b' } + shape_block: { fg: '#33b5e1' attr: 'b' } + shape_bool: '#52cbb0' + shape_custom: '#7cc844' + shape_datetime: { fg: '#52cbb0' attr: 'b' } + shape_directory: '#52cbb0' + shape_external: '#52cbb0' + shape_externalarg: { fg: '#7cc844' attr: 'b' } + shape_filepath: '#52cbb0' + shape_flag: { fg: '#33b5e1' attr: 'b' } + shape_float: { fg: '#a363d5' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#52cbb0' attr: 'b' } + shape_int: { fg: '#a363d5' attr: 'b' } + shape_internalcall: { fg: '#52cbb0' attr: 'b' } + shape_list: { fg: '#52cbb0' attr: 'b' } + shape_literal: '#33b5e1' + shape_match_pattern: '#7cc844' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#52cbb0' + shape_operator: '#e4b51c' + shape_or: { fg: '#a363d5' attr: 'b' } + shape_pipe: { fg: '#a363d5' attr: 'b' } + shape_range: { fg: '#e4b51c' attr: 'b' } + shape_record: { fg: '#52cbb0' attr: 'b' } + shape_redirection: { fg: '#a363d5' attr: 'b' } + shape_signature: { fg: '#7cc844' attr: 'b' } + shape_string: '#7cc844' + shape_string_interpolation: { fg: '#52cbb0' attr: 'b' } + shape_table: { fg: '#33b5e1' attr: 'b' } + shape_variable: '#a363d5' + + background: '#18262f' + foreground: '#a6afb8' + cursor: '#a6afb8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solarized-darcula.nu b/themes/nu-themes/solarized-darcula.nu index 942d4f6..df874aa 100644 --- a/themes/nu-themes/solarized-darcula.nu +++ b/themes/nu-themes/solarized-darcula.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d2d8d9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#629655" attr: "b" } - empty: "#2075c7" - bool: {|| if $in { "#15968d" } else { "light_gray" } } - int: "#d2d8d9" - filesize: {|e| - if $e == 0b { - "#d2d8d9" - } else if $e < 1mb { - "#15968d" - } else {{ fg: "#2075c7" }} - } - duration: "#d2d8d9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f24840" attr: "b" } - } else if $in < 6hr { - "#f24840" - } else if $in < 1day { - "#b68800" - } else if $in < 3day { - "#629655" - } else if $in < 1wk { - { fg: "#629655" attr: "b" } - } else if $in < 6wk { - "#15968d" - } else if $in < 52wk { - "#2075c7" - } else { "dark_gray" } - } - range: "#d2d8d9" - float: "#d2d8d9" - string: "#d2d8d9" - nothing: "#d2d8d9" - binary: "#d2d8d9" - cellpath: "#d2d8d9" - row_index: { fg: "#629655" attr: "b" } - record: "#d2d8d9" - list: "#d2d8d9" - block: "#d2d8d9" - hints: "dark_gray" - search_result: { fg: "#f24840" bg: "#d2d8d9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#797fd4" attr: "b" } - shape_binary: { fg: "#797fd4" attr: "b" } - shape_block: { fg: "#2075c7" attr: "b" } - shape_bool: "#15968d" - shape_custom: "#629655" - shape_datetime: { fg: "#15968d" attr: "b" } - shape_directory: "#15968d" - shape_external: "#15968d" - shape_externalarg: { fg: "#629655" attr: "b" } - shape_filepath: "#15968d" - shape_flag: { fg: "#2075c7" attr: "b" } - shape_float: { fg: "#797fd4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#15968d" attr: "b" } - shape_int: { fg: "#797fd4" attr: "b" } - shape_internalcall: { fg: "#15968d" attr: "b" } - shape_list: { fg: "#15968d" attr: "b" } - shape_literal: "#2075c7" - shape_match_pattern: "#629655" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#15968d" - shape_operator: "#b68800" - shape_or: { fg: "#797fd4" attr: "b" } - shape_pipe: { fg: "#797fd4" attr: "b" } - shape_range: { fg: "#b68800" attr: "b" } - shape_record: { fg: "#15968d" attr: "b" } - shape_redirection: { fg: "#797fd4" attr: "b" } - shape_signature: { fg: "#629655" attr: "b" } - shape_string: "#629655" - shape_string_interpolation: { fg: "#15968d" attr: "b" } - shape_table: { fg: "#2075c7" attr: "b" } - shape_variable: "#797fd4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#3d3f41" - foreground: "#d2d8d9" - cursor: "#d2d8d9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d2d8d9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#629655' attr: 'b' } + empty: '#2075c7' + bool: {|| if $in { '#15968d' } else { 'light_gray' } } + int: '#d2d8d9' + filesize: {|e| + if $e == 0b { + '#d2d8d9' + } else if $e < 1mb { + '#15968d' + } else {{ fg: '#2075c7' }} + } + duration: '#d2d8d9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f24840' attr: 'b' } + } else if $in < 6hr { + '#f24840' + } else if $in < 1day { + '#b68800' + } else if $in < 3day { + '#629655' + } else if $in < 1wk { + { fg: '#629655' attr: 'b' } + } else if $in < 6wk { + '#15968d' + } else if $in < 52wk { + '#2075c7' + } else { 'dark_gray' } + } + range: '#d2d8d9' + float: '#d2d8d9' + string: '#d2d8d9' + nothing: '#d2d8d9' + binary: '#d2d8d9' + cellpath: '#d2d8d9' + row_index: { fg: '#629655' attr: 'b' } + record: '#d2d8d9' + list: '#d2d8d9' + block: '#d2d8d9' + hints: 'dark_gray' + search_result: { fg: '#f24840' bg: '#d2d8d9' } + + shape_and: { fg: '#797fd4' attr: 'b' } + shape_binary: { fg: '#797fd4' attr: 'b' } + shape_block: { fg: '#2075c7' attr: 'b' } + shape_bool: '#15968d' + shape_custom: '#629655' + shape_datetime: { fg: '#15968d' attr: 'b' } + shape_directory: '#15968d' + shape_external: '#15968d' + shape_externalarg: { fg: '#629655' attr: 'b' } + shape_filepath: '#15968d' + shape_flag: { fg: '#2075c7' attr: 'b' } + shape_float: { fg: '#797fd4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#15968d' attr: 'b' } + shape_int: { fg: '#797fd4' attr: 'b' } + shape_internalcall: { fg: '#15968d' attr: 'b' } + shape_list: { fg: '#15968d' attr: 'b' } + shape_literal: '#2075c7' + shape_match_pattern: '#629655' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#15968d' + shape_operator: '#b68800' + shape_or: { fg: '#797fd4' attr: 'b' } + shape_pipe: { fg: '#797fd4' attr: 'b' } + shape_range: { fg: '#b68800' attr: 'b' } + shape_record: { fg: '#15968d' attr: 'b' } + shape_redirection: { fg: '#797fd4' attr: 'b' } + shape_signature: { fg: '#629655' attr: 'b' } + shape_string: '#629655' + shape_string_interpolation: { fg: '#15968d' attr: 'b' } + shape_table: { fg: '#2075c7' attr: 'b' } + shape_variable: '#797fd4' + + background: '#3d3f41' + foreground: '#d2d8d9' + cursor: '#d2d8d9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solarized-dark-higher-contrast.nu b/themes/nu-themes/solarized-dark-higher-contrast.nu index d7abbbf..7fccbc0 100644 --- a/themes/nu-themes/solarized-dark-higher-contrast.nu +++ b/themes/nu-themes/solarized-dark-higher-contrast.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eae3cb" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6cbe6c" attr: "b" } - empty: "#2176c7" - bool: {|| if $in { "#00b39e" } else { "light_gray" } } - int: "#eae3cb" - filesize: {|e| - if $e == 0b { - "#eae3cb" - } else if $e < 1mb { - "#259286" - } else {{ fg: "#2176c7" }} - } - duration: "#eae3cb" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d11c24" attr: "b" } - } else if $in < 6hr { - "#d11c24" - } else if $in < 1day { - "#a57706" - } else if $in < 3day { - "#6cbe6c" - } else if $in < 1wk { - { fg: "#6cbe6c" attr: "b" } - } else if $in < 6wk { - "#259286" - } else if $in < 52wk { - "#2176c7" - } else { "dark_gray" } - } - range: "#eae3cb" - float: "#eae3cb" - string: "#eae3cb" - nothing: "#eae3cb" - binary: "#eae3cb" - cellpath: "#eae3cb" - row_index: { fg: "#6cbe6c" attr: "b" } - record: "#eae3cb" - list: "#eae3cb" - block: "#eae3cb" - hints: "dark_gray" - search_result: { fg: "#d11c24" bg: "#eae3cb" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c61c6f" attr: "b" } - shape_binary: { fg: "#c61c6f" attr: "b" } - shape_block: { fg: "#2176c7" attr: "b" } - shape_bool: "#00b39e" - shape_custom: "#6cbe6c" - shape_datetime: { fg: "#259286" attr: "b" } - shape_directory: "#259286" - shape_external: "#259286" - shape_externalarg: { fg: "#6cbe6c" attr: "b" } - shape_filepath: "#259286" - shape_flag: { fg: "#2176c7" attr: "b" } - shape_float: { fg: "#c61c6f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#259286" attr: "b" } - shape_int: { fg: "#c61c6f" attr: "b" } - shape_internalcall: { fg: "#259286" attr: "b" } - shape_list: { fg: "#259286" attr: "b" } - shape_literal: "#2176c7" - shape_match_pattern: "#6cbe6c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00b39e" - shape_operator: "#a57706" - shape_or: { fg: "#c61c6f" attr: "b" } - shape_pipe: { fg: "#c61c6f" attr: "b" } - shape_range: { fg: "#a57706" attr: "b" } - shape_record: { fg: "#259286" attr: "b" } - shape_redirection: { fg: "#c61c6f" attr: "b" } - shape_signature: { fg: "#6cbe6c" attr: "b" } - shape_string: "#6cbe6c" - shape_string_interpolation: { fg: "#259286" attr: "b" } - shape_table: { fg: "#2176c7" attr: "b" } - shape_variable: "#c61c6f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#001e27" - foreground: "#9cc2c3" - cursor: "#9cc2c3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eae3cb' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6cbe6c' attr: 'b' } + empty: '#2176c7' + bool: {|| if $in { '#00b39e' } else { 'light_gray' } } + int: '#eae3cb' + filesize: {|e| + if $e == 0b { + '#eae3cb' + } else if $e < 1mb { + '#259286' + } else {{ fg: '#2176c7' }} + } + duration: '#eae3cb' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d11c24' attr: 'b' } + } else if $in < 6hr { + '#d11c24' + } else if $in < 1day { + '#a57706' + } else if $in < 3day { + '#6cbe6c' + } else if $in < 1wk { + { fg: '#6cbe6c' attr: 'b' } + } else if $in < 6wk { + '#259286' + } else if $in < 52wk { + '#2176c7' + } else { 'dark_gray' } + } + range: '#eae3cb' + float: '#eae3cb' + string: '#eae3cb' + nothing: '#eae3cb' + binary: '#eae3cb' + cellpath: '#eae3cb' + row_index: { fg: '#6cbe6c' attr: 'b' } + record: '#eae3cb' + list: '#eae3cb' + block: '#eae3cb' + hints: 'dark_gray' + search_result: { fg: '#d11c24' bg: '#eae3cb' } + + shape_and: { fg: '#c61c6f' attr: 'b' } + shape_binary: { fg: '#c61c6f' attr: 'b' } + shape_block: { fg: '#2176c7' attr: 'b' } + shape_bool: '#00b39e' + shape_custom: '#6cbe6c' + shape_datetime: { fg: '#259286' attr: 'b' } + shape_directory: '#259286' + shape_external: '#259286' + shape_externalarg: { fg: '#6cbe6c' attr: 'b' } + shape_filepath: '#259286' + shape_flag: { fg: '#2176c7' attr: 'b' } + shape_float: { fg: '#c61c6f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#259286' attr: 'b' } + shape_int: { fg: '#c61c6f' attr: 'b' } + shape_internalcall: { fg: '#259286' attr: 'b' } + shape_list: { fg: '#259286' attr: 'b' } + shape_literal: '#2176c7' + shape_match_pattern: '#6cbe6c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00b39e' + shape_operator: '#a57706' + shape_or: { fg: '#c61c6f' attr: 'b' } + shape_pipe: { fg: '#c61c6f' attr: 'b' } + shape_range: { fg: '#a57706' attr: 'b' } + shape_record: { fg: '#259286' attr: 'b' } + shape_redirection: { fg: '#c61c6f' attr: 'b' } + shape_signature: { fg: '#6cbe6c' attr: 'b' } + shape_string: '#6cbe6c' + shape_string_interpolation: { fg: '#259286' attr: 'b' } + shape_table: { fg: '#2176c7' attr: 'b' } + shape_variable: '#c61c6f' + + background: '#001e27' + foreground: '#9cc2c3' + cursor: '#9cc2c3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solarized-dark.nu b/themes/nu-themes/solarized-dark.nu index 4f47e3d..1d40b12 100644 --- a/themes/nu-themes/solarized-dark.nu +++ b/themes/nu-themes/solarized-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#93a1a1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#859900" attr: "b" } - empty: "#268bd2" - bool: {|| if $in { "#2aa198" } else { "light_gray" } } - int: "#93a1a1" - filesize: {|e| - if $e == 0b { - "#93a1a1" - } else if $e < 1mb { - "#2aa198" - } else {{ fg: "#268bd2" }} - } - duration: "#93a1a1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dc322f" attr: "b" } - } else if $in < 6hr { - "#dc322f" - } else if $in < 1day { - "#b58900" - } else if $in < 3day { - "#859900" - } else if $in < 1wk { - { fg: "#859900" attr: "b" } - } else if $in < 6wk { - "#2aa198" - } else if $in < 52wk { - "#268bd2" - } else { "dark_gray" } - } - range: "#93a1a1" - float: "#93a1a1" - string: "#93a1a1" - nothing: "#93a1a1" - binary: "#93a1a1" - cellpath: "#93a1a1" - row_index: { fg: "#859900" attr: "b" } - record: "#93a1a1" - list: "#93a1a1" - block: "#93a1a1" - hints: "dark_gray" - search_result: { fg: "#dc322f" bg: "#93a1a1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6c71c4" attr: "b" } - shape_binary: { fg: "#6c71c4" attr: "b" } - shape_block: { fg: "#268bd2" attr: "b" } - shape_bool: "#2aa198" - shape_custom: "#859900" - shape_datetime: { fg: "#2aa198" attr: "b" } - shape_directory: "#2aa198" - shape_external: "#2aa198" - shape_externalarg: { fg: "#859900" attr: "b" } - shape_filepath: "#2aa198" - shape_flag: { fg: "#268bd2" attr: "b" } - shape_float: { fg: "#6c71c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2aa198" attr: "b" } - shape_int: { fg: "#6c71c4" attr: "b" } - shape_internalcall: { fg: "#2aa198" attr: "b" } - shape_list: { fg: "#2aa198" attr: "b" } - shape_literal: "#268bd2" - shape_match_pattern: "#859900" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2aa198" - shape_operator: "#b58900" - shape_or: { fg: "#6c71c4" attr: "b" } - shape_pipe: { fg: "#6c71c4" attr: "b" } - shape_range: { fg: "#b58900" attr: "b" } - shape_record: { fg: "#2aa198" attr: "b" } - shape_redirection: { fg: "#6c71c4" attr: "b" } - shape_signature: { fg: "#859900" attr: "b" } - shape_string: "#859900" - shape_string_interpolation: { fg: "#2aa198" attr: "b" } - shape_table: { fg: "#268bd2" attr: "b" } - shape_variable: "#6c71c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#002b36" - foreground: "#93a1a1" - cursor: "#93a1a1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#93a1a1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#859900' attr: 'b' } + empty: '#268bd2' + bool: {|| if $in { '#2aa198' } else { 'light_gray' } } + int: '#93a1a1' + filesize: {|e| + if $e == 0b { + '#93a1a1' + } else if $e < 1mb { + '#2aa198' + } else {{ fg: '#268bd2' }} + } + duration: '#93a1a1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dc322f' attr: 'b' } + } else if $in < 6hr { + '#dc322f' + } else if $in < 1day { + '#b58900' + } else if $in < 3day { + '#859900' + } else if $in < 1wk { + { fg: '#859900' attr: 'b' } + } else if $in < 6wk { + '#2aa198' + } else if $in < 52wk { + '#268bd2' + } else { 'dark_gray' } + } + range: '#93a1a1' + float: '#93a1a1' + string: '#93a1a1' + nothing: '#93a1a1' + binary: '#93a1a1' + cellpath: '#93a1a1' + row_index: { fg: '#859900' attr: 'b' } + record: '#93a1a1' + list: '#93a1a1' + block: '#93a1a1' + hints: 'dark_gray' + search_result: { fg: '#dc322f' bg: '#93a1a1' } + + shape_and: { fg: '#6c71c4' attr: 'b' } + shape_binary: { fg: '#6c71c4' attr: 'b' } + shape_block: { fg: '#268bd2' attr: 'b' } + shape_bool: '#2aa198' + shape_custom: '#859900' + shape_datetime: { fg: '#2aa198' attr: 'b' } + shape_directory: '#2aa198' + shape_external: '#2aa198' + shape_externalarg: { fg: '#859900' attr: 'b' } + shape_filepath: '#2aa198' + shape_flag: { fg: '#268bd2' attr: 'b' } + shape_float: { fg: '#6c71c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2aa198' attr: 'b' } + shape_int: { fg: '#6c71c4' attr: 'b' } + shape_internalcall: { fg: '#2aa198' attr: 'b' } + shape_list: { fg: '#2aa198' attr: 'b' } + shape_literal: '#268bd2' + shape_match_pattern: '#859900' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2aa198' + shape_operator: '#b58900' + shape_or: { fg: '#6c71c4' attr: 'b' } + shape_pipe: { fg: '#6c71c4' attr: 'b' } + shape_range: { fg: '#b58900' attr: 'b' } + shape_record: { fg: '#2aa198' attr: 'b' } + shape_redirection: { fg: '#6c71c4' attr: 'b' } + shape_signature: { fg: '#859900' attr: 'b' } + shape_string: '#859900' + shape_string_interpolation: { fg: '#2aa198' attr: 'b' } + shape_table: { fg: '#268bd2' attr: 'b' } + shape_variable: '#6c71c4' + + background: '#002b36' + foreground: '#93a1a1' + cursor: '#93a1a1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/solarized-light.nu b/themes/nu-themes/solarized-light.nu index f9ca488..470dac9 100644 --- a/themes/nu-themes/solarized-light.nu +++ b/themes/nu-themes/solarized-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#586e75" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#859900" attr: "b" } - empty: "#268bd2" - bool: {|| if $in { "#2aa198" } else { "light_gray" } } - int: "#586e75" - filesize: {|e| - if $e == 0b { - "#586e75" - } else if $e < 1mb { - "#2aa198" - } else {{ fg: "#268bd2" }} - } - duration: "#586e75" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dc322f" attr: "b" } - } else if $in < 6hr { - "#dc322f" - } else if $in < 1day { - "#b58900" - } else if $in < 3day { - "#859900" - } else if $in < 1wk { - { fg: "#859900" attr: "b" } - } else if $in < 6wk { - "#2aa198" - } else if $in < 52wk { - "#268bd2" - } else { "dark_gray" } - } - range: "#586e75" - float: "#586e75" - string: "#586e75" - nothing: "#586e75" - binary: "#586e75" - cellpath: "#586e75" - row_index: { fg: "#859900" attr: "b" } - record: "#586e75" - list: "#586e75" - block: "#586e75" - hints: "dark_gray" - search_result: { fg: "#dc322f" bg: "#586e75" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6c71c4" attr: "b" } - shape_binary: { fg: "#6c71c4" attr: "b" } - shape_block: { fg: "#268bd2" attr: "b" } - shape_bool: "#2aa198" - shape_custom: "#859900" - shape_datetime: { fg: "#2aa198" attr: "b" } - shape_directory: "#2aa198" - shape_external: "#2aa198" - shape_externalarg: { fg: "#859900" attr: "b" } - shape_filepath: "#2aa198" - shape_flag: { fg: "#268bd2" attr: "b" } - shape_float: { fg: "#6c71c4" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2aa198" attr: "b" } - shape_int: { fg: "#6c71c4" attr: "b" } - shape_internalcall: { fg: "#2aa198" attr: "b" } - shape_list: { fg: "#2aa198" attr: "b" } - shape_literal: "#268bd2" - shape_match_pattern: "#859900" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2aa198" - shape_operator: "#b58900" - shape_or: { fg: "#6c71c4" attr: "b" } - shape_pipe: { fg: "#6c71c4" attr: "b" } - shape_range: { fg: "#b58900" attr: "b" } - shape_record: { fg: "#2aa198" attr: "b" } - shape_redirection: { fg: "#6c71c4" attr: "b" } - shape_signature: { fg: "#859900" attr: "b" } - shape_string: "#859900" - shape_string_interpolation: { fg: "#2aa198" attr: "b" } - shape_table: { fg: "#268bd2" attr: "b" } - shape_variable: "#6c71c4" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fdf6e3" - foreground: "#586e75" - cursor: "#586e75" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#586e75' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#859900' attr: 'b' } + empty: '#268bd2' + bool: {|| if $in { '#2aa198' } else { 'light_gray' } } + int: '#586e75' + filesize: {|e| + if $e == 0b { + '#586e75' + } else if $e < 1mb { + '#2aa198' + } else {{ fg: '#268bd2' }} + } + duration: '#586e75' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dc322f' attr: 'b' } + } else if $in < 6hr { + '#dc322f' + } else if $in < 1day { + '#b58900' + } else if $in < 3day { + '#859900' + } else if $in < 1wk { + { fg: '#859900' attr: 'b' } + } else if $in < 6wk { + '#2aa198' + } else if $in < 52wk { + '#268bd2' + } else { 'dark_gray' } + } + range: '#586e75' + float: '#586e75' + string: '#586e75' + nothing: '#586e75' + binary: '#586e75' + cellpath: '#586e75' + row_index: { fg: '#859900' attr: 'b' } + record: '#586e75' + list: '#586e75' + block: '#586e75' + hints: 'dark_gray' + search_result: { fg: '#dc322f' bg: '#586e75' } + + shape_and: { fg: '#6c71c4' attr: 'b' } + shape_binary: { fg: '#6c71c4' attr: 'b' } + shape_block: { fg: '#268bd2' attr: 'b' } + shape_bool: '#2aa198' + shape_custom: '#859900' + shape_datetime: { fg: '#2aa198' attr: 'b' } + shape_directory: '#2aa198' + shape_external: '#2aa198' + shape_externalarg: { fg: '#859900' attr: 'b' } + shape_filepath: '#2aa198' + shape_flag: { fg: '#268bd2' attr: 'b' } + shape_float: { fg: '#6c71c4' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2aa198' attr: 'b' } + shape_int: { fg: '#6c71c4' attr: 'b' } + shape_internalcall: { fg: '#2aa198' attr: 'b' } + shape_list: { fg: '#2aa198' attr: 'b' } + shape_literal: '#268bd2' + shape_match_pattern: '#859900' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2aa198' + shape_operator: '#b58900' + shape_or: { fg: '#6c71c4' attr: 'b' } + shape_pipe: { fg: '#6c71c4' attr: 'b' } + shape_range: { fg: '#b58900' attr: 'b' } + shape_record: { fg: '#2aa198' attr: 'b' } + shape_redirection: { fg: '#6c71c4' attr: 'b' } + shape_signature: { fg: '#859900' attr: 'b' } + shape_string: '#859900' + shape_string_interpolation: { fg: '#2aa198' attr: 'b' } + shape_table: { fg: '#268bd2' attr: 'b' } + shape_variable: '#6c71c4' + + background: '#fdf6e3' + foreground: '#586e75' + cursor: '#586e75' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/source-code-x.nu b/themes/nu-themes/source-code-x.nu index 98fb143..02233d6 100644 --- a/themes/nu-themes/source-code-x.nu +++ b/themes/nu-themes/source-code-x.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#74b391" attr: "b" } - empty: "#9586f4" - bool: {|| if $in { "#83d2c0" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#79c8b6" - } else {{ fg: "#9586f4" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb695d" attr: "b" } - } else if $in < 6hr { - "#fb695d" - } else if $in < 1day { - "#fc8e3e" - } else if $in < 3day { - "#74b391" - } else if $in < 1wk { - { fg: "#74b391" attr: "b" } - } else if $in < 6wk { - "#79c8b6" - } else if $in < 52wk { - "#9586f4" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#74b391" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#fb695d" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fb5ea3" attr: "b" } - shape_binary: { fg: "#fb5ea3" attr: "b" } - shape_block: { fg: "#9586f4" attr: "b" } - shape_bool: "#83d2c0" - shape_custom: "#74b391" - shape_datetime: { fg: "#79c8b6" attr: "b" } - shape_directory: "#79c8b6" - shape_external: "#79c8b6" - shape_externalarg: { fg: "#74b391" attr: "b" } - shape_filepath: "#79c8b6" - shape_flag: { fg: "#9586f4" attr: "b" } - shape_float: { fg: "#fb5ea3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#79c8b6" attr: "b" } - shape_int: { fg: "#fb5ea3" attr: "b" } - shape_internalcall: { fg: "#79c8b6" attr: "b" } - shape_list: { fg: "#79c8b6" attr: "b" } - shape_literal: "#9586f4" - shape_match_pattern: "#74b391" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#83d2c0" - shape_operator: "#fc8e3e" - shape_or: { fg: "#fb5ea3" attr: "b" } - shape_pipe: { fg: "#fb5ea3" attr: "b" } - shape_range: { fg: "#fc8e3e" attr: "b" } - shape_record: { fg: "#79c8b6" attr: "b" } - shape_redirection: { fg: "#fb5ea3" attr: "b" } - shape_signature: { fg: "#74b391" attr: "b" } - shape_string: "#74b391" - shape_string_interpolation: { fg: "#79c8b6" attr: "b" } - shape_table: { fg: "#9586f4" attr: "b" } - shape_variable: "#fb5ea3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1f24" - foreground: "#000000" - cursor: "#7f7f7f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#74b391' attr: 'b' } + empty: '#9586f4' + bool: {|| if $in { '#83d2c0' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#79c8b6' + } else {{ fg: '#9586f4' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb695d' attr: 'b' } + } else if $in < 6hr { + '#fb695d' + } else if $in < 1day { + '#fc8e3e' + } else if $in < 3day { + '#74b391' + } else if $in < 1wk { + { fg: '#74b391' attr: 'b' } + } else if $in < 6wk { + '#79c8b6' + } else if $in < 52wk { + '#9586f4' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#74b391' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#fb695d' bg: '#bfbfbf' } + + shape_and: { fg: '#fb5ea3' attr: 'b' } + shape_binary: { fg: '#fb5ea3' attr: 'b' } + shape_block: { fg: '#9586f4' attr: 'b' } + shape_bool: '#83d2c0' + shape_custom: '#74b391' + shape_datetime: { fg: '#79c8b6' attr: 'b' } + shape_directory: '#79c8b6' + shape_external: '#79c8b6' + shape_externalarg: { fg: '#74b391' attr: 'b' } + shape_filepath: '#79c8b6' + shape_flag: { fg: '#9586f4' attr: 'b' } + shape_float: { fg: '#fb5ea3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#79c8b6' attr: 'b' } + shape_int: { fg: '#fb5ea3' attr: 'b' } + shape_internalcall: { fg: '#79c8b6' attr: 'b' } + shape_list: { fg: '#79c8b6' attr: 'b' } + shape_literal: '#9586f4' + shape_match_pattern: '#74b391' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#83d2c0' + shape_operator: '#fc8e3e' + shape_or: { fg: '#fb5ea3' attr: 'b' } + shape_pipe: { fg: '#fb5ea3' attr: 'b' } + shape_range: { fg: '#fc8e3e' attr: 'b' } + shape_record: { fg: '#79c8b6' attr: 'b' } + shape_redirection: { fg: '#fb5ea3' attr: 'b' } + shape_signature: { fg: '#74b391' attr: 'b' } + shape_string: '#74b391' + shape_string_interpolation: { fg: '#79c8b6' attr: 'b' } + shape_table: { fg: '#9586f4' attr: 'b' } + shape_variable: '#fb5ea3' + + background: '#1f1f24' + foreground: '#000000' + cursor: '#7f7f7f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sourcerer.nu b/themes/nu-themes/sourcerer.nu index 50cd11f..1d72f9f 100644 --- a/themes/nu-themes/sourcerer.nu +++ b/themes/nu-themes/sourcerer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d3d3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#719611" attr: "b" } - empty: "#6688aa" - bool: {|| if $in { "#87ceeb" } else { "light_gray" } } - int: "#d3d3d3" - filesize: {|e| - if $e == 0b { - "#d3d3d3" - } else if $e < 1mb { - "#528b8b" - } else {{ fg: "#6688aa" }} - } - duration: "#d3d3d3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#aa4450" attr: "b" } - } else if $in < 6hr { - "#aa4450" - } else if $in < 1day { - "#ff9800" - } else if $in < 3day { - "#719611" - } else if $in < 1wk { - { fg: "#719611" attr: "b" } - } else if $in < 6wk { - "#528b8b" - } else if $in < 52wk { - "#6688aa" - } else { "dark_gray" } - } - range: "#d3d3d3" - float: "#d3d3d3" - string: "#d3d3d3" - nothing: "#d3d3d3" - binary: "#d3d3d3" - cellpath: "#d3d3d3" - row_index: { fg: "#719611" attr: "b" } - record: "#d3d3d3" - list: "#d3d3d3" - block: "#d3d3d3" - hints: "dark_gray" - search_result: { fg: "#aa4450" bg: "#d3d3d3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f6f8f" attr: "b" } - shape_binary: { fg: "#8f6f8f" attr: "b" } - shape_block: { fg: "#6688aa" attr: "b" } - shape_bool: "#87ceeb" - shape_custom: "#719611" - shape_datetime: { fg: "#528b8b" attr: "b" } - shape_directory: "#528b8b" - shape_external: "#528b8b" - shape_externalarg: { fg: "#719611" attr: "b" } - shape_filepath: "#528b8b" - shape_flag: { fg: "#6688aa" attr: "b" } - shape_float: { fg: "#8f6f8f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#528b8b" attr: "b" } - shape_int: { fg: "#8f6f8f" attr: "b" } - shape_internalcall: { fg: "#528b8b" attr: "b" } - shape_list: { fg: "#528b8b" attr: "b" } - shape_literal: "#6688aa" - shape_match_pattern: "#719611" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#87ceeb" - shape_operator: "#ff9800" - shape_or: { fg: "#8f6f8f" attr: "b" } - shape_pipe: { fg: "#8f6f8f" attr: "b" } - shape_range: { fg: "#ff9800" attr: "b" } - shape_record: { fg: "#528b8b" attr: "b" } - shape_redirection: { fg: "#8f6f8f" attr: "b" } - shape_signature: { fg: "#719611" attr: "b" } - shape_string: "#719611" - shape_string_interpolation: { fg: "#528b8b" attr: "b" } - shape_table: { fg: "#6688aa" attr: "b" } - shape_variable: "#8f6f8f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#c2c2b0" - cursor: "#c2c2b0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d3d3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#719611' attr: 'b' } + empty: '#6688aa' + bool: {|| if $in { '#87ceeb' } else { 'light_gray' } } + int: '#d3d3d3' + filesize: {|e| + if $e == 0b { + '#d3d3d3' + } else if $e < 1mb { + '#528b8b' + } else {{ fg: '#6688aa' }} + } + duration: '#d3d3d3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#aa4450' attr: 'b' } + } else if $in < 6hr { + '#aa4450' + } else if $in < 1day { + '#ff9800' + } else if $in < 3day { + '#719611' + } else if $in < 1wk { + { fg: '#719611' attr: 'b' } + } else if $in < 6wk { + '#528b8b' + } else if $in < 52wk { + '#6688aa' + } else { 'dark_gray' } + } + range: '#d3d3d3' + float: '#d3d3d3' + string: '#d3d3d3' + nothing: '#d3d3d3' + binary: '#d3d3d3' + cellpath: '#d3d3d3' + row_index: { fg: '#719611' attr: 'b' } + record: '#d3d3d3' + list: '#d3d3d3' + block: '#d3d3d3' + hints: 'dark_gray' + search_result: { fg: '#aa4450' bg: '#d3d3d3' } + + shape_and: { fg: '#8f6f8f' attr: 'b' } + shape_binary: { fg: '#8f6f8f' attr: 'b' } + shape_block: { fg: '#6688aa' attr: 'b' } + shape_bool: '#87ceeb' + shape_custom: '#719611' + shape_datetime: { fg: '#528b8b' attr: 'b' } + shape_directory: '#528b8b' + shape_external: '#528b8b' + shape_externalarg: { fg: '#719611' attr: 'b' } + shape_filepath: '#528b8b' + shape_flag: { fg: '#6688aa' attr: 'b' } + shape_float: { fg: '#8f6f8f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#528b8b' attr: 'b' } + shape_int: { fg: '#8f6f8f' attr: 'b' } + shape_internalcall: { fg: '#528b8b' attr: 'b' } + shape_list: { fg: '#528b8b' attr: 'b' } + shape_literal: '#6688aa' + shape_match_pattern: '#719611' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#87ceeb' + shape_operator: '#ff9800' + shape_or: { fg: '#8f6f8f' attr: 'b' } + shape_pipe: { fg: '#8f6f8f' attr: 'b' } + shape_range: { fg: '#ff9800' attr: 'b' } + shape_record: { fg: '#528b8b' attr: 'b' } + shape_redirection: { fg: '#8f6f8f' attr: 'b' } + shape_signature: { fg: '#719611' attr: 'b' } + shape_string: '#719611' + shape_string_interpolation: { fg: '#528b8b' attr: 'b' } + shape_table: { fg: '#6688aa' attr: 'b' } + shape_variable: '#8f6f8f' + + background: '#222222' + foreground: '#c2c2b0' + cursor: '#c2c2b0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sourcerer2.nu b/themes/nu-themes/sourcerer2.nu index 50cd11f..1d72f9f 100644 --- a/themes/nu-themes/sourcerer2.nu +++ b/themes/nu-themes/sourcerer2.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d3d3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#719611" attr: "b" } - empty: "#6688aa" - bool: {|| if $in { "#87ceeb" } else { "light_gray" } } - int: "#d3d3d3" - filesize: {|e| - if $e == 0b { - "#d3d3d3" - } else if $e < 1mb { - "#528b8b" - } else {{ fg: "#6688aa" }} - } - duration: "#d3d3d3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#aa4450" attr: "b" } - } else if $in < 6hr { - "#aa4450" - } else if $in < 1day { - "#ff9800" - } else if $in < 3day { - "#719611" - } else if $in < 1wk { - { fg: "#719611" attr: "b" } - } else if $in < 6wk { - "#528b8b" - } else if $in < 52wk { - "#6688aa" - } else { "dark_gray" } - } - range: "#d3d3d3" - float: "#d3d3d3" - string: "#d3d3d3" - nothing: "#d3d3d3" - binary: "#d3d3d3" - cellpath: "#d3d3d3" - row_index: { fg: "#719611" attr: "b" } - record: "#d3d3d3" - list: "#d3d3d3" - block: "#d3d3d3" - hints: "dark_gray" - search_result: { fg: "#aa4450" bg: "#d3d3d3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8f6f8f" attr: "b" } - shape_binary: { fg: "#8f6f8f" attr: "b" } - shape_block: { fg: "#6688aa" attr: "b" } - shape_bool: "#87ceeb" - shape_custom: "#719611" - shape_datetime: { fg: "#528b8b" attr: "b" } - shape_directory: "#528b8b" - shape_external: "#528b8b" - shape_externalarg: { fg: "#719611" attr: "b" } - shape_filepath: "#528b8b" - shape_flag: { fg: "#6688aa" attr: "b" } - shape_float: { fg: "#8f6f8f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#528b8b" attr: "b" } - shape_int: { fg: "#8f6f8f" attr: "b" } - shape_internalcall: { fg: "#528b8b" attr: "b" } - shape_list: { fg: "#528b8b" attr: "b" } - shape_literal: "#6688aa" - shape_match_pattern: "#719611" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#87ceeb" - shape_operator: "#ff9800" - shape_or: { fg: "#8f6f8f" attr: "b" } - shape_pipe: { fg: "#8f6f8f" attr: "b" } - shape_range: { fg: "#ff9800" attr: "b" } - shape_record: { fg: "#528b8b" attr: "b" } - shape_redirection: { fg: "#8f6f8f" attr: "b" } - shape_signature: { fg: "#719611" attr: "b" } - shape_string: "#719611" - shape_string_interpolation: { fg: "#528b8b" attr: "b" } - shape_table: { fg: "#6688aa" attr: "b" } - shape_variable: "#8f6f8f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#c2c2b0" - cursor: "#c2c2b0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d3d3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#719611' attr: 'b' } + empty: '#6688aa' + bool: {|| if $in { '#87ceeb' } else { 'light_gray' } } + int: '#d3d3d3' + filesize: {|e| + if $e == 0b { + '#d3d3d3' + } else if $e < 1mb { + '#528b8b' + } else {{ fg: '#6688aa' }} + } + duration: '#d3d3d3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#aa4450' attr: 'b' } + } else if $in < 6hr { + '#aa4450' + } else if $in < 1day { + '#ff9800' + } else if $in < 3day { + '#719611' + } else if $in < 1wk { + { fg: '#719611' attr: 'b' } + } else if $in < 6wk { + '#528b8b' + } else if $in < 52wk { + '#6688aa' + } else { 'dark_gray' } + } + range: '#d3d3d3' + float: '#d3d3d3' + string: '#d3d3d3' + nothing: '#d3d3d3' + binary: '#d3d3d3' + cellpath: '#d3d3d3' + row_index: { fg: '#719611' attr: 'b' } + record: '#d3d3d3' + list: '#d3d3d3' + block: '#d3d3d3' + hints: 'dark_gray' + search_result: { fg: '#aa4450' bg: '#d3d3d3' } + + shape_and: { fg: '#8f6f8f' attr: 'b' } + shape_binary: { fg: '#8f6f8f' attr: 'b' } + shape_block: { fg: '#6688aa' attr: 'b' } + shape_bool: '#87ceeb' + shape_custom: '#719611' + shape_datetime: { fg: '#528b8b' attr: 'b' } + shape_directory: '#528b8b' + shape_external: '#528b8b' + shape_externalarg: { fg: '#719611' attr: 'b' } + shape_filepath: '#528b8b' + shape_flag: { fg: '#6688aa' attr: 'b' } + shape_float: { fg: '#8f6f8f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#528b8b' attr: 'b' } + shape_int: { fg: '#8f6f8f' attr: 'b' } + shape_internalcall: { fg: '#528b8b' attr: 'b' } + shape_list: { fg: '#528b8b' attr: 'b' } + shape_literal: '#6688aa' + shape_match_pattern: '#719611' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#87ceeb' + shape_operator: '#ff9800' + shape_or: { fg: '#8f6f8f' attr: 'b' } + shape_pipe: { fg: '#8f6f8f' attr: 'b' } + shape_range: { fg: '#ff9800' attr: 'b' } + shape_record: { fg: '#528b8b' attr: 'b' } + shape_redirection: { fg: '#8f6f8f' attr: 'b' } + shape_signature: { fg: '#719611' attr: 'b' } + shape_string: '#719611' + shape_string_interpolation: { fg: '#528b8b' attr: 'b' } + shape_table: { fg: '#6688aa' attr: 'b' } + shape_variable: '#8f6f8f' + + background: '#222222' + foreground: '#c2c2b0' + cursor: '#c2c2b0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spaceduck.nu b/themes/nu-themes/spaceduck.nu index 453a0dd..b94e87d 100644 --- a/themes/nu-themes/spaceduck.nu +++ b/themes/nu-themes/spaceduck.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#686f9a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5ccc96" attr: "b" } - empty: "#00a3cc" - bool: {|| if $in { "#7a5ccc" } else { "light_gray" } } - int: "#686f9a" - filesize: {|e| - if $e == 0b { - "#686f9a" - } else if $e < 1mb { - "#7a5ccc" - } else {{ fg: "#00a3cc" }} - } - duration: "#686f9a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e33400" attr: "b" } - } else if $in < 6hr { - "#e33400" - } else if $in < 1day { - "#b3a1e6" - } else if $in < 3day { - "#5ccc96" - } else if $in < 1wk { - { fg: "#5ccc96" attr: "b" } - } else if $in < 6wk { - "#7a5ccc" - } else if $in < 52wk { - "#00a3cc" - } else { "dark_gray" } - } - range: "#686f9a" - float: "#686f9a" - string: "#686f9a" - nothing: "#686f9a" - binary: "#686f9a" - cellpath: "#686f9a" - row_index: { fg: "#5ccc96" attr: "b" } - record: "#686f9a" - list: "#686f9a" - block: "#686f9a" - hints: "dark_gray" - search_result: { fg: "#e33400" bg: "#686f9a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f2ce00" attr: "b" } - shape_binary: { fg: "#f2ce00" attr: "b" } - shape_block: { fg: "#00a3cc" attr: "b" } - shape_bool: "#7a5ccc" - shape_custom: "#5ccc96" - shape_datetime: { fg: "#7a5ccc" attr: "b" } - shape_directory: "#7a5ccc" - shape_external: "#7a5ccc" - shape_externalarg: { fg: "#5ccc96" attr: "b" } - shape_filepath: "#7a5ccc" - shape_flag: { fg: "#00a3cc" attr: "b" } - shape_float: { fg: "#f2ce00" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7a5ccc" attr: "b" } - shape_int: { fg: "#f2ce00" attr: "b" } - shape_internalcall: { fg: "#7a5ccc" attr: "b" } - shape_list: { fg: "#7a5ccc" attr: "b" } - shape_literal: "#00a3cc" - shape_match_pattern: "#5ccc96" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7a5ccc" - shape_operator: "#b3a1e6" - shape_or: { fg: "#f2ce00" attr: "b" } - shape_pipe: { fg: "#f2ce00" attr: "b" } - shape_range: { fg: "#b3a1e6" attr: "b" } - shape_record: { fg: "#7a5ccc" attr: "b" } - shape_redirection: { fg: "#f2ce00" attr: "b" } - shape_signature: { fg: "#5ccc96" attr: "b" } - shape_string: "#5ccc96" - shape_string_interpolation: { fg: "#7a5ccc" attr: "b" } - shape_table: { fg: "#00a3cc" attr: "b" } - shape_variable: "#f2ce00" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0f111b" - foreground: "#ecf0c1" - cursor: "#ecf0c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#686f9a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5ccc96' attr: 'b' } + empty: '#00a3cc' + bool: {|| if $in { '#7a5ccc' } else { 'light_gray' } } + int: '#686f9a' + filesize: {|e| + if $e == 0b { + '#686f9a' + } else if $e < 1mb { + '#7a5ccc' + } else {{ fg: '#00a3cc' }} + } + duration: '#686f9a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e33400' attr: 'b' } + } else if $in < 6hr { + '#e33400' + } else if $in < 1day { + '#b3a1e6' + } else if $in < 3day { + '#5ccc96' + } else if $in < 1wk { + { fg: '#5ccc96' attr: 'b' } + } else if $in < 6wk { + '#7a5ccc' + } else if $in < 52wk { + '#00a3cc' + } else { 'dark_gray' } + } + range: '#686f9a' + float: '#686f9a' + string: '#686f9a' + nothing: '#686f9a' + binary: '#686f9a' + cellpath: '#686f9a' + row_index: { fg: '#5ccc96' attr: 'b' } + record: '#686f9a' + list: '#686f9a' + block: '#686f9a' + hints: 'dark_gray' + search_result: { fg: '#e33400' bg: '#686f9a' } + + shape_and: { fg: '#f2ce00' attr: 'b' } + shape_binary: { fg: '#f2ce00' attr: 'b' } + shape_block: { fg: '#00a3cc' attr: 'b' } + shape_bool: '#7a5ccc' + shape_custom: '#5ccc96' + shape_datetime: { fg: '#7a5ccc' attr: 'b' } + shape_directory: '#7a5ccc' + shape_external: '#7a5ccc' + shape_externalarg: { fg: '#5ccc96' attr: 'b' } + shape_filepath: '#7a5ccc' + shape_flag: { fg: '#00a3cc' attr: 'b' } + shape_float: { fg: '#f2ce00' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7a5ccc' attr: 'b' } + shape_int: { fg: '#f2ce00' attr: 'b' } + shape_internalcall: { fg: '#7a5ccc' attr: 'b' } + shape_list: { fg: '#7a5ccc' attr: 'b' } + shape_literal: '#00a3cc' + shape_match_pattern: '#5ccc96' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7a5ccc' + shape_operator: '#b3a1e6' + shape_or: { fg: '#f2ce00' attr: 'b' } + shape_pipe: { fg: '#f2ce00' attr: 'b' } + shape_range: { fg: '#b3a1e6' attr: 'b' } + shape_record: { fg: '#7a5ccc' attr: 'b' } + shape_redirection: { fg: '#f2ce00' attr: 'b' } + shape_signature: { fg: '#5ccc96' attr: 'b' } + shape_string: '#5ccc96' + shape_string_interpolation: { fg: '#7a5ccc' attr: 'b' } + shape_table: { fg: '#00a3cc' attr: 'b' } + shape_variable: '#f2ce00' + + background: '#0f111b' + foreground: '#ecf0c1' + cursor: '#ecf0c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spacedust.nu b/themes/nu-themes/spacedust.nu index 2466f14..c395445 100644 --- a/themes/nu-themes/spacedust.nu +++ b/themes/nu-themes/spacedust.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f0f1ce" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5cab96" attr: "b" } - empty: "#0f548b" - bool: {|| if $in { "#83a7b4" } else { "light_gray" } } - int: "#f0f1ce" - filesize: {|e| - if $e == 0b { - "#f0f1ce" - } else if $e < 1mb { - "#06afc7" - } else {{ fg: "#0f548b" }} - } - duration: "#f0f1ce" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e35b00" attr: "b" } - } else if $in < 6hr { - "#e35b00" - } else if $in < 1day { - "#e3cd7b" - } else if $in < 3day { - "#5cab96" - } else if $in < 1wk { - { fg: "#5cab96" attr: "b" } - } else if $in < 6wk { - "#06afc7" - } else if $in < 52wk { - "#0f548b" - } else { "dark_gray" } - } - range: "#f0f1ce" - float: "#f0f1ce" - string: "#f0f1ce" - nothing: "#f0f1ce" - binary: "#f0f1ce" - cellpath: "#f0f1ce" - row_index: { fg: "#5cab96" attr: "b" } - record: "#f0f1ce" - list: "#f0f1ce" - block: "#f0f1ce" - hints: "dark_gray" - search_result: { fg: "#e35b00" bg: "#f0f1ce" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e35b00" attr: "b" } - shape_binary: { fg: "#e35b00" attr: "b" } - shape_block: { fg: "#0f548b" attr: "b" } - shape_bool: "#83a7b4" - shape_custom: "#5cab96" - shape_datetime: { fg: "#06afc7" attr: "b" } - shape_directory: "#06afc7" - shape_external: "#06afc7" - shape_externalarg: { fg: "#5cab96" attr: "b" } - shape_filepath: "#06afc7" - shape_flag: { fg: "#0f548b" attr: "b" } - shape_float: { fg: "#e35b00" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#06afc7" attr: "b" } - shape_int: { fg: "#e35b00" attr: "b" } - shape_internalcall: { fg: "#06afc7" attr: "b" } - shape_list: { fg: "#06afc7" attr: "b" } - shape_literal: "#0f548b" - shape_match_pattern: "#5cab96" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#83a7b4" - shape_operator: "#e3cd7b" - shape_or: { fg: "#e35b00" attr: "b" } - shape_pipe: { fg: "#e35b00" attr: "b" } - shape_range: { fg: "#e3cd7b" attr: "b" } - shape_record: { fg: "#06afc7" attr: "b" } - shape_redirection: { fg: "#e35b00" attr: "b" } - shape_signature: { fg: "#5cab96" attr: "b" } - shape_string: "#5cab96" - shape_string_interpolation: { fg: "#06afc7" attr: "b" } - shape_table: { fg: "#0f548b" attr: "b" } - shape_variable: "#e35b00" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0a1e24" - foreground: "#ecf0c1" - cursor: "#ecf0c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f0f1ce' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5cab96' attr: 'b' } + empty: '#0f548b' + bool: {|| if $in { '#83a7b4' } else { 'light_gray' } } + int: '#f0f1ce' + filesize: {|e| + if $e == 0b { + '#f0f1ce' + } else if $e < 1mb { + '#06afc7' + } else {{ fg: '#0f548b' }} + } + duration: '#f0f1ce' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e35b00' attr: 'b' } + } else if $in < 6hr { + '#e35b00' + } else if $in < 1day { + '#e3cd7b' + } else if $in < 3day { + '#5cab96' + } else if $in < 1wk { + { fg: '#5cab96' attr: 'b' } + } else if $in < 6wk { + '#06afc7' + } else if $in < 52wk { + '#0f548b' + } else { 'dark_gray' } + } + range: '#f0f1ce' + float: '#f0f1ce' + string: '#f0f1ce' + nothing: '#f0f1ce' + binary: '#f0f1ce' + cellpath: '#f0f1ce' + row_index: { fg: '#5cab96' attr: 'b' } + record: '#f0f1ce' + list: '#f0f1ce' + block: '#f0f1ce' + hints: 'dark_gray' + search_result: { fg: '#e35b00' bg: '#f0f1ce' } + + shape_and: { fg: '#e35b00' attr: 'b' } + shape_binary: { fg: '#e35b00' attr: 'b' } + shape_block: { fg: '#0f548b' attr: 'b' } + shape_bool: '#83a7b4' + shape_custom: '#5cab96' + shape_datetime: { fg: '#06afc7' attr: 'b' } + shape_directory: '#06afc7' + shape_external: '#06afc7' + shape_externalarg: { fg: '#5cab96' attr: 'b' } + shape_filepath: '#06afc7' + shape_flag: { fg: '#0f548b' attr: 'b' } + shape_float: { fg: '#e35b00' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#06afc7' attr: 'b' } + shape_int: { fg: '#e35b00' attr: 'b' } + shape_internalcall: { fg: '#06afc7' attr: 'b' } + shape_list: { fg: '#06afc7' attr: 'b' } + shape_literal: '#0f548b' + shape_match_pattern: '#5cab96' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#83a7b4' + shape_operator: '#e3cd7b' + shape_or: { fg: '#e35b00' attr: 'b' } + shape_pipe: { fg: '#e35b00' attr: 'b' } + shape_range: { fg: '#e3cd7b' attr: 'b' } + shape_record: { fg: '#06afc7' attr: 'b' } + shape_redirection: { fg: '#e35b00' attr: 'b' } + shape_signature: { fg: '#5cab96' attr: 'b' } + shape_string: '#5cab96' + shape_string_interpolation: { fg: '#06afc7' attr: 'b' } + shape_table: { fg: '#0f548b' attr: 'b' } + shape_variable: '#e35b00' + + background: '#0a1e24' + foreground: '#ecf0c1' + cursor: '#ecf0c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spacegray-eighties-dull.nu b/themes/nu-themes/spacegray-eighties-dull.nu index 5a26a61..33b9c5f 100644 --- a/themes/nu-themes/spacegray-eighties-dull.nu +++ b/themes/nu-themes/spacegray-eighties-dull.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b3b8c3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#92b477" attr: "b" } - empty: "#7c8fa5" - bool: {|| if $in { "#58c2c1" } else { "light_gray" } } - int: "#b3b8c3" - filesize: {|e| - if $e == 0b { - "#b3b8c3" - } else if $e < 1mb { - "#80cdcb" - } else {{ fg: "#7c8fa5" }} - } - duration: "#b3b8c3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b24a56" attr: "b" } - } else if $in < 6hr { - "#b24a56" - } else if $in < 1day { - "#c6735a" - } else if $in < 3day { - "#92b477" - } else if $in < 1wk { - { fg: "#92b477" attr: "b" } - } else if $in < 6wk { - "#80cdcb" - } else if $in < 52wk { - "#7c8fa5" - } else { "dark_gray" } - } - range: "#b3b8c3" - float: "#b3b8c3" - string: "#b3b8c3" - nothing: "#b3b8c3" - binary: "#b3b8c3" - cellpath: "#b3b8c3" - row_index: { fg: "#92b477" attr: "b" } - record: "#b3b8c3" - list: "#b3b8c3" - block: "#b3b8c3" - hints: "dark_gray" - search_result: { fg: "#b24a56" bg: "#b3b8c3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a5789e" attr: "b" } - shape_binary: { fg: "#a5789e" attr: "b" } - shape_block: { fg: "#7c8fa5" attr: "b" } - shape_bool: "#58c2c1" - shape_custom: "#92b477" - shape_datetime: { fg: "#80cdcb" attr: "b" } - shape_directory: "#80cdcb" - shape_external: "#80cdcb" - shape_externalarg: { fg: "#92b477" attr: "b" } - shape_filepath: "#80cdcb" - shape_flag: { fg: "#7c8fa5" attr: "b" } - shape_float: { fg: "#a5789e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#80cdcb" attr: "b" } - shape_int: { fg: "#a5789e" attr: "b" } - shape_internalcall: { fg: "#80cdcb" attr: "b" } - shape_list: { fg: "#80cdcb" attr: "b" } - shape_literal: "#7c8fa5" - shape_match_pattern: "#92b477" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#58c2c1" - shape_operator: "#c6735a" - shape_or: { fg: "#a5789e" attr: "b" } - shape_pipe: { fg: "#a5789e" attr: "b" } - shape_range: { fg: "#c6735a" attr: "b" } - shape_record: { fg: "#80cdcb" attr: "b" } - shape_redirection: { fg: "#a5789e" attr: "b" } - shape_signature: { fg: "#92b477" attr: "b" } - shape_string: "#92b477" - shape_string_interpolation: { fg: "#80cdcb" attr: "b" } - shape_table: { fg: "#7c8fa5" attr: "b" } - shape_variable: "#a5789e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#c9c6bc" - cursor: "#c9c6bc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b3b8c3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#92b477' attr: 'b' } + empty: '#7c8fa5' + bool: {|| if $in { '#58c2c1' } else { 'light_gray' } } + int: '#b3b8c3' + filesize: {|e| + if $e == 0b { + '#b3b8c3' + } else if $e < 1mb { + '#80cdcb' + } else {{ fg: '#7c8fa5' }} + } + duration: '#b3b8c3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b24a56' attr: 'b' } + } else if $in < 6hr { + '#b24a56' + } else if $in < 1day { + '#c6735a' + } else if $in < 3day { + '#92b477' + } else if $in < 1wk { + { fg: '#92b477' attr: 'b' } + } else if $in < 6wk { + '#80cdcb' + } else if $in < 52wk { + '#7c8fa5' + } else { 'dark_gray' } + } + range: '#b3b8c3' + float: '#b3b8c3' + string: '#b3b8c3' + nothing: '#b3b8c3' + binary: '#b3b8c3' + cellpath: '#b3b8c3' + row_index: { fg: '#92b477' attr: 'b' } + record: '#b3b8c3' + list: '#b3b8c3' + block: '#b3b8c3' + hints: 'dark_gray' + search_result: { fg: '#b24a56' bg: '#b3b8c3' } + + shape_and: { fg: '#a5789e' attr: 'b' } + shape_binary: { fg: '#a5789e' attr: 'b' } + shape_block: { fg: '#7c8fa5' attr: 'b' } + shape_bool: '#58c2c1' + shape_custom: '#92b477' + shape_datetime: { fg: '#80cdcb' attr: 'b' } + shape_directory: '#80cdcb' + shape_external: '#80cdcb' + shape_externalarg: { fg: '#92b477' attr: 'b' } + shape_filepath: '#80cdcb' + shape_flag: { fg: '#7c8fa5' attr: 'b' } + shape_float: { fg: '#a5789e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#80cdcb' attr: 'b' } + shape_int: { fg: '#a5789e' attr: 'b' } + shape_internalcall: { fg: '#80cdcb' attr: 'b' } + shape_list: { fg: '#80cdcb' attr: 'b' } + shape_literal: '#7c8fa5' + shape_match_pattern: '#92b477' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#58c2c1' + shape_operator: '#c6735a' + shape_or: { fg: '#a5789e' attr: 'b' } + shape_pipe: { fg: '#a5789e' attr: 'b' } + shape_range: { fg: '#c6735a' attr: 'b' } + shape_record: { fg: '#80cdcb' attr: 'b' } + shape_redirection: { fg: '#a5789e' attr: 'b' } + shape_signature: { fg: '#92b477' attr: 'b' } + shape_string: '#92b477' + shape_string_interpolation: { fg: '#80cdcb' attr: 'b' } + shape_table: { fg: '#7c8fa5' attr: 'b' } + shape_variable: '#a5789e' + + background: '#222222' + foreground: '#c9c6bc' + cursor: '#c9c6bc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spacegray-eighties.nu b/themes/nu-themes/spacegray-eighties.nu index b744122..7387c0e 100644 --- a/themes/nu-themes/spacegray-eighties.nu +++ b/themes/nu-themes/spacegray-eighties.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#efece7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#81a764" attr: "b" } - empty: "#5486c0" - bool: {|| if $in { "#83e9e4" } else { "light_gray" } } - int: "#efece7" - filesize: {|e| - if $e == 0b { - "#efece7" - } else if $e < 1mb { - "#57c2c1" - } else {{ fg: "#5486c0" }} - } - duration: "#efece7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ec5f67" attr: "b" } - } else if $in < 6hr { - "#ec5f67" - } else if $in < 1day { - "#fec254" - } else if $in < 3day { - "#81a764" - } else if $in < 1wk { - { fg: "#81a764" attr: "b" } - } else if $in < 6wk { - "#57c2c1" - } else if $in < 52wk { - "#5486c0" - } else { "dark_gray" } - } - range: "#efece7" - float: "#efece7" - string: "#efece7" - nothing: "#efece7" - binary: "#efece7" - cellpath: "#efece7" - row_index: { fg: "#81a764" attr: "b" } - record: "#efece7" - list: "#efece7" - block: "#efece7" - hints: "dark_gray" - search_result: { fg: "#ec5f67" bg: "#efece7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bf83c1" attr: "b" } - shape_binary: { fg: "#bf83c1" attr: "b" } - shape_block: { fg: "#5486c0" attr: "b" } - shape_bool: "#83e9e4" - shape_custom: "#81a764" - shape_datetime: { fg: "#57c2c1" attr: "b" } - shape_directory: "#57c2c1" - shape_external: "#57c2c1" - shape_externalarg: { fg: "#81a764" attr: "b" } - shape_filepath: "#57c2c1" - shape_flag: { fg: "#5486c0" attr: "b" } - shape_float: { fg: "#bf83c1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#57c2c1" attr: "b" } - shape_int: { fg: "#bf83c1" attr: "b" } - shape_internalcall: { fg: "#57c2c1" attr: "b" } - shape_list: { fg: "#57c2c1" attr: "b" } - shape_literal: "#5486c0" - shape_match_pattern: "#81a764" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#83e9e4" - shape_operator: "#fec254" - shape_or: { fg: "#bf83c1" attr: "b" } - shape_pipe: { fg: "#bf83c1" attr: "b" } - shape_range: { fg: "#fec254" attr: "b" } - shape_record: { fg: "#57c2c1" attr: "b" } - shape_redirection: { fg: "#bf83c1" attr: "b" } - shape_signature: { fg: "#81a764" attr: "b" } - shape_string: "#81a764" - shape_string_interpolation: { fg: "#57c2c1" attr: "b" } - shape_table: { fg: "#5486c0" attr: "b" } - shape_variable: "#bf83c1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#222222" - foreground: "#bdbaae" - cursor: "#bdbaae" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#efece7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#81a764' attr: 'b' } + empty: '#5486c0' + bool: {|| if $in { '#83e9e4' } else { 'light_gray' } } + int: '#efece7' + filesize: {|e| + if $e == 0b { + '#efece7' + } else if $e < 1mb { + '#57c2c1' + } else {{ fg: '#5486c0' }} + } + duration: '#efece7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ec5f67' attr: 'b' } + } else if $in < 6hr { + '#ec5f67' + } else if $in < 1day { + '#fec254' + } else if $in < 3day { + '#81a764' + } else if $in < 1wk { + { fg: '#81a764' attr: 'b' } + } else if $in < 6wk { + '#57c2c1' + } else if $in < 52wk { + '#5486c0' + } else { 'dark_gray' } + } + range: '#efece7' + float: '#efece7' + string: '#efece7' + nothing: '#efece7' + binary: '#efece7' + cellpath: '#efece7' + row_index: { fg: '#81a764' attr: 'b' } + record: '#efece7' + list: '#efece7' + block: '#efece7' + hints: 'dark_gray' + search_result: { fg: '#ec5f67' bg: '#efece7' } + + shape_and: { fg: '#bf83c1' attr: 'b' } + shape_binary: { fg: '#bf83c1' attr: 'b' } + shape_block: { fg: '#5486c0' attr: 'b' } + shape_bool: '#83e9e4' + shape_custom: '#81a764' + shape_datetime: { fg: '#57c2c1' attr: 'b' } + shape_directory: '#57c2c1' + shape_external: '#57c2c1' + shape_externalarg: { fg: '#81a764' attr: 'b' } + shape_filepath: '#57c2c1' + shape_flag: { fg: '#5486c0' attr: 'b' } + shape_float: { fg: '#bf83c1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#57c2c1' attr: 'b' } + shape_int: { fg: '#bf83c1' attr: 'b' } + shape_internalcall: { fg: '#57c2c1' attr: 'b' } + shape_list: { fg: '#57c2c1' attr: 'b' } + shape_literal: '#5486c0' + shape_match_pattern: '#81a764' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#83e9e4' + shape_operator: '#fec254' + shape_or: { fg: '#bf83c1' attr: 'b' } + shape_pipe: { fg: '#bf83c1' attr: 'b' } + shape_range: { fg: '#fec254' attr: 'b' } + shape_record: { fg: '#57c2c1' attr: 'b' } + shape_redirection: { fg: '#bf83c1' attr: 'b' } + shape_signature: { fg: '#81a764' attr: 'b' } + shape_string: '#81a764' + shape_string_interpolation: { fg: '#57c2c1' attr: 'b' } + shape_table: { fg: '#5486c0' attr: 'b' } + shape_variable: '#bf83c1' + + background: '#222222' + foreground: '#bdbaae' + cursor: '#bdbaae' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spacegray.nu b/themes/nu-themes/spacegray.nu index 4866203..ccca0dc 100644 --- a/themes/nu-themes/spacegray.nu +++ b/themes/nu-themes/spacegray.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b3b8c3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#87b379" attr: "b" } - empty: "#7d8fa4" - bool: {|| if $in { "#85a7a5" } else { "light_gray" } } - int: "#b3b8c3" - filesize: {|e| - if $e == 0b { - "#b3b8c3" - } else if $e < 1mb { - "#85a7a5" - } else {{ fg: "#7d8fa4" }} - } - duration: "#b3b8c3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b04b57" attr: "b" } - } else if $in < 6hr { - "#b04b57" - } else if $in < 1day { - "#e5c179" - } else if $in < 3day { - "#87b379" - } else if $in < 1wk { - { fg: "#87b379" attr: "b" } - } else if $in < 6wk { - "#85a7a5" - } else if $in < 52wk { - "#7d8fa4" - } else { "dark_gray" } - } - range: "#b3b8c3" - float: "#b3b8c3" - string: "#b3b8c3" - nothing: "#b3b8c3" - binary: "#b3b8c3" - cellpath: "#b3b8c3" - row_index: { fg: "#87b379" attr: "b" } - record: "#b3b8c3" - list: "#b3b8c3" - block: "#b3b8c3" - hints: "dark_gray" - search_result: { fg: "#b04b57" bg: "#b3b8c3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a47996" attr: "b" } - shape_binary: { fg: "#a47996" attr: "b" } - shape_block: { fg: "#7d8fa4" attr: "b" } - shape_bool: "#85a7a5" - shape_custom: "#87b379" - shape_datetime: { fg: "#85a7a5" attr: "b" } - shape_directory: "#85a7a5" - shape_external: "#85a7a5" - shape_externalarg: { fg: "#87b379" attr: "b" } - shape_filepath: "#85a7a5" - shape_flag: { fg: "#7d8fa4" attr: "b" } - shape_float: { fg: "#a47996" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#85a7a5" attr: "b" } - shape_int: { fg: "#a47996" attr: "b" } - shape_internalcall: { fg: "#85a7a5" attr: "b" } - shape_list: { fg: "#85a7a5" attr: "b" } - shape_literal: "#7d8fa4" - shape_match_pattern: "#87b379" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#85a7a5" - shape_operator: "#e5c179" - shape_or: { fg: "#a47996" attr: "b" } - shape_pipe: { fg: "#a47996" attr: "b" } - shape_range: { fg: "#e5c179" attr: "b" } - shape_record: { fg: "#85a7a5" attr: "b" } - shape_redirection: { fg: "#a47996" attr: "b" } - shape_signature: { fg: "#87b379" attr: "b" } - shape_string: "#87b379" - shape_string_interpolation: { fg: "#85a7a5" attr: "b" } - shape_table: { fg: "#7d8fa4" attr: "b" } - shape_variable: "#a47996" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#20242d" - foreground: "#b3b8c3" - cursor: "#b3b8c3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b3b8c3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#87b379' attr: 'b' } + empty: '#7d8fa4' + bool: {|| if $in { '#85a7a5' } else { 'light_gray' } } + int: '#b3b8c3' + filesize: {|e| + if $e == 0b { + '#b3b8c3' + } else if $e < 1mb { + '#85a7a5' + } else {{ fg: '#7d8fa4' }} + } + duration: '#b3b8c3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b04b57' attr: 'b' } + } else if $in < 6hr { + '#b04b57' + } else if $in < 1day { + '#e5c179' + } else if $in < 3day { + '#87b379' + } else if $in < 1wk { + { fg: '#87b379' attr: 'b' } + } else if $in < 6wk { + '#85a7a5' + } else if $in < 52wk { + '#7d8fa4' + } else { 'dark_gray' } + } + range: '#b3b8c3' + float: '#b3b8c3' + string: '#b3b8c3' + nothing: '#b3b8c3' + binary: '#b3b8c3' + cellpath: '#b3b8c3' + row_index: { fg: '#87b379' attr: 'b' } + record: '#b3b8c3' + list: '#b3b8c3' + block: '#b3b8c3' + hints: 'dark_gray' + search_result: { fg: '#b04b57' bg: '#b3b8c3' } + + shape_and: { fg: '#a47996' attr: 'b' } + shape_binary: { fg: '#a47996' attr: 'b' } + shape_block: { fg: '#7d8fa4' attr: 'b' } + shape_bool: '#85a7a5' + shape_custom: '#87b379' + shape_datetime: { fg: '#85a7a5' attr: 'b' } + shape_directory: '#85a7a5' + shape_external: '#85a7a5' + shape_externalarg: { fg: '#87b379' attr: 'b' } + shape_filepath: '#85a7a5' + shape_flag: { fg: '#7d8fa4' attr: 'b' } + shape_float: { fg: '#a47996' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#85a7a5' attr: 'b' } + shape_int: { fg: '#a47996' attr: 'b' } + shape_internalcall: { fg: '#85a7a5' attr: 'b' } + shape_list: { fg: '#85a7a5' attr: 'b' } + shape_literal: '#7d8fa4' + shape_match_pattern: '#87b379' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#85a7a5' + shape_operator: '#e5c179' + shape_or: { fg: '#a47996' attr: 'b' } + shape_pipe: { fg: '#a47996' attr: 'b' } + shape_range: { fg: '#e5c179' attr: 'b' } + shape_record: { fg: '#85a7a5' attr: 'b' } + shape_redirection: { fg: '#a47996' attr: 'b' } + shape_signature: { fg: '#87b379' attr: 'b' } + shape_string: '#87b379' + shape_string_interpolation: { fg: '#85a7a5' attr: 'b' } + shape_table: { fg: '#7d8fa4' attr: 'b' } + shape_variable: '#a47996' + + background: '#20242d' + foreground: '#b3b8c3' + cursor: '#b3b8c3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spacemacs.nu b/themes/nu-themes/spacemacs.nu index c254cb0..ce03a0d 100644 --- a/themes/nu-themes/spacemacs.nu +++ b/themes/nu-themes/spacemacs.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a3a3a3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#67b11d" attr: "b" } - empty: "#4f97d7" - bool: {|| if $in { "#2d9574" } else { "light_gray" } } - int: "#a3a3a3" - filesize: {|e| - if $e == 0b { - "#a3a3a3" - } else if $e < 1mb { - "#2d9574" - } else {{ fg: "#4f97d7" }} - } - duration: "#a3a3a3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f2241f" attr: "b" } - } else if $in < 6hr { - "#f2241f" - } else if $in < 1day { - "#b1951d" - } else if $in < 3day { - "#67b11d" - } else if $in < 1wk { - { fg: "#67b11d" attr: "b" } - } else if $in < 6wk { - "#2d9574" - } else if $in < 52wk { - "#4f97d7" - } else { "dark_gray" } - } - range: "#a3a3a3" - float: "#a3a3a3" - string: "#a3a3a3" - nothing: "#a3a3a3" - binary: "#a3a3a3" - cellpath: "#a3a3a3" - row_index: { fg: "#67b11d" attr: "b" } - record: "#a3a3a3" - list: "#a3a3a3" - block: "#a3a3a3" - hints: "dark_gray" - search_result: { fg: "#f2241f" bg: "#a3a3a3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a31db1" attr: "b" } - shape_binary: { fg: "#a31db1" attr: "b" } - shape_block: { fg: "#4f97d7" attr: "b" } - shape_bool: "#2d9574" - shape_custom: "#67b11d" - shape_datetime: { fg: "#2d9574" attr: "b" } - shape_directory: "#2d9574" - shape_external: "#2d9574" - shape_externalarg: { fg: "#67b11d" attr: "b" } - shape_filepath: "#2d9574" - shape_flag: { fg: "#4f97d7" attr: "b" } - shape_float: { fg: "#a31db1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2d9574" attr: "b" } - shape_int: { fg: "#a31db1" attr: "b" } - shape_internalcall: { fg: "#2d9574" attr: "b" } - shape_list: { fg: "#2d9574" attr: "b" } - shape_literal: "#4f97d7" - shape_match_pattern: "#67b11d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2d9574" - shape_operator: "#b1951d" - shape_or: { fg: "#a31db1" attr: "b" } - shape_pipe: { fg: "#a31db1" attr: "b" } - shape_range: { fg: "#b1951d" attr: "b" } - shape_record: { fg: "#2d9574" attr: "b" } - shape_redirection: { fg: "#a31db1" attr: "b" } - shape_signature: { fg: "#67b11d" attr: "b" } - shape_string: "#67b11d" - shape_string_interpolation: { fg: "#2d9574" attr: "b" } - shape_table: { fg: "#4f97d7" attr: "b" } - shape_variable: "#a31db1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f2022" - foreground: "#a3a3a3" - cursor: "#a3a3a3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a3a3a3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#67b11d' attr: 'b' } + empty: '#4f97d7' + bool: {|| if $in { '#2d9574' } else { 'light_gray' } } + int: '#a3a3a3' + filesize: {|e| + if $e == 0b { + '#a3a3a3' + } else if $e < 1mb { + '#2d9574' + } else {{ fg: '#4f97d7' }} + } + duration: '#a3a3a3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f2241f' attr: 'b' } + } else if $in < 6hr { + '#f2241f' + } else if $in < 1day { + '#b1951d' + } else if $in < 3day { + '#67b11d' + } else if $in < 1wk { + { fg: '#67b11d' attr: 'b' } + } else if $in < 6wk { + '#2d9574' + } else if $in < 52wk { + '#4f97d7' + } else { 'dark_gray' } + } + range: '#a3a3a3' + float: '#a3a3a3' + string: '#a3a3a3' + nothing: '#a3a3a3' + binary: '#a3a3a3' + cellpath: '#a3a3a3' + row_index: { fg: '#67b11d' attr: 'b' } + record: '#a3a3a3' + list: '#a3a3a3' + block: '#a3a3a3' + hints: 'dark_gray' + search_result: { fg: '#f2241f' bg: '#a3a3a3' } + + shape_and: { fg: '#a31db1' attr: 'b' } + shape_binary: { fg: '#a31db1' attr: 'b' } + shape_block: { fg: '#4f97d7' attr: 'b' } + shape_bool: '#2d9574' + shape_custom: '#67b11d' + shape_datetime: { fg: '#2d9574' attr: 'b' } + shape_directory: '#2d9574' + shape_external: '#2d9574' + shape_externalarg: { fg: '#67b11d' attr: 'b' } + shape_filepath: '#2d9574' + shape_flag: { fg: '#4f97d7' attr: 'b' } + shape_float: { fg: '#a31db1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2d9574' attr: 'b' } + shape_int: { fg: '#a31db1' attr: 'b' } + shape_internalcall: { fg: '#2d9574' attr: 'b' } + shape_list: { fg: '#2d9574' attr: 'b' } + shape_literal: '#4f97d7' + shape_match_pattern: '#67b11d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2d9574' + shape_operator: '#b1951d' + shape_or: { fg: '#a31db1' attr: 'b' } + shape_pipe: { fg: '#a31db1' attr: 'b' } + shape_range: { fg: '#b1951d' attr: 'b' } + shape_record: { fg: '#2d9574' attr: 'b' } + shape_redirection: { fg: '#a31db1' attr: 'b' } + shape_signature: { fg: '#67b11d' attr: 'b' } + shape_string: '#67b11d' + shape_string_interpolation: { fg: '#2d9574' attr: 'b' } + shape_table: { fg: '#4f97d7' attr: 'b' } + shape_variable: '#a31db1' + + background: '#1f2022' + foreground: '#a3a3a3' + cursor: '#a3a3a3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spiderman.nu b/themes/nu-themes/spiderman.nu index 004f6da..6646d46 100644 --- a/themes/nu-themes/spiderman.nu +++ b/themes/nu-themes/spiderman.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fffef6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#e22828" attr: "b" } - empty: "#2b3fff" - bool: {|| if $in { "#6083ff" } else { "light_gray" } } - int: "#fffef6" - filesize: {|e| - if $e == 0b { - "#fffef6" - } else if $e < 1mb { - "#3255ff" - } else {{ fg: "#2b3fff" }} - } - duration: "#fffef6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e60712" attr: "b" } - } else if $in < 6hr { - "#e60712" - } else if $in < 1day { - "#e24655" - } else if $in < 3day { - "#e22828" - } else if $in < 1wk { - { fg: "#e22828" attr: "b" } - } else if $in < 6wk { - "#3255ff" - } else if $in < 52wk { - "#2b3fff" - } else { "dark_gray" } - } - range: "#fffef6" - float: "#fffef6" - string: "#fffef6" - nothing: "#fffef6" - binary: "#fffef6" - cellpath: "#fffef6" - row_index: { fg: "#e22828" attr: "b" } - record: "#fffef6" - list: "#fffef6" - block: "#fffef6" - hints: "dark_gray" - search_result: { fg: "#e60712" bg: "#fffef6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#2435db" attr: "b" } - shape_binary: { fg: "#2435db" attr: "b" } - shape_block: { fg: "#2b3fff" attr: "b" } - shape_bool: "#6083ff" - shape_custom: "#e22828" - shape_datetime: { fg: "#3255ff" attr: "b" } - shape_directory: "#3255ff" - shape_external: "#3255ff" - shape_externalarg: { fg: "#e22828" attr: "b" } - shape_filepath: "#3255ff" - shape_flag: { fg: "#2b3fff" attr: "b" } - shape_float: { fg: "#2435db" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3255ff" attr: "b" } - shape_int: { fg: "#2435db" attr: "b" } - shape_internalcall: { fg: "#3255ff" attr: "b" } - shape_list: { fg: "#3255ff" attr: "b" } - shape_literal: "#2b3fff" - shape_match_pattern: "#e22828" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6083ff" - shape_operator: "#e24655" - shape_or: { fg: "#2435db" attr: "b" } - shape_pipe: { fg: "#2435db" attr: "b" } - shape_range: { fg: "#e24655" attr: "b" } - shape_record: { fg: "#3255ff" attr: "b" } - shape_redirection: { fg: "#2435db" attr: "b" } - shape_signature: { fg: "#e22828" attr: "b" } - shape_string: "#e22828" - shape_string_interpolation: { fg: "#3255ff" attr: "b" } - shape_table: { fg: "#2b3fff" attr: "b" } - shape_variable: "#2435db" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1d1e" - foreground: "#e2e2e2" - cursor: "#2b3fff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fffef6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#e22828' attr: 'b' } + empty: '#2b3fff' + bool: {|| if $in { '#6083ff' } else { 'light_gray' } } + int: '#fffef6' + filesize: {|e| + if $e == 0b { + '#fffef6' + } else if $e < 1mb { + '#3255ff' + } else {{ fg: '#2b3fff' }} + } + duration: '#fffef6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e60712' attr: 'b' } + } else if $in < 6hr { + '#e60712' + } else if $in < 1day { + '#e24655' + } else if $in < 3day { + '#e22828' + } else if $in < 1wk { + { fg: '#e22828' attr: 'b' } + } else if $in < 6wk { + '#3255ff' + } else if $in < 52wk { + '#2b3fff' + } else { 'dark_gray' } + } + range: '#fffef6' + float: '#fffef6' + string: '#fffef6' + nothing: '#fffef6' + binary: '#fffef6' + cellpath: '#fffef6' + row_index: { fg: '#e22828' attr: 'b' } + record: '#fffef6' + list: '#fffef6' + block: '#fffef6' + hints: 'dark_gray' + search_result: { fg: '#e60712' bg: '#fffef6' } + + shape_and: { fg: '#2435db' attr: 'b' } + shape_binary: { fg: '#2435db' attr: 'b' } + shape_block: { fg: '#2b3fff' attr: 'b' } + shape_bool: '#6083ff' + shape_custom: '#e22828' + shape_datetime: { fg: '#3255ff' attr: 'b' } + shape_directory: '#3255ff' + shape_external: '#3255ff' + shape_externalarg: { fg: '#e22828' attr: 'b' } + shape_filepath: '#3255ff' + shape_flag: { fg: '#2b3fff' attr: 'b' } + shape_float: { fg: '#2435db' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3255ff' attr: 'b' } + shape_int: { fg: '#2435db' attr: 'b' } + shape_internalcall: { fg: '#3255ff' attr: 'b' } + shape_list: { fg: '#3255ff' attr: 'b' } + shape_literal: '#2b3fff' + shape_match_pattern: '#e22828' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6083ff' + shape_operator: '#e24655' + shape_or: { fg: '#2435db' attr: 'b' } + shape_pipe: { fg: '#2435db' attr: 'b' } + shape_range: { fg: '#e24655' attr: 'b' } + shape_record: { fg: '#3255ff' attr: 'b' } + shape_redirection: { fg: '#2435db' attr: 'b' } + shape_signature: { fg: '#e22828' attr: 'b' } + shape_string: '#e22828' + shape_string_interpolation: { fg: '#3255ff' attr: 'b' } + shape_table: { fg: '#2b3fff' attr: 'b' } + shape_variable: '#2435db' + + background: '#1b1d1e' + foreground: '#e2e2e2' + cursor: '#2b3fff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/spring.nu b/themes/nu-themes/spring.nu index 446ba25..50884c3 100644 --- a/themes/nu-themes/spring.nu +++ b/themes/nu-themes/spring.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#1f8c3b" attr: "b" } - empty: "#1dd3ee" - bool: {|| if $in { "#3e999f" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#3e999f" - } else {{ fg: "#1dd3ee" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff4d83" attr: "b" } - } else if $in < 6hr { - "#ff4d83" - } else if $in < 1day { - "#1fc95b" - } else if $in < 3day { - "#1f8c3b" - } else if $in < 1wk { - { fg: "#1f8c3b" attr: "b" } - } else if $in < 6wk { - "#3e999f" - } else if $in < 52wk { - "#1dd3ee" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#1f8c3b" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#ff4d83" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8959a8" attr: "b" } - shape_binary: { fg: "#8959a8" attr: "b" } - shape_block: { fg: "#1dd3ee" attr: "b" } - shape_bool: "#3e999f" - shape_custom: "#1f8c3b" - shape_datetime: { fg: "#3e999f" attr: "b" } - shape_directory: "#3e999f" - shape_external: "#3e999f" - shape_externalarg: { fg: "#1f8c3b" attr: "b" } - shape_filepath: "#3e999f" - shape_flag: { fg: "#1dd3ee" attr: "b" } - shape_float: { fg: "#8959a8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3e999f" attr: "b" } - shape_int: { fg: "#8959a8" attr: "b" } - shape_internalcall: { fg: "#3e999f" attr: "b" } - shape_list: { fg: "#3e999f" attr: "b" } - shape_literal: "#1dd3ee" - shape_match_pattern: "#1f8c3b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3e999f" - shape_operator: "#1fc95b" - shape_or: { fg: "#8959a8" attr: "b" } - shape_pipe: { fg: "#8959a8" attr: "b" } - shape_range: { fg: "#1fc95b" attr: "b" } - shape_record: { fg: "#3e999f" attr: "b" } - shape_redirection: { fg: "#8959a8" attr: "b" } - shape_signature: { fg: "#1f8c3b" attr: "b" } - shape_string: "#1f8c3b" - shape_string_interpolation: { fg: "#3e999f" attr: "b" } - shape_table: { fg: "#1dd3ee" attr: "b" } - shape_variable: "#8959a8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0a1e24" - foreground: "#ecf0c1" - cursor: "#ecf0c1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#1f8c3b' attr: 'b' } + empty: '#1dd3ee' + bool: {|| if $in { '#3e999f' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#3e999f' + } else {{ fg: '#1dd3ee' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff4d83' attr: 'b' } + } else if $in < 6hr { + '#ff4d83' + } else if $in < 1day { + '#1fc95b' + } else if $in < 3day { + '#1f8c3b' + } else if $in < 1wk { + { fg: '#1f8c3b' attr: 'b' } + } else if $in < 6wk { + '#3e999f' + } else if $in < 52wk { + '#1dd3ee' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#1f8c3b' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#ff4d83' bg: '#ffffff' } + + shape_and: { fg: '#8959a8' attr: 'b' } + shape_binary: { fg: '#8959a8' attr: 'b' } + shape_block: { fg: '#1dd3ee' attr: 'b' } + shape_bool: '#3e999f' + shape_custom: '#1f8c3b' + shape_datetime: { fg: '#3e999f' attr: 'b' } + shape_directory: '#3e999f' + shape_external: '#3e999f' + shape_externalarg: { fg: '#1f8c3b' attr: 'b' } + shape_filepath: '#3e999f' + shape_flag: { fg: '#1dd3ee' attr: 'b' } + shape_float: { fg: '#8959a8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3e999f' attr: 'b' } + shape_int: { fg: '#8959a8' attr: 'b' } + shape_internalcall: { fg: '#3e999f' attr: 'b' } + shape_list: { fg: '#3e999f' attr: 'b' } + shape_literal: '#1dd3ee' + shape_match_pattern: '#1f8c3b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3e999f' + shape_operator: '#1fc95b' + shape_or: { fg: '#8959a8' attr: 'b' } + shape_pipe: { fg: '#8959a8' attr: 'b' } + shape_range: { fg: '#1fc95b' attr: 'b' } + shape_record: { fg: '#3e999f' attr: 'b' } + shape_redirection: { fg: '#8959a8' attr: 'b' } + shape_signature: { fg: '#1f8c3b' attr: 'b' } + shape_string: '#1f8c3b' + shape_string_interpolation: { fg: '#3e999f' attr: 'b' } + shape_table: { fg: '#1dd3ee' attr: 'b' } + shape_variable: '#8959a8' + + background: '#0a1e24' + foreground: '#ecf0c1' + cursor: '#ecf0c1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/square.nu b/themes/nu-themes/square.nu index 1720e9d..e279705 100644 --- a/themes/nu-themes/square.nu +++ b/themes/nu-themes/square.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2f2f2" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b6377d" attr: "b" } - empty: "#a9cdeb" - bool: {|| if $in { "#d7d9fc" } else { "light_gray" } } - int: "#f2f2f2" - filesize: {|e| - if $e == 0b { - "#f2f2f2" - } else if $e < 1mb { - "#c9caec" - } else {{ fg: "#a9cdeb" }} - } - duration: "#f2f2f2" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e9897c" attr: "b" } - } else if $in < 6hr { - "#e9897c" - } else if $in < 1day { - "#ecebbe" - } else if $in < 3day { - "#b6377d" - } else if $in < 1wk { - { fg: "#b6377d" attr: "b" } - } else if $in < 6wk { - "#c9caec" - } else if $in < 52wk { - "#a9cdeb" - } else { "dark_gray" } - } - range: "#f2f2f2" - float: "#f2f2f2" - string: "#f2f2f2" - nothing: "#f2f2f2" - binary: "#f2f2f2" - cellpath: "#f2f2f2" - row_index: { fg: "#b6377d" attr: "b" } - record: "#f2f2f2" - list: "#f2f2f2" - block: "#f2f2f2" - hints: "dark_gray" - search_result: { fg: "#e9897c" bg: "#f2f2f2" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#75507b" attr: "b" } - shape_binary: { fg: "#75507b" attr: "b" } - shape_block: { fg: "#a9cdeb" attr: "b" } - shape_bool: "#d7d9fc" - shape_custom: "#b6377d" - shape_datetime: { fg: "#c9caec" attr: "b" } - shape_directory: "#c9caec" - shape_external: "#c9caec" - shape_externalarg: { fg: "#b6377d" attr: "b" } - shape_filepath: "#c9caec" - shape_flag: { fg: "#a9cdeb" attr: "b" } - shape_float: { fg: "#75507b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c9caec" attr: "b" } - shape_int: { fg: "#75507b" attr: "b" } - shape_internalcall: { fg: "#c9caec" attr: "b" } - shape_list: { fg: "#c9caec" attr: "b" } - shape_literal: "#a9cdeb" - shape_match_pattern: "#b6377d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#d7d9fc" - shape_operator: "#ecebbe" - shape_or: { fg: "#75507b" attr: "b" } - shape_pipe: { fg: "#75507b" attr: "b" } - shape_range: { fg: "#ecebbe" attr: "b" } - shape_record: { fg: "#c9caec" attr: "b" } - shape_redirection: { fg: "#75507b" attr: "b" } - shape_signature: { fg: "#b6377d" attr: "b" } - shape_string: "#b6377d" - shape_string_interpolation: { fg: "#c9caec" attr: "b" } - shape_table: { fg: "#a9cdeb" attr: "b" } - shape_variable: "#75507b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0a1e24" - foreground: "#1a1a1a" - cursor: "#1a1a1a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2f2f2' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b6377d' attr: 'b' } + empty: '#a9cdeb' + bool: {|| if $in { '#d7d9fc' } else { 'light_gray' } } + int: '#f2f2f2' + filesize: {|e| + if $e == 0b { + '#f2f2f2' + } else if $e < 1mb { + '#c9caec' + } else {{ fg: '#a9cdeb' }} + } + duration: '#f2f2f2' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e9897c' attr: 'b' } + } else if $in < 6hr { + '#e9897c' + } else if $in < 1day { + '#ecebbe' + } else if $in < 3day { + '#b6377d' + } else if $in < 1wk { + { fg: '#b6377d' attr: 'b' } + } else if $in < 6wk { + '#c9caec' + } else if $in < 52wk { + '#a9cdeb' + } else { 'dark_gray' } + } + range: '#f2f2f2' + float: '#f2f2f2' + string: '#f2f2f2' + nothing: '#f2f2f2' + binary: '#f2f2f2' + cellpath: '#f2f2f2' + row_index: { fg: '#b6377d' attr: 'b' } + record: '#f2f2f2' + list: '#f2f2f2' + block: '#f2f2f2' + hints: 'dark_gray' + search_result: { fg: '#e9897c' bg: '#f2f2f2' } + + shape_and: { fg: '#75507b' attr: 'b' } + shape_binary: { fg: '#75507b' attr: 'b' } + shape_block: { fg: '#a9cdeb' attr: 'b' } + shape_bool: '#d7d9fc' + shape_custom: '#b6377d' + shape_datetime: { fg: '#c9caec' attr: 'b' } + shape_directory: '#c9caec' + shape_external: '#c9caec' + shape_externalarg: { fg: '#b6377d' attr: 'b' } + shape_filepath: '#c9caec' + shape_flag: { fg: '#a9cdeb' attr: 'b' } + shape_float: { fg: '#75507b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c9caec' attr: 'b' } + shape_int: { fg: '#75507b' attr: 'b' } + shape_internalcall: { fg: '#c9caec' attr: 'b' } + shape_list: { fg: '#c9caec' attr: 'b' } + shape_literal: '#a9cdeb' + shape_match_pattern: '#b6377d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#d7d9fc' + shape_operator: '#ecebbe' + shape_or: { fg: '#75507b' attr: 'b' } + shape_pipe: { fg: '#75507b' attr: 'b' } + shape_range: { fg: '#ecebbe' attr: 'b' } + shape_record: { fg: '#c9caec' attr: 'b' } + shape_redirection: { fg: '#75507b' attr: 'b' } + shape_signature: { fg: '#b6377d' attr: 'b' } + shape_string: '#b6377d' + shape_string_interpolation: { fg: '#c9caec' attr: 'b' } + shape_table: { fg: '#a9cdeb' attr: 'b' } + shape_variable: '#75507b' + + background: '#0a1e24' + foreground: '#1a1a1a' + cursor: '#1a1a1a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/srcery.nu b/themes/nu-themes/srcery.nu index f1ed4d9..55b82ad 100644 --- a/themes/nu-themes/srcery.nu +++ b/themes/nu-themes/srcery.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#baa67f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#519f50" attr: "b" } - empty: "#2c78bf" - bool: {|| if $in { "#2be4d0" } else { "light_gray" } } - int: "#baa67f" - filesize: {|e| - if $e == 0b { - "#baa67f" - } else if $e < 1mb { - "#0aaeb3" - } else {{ fg: "#2c78bf" }} - } - duration: "#baa67f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ef2f27" attr: "b" } - } else if $in < 6hr { - "#ef2f27" - } else if $in < 1day { - "#fbb829" - } else if $in < 3day { - "#519f50" - } else if $in < 1wk { - { fg: "#519f50" attr: "b" } - } else if $in < 6wk { - "#0aaeb3" - } else if $in < 52wk { - "#2c78bf" - } else { "dark_gray" } - } - range: "#baa67f" - float: "#baa67f" - string: "#baa67f" - nothing: "#baa67f" - binary: "#baa67f" - cellpath: "#baa67f" - row_index: { fg: "#519f50" attr: "b" } - record: "#baa67f" - list: "#baa67f" - block: "#baa67f" - hints: "dark_gray" - search_result: { fg: "#ef2f27" bg: "#baa67f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e02c6d" attr: "b" } - shape_binary: { fg: "#e02c6d" attr: "b" } - shape_block: { fg: "#2c78bf" attr: "b" } - shape_bool: "#2be4d0" - shape_custom: "#519f50" - shape_datetime: { fg: "#0aaeb3" attr: "b" } - shape_directory: "#0aaeb3" - shape_external: "#0aaeb3" - shape_externalarg: { fg: "#519f50" attr: "b" } - shape_filepath: "#0aaeb3" - shape_flag: { fg: "#2c78bf" attr: "b" } - shape_float: { fg: "#e02c6d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#0aaeb3" attr: "b" } - shape_int: { fg: "#e02c6d" attr: "b" } - shape_internalcall: { fg: "#0aaeb3" attr: "b" } - shape_list: { fg: "#0aaeb3" attr: "b" } - shape_literal: "#2c78bf" - shape_match_pattern: "#519f50" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2be4d0" - shape_operator: "#fbb829" - shape_or: { fg: "#e02c6d" attr: "b" } - shape_pipe: { fg: "#e02c6d" attr: "b" } - shape_range: { fg: "#fbb829" attr: "b" } - shape_record: { fg: "#0aaeb3" attr: "b" } - shape_redirection: { fg: "#e02c6d" attr: "b" } - shape_signature: { fg: "#519f50" attr: "b" } - shape_string: "#519f50" - shape_string_interpolation: { fg: "#0aaeb3" attr: "b" } - shape_table: { fg: "#2c78bf" attr: "b" } - shape_variable: "#e02c6d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1b19" - foreground: "#fce8c3" - cursor: "#fbb829" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#baa67f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#519f50' attr: 'b' } + empty: '#2c78bf' + bool: {|| if $in { '#2be4d0' } else { 'light_gray' } } + int: '#baa67f' + filesize: {|e| + if $e == 0b { + '#baa67f' + } else if $e < 1mb { + '#0aaeb3' + } else {{ fg: '#2c78bf' }} + } + duration: '#baa67f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ef2f27' attr: 'b' } + } else if $in < 6hr { + '#ef2f27' + } else if $in < 1day { + '#fbb829' + } else if $in < 3day { + '#519f50' + } else if $in < 1wk { + { fg: '#519f50' attr: 'b' } + } else if $in < 6wk { + '#0aaeb3' + } else if $in < 52wk { + '#2c78bf' + } else { 'dark_gray' } + } + range: '#baa67f' + float: '#baa67f' + string: '#baa67f' + nothing: '#baa67f' + binary: '#baa67f' + cellpath: '#baa67f' + row_index: { fg: '#519f50' attr: 'b' } + record: '#baa67f' + list: '#baa67f' + block: '#baa67f' + hints: 'dark_gray' + search_result: { fg: '#ef2f27' bg: '#baa67f' } + + shape_and: { fg: '#e02c6d' attr: 'b' } + shape_binary: { fg: '#e02c6d' attr: 'b' } + shape_block: { fg: '#2c78bf' attr: 'b' } + shape_bool: '#2be4d0' + shape_custom: '#519f50' + shape_datetime: { fg: '#0aaeb3' attr: 'b' } + shape_directory: '#0aaeb3' + shape_external: '#0aaeb3' + shape_externalarg: { fg: '#519f50' attr: 'b' } + shape_filepath: '#0aaeb3' + shape_flag: { fg: '#2c78bf' attr: 'b' } + shape_float: { fg: '#e02c6d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#0aaeb3' attr: 'b' } + shape_int: { fg: '#e02c6d' attr: 'b' } + shape_internalcall: { fg: '#0aaeb3' attr: 'b' } + shape_list: { fg: '#0aaeb3' attr: 'b' } + shape_literal: '#2c78bf' + shape_match_pattern: '#519f50' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2be4d0' + shape_operator: '#fbb829' + shape_or: { fg: '#e02c6d' attr: 'b' } + shape_pipe: { fg: '#e02c6d' attr: 'b' } + shape_range: { fg: '#fbb829' attr: 'b' } + shape_record: { fg: '#0aaeb3' attr: 'b' } + shape_redirection: { fg: '#e02c6d' attr: 'b' } + shape_signature: { fg: '#519f50' attr: 'b' } + shape_string: '#519f50' + shape_string_interpolation: { fg: '#0aaeb3' attr: 'b' } + shape_table: { fg: '#2c78bf' attr: 'b' } + shape_variable: '#e02c6d' + + background: '#1c1b19' + foreground: '#fce8c3' + cursor: '#fbb829' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/substrata.nu b/themes/nu-themes/substrata.nu index e302aec..1536365 100644 --- a/themes/nu-themes/substrata.nu +++ b/themes/nu-themes/substrata.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b5b4c9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#76a065" attr: "b" } - empty: "#8296b0" - bool: {|| if $in { "#7dc2c7" } else { "light_gray" } } - int: "#b5b4c9" - filesize: {|e| - if $e == 0b { - "#b5b4c9" - } else if $e < 1mb { - "#659ea2" - } else {{ fg: "#8296b0" }} - } - duration: "#b5b4c9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf8164" attr: "b" } - } else if $in < 6hr { - "#cf8164" - } else if $in < 1day { - "#ab924c" - } else if $in < 3day { - "#76a065" - } else if $in < 1wk { - { fg: "#76a065" attr: "b" } - } else if $in < 6wk { - "#659ea2" - } else if $in < 52wk { - "#8296b0" - } else { "dark_gray" } - } - range: "#b5b4c9" - float: "#b5b4c9" - string: "#b5b4c9" - nothing: "#b5b4c9" - binary: "#b5b4c9" - cellpath: "#b5b4c9" - row_index: { fg: "#76a065" attr: "b" } - record: "#b5b4c9" - list: "#b5b4c9" - block: "#b5b4c9" - hints: "dark_gray" - search_result: { fg: "#cf8164" bg: "#b5b4c9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a18daf" attr: "b" } - shape_binary: { fg: "#a18daf" attr: "b" } - shape_block: { fg: "#8296b0" attr: "b" } - shape_bool: "#7dc2c7" - shape_custom: "#76a065" - shape_datetime: { fg: "#659ea2" attr: "b" } - shape_directory: "#659ea2" - shape_external: "#659ea2" - shape_externalarg: { fg: "#76a065" attr: "b" } - shape_filepath: "#659ea2" - shape_flag: { fg: "#8296b0" attr: "b" } - shape_float: { fg: "#a18daf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#659ea2" attr: "b" } - shape_int: { fg: "#a18daf" attr: "b" } - shape_internalcall: { fg: "#659ea2" attr: "b" } - shape_list: { fg: "#659ea2" attr: "b" } - shape_literal: "#8296b0" - shape_match_pattern: "#76a065" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7dc2c7" - shape_operator: "#ab924c" - shape_or: { fg: "#a18daf" attr: "b" } - shape_pipe: { fg: "#a18daf" attr: "b" } - shape_range: { fg: "#ab924c" attr: "b" } - shape_record: { fg: "#659ea2" attr: "b" } - shape_redirection: { fg: "#a18daf" attr: "b" } - shape_signature: { fg: "#76a065" attr: "b" } - shape_string: "#76a065" - shape_string_interpolation: { fg: "#659ea2" attr: "b" } - shape_table: { fg: "#8296b0" attr: "b" } - shape_variable: "#a18daf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191c25" - foreground: "#b5b4c9" - cursor: "#b5b4c9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b5b4c9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#76a065' attr: 'b' } + empty: '#8296b0' + bool: {|| if $in { '#7dc2c7' } else { 'light_gray' } } + int: '#b5b4c9' + filesize: {|e| + if $e == 0b { + '#b5b4c9' + } else if $e < 1mb { + '#659ea2' + } else {{ fg: '#8296b0' }} + } + duration: '#b5b4c9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf8164' attr: 'b' } + } else if $in < 6hr { + '#cf8164' + } else if $in < 1day { + '#ab924c' + } else if $in < 3day { + '#76a065' + } else if $in < 1wk { + { fg: '#76a065' attr: 'b' } + } else if $in < 6wk { + '#659ea2' + } else if $in < 52wk { + '#8296b0' + } else { 'dark_gray' } + } + range: '#b5b4c9' + float: '#b5b4c9' + string: '#b5b4c9' + nothing: '#b5b4c9' + binary: '#b5b4c9' + cellpath: '#b5b4c9' + row_index: { fg: '#76a065' attr: 'b' } + record: '#b5b4c9' + list: '#b5b4c9' + block: '#b5b4c9' + hints: 'dark_gray' + search_result: { fg: '#cf8164' bg: '#b5b4c9' } + + shape_and: { fg: '#a18daf' attr: 'b' } + shape_binary: { fg: '#a18daf' attr: 'b' } + shape_block: { fg: '#8296b0' attr: 'b' } + shape_bool: '#7dc2c7' + shape_custom: '#76a065' + shape_datetime: { fg: '#659ea2' attr: 'b' } + shape_directory: '#659ea2' + shape_external: '#659ea2' + shape_externalarg: { fg: '#76a065' attr: 'b' } + shape_filepath: '#659ea2' + shape_flag: { fg: '#8296b0' attr: 'b' } + shape_float: { fg: '#a18daf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#659ea2' attr: 'b' } + shape_int: { fg: '#a18daf' attr: 'b' } + shape_internalcall: { fg: '#659ea2' attr: 'b' } + shape_list: { fg: '#659ea2' attr: 'b' } + shape_literal: '#8296b0' + shape_match_pattern: '#76a065' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7dc2c7' + shape_operator: '#ab924c' + shape_or: { fg: '#a18daf' attr: 'b' } + shape_pipe: { fg: '#a18daf' attr: 'b' } + shape_range: { fg: '#ab924c' attr: 'b' } + shape_record: { fg: '#659ea2' attr: 'b' } + shape_redirection: { fg: '#a18daf' attr: 'b' } + shape_signature: { fg: '#76a065' attr: 'b' } + shape_string: '#76a065' + shape_string_interpolation: { fg: '#659ea2' attr: 'b' } + shape_table: { fg: '#8296b0' attr: 'b' } + shape_variable: '#a18daf' + + background: '#191c25' + foreground: '#b5b4c9' + cursor: '#b5b4c9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/summercamp.nu b/themes/nu-themes/summercamp.nu index 040ad09..718d2a9 100644 --- a/themes/nu-themes/summercamp.nu +++ b/themes/nu-themes/summercamp.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#736e55" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5ceb5a" attr: "b" } - empty: "#489bf0" - bool: {|| if $in { "#5aebbc" } else { "light_gray" } } - int: "#736e55" - filesize: {|e| - if $e == 0b { - "#736e55" - } else if $e < 1mb { - "#5aebbc" - } else {{ fg: "#489bf0" }} - } - duration: "#736e55" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e35142" attr: "b" } - } else if $in < 6hr { - "#e35142" - } else if $in < 1day { - "#f2ff27" - } else if $in < 3day { - "#5ceb5a" - } else if $in < 1wk { - { fg: "#5ceb5a" attr: "b" } - } else if $in < 6wk { - "#5aebbc" - } else if $in < 52wk { - "#489bf0" - } else { "dark_gray" } - } - range: "#736e55" - float: "#736e55" - string: "#736e55" - nothing: "#736e55" - binary: "#736e55" - cellpath: "#736e55" - row_index: { fg: "#5ceb5a" attr: "b" } - record: "#736e55" - list: "#736e55" - block: "#736e55" - hints: "dark_gray" - search_result: { fg: "#e35142" bg: "#736e55" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff8080" attr: "b" } - shape_binary: { fg: "#ff8080" attr: "b" } - shape_block: { fg: "#489bf0" attr: "b" } - shape_bool: "#5aebbc" - shape_custom: "#5ceb5a" - shape_datetime: { fg: "#5aebbc" attr: "b" } - shape_directory: "#5aebbc" - shape_external: "#5aebbc" - shape_externalarg: { fg: "#5ceb5a" attr: "b" } - shape_filepath: "#5aebbc" - shape_flag: { fg: "#489bf0" attr: "b" } - shape_float: { fg: "#ff8080" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5aebbc" attr: "b" } - shape_int: { fg: "#ff8080" attr: "b" } - shape_internalcall: { fg: "#5aebbc" attr: "b" } - shape_list: { fg: "#5aebbc" attr: "b" } - shape_literal: "#489bf0" - shape_match_pattern: "#5ceb5a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5aebbc" - shape_operator: "#f2ff27" - shape_or: { fg: "#ff8080" attr: "b" } - shape_pipe: { fg: "#ff8080" attr: "b" } - shape_range: { fg: "#f2ff27" attr: "b" } - shape_record: { fg: "#5aebbc" attr: "b" } - shape_redirection: { fg: "#ff8080" attr: "b" } - shape_signature: { fg: "#5ceb5a" attr: "b" } - shape_string: "#5ceb5a" - shape_string_interpolation: { fg: "#5aebbc" attr: "b" } - shape_table: { fg: "#489bf0" attr: "b" } - shape_variable: "#ff8080" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1c1810" - foreground: "#736e55" - cursor: "#736e55" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#736e55' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5ceb5a' attr: 'b' } + empty: '#489bf0' + bool: {|| if $in { '#5aebbc' } else { 'light_gray' } } + int: '#736e55' + filesize: {|e| + if $e == 0b { + '#736e55' + } else if $e < 1mb { + '#5aebbc' + } else {{ fg: '#489bf0' }} + } + duration: '#736e55' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e35142' attr: 'b' } + } else if $in < 6hr { + '#e35142' + } else if $in < 1day { + '#f2ff27' + } else if $in < 3day { + '#5ceb5a' + } else if $in < 1wk { + { fg: '#5ceb5a' attr: 'b' } + } else if $in < 6wk { + '#5aebbc' + } else if $in < 52wk { + '#489bf0' + } else { 'dark_gray' } + } + range: '#736e55' + float: '#736e55' + string: '#736e55' + nothing: '#736e55' + binary: '#736e55' + cellpath: '#736e55' + row_index: { fg: '#5ceb5a' attr: 'b' } + record: '#736e55' + list: '#736e55' + block: '#736e55' + hints: 'dark_gray' + search_result: { fg: '#e35142' bg: '#736e55' } + + shape_and: { fg: '#ff8080' attr: 'b' } + shape_binary: { fg: '#ff8080' attr: 'b' } + shape_block: { fg: '#489bf0' attr: 'b' } + shape_bool: '#5aebbc' + shape_custom: '#5ceb5a' + shape_datetime: { fg: '#5aebbc' attr: 'b' } + shape_directory: '#5aebbc' + shape_external: '#5aebbc' + shape_externalarg: { fg: '#5ceb5a' attr: 'b' } + shape_filepath: '#5aebbc' + shape_flag: { fg: '#489bf0' attr: 'b' } + shape_float: { fg: '#ff8080' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5aebbc' attr: 'b' } + shape_int: { fg: '#ff8080' attr: 'b' } + shape_internalcall: { fg: '#5aebbc' attr: 'b' } + shape_list: { fg: '#5aebbc' attr: 'b' } + shape_literal: '#489bf0' + shape_match_pattern: '#5ceb5a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5aebbc' + shape_operator: '#f2ff27' + shape_or: { fg: '#ff8080' attr: 'b' } + shape_pipe: { fg: '#ff8080' attr: 'b' } + shape_range: { fg: '#f2ff27' attr: 'b' } + shape_record: { fg: '#5aebbc' attr: 'b' } + shape_redirection: { fg: '#ff8080' attr: 'b' } + shape_signature: { fg: '#5ceb5a' attr: 'b' } + shape_string: '#5ceb5a' + shape_string_interpolation: { fg: '#5aebbc' attr: 'b' } + shape_table: { fg: '#489bf0' attr: 'b' } + shape_variable: '#ff8080' + + background: '#1c1810' + foreground: '#736e55' + cursor: '#736e55' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/summerfruit-dark.nu b/themes/nu-themes/summerfruit-dark.nu index 0ad9544..4f00b2b 100644 --- a/themes/nu-themes/summerfruit-dark.nu +++ b/themes/nu-themes/summerfruit-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00c918" attr: "b" } - empty: "#3777e6" - bool: {|| if $in { "#1faaaa" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#1faaaa" - } else {{ fg: "#3777e6" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0086" attr: "b" } - } else if $in < 6hr { - "#ff0086" - } else if $in < 1day { - "#aba800" - } else if $in < 3day { - "#00c918" - } else if $in < 1wk { - { fg: "#00c918" attr: "b" } - } else if $in < 6wk { - "#1faaaa" - } else if $in < 52wk { - "#3777e6" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#00c918" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#ff0086" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ad00a1" attr: "b" } - shape_binary: { fg: "#ad00a1" attr: "b" } - shape_block: { fg: "#3777e6" attr: "b" } - shape_bool: "#1faaaa" - shape_custom: "#00c918" - shape_datetime: { fg: "#1faaaa" attr: "b" } - shape_directory: "#1faaaa" - shape_external: "#1faaaa" - shape_externalarg: { fg: "#00c918" attr: "b" } - shape_filepath: "#1faaaa" - shape_flag: { fg: "#3777e6" attr: "b" } - shape_float: { fg: "#ad00a1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1faaaa" attr: "b" } - shape_int: { fg: "#ad00a1" attr: "b" } - shape_internalcall: { fg: "#1faaaa" attr: "b" } - shape_list: { fg: "#1faaaa" attr: "b" } - shape_literal: "#3777e6" - shape_match_pattern: "#00c918" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1faaaa" - shape_operator: "#aba800" - shape_or: { fg: "#ad00a1" attr: "b" } - shape_pipe: { fg: "#ad00a1" attr: "b" } - shape_range: { fg: "#aba800" attr: "b" } - shape_record: { fg: "#1faaaa" attr: "b" } - shape_redirection: { fg: "#ad00a1" attr: "b" } - shape_signature: { fg: "#00c918" attr: "b" } - shape_string: "#00c918" - shape_string_interpolation: { fg: "#1faaaa" attr: "b" } - shape_table: { fg: "#3777e6" attr: "b" } - shape_variable: "#ad00a1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#151515" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00c918' attr: 'b' } + empty: '#3777e6' + bool: {|| if $in { '#1faaaa' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#1faaaa' + } else {{ fg: '#3777e6' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0086' attr: 'b' } + } else if $in < 6hr { + '#ff0086' + } else if $in < 1day { + '#aba800' + } else if $in < 3day { + '#00c918' + } else if $in < 1wk { + { fg: '#00c918' attr: 'b' } + } else if $in < 6wk { + '#1faaaa' + } else if $in < 52wk { + '#3777e6' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#00c918' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#ff0086' bg: '#d0d0d0' } + + shape_and: { fg: '#ad00a1' attr: 'b' } + shape_binary: { fg: '#ad00a1' attr: 'b' } + shape_block: { fg: '#3777e6' attr: 'b' } + shape_bool: '#1faaaa' + shape_custom: '#00c918' + shape_datetime: { fg: '#1faaaa' attr: 'b' } + shape_directory: '#1faaaa' + shape_external: '#1faaaa' + shape_externalarg: { fg: '#00c918' attr: 'b' } + shape_filepath: '#1faaaa' + shape_flag: { fg: '#3777e6' attr: 'b' } + shape_float: { fg: '#ad00a1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1faaaa' attr: 'b' } + shape_int: { fg: '#ad00a1' attr: 'b' } + shape_internalcall: { fg: '#1faaaa' attr: 'b' } + shape_list: { fg: '#1faaaa' attr: 'b' } + shape_literal: '#3777e6' + shape_match_pattern: '#00c918' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1faaaa' + shape_operator: '#aba800' + shape_or: { fg: '#ad00a1' attr: 'b' } + shape_pipe: { fg: '#ad00a1' attr: 'b' } + shape_range: { fg: '#aba800' attr: 'b' } + shape_record: { fg: '#1faaaa' attr: 'b' } + shape_redirection: { fg: '#ad00a1' attr: 'b' } + shape_signature: { fg: '#00c918' attr: 'b' } + shape_string: '#00c918' + shape_string_interpolation: { fg: '#1faaaa' attr: 'b' } + shape_table: { fg: '#3777e6' attr: 'b' } + shape_variable: '#ad00a1' + + background: '#151515' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/summerfruit-light.nu b/themes/nu-themes/summerfruit-light.nu index 3b715d1..adcf531 100644 --- a/themes/nu-themes/summerfruit-light.nu +++ b/themes/nu-themes/summerfruit-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#101010" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00c918" attr: "b" } - empty: "#3777e6" - bool: {|| if $in { "#1faaaa" } else { "light_gray" } } - int: "#101010" - filesize: {|e| - if $e == 0b { - "#101010" - } else if $e < 1mb { - "#1faaaa" - } else {{ fg: "#3777e6" }} - } - duration: "#101010" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0086" attr: "b" } - } else if $in < 6hr { - "#ff0086" - } else if $in < 1day { - "#aba800" - } else if $in < 3day { - "#00c918" - } else if $in < 1wk { - { fg: "#00c918" attr: "b" } - } else if $in < 6wk { - "#1faaaa" - } else if $in < 52wk { - "#3777e6" - } else { "dark_gray" } - } - range: "#101010" - float: "#101010" - string: "#101010" - nothing: "#101010" - binary: "#101010" - cellpath: "#101010" - row_index: { fg: "#00c918" attr: "b" } - record: "#101010" - list: "#101010" - block: "#101010" - hints: "dark_gray" - search_result: { fg: "#ff0086" bg: "#101010" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ad00a1" attr: "b" } - shape_binary: { fg: "#ad00a1" attr: "b" } - shape_block: { fg: "#3777e6" attr: "b" } - shape_bool: "#1faaaa" - shape_custom: "#00c918" - shape_datetime: { fg: "#1faaaa" attr: "b" } - shape_directory: "#1faaaa" - shape_external: "#1faaaa" - shape_externalarg: { fg: "#00c918" attr: "b" } - shape_filepath: "#1faaaa" - shape_flag: { fg: "#3777e6" attr: "b" } - shape_float: { fg: "#ad00a1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1faaaa" attr: "b" } - shape_int: { fg: "#ad00a1" attr: "b" } - shape_internalcall: { fg: "#1faaaa" attr: "b" } - shape_list: { fg: "#1faaaa" attr: "b" } - shape_literal: "#3777e6" - shape_match_pattern: "#00c918" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1faaaa" - shape_operator: "#aba800" - shape_or: { fg: "#ad00a1" attr: "b" } - shape_pipe: { fg: "#ad00a1" attr: "b" } - shape_range: { fg: "#aba800" attr: "b" } - shape_record: { fg: "#1faaaa" attr: "b" } - shape_redirection: { fg: "#ad00a1" attr: "b" } - shape_signature: { fg: "#00c918" attr: "b" } - shape_string: "#00c918" - shape_string_interpolation: { fg: "#1faaaa" attr: "b" } - shape_table: { fg: "#3777e6" attr: "b" } - shape_variable: "#ad00a1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#101010" - cursor: "#101010" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#101010' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00c918' attr: 'b' } + empty: '#3777e6' + bool: {|| if $in { '#1faaaa' } else { 'light_gray' } } + int: '#101010' + filesize: {|e| + if $e == 0b { + '#101010' + } else if $e < 1mb { + '#1faaaa' + } else {{ fg: '#3777e6' }} + } + duration: '#101010' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0086' attr: 'b' } + } else if $in < 6hr { + '#ff0086' + } else if $in < 1day { + '#aba800' + } else if $in < 3day { + '#00c918' + } else if $in < 1wk { + { fg: '#00c918' attr: 'b' } + } else if $in < 6wk { + '#1faaaa' + } else if $in < 52wk { + '#3777e6' + } else { 'dark_gray' } + } + range: '#101010' + float: '#101010' + string: '#101010' + nothing: '#101010' + binary: '#101010' + cellpath: '#101010' + row_index: { fg: '#00c918' attr: 'b' } + record: '#101010' + list: '#101010' + block: '#101010' + hints: 'dark_gray' + search_result: { fg: '#ff0086' bg: '#101010' } + + shape_and: { fg: '#ad00a1' attr: 'b' } + shape_binary: { fg: '#ad00a1' attr: 'b' } + shape_block: { fg: '#3777e6' attr: 'b' } + shape_bool: '#1faaaa' + shape_custom: '#00c918' + shape_datetime: { fg: '#1faaaa' attr: 'b' } + shape_directory: '#1faaaa' + shape_external: '#1faaaa' + shape_externalarg: { fg: '#00c918' attr: 'b' } + shape_filepath: '#1faaaa' + shape_flag: { fg: '#3777e6' attr: 'b' } + shape_float: { fg: '#ad00a1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1faaaa' attr: 'b' } + shape_int: { fg: '#ad00a1' attr: 'b' } + shape_internalcall: { fg: '#1faaaa' attr: 'b' } + shape_list: { fg: '#1faaaa' attr: 'b' } + shape_literal: '#3777e6' + shape_match_pattern: '#00c918' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1faaaa' + shape_operator: '#aba800' + shape_or: { fg: '#ad00a1' attr: 'b' } + shape_pipe: { fg: '#ad00a1' attr: 'b' } + shape_range: { fg: '#aba800' attr: 'b' } + shape_record: { fg: '#1faaaa' attr: 'b' } + shape_redirection: { fg: '#ad00a1' attr: 'b' } + shape_signature: { fg: '#00c918' attr: 'b' } + shape_string: '#00c918' + shape_string_interpolation: { fg: '#1faaaa' attr: 'b' } + shape_table: { fg: '#3777e6' attr: 'b' } + shape_variable: '#ad00a1' + + background: '#ffffff' + foreground: '#101010' + cursor: '#101010' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/sundried.nu b/themes/nu-themes/sundried.nu index b4258cc..7f57804 100644 --- a/themes/nu-themes/sundried.nu +++ b/themes/nu-themes/sundried.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c9c9c9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#587744" attr: "b" } - empty: "#485b98" - bool: {|| if $in { "#fad484" } else { "light_gray" } } - int: "#c9c9c9" - filesize: {|e| - if $e == 0b { - "#c9c9c9" - } else if $e < 1mb { - "#9c814f" - } else {{ fg: "#485b98" }} - } - duration: "#c9c9c9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a7463d" attr: "b" } - } else if $in < 6hr { - "#a7463d" - } else if $in < 1day { - "#9d602a" - } else if $in < 3day { - "#587744" - } else if $in < 1wk { - { fg: "#587744" attr: "b" } - } else if $in < 6wk { - "#9c814f" - } else if $in < 52wk { - "#485b98" - } else { "dark_gray" } - } - range: "#c9c9c9" - float: "#c9c9c9" - string: "#c9c9c9" - nothing: "#c9c9c9" - binary: "#c9c9c9" - cellpath: "#c9c9c9" - row_index: { fg: "#587744" attr: "b" } - record: "#c9c9c9" - list: "#c9c9c9" - block: "#c9c9c9" - hints: "dark_gray" - search_result: { fg: "#a7463d" bg: "#c9c9c9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#864651" attr: "b" } - shape_binary: { fg: "#864651" attr: "b" } - shape_block: { fg: "#485b98" attr: "b" } - shape_bool: "#fad484" - shape_custom: "#587744" - shape_datetime: { fg: "#9c814f" attr: "b" } - shape_directory: "#9c814f" - shape_external: "#9c814f" - shape_externalarg: { fg: "#587744" attr: "b" } - shape_filepath: "#9c814f" - shape_flag: { fg: "#485b98" attr: "b" } - shape_float: { fg: "#864651" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#9c814f" attr: "b" } - shape_int: { fg: "#864651" attr: "b" } - shape_internalcall: { fg: "#9c814f" attr: "b" } - shape_list: { fg: "#9c814f" attr: "b" } - shape_literal: "#485b98" - shape_match_pattern: "#587744" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#fad484" - shape_operator: "#9d602a" - shape_or: { fg: "#864651" attr: "b" } - shape_pipe: { fg: "#864651" attr: "b" } - shape_range: { fg: "#9d602a" attr: "b" } - shape_record: { fg: "#9c814f" attr: "b" } - shape_redirection: { fg: "#864651" attr: "b" } - shape_signature: { fg: "#587744" attr: "b" } - shape_string: "#587744" - shape_string_interpolation: { fg: "#9c814f" attr: "b" } - shape_table: { fg: "#485b98" attr: "b" } - shape_variable: "#864651" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1a1818" - foreground: "#c9c9c9" - cursor: "#c9c9c9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c9c9c9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#587744' attr: 'b' } + empty: '#485b98' + bool: {|| if $in { '#fad484' } else { 'light_gray' } } + int: '#c9c9c9' + filesize: {|e| + if $e == 0b { + '#c9c9c9' + } else if $e < 1mb { + '#9c814f' + } else {{ fg: '#485b98' }} + } + duration: '#c9c9c9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a7463d' attr: 'b' } + } else if $in < 6hr { + '#a7463d' + } else if $in < 1day { + '#9d602a' + } else if $in < 3day { + '#587744' + } else if $in < 1wk { + { fg: '#587744' attr: 'b' } + } else if $in < 6wk { + '#9c814f' + } else if $in < 52wk { + '#485b98' + } else { 'dark_gray' } + } + range: '#c9c9c9' + float: '#c9c9c9' + string: '#c9c9c9' + nothing: '#c9c9c9' + binary: '#c9c9c9' + cellpath: '#c9c9c9' + row_index: { fg: '#587744' attr: 'b' } + record: '#c9c9c9' + list: '#c9c9c9' + block: '#c9c9c9' + hints: 'dark_gray' + search_result: { fg: '#a7463d' bg: '#c9c9c9' } + + shape_and: { fg: '#864651' attr: 'b' } + shape_binary: { fg: '#864651' attr: 'b' } + shape_block: { fg: '#485b98' attr: 'b' } + shape_bool: '#fad484' + shape_custom: '#587744' + shape_datetime: { fg: '#9c814f' attr: 'b' } + shape_directory: '#9c814f' + shape_external: '#9c814f' + shape_externalarg: { fg: '#587744' attr: 'b' } + shape_filepath: '#9c814f' + shape_flag: { fg: '#485b98' attr: 'b' } + shape_float: { fg: '#864651' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#9c814f' attr: 'b' } + shape_int: { fg: '#864651' attr: 'b' } + shape_internalcall: { fg: '#9c814f' attr: 'b' } + shape_list: { fg: '#9c814f' attr: 'b' } + shape_literal: '#485b98' + shape_match_pattern: '#587744' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#fad484' + shape_operator: '#9d602a' + shape_or: { fg: '#864651' attr: 'b' } + shape_pipe: { fg: '#864651' attr: 'b' } + shape_range: { fg: '#9d602a' attr: 'b' } + shape_record: { fg: '#9c814f' attr: 'b' } + shape_redirection: { fg: '#864651' attr: 'b' } + shape_signature: { fg: '#587744' attr: 'b' } + shape_string: '#587744' + shape_string_interpolation: { fg: '#9c814f' attr: 'b' } + shape_table: { fg: '#485b98' attr: 'b' } + shape_variable: '#864651' + + background: '#1a1818' + foreground: '#c9c9c9' + cursor: '#c9c9c9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/symphonic.nu b/themes/nu-themes/symphonic.nu index 3cb2498..c54f1d0 100644 --- a/themes/nu-themes/symphonic.nu +++ b/themes/nu-themes/symphonic.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#56db3a" attr: "b" } - empty: "#0084d4" - bool: {|| if $in { "#ccccff" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#ccccff" - } else {{ fg: "#0084d4" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dc322f" attr: "b" } - } else if $in < 6hr { - "#dc322f" - } else if $in < 1day { - "#ff8400" - } else if $in < 3day { - "#56db3a" - } else if $in < 1wk { - { fg: "#56db3a" attr: "b" } - } else if $in < 6wk { - "#ccccff" - } else if $in < 52wk { - "#0084d4" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#56db3a" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#dc322f" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b729d9" attr: "b" } - shape_binary: { fg: "#b729d9" attr: "b" } - shape_block: { fg: "#0084d4" attr: "b" } - shape_bool: "#ccccff" - shape_custom: "#56db3a" - shape_datetime: { fg: "#ccccff" attr: "b" } - shape_directory: "#ccccff" - shape_external: "#ccccff" - shape_externalarg: { fg: "#56db3a" attr: "b" } - shape_filepath: "#ccccff" - shape_flag: { fg: "#0084d4" attr: "b" } - shape_float: { fg: "#b729d9" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ccccff" attr: "b" } - shape_int: { fg: "#b729d9" attr: "b" } - shape_internalcall: { fg: "#ccccff" attr: "b" } - shape_list: { fg: "#ccccff" attr: "b" } - shape_literal: "#0084d4" - shape_match_pattern: "#56db3a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ccccff" - shape_operator: "#ff8400" - shape_or: { fg: "#b729d9" attr: "b" } - shape_pipe: { fg: "#b729d9" attr: "b" } - shape_range: { fg: "#ff8400" attr: "b" } - shape_record: { fg: "#ccccff" attr: "b" } - shape_redirection: { fg: "#b729d9" attr: "b" } - shape_signature: { fg: "#56db3a" attr: "b" } - shape_string: "#56db3a" - shape_string_interpolation: { fg: "#ccccff" attr: "b" } - shape_table: { fg: "#0084d4" attr: "b" } - shape_variable: "#b729d9" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#56db3a' attr: 'b' } + empty: '#0084d4' + bool: {|| if $in { '#ccccff' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#ccccff' + } else {{ fg: '#0084d4' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dc322f' attr: 'b' } + } else if $in < 6hr { + '#dc322f' + } else if $in < 1day { + '#ff8400' + } else if $in < 3day { + '#56db3a' + } else if $in < 1wk { + { fg: '#56db3a' attr: 'b' } + } else if $in < 6wk { + '#ccccff' + } else if $in < 52wk { + '#0084d4' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#56db3a' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#dc322f' bg: '#ffffff' } + + shape_and: { fg: '#b729d9' attr: 'b' } + shape_binary: { fg: '#b729d9' attr: 'b' } + shape_block: { fg: '#0084d4' attr: 'b' } + shape_bool: '#ccccff' + shape_custom: '#56db3a' + shape_datetime: { fg: '#ccccff' attr: 'b' } + shape_directory: '#ccccff' + shape_external: '#ccccff' + shape_externalarg: { fg: '#56db3a' attr: 'b' } + shape_filepath: '#ccccff' + shape_flag: { fg: '#0084d4' attr: 'b' } + shape_float: { fg: '#b729d9' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ccccff' attr: 'b' } + shape_int: { fg: '#b729d9' attr: 'b' } + shape_internalcall: { fg: '#ccccff' attr: 'b' } + shape_list: { fg: '#ccccff' attr: 'b' } + shape_literal: '#0084d4' + shape_match_pattern: '#56db3a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ccccff' + shape_operator: '#ff8400' + shape_or: { fg: '#b729d9' attr: 'b' } + shape_pipe: { fg: '#b729d9' attr: 'b' } + shape_range: { fg: '#ff8400' attr: 'b' } + shape_record: { fg: '#ccccff' attr: 'b' } + shape_redirection: { fg: '#b729d9' attr: 'b' } + shape_signature: { fg: '#56db3a' attr: 'b' } + shape_string: '#56db3a' + shape_string_interpolation: { fg: '#ccccff' attr: 'b' } + shape_table: { fg: '#0084d4' attr: 'b' } + shape_variable: '#b729d9' + + background: '#000000' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/synth-midnight-dark.nu b/themes/nu-themes/synth-midnight-dark.nu index 5663bf0..c56d4d4 100644 --- a/themes/nu-themes/synth-midnight-dark.nu +++ b/themes/nu-themes/synth-midnight-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c1c3c4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#06ea61" attr: "b" } - empty: "#03aeff" - bool: {|| if $in { "#42fff9" } else { "light_gray" } } - int: "#c1c3c4" - filesize: {|e| - if $e == 0b { - "#c1c3c4" - } else if $e < 1mb { - "#42fff9" - } else {{ fg: "#03aeff" }} - } - duration: "#c1c3c4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b53b50" attr: "b" } - } else if $in < 6hr { - "#b53b50" - } else if $in < 1day { - "#c9d364" - } else if $in < 3day { - "#06ea61" - } else if $in < 1wk { - { fg: "#06ea61" attr: "b" } - } else if $in < 6wk { - "#42fff9" - } else if $in < 52wk { - "#03aeff" - } else { "dark_gray" } - } - range: "#c1c3c4" - float: "#c1c3c4" - string: "#c1c3c4" - nothing: "#c1c3c4" - binary: "#c1c3c4" - cellpath: "#c1c3c4" - row_index: { fg: "#06ea61" attr: "b" } - record: "#c1c3c4" - list: "#c1c3c4" - block: "#c1c3c4" - hints: "dark_gray" - search_result: { fg: "#b53b50" bg: "#c1c3c4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ea5ce2" attr: "b" } - shape_binary: { fg: "#ea5ce2" attr: "b" } - shape_block: { fg: "#03aeff" attr: "b" } - shape_bool: "#42fff9" - shape_custom: "#06ea61" - shape_datetime: { fg: "#42fff9" attr: "b" } - shape_directory: "#42fff9" - shape_external: "#42fff9" - shape_externalarg: { fg: "#06ea61" attr: "b" } - shape_filepath: "#42fff9" - shape_flag: { fg: "#03aeff" attr: "b" } - shape_float: { fg: "#ea5ce2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#42fff9" attr: "b" } - shape_int: { fg: "#ea5ce2" attr: "b" } - shape_internalcall: { fg: "#42fff9" attr: "b" } - shape_list: { fg: "#42fff9" attr: "b" } - shape_literal: "#03aeff" - shape_match_pattern: "#06ea61" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#42fff9" - shape_operator: "#c9d364" - shape_or: { fg: "#ea5ce2" attr: "b" } - shape_pipe: { fg: "#ea5ce2" attr: "b" } - shape_range: { fg: "#c9d364" attr: "b" } - shape_record: { fg: "#42fff9" attr: "b" } - shape_redirection: { fg: "#ea5ce2" attr: "b" } - shape_signature: { fg: "#06ea61" attr: "b" } - shape_string: "#06ea61" - shape_string_interpolation: { fg: "#42fff9" attr: "b" } - shape_table: { fg: "#03aeff" attr: "b" } - shape_variable: "#ea5ce2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#050608" - foreground: "#c1c3c4" - cursor: "#c1c3c4" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c1c3c4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#06ea61' attr: 'b' } + empty: '#03aeff' + bool: {|| if $in { '#42fff9' } else { 'light_gray' } } + int: '#c1c3c4' + filesize: {|e| + if $e == 0b { + '#c1c3c4' + } else if $e < 1mb { + '#42fff9' + } else {{ fg: '#03aeff' }} + } + duration: '#c1c3c4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b53b50' attr: 'b' } + } else if $in < 6hr { + '#b53b50' + } else if $in < 1day { + '#c9d364' + } else if $in < 3day { + '#06ea61' + } else if $in < 1wk { + { fg: '#06ea61' attr: 'b' } + } else if $in < 6wk { + '#42fff9' + } else if $in < 52wk { + '#03aeff' + } else { 'dark_gray' } + } + range: '#c1c3c4' + float: '#c1c3c4' + string: '#c1c3c4' + nothing: '#c1c3c4' + binary: '#c1c3c4' + cellpath: '#c1c3c4' + row_index: { fg: '#06ea61' attr: 'b' } + record: '#c1c3c4' + list: '#c1c3c4' + block: '#c1c3c4' + hints: 'dark_gray' + search_result: { fg: '#b53b50' bg: '#c1c3c4' } + + shape_and: { fg: '#ea5ce2' attr: 'b' } + shape_binary: { fg: '#ea5ce2' attr: 'b' } + shape_block: { fg: '#03aeff' attr: 'b' } + shape_bool: '#42fff9' + shape_custom: '#06ea61' + shape_datetime: { fg: '#42fff9' attr: 'b' } + shape_directory: '#42fff9' + shape_external: '#42fff9' + shape_externalarg: { fg: '#06ea61' attr: 'b' } + shape_filepath: '#42fff9' + shape_flag: { fg: '#03aeff' attr: 'b' } + shape_float: { fg: '#ea5ce2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#42fff9' attr: 'b' } + shape_int: { fg: '#ea5ce2' attr: 'b' } + shape_internalcall: { fg: '#42fff9' attr: 'b' } + shape_list: { fg: '#42fff9' attr: 'b' } + shape_literal: '#03aeff' + shape_match_pattern: '#06ea61' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#42fff9' + shape_operator: '#c9d364' + shape_or: { fg: '#ea5ce2' attr: 'b' } + shape_pipe: { fg: '#ea5ce2' attr: 'b' } + shape_range: { fg: '#c9d364' attr: 'b' } + shape_record: { fg: '#42fff9' attr: 'b' } + shape_redirection: { fg: '#ea5ce2' attr: 'b' } + shape_signature: { fg: '#06ea61' attr: 'b' } + shape_string: '#06ea61' + shape_string_interpolation: { fg: '#42fff9' attr: 'b' } + shape_table: { fg: '#03aeff' attr: 'b' } + shape_variable: '#ea5ce2' + + background: '#050608' + foreground: '#c1c3c4' + cursor: '#c1c3c4' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/synth-midnight-light.nu b/themes/nu-themes/synth-midnight-light.nu index 849d28f..5fd6533 100644 --- a/themes/nu-themes/synth-midnight-light.nu +++ b/themes/nu-themes/synth-midnight-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#28292a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#06ea61" attr: "b" } - empty: "#03aeff" - bool: {|| if $in { "#42fff9" } else { "light_gray" } } - int: "#28292a" - filesize: {|e| - if $e == 0b { - "#28292a" - } else if $e < 1mb { - "#42fff9" - } else {{ fg: "#03aeff" }} - } - duration: "#28292a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b53b50" attr: "b" } - } else if $in < 6hr { - "#b53b50" - } else if $in < 1day { - "#c9d364" - } else if $in < 3day { - "#06ea61" - } else if $in < 1wk { - { fg: "#06ea61" attr: "b" } - } else if $in < 6wk { - "#42fff9" - } else if $in < 52wk { - "#03aeff" - } else { "dark_gray" } - } - range: "#28292a" - float: "#28292a" - string: "#28292a" - nothing: "#28292a" - binary: "#28292a" - cellpath: "#28292a" - row_index: { fg: "#06ea61" attr: "b" } - record: "#28292a" - list: "#28292a" - block: "#28292a" - hints: "dark_gray" - search_result: { fg: "#b53b50" bg: "#28292a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ea5ce2" attr: "b" } - shape_binary: { fg: "#ea5ce2" attr: "b" } - shape_block: { fg: "#03aeff" attr: "b" } - shape_bool: "#42fff9" - shape_custom: "#06ea61" - shape_datetime: { fg: "#42fff9" attr: "b" } - shape_directory: "#42fff9" - shape_external: "#42fff9" - shape_externalarg: { fg: "#06ea61" attr: "b" } - shape_filepath: "#42fff9" - shape_flag: { fg: "#03aeff" attr: "b" } - shape_float: { fg: "#ea5ce2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#42fff9" attr: "b" } - shape_int: { fg: "#ea5ce2" attr: "b" } - shape_internalcall: { fg: "#42fff9" attr: "b" } - shape_list: { fg: "#42fff9" attr: "b" } - shape_literal: "#03aeff" - shape_match_pattern: "#06ea61" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#42fff9" - shape_operator: "#c9d364" - shape_or: { fg: "#ea5ce2" attr: "b" } - shape_pipe: { fg: "#ea5ce2" attr: "b" } - shape_range: { fg: "#c9d364" attr: "b" } - shape_record: { fg: "#42fff9" attr: "b" } - shape_redirection: { fg: "#ea5ce2" attr: "b" } - shape_signature: { fg: "#06ea61" attr: "b" } - shape_string: "#06ea61" - shape_string_interpolation: { fg: "#42fff9" attr: "b" } - shape_table: { fg: "#03aeff" attr: "b" } - shape_variable: "#ea5ce2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#dddfe0" - foreground: "#28292a" - cursor: "#28292a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#28292a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#06ea61' attr: 'b' } + empty: '#03aeff' + bool: {|| if $in { '#42fff9' } else { 'light_gray' } } + int: '#28292a' + filesize: {|e| + if $e == 0b { + '#28292a' + } else if $e < 1mb { + '#42fff9' + } else {{ fg: '#03aeff' }} + } + duration: '#28292a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b53b50' attr: 'b' } + } else if $in < 6hr { + '#b53b50' + } else if $in < 1day { + '#c9d364' + } else if $in < 3day { + '#06ea61' + } else if $in < 1wk { + { fg: '#06ea61' attr: 'b' } + } else if $in < 6wk { + '#42fff9' + } else if $in < 52wk { + '#03aeff' + } else { 'dark_gray' } + } + range: '#28292a' + float: '#28292a' + string: '#28292a' + nothing: '#28292a' + binary: '#28292a' + cellpath: '#28292a' + row_index: { fg: '#06ea61' attr: 'b' } + record: '#28292a' + list: '#28292a' + block: '#28292a' + hints: 'dark_gray' + search_result: { fg: '#b53b50' bg: '#28292a' } + + shape_and: { fg: '#ea5ce2' attr: 'b' } + shape_binary: { fg: '#ea5ce2' attr: 'b' } + shape_block: { fg: '#03aeff' attr: 'b' } + shape_bool: '#42fff9' + shape_custom: '#06ea61' + shape_datetime: { fg: '#42fff9' attr: 'b' } + shape_directory: '#42fff9' + shape_external: '#42fff9' + shape_externalarg: { fg: '#06ea61' attr: 'b' } + shape_filepath: '#42fff9' + shape_flag: { fg: '#03aeff' attr: 'b' } + shape_float: { fg: '#ea5ce2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#42fff9' attr: 'b' } + shape_int: { fg: '#ea5ce2' attr: 'b' } + shape_internalcall: { fg: '#42fff9' attr: 'b' } + shape_list: { fg: '#42fff9' attr: 'b' } + shape_literal: '#03aeff' + shape_match_pattern: '#06ea61' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#42fff9' + shape_operator: '#c9d364' + shape_or: { fg: '#ea5ce2' attr: 'b' } + shape_pipe: { fg: '#ea5ce2' attr: 'b' } + shape_range: { fg: '#c9d364' attr: 'b' } + shape_record: { fg: '#42fff9' attr: 'b' } + shape_redirection: { fg: '#ea5ce2' attr: 'b' } + shape_signature: { fg: '#06ea61' attr: 'b' } + shape_string: '#06ea61' + shape_string_interpolation: { fg: '#42fff9' attr: 'b' } + shape_table: { fg: '#03aeff' attr: 'b' } + shape_variable: '#ea5ce2' + + background: '#dddfe0' + foreground: '#28292a' + cursor: '#28292a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tango-dark.nu b/themes/nu-themes/tango-dark.nu index 65fdecd..60145c2 100644 --- a/themes/nu-themes/tango-dark.nu +++ b/themes/nu-themes/tango-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d7cf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4e9a05" attr: "b" } - empty: "#3464a4" - bool: {|| if $in { "#34e2e2" } else { "light_gray" } } - int: "#d3d7cf" - filesize: {|e| - if $e == 0b { - "#d3d7cf" - } else if $e < 1mb { - "#05989a" - } else {{ fg: "#3464a4" }} - } - duration: "#d3d7cf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#c4a000" - } else if $in < 3day { - "#4e9a05" - } else if $in < 1wk { - { fg: "#4e9a05" attr: "b" } - } else if $in < 6wk { - "#05989a" - } else if $in < 52wk { - "#3464a4" - } else { "dark_gray" } - } - range: "#d3d7cf" - float: "#d3d7cf" - string: "#d3d7cf" - nothing: "#d3d7cf" - binary: "#d3d7cf" - cellpath: "#d3d7cf" - row_index: { fg: "#4e9a05" attr: "b" } - record: "#d3d7cf" - list: "#d3d7cf" - block: "#d3d7cf" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#d3d7cf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#74507a" attr: "b" } - shape_binary: { fg: "#74507a" attr: "b" } - shape_block: { fg: "#3464a4" attr: "b" } - shape_bool: "#34e2e2" - shape_custom: "#4e9a05" - shape_datetime: { fg: "#05989a" attr: "b" } - shape_directory: "#05989a" - shape_external: "#05989a" - shape_externalarg: { fg: "#4e9a05" attr: "b" } - shape_filepath: "#05989a" - shape_flag: { fg: "#3464a4" attr: "b" } - shape_float: { fg: "#74507a" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#05989a" attr: "b" } - shape_int: { fg: "#74507a" attr: "b" } - shape_internalcall: { fg: "#05989a" attr: "b" } - shape_list: { fg: "#05989a" attr: "b" } - shape_literal: "#3464a4" - shape_match_pattern: "#4e9a05" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#34e2e2" - shape_operator: "#c4a000" - shape_or: { fg: "#74507a" attr: "b" } - shape_pipe: { fg: "#74507a" attr: "b" } - shape_range: { fg: "#c4a000" attr: "b" } - shape_record: { fg: "#05989a" attr: "b" } - shape_redirection: { fg: "#74507a" attr: "b" } - shape_signature: { fg: "#4e9a05" attr: "b" } - shape_string: "#4e9a05" - shape_string_interpolation: { fg: "#05989a" attr: "b" } - shape_table: { fg: "#3464a4" attr: "b" } - shape_variable: "#74507a" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d7cf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4e9a05' attr: 'b' } + empty: '#3464a4' + bool: {|| if $in { '#34e2e2' } else { 'light_gray' } } + int: '#d3d7cf' + filesize: {|e| + if $e == 0b { + '#d3d7cf' + } else if $e < 1mb { + '#05989a' + } else {{ fg: '#3464a4' }} + } + duration: '#d3d7cf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#c4a000' + } else if $in < 3day { + '#4e9a05' + } else if $in < 1wk { + { fg: '#4e9a05' attr: 'b' } + } else if $in < 6wk { + '#05989a' + } else if $in < 52wk { + '#3464a4' + } else { 'dark_gray' } + } + range: '#d3d7cf' + float: '#d3d7cf' + string: '#d3d7cf' + nothing: '#d3d7cf' + binary: '#d3d7cf' + cellpath: '#d3d7cf' + row_index: { fg: '#4e9a05' attr: 'b' } + record: '#d3d7cf' + list: '#d3d7cf' + block: '#d3d7cf' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#d3d7cf' } + + shape_and: { fg: '#74507a' attr: 'b' } + shape_binary: { fg: '#74507a' attr: 'b' } + shape_block: { fg: '#3464a4' attr: 'b' } + shape_bool: '#34e2e2' + shape_custom: '#4e9a05' + shape_datetime: { fg: '#05989a' attr: 'b' } + shape_directory: '#05989a' + shape_external: '#05989a' + shape_externalarg: { fg: '#4e9a05' attr: 'b' } + shape_filepath: '#05989a' + shape_flag: { fg: '#3464a4' attr: 'b' } + shape_float: { fg: '#74507a' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#05989a' attr: 'b' } + shape_int: { fg: '#74507a' attr: 'b' } + shape_internalcall: { fg: '#05989a' attr: 'b' } + shape_list: { fg: '#05989a' attr: 'b' } + shape_literal: '#3464a4' + shape_match_pattern: '#4e9a05' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#34e2e2' + shape_operator: '#c4a000' + shape_or: { fg: '#74507a' attr: 'b' } + shape_pipe: { fg: '#74507a' attr: 'b' } + shape_range: { fg: '#c4a000' attr: 'b' } + shape_record: { fg: '#05989a' attr: 'b' } + shape_redirection: { fg: '#74507a' attr: 'b' } + shape_signature: { fg: '#4e9a05' attr: 'b' } + shape_string: '#4e9a05' + shape_string_interpolation: { fg: '#05989a' attr: 'b' } + shape_table: { fg: '#3464a4' attr: 'b' } + shape_variable: '#74507a' + + background: '#000000' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tango-light.nu b/themes/nu-themes/tango-light.nu index b5e0240..43c4cf1 100644 --- a/themes/nu-themes/tango-light.nu +++ b/themes/nu-themes/tango-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d7cf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4e9a05" attr: "b" } - empty: "#3464a4" - bool: {|| if $in { "#34e2e2" } else { "light_gray" } } - int: "#d3d7cf" - filesize: {|e| - if $e == 0b { - "#d3d7cf" - } else if $e < 1mb { - "#05989a" - } else {{ fg: "#3464a4" }} - } - duration: "#d3d7cf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#c4a000" - } else if $in < 3day { - "#4e9a05" - } else if $in < 1wk { - { fg: "#4e9a05" attr: "b" } - } else if $in < 6wk { - "#05989a" - } else if $in < 52wk { - "#3464a4" - } else { "dark_gray" } - } - range: "#d3d7cf" - float: "#d3d7cf" - string: "#d3d7cf" - nothing: "#d3d7cf" - binary: "#d3d7cf" - cellpath: "#d3d7cf" - row_index: { fg: "#4e9a05" attr: "b" } - record: "#d3d7cf" - list: "#d3d7cf" - block: "#d3d7cf" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#d3d7cf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#74507a" attr: "b" } - shape_binary: { fg: "#74507a" attr: "b" } - shape_block: { fg: "#3464a4" attr: "b" } - shape_bool: "#34e2e2" - shape_custom: "#4e9a05" - shape_datetime: { fg: "#05989a" attr: "b" } - shape_directory: "#05989a" - shape_external: "#05989a" - shape_externalarg: { fg: "#4e9a05" attr: "b" } - shape_filepath: "#05989a" - shape_flag: { fg: "#3464a4" attr: "b" } - shape_float: { fg: "#74507a" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#05989a" attr: "b" } - shape_int: { fg: "#74507a" attr: "b" } - shape_internalcall: { fg: "#05989a" attr: "b" } - shape_list: { fg: "#05989a" attr: "b" } - shape_literal: "#3464a4" - shape_match_pattern: "#4e9a05" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#34e2e2" - shape_operator: "#c4a000" - shape_or: { fg: "#74507a" attr: "b" } - shape_pipe: { fg: "#74507a" attr: "b" } - shape_range: { fg: "#c4a000" attr: "b" } - shape_record: { fg: "#05989a" attr: "b" } - shape_redirection: { fg: "#74507a" attr: "b" } - shape_signature: { fg: "#4e9a05" attr: "b" } - shape_string: "#4e9a05" - shape_string_interpolation: { fg: "#05989a" attr: "b" } - shape_table: { fg: "#3464a4" attr: "b" } - shape_variable: "#74507a" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#000000" - cursor: "#000000" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d7cf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4e9a05' attr: 'b' } + empty: '#3464a4' + bool: {|| if $in { '#34e2e2' } else { 'light_gray' } } + int: '#d3d7cf' + filesize: {|e| + if $e == 0b { + '#d3d7cf' + } else if $e < 1mb { + '#05989a' + } else {{ fg: '#3464a4' }} + } + duration: '#d3d7cf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#c4a000' + } else if $in < 3day { + '#4e9a05' + } else if $in < 1wk { + { fg: '#4e9a05' attr: 'b' } + } else if $in < 6wk { + '#05989a' + } else if $in < 52wk { + '#3464a4' + } else { 'dark_gray' } + } + range: '#d3d7cf' + float: '#d3d7cf' + string: '#d3d7cf' + nothing: '#d3d7cf' + binary: '#d3d7cf' + cellpath: '#d3d7cf' + row_index: { fg: '#4e9a05' attr: 'b' } + record: '#d3d7cf' + list: '#d3d7cf' + block: '#d3d7cf' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#d3d7cf' } + + shape_and: { fg: '#74507a' attr: 'b' } + shape_binary: { fg: '#74507a' attr: 'b' } + shape_block: { fg: '#3464a4' attr: 'b' } + shape_bool: '#34e2e2' + shape_custom: '#4e9a05' + shape_datetime: { fg: '#05989a' attr: 'b' } + shape_directory: '#05989a' + shape_external: '#05989a' + shape_externalarg: { fg: '#4e9a05' attr: 'b' } + shape_filepath: '#05989a' + shape_flag: { fg: '#3464a4' attr: 'b' } + shape_float: { fg: '#74507a' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#05989a' attr: 'b' } + shape_int: { fg: '#74507a' attr: 'b' } + shape_internalcall: { fg: '#05989a' attr: 'b' } + shape_list: { fg: '#05989a' attr: 'b' } + shape_literal: '#3464a4' + shape_match_pattern: '#4e9a05' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#34e2e2' + shape_operator: '#c4a000' + shape_or: { fg: '#74507a' attr: 'b' } + shape_pipe: { fg: '#74507a' attr: 'b' } + shape_range: { fg: '#c4a000' attr: 'b' } + shape_record: { fg: '#05989a' attr: 'b' } + shape_redirection: { fg: '#74507a' attr: 'b' } + shape_signature: { fg: '#4e9a05' attr: 'b' } + shape_string: '#4e9a05' + shape_string_interpolation: { fg: '#05989a' attr: 'b' } + shape_table: { fg: '#3464a4' attr: 'b' } + shape_variable: '#74507a' + + background: '#ffffff' + foreground: '#000000' + cursor: '#000000' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tango.nu b/themes/nu-themes/tango.nu index 6e3859e..21e8bb3 100644 --- a/themes/nu-themes/tango.nu +++ b/themes/nu-themes/tango.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d3d7cf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4e9a06" attr: "b" } - empty: "#3465a4" - bool: {|| if $in { "#06989a" } else { "light_gray" } } - int: "#d3d7cf" - filesize: {|e| - if $e == 0b { - "#d3d7cf" - } else if $e < 1mb { - "#06989a" - } else {{ fg: "#3465a4" }} - } - duration: "#d3d7cf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc0000" attr: "b" } - } else if $in < 6hr { - "#cc0000" - } else if $in < 1day { - "#c4a000" - } else if $in < 3day { - "#4e9a06" - } else if $in < 1wk { - { fg: "#4e9a06" attr: "b" } - } else if $in < 6wk { - "#06989a" - } else if $in < 52wk { - "#3465a4" - } else { "dark_gray" } - } - range: "#d3d7cf" - float: "#d3d7cf" - string: "#d3d7cf" - nothing: "#d3d7cf" - binary: "#d3d7cf" - cellpath: "#d3d7cf" - row_index: { fg: "#4e9a06" attr: "b" } - record: "#d3d7cf" - list: "#d3d7cf" - block: "#d3d7cf" - hints: "dark_gray" - search_result: { fg: "#cc0000" bg: "#d3d7cf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#75507b" attr: "b" } - shape_binary: { fg: "#75507b" attr: "b" } - shape_block: { fg: "#3465a4" attr: "b" } - shape_bool: "#06989a" - shape_custom: "#4e9a06" - shape_datetime: { fg: "#06989a" attr: "b" } - shape_directory: "#06989a" - shape_external: "#06989a" - shape_externalarg: { fg: "#4e9a06" attr: "b" } - shape_filepath: "#06989a" - shape_flag: { fg: "#3465a4" attr: "b" } - shape_float: { fg: "#75507b" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#06989a" attr: "b" } - shape_int: { fg: "#75507b" attr: "b" } - shape_internalcall: { fg: "#06989a" attr: "b" } - shape_list: { fg: "#06989a" attr: "b" } - shape_literal: "#3465a4" - shape_match_pattern: "#4e9a06" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#06989a" - shape_operator: "#c4a000" - shape_or: { fg: "#75507b" attr: "b" } - shape_pipe: { fg: "#75507b" attr: "b" } - shape_range: { fg: "#c4a000" attr: "b" } - shape_record: { fg: "#06989a" attr: "b" } - shape_redirection: { fg: "#75507b" attr: "b" } - shape_signature: { fg: "#4e9a06" attr: "b" } - shape_string: "#4e9a06" - shape_string_interpolation: { fg: "#06989a" attr: "b" } - shape_table: { fg: "#3465a4" attr: "b" } - shape_variable: "#75507b" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2e3436" - foreground: "#d3d7cf" - cursor: "#d3d7cf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d3d7cf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4e9a06' attr: 'b' } + empty: '#3465a4' + bool: {|| if $in { '#06989a' } else { 'light_gray' } } + int: '#d3d7cf' + filesize: {|e| + if $e == 0b { + '#d3d7cf' + } else if $e < 1mb { + '#06989a' + } else {{ fg: '#3465a4' }} + } + duration: '#d3d7cf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc0000' attr: 'b' } + } else if $in < 6hr { + '#cc0000' + } else if $in < 1day { + '#c4a000' + } else if $in < 3day { + '#4e9a06' + } else if $in < 1wk { + { fg: '#4e9a06' attr: 'b' } + } else if $in < 6wk { + '#06989a' + } else if $in < 52wk { + '#3465a4' + } else { 'dark_gray' } + } + range: '#d3d7cf' + float: '#d3d7cf' + string: '#d3d7cf' + nothing: '#d3d7cf' + binary: '#d3d7cf' + cellpath: '#d3d7cf' + row_index: { fg: '#4e9a06' attr: 'b' } + record: '#d3d7cf' + list: '#d3d7cf' + block: '#d3d7cf' + hints: 'dark_gray' + search_result: { fg: '#cc0000' bg: '#d3d7cf' } + + shape_and: { fg: '#75507b' attr: 'b' } + shape_binary: { fg: '#75507b' attr: 'b' } + shape_block: { fg: '#3465a4' attr: 'b' } + shape_bool: '#06989a' + shape_custom: '#4e9a06' + shape_datetime: { fg: '#06989a' attr: 'b' } + shape_directory: '#06989a' + shape_external: '#06989a' + shape_externalarg: { fg: '#4e9a06' attr: 'b' } + shape_filepath: '#06989a' + shape_flag: { fg: '#3465a4' attr: 'b' } + shape_float: { fg: '#75507b' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#06989a' attr: 'b' } + shape_int: { fg: '#75507b' attr: 'b' } + shape_internalcall: { fg: '#06989a' attr: 'b' } + shape_list: { fg: '#06989a' attr: 'b' } + shape_literal: '#3465a4' + shape_match_pattern: '#4e9a06' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#06989a' + shape_operator: '#c4a000' + shape_or: { fg: '#75507b' attr: 'b' } + shape_pipe: { fg: '#75507b' attr: 'b' } + shape_range: { fg: '#c4a000' attr: 'b' } + shape_record: { fg: '#06989a' attr: 'b' } + shape_redirection: { fg: '#75507b' attr: 'b' } + shape_signature: { fg: '#4e9a06' attr: 'b' } + shape_string: '#4e9a06' + shape_string_interpolation: { fg: '#06989a' attr: 'b' } + shape_table: { fg: '#3465a4' attr: 'b' } + shape_variable: '#75507b' + + background: '#2e3436' + foreground: '#d3d7cf' + cursor: '#d3d7cf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/teerb.nu b/themes/nu-themes/teerb.nu index a2fb6cc..eb36077 100644 --- a/themes/nu-themes/teerb.nu +++ b/themes/nu-themes/teerb.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0d0d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#aed686" attr: "b" } - empty: "#86aed6" - bool: {|| if $in { "#b1e7dd" } else { "light_gray" } } - int: "#d0d0d0" - filesize: {|e| - if $e == 0b { - "#d0d0d0" - } else if $e < 1mb { - "#8adbb4" - } else {{ fg: "#86aed6" }} - } - duration: "#d0d0d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d68686" attr: "b" } - } else if $in < 6hr { - "#d68686" - } else if $in < 1day { - "#d7af87" - } else if $in < 3day { - "#aed686" - } else if $in < 1wk { - { fg: "#aed686" attr: "b" } - } else if $in < 6wk { - "#8adbb4" - } else if $in < 52wk { - "#86aed6" - } else { "dark_gray" } - } - range: "#d0d0d0" - float: "#d0d0d0" - string: "#d0d0d0" - nothing: "#d0d0d0" - binary: "#d0d0d0" - cellpath: "#d0d0d0" - row_index: { fg: "#aed686" attr: "b" } - record: "#d0d0d0" - list: "#d0d0d0" - block: "#d0d0d0" - hints: "dark_gray" - search_result: { fg: "#d68686" bg: "#d0d0d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d6aed6" attr: "b" } - shape_binary: { fg: "#d6aed6" attr: "b" } - shape_block: { fg: "#86aed6" attr: "b" } - shape_bool: "#b1e7dd" - shape_custom: "#aed686" - shape_datetime: { fg: "#8adbb4" attr: "b" } - shape_directory: "#8adbb4" - shape_external: "#8adbb4" - shape_externalarg: { fg: "#aed686" attr: "b" } - shape_filepath: "#8adbb4" - shape_flag: { fg: "#86aed6" attr: "b" } - shape_float: { fg: "#d6aed6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8adbb4" attr: "b" } - shape_int: { fg: "#d6aed6" attr: "b" } - shape_internalcall: { fg: "#8adbb4" attr: "b" } - shape_list: { fg: "#8adbb4" attr: "b" } - shape_literal: "#86aed6" - shape_match_pattern: "#aed686" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b1e7dd" - shape_operator: "#d7af87" - shape_or: { fg: "#d6aed6" attr: "b" } - shape_pipe: { fg: "#d6aed6" attr: "b" } - shape_range: { fg: "#d7af87" attr: "b" } - shape_record: { fg: "#8adbb4" attr: "b" } - shape_redirection: { fg: "#d6aed6" attr: "b" } - shape_signature: { fg: "#aed686" attr: "b" } - shape_string: "#aed686" - shape_string_interpolation: { fg: "#8adbb4" attr: "b" } - shape_table: { fg: "#86aed6" attr: "b" } - shape_variable: "#d6aed6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#262626" - foreground: "#d0d0d0" - cursor: "#d0d0d0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0d0d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#aed686' attr: 'b' } + empty: '#86aed6' + bool: {|| if $in { '#b1e7dd' } else { 'light_gray' } } + int: '#d0d0d0' + filesize: {|e| + if $e == 0b { + '#d0d0d0' + } else if $e < 1mb { + '#8adbb4' + } else {{ fg: '#86aed6' }} + } + duration: '#d0d0d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d68686' attr: 'b' } + } else if $in < 6hr { + '#d68686' + } else if $in < 1day { + '#d7af87' + } else if $in < 3day { + '#aed686' + } else if $in < 1wk { + { fg: '#aed686' attr: 'b' } + } else if $in < 6wk { + '#8adbb4' + } else if $in < 52wk { + '#86aed6' + } else { 'dark_gray' } + } + range: '#d0d0d0' + float: '#d0d0d0' + string: '#d0d0d0' + nothing: '#d0d0d0' + binary: '#d0d0d0' + cellpath: '#d0d0d0' + row_index: { fg: '#aed686' attr: 'b' } + record: '#d0d0d0' + list: '#d0d0d0' + block: '#d0d0d0' + hints: 'dark_gray' + search_result: { fg: '#d68686' bg: '#d0d0d0' } + + shape_and: { fg: '#d6aed6' attr: 'b' } + shape_binary: { fg: '#d6aed6' attr: 'b' } + shape_block: { fg: '#86aed6' attr: 'b' } + shape_bool: '#b1e7dd' + shape_custom: '#aed686' + shape_datetime: { fg: '#8adbb4' attr: 'b' } + shape_directory: '#8adbb4' + shape_external: '#8adbb4' + shape_externalarg: { fg: '#aed686' attr: 'b' } + shape_filepath: '#8adbb4' + shape_flag: { fg: '#86aed6' attr: 'b' } + shape_float: { fg: '#d6aed6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8adbb4' attr: 'b' } + shape_int: { fg: '#d6aed6' attr: 'b' } + shape_internalcall: { fg: '#8adbb4' attr: 'b' } + shape_list: { fg: '#8adbb4' attr: 'b' } + shape_literal: '#86aed6' + shape_match_pattern: '#aed686' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b1e7dd' + shape_operator: '#d7af87' + shape_or: { fg: '#d6aed6' attr: 'b' } + shape_pipe: { fg: '#d6aed6' attr: 'b' } + shape_range: { fg: '#d7af87' attr: 'b' } + shape_record: { fg: '#8adbb4' attr: 'b' } + shape_redirection: { fg: '#d6aed6' attr: 'b' } + shape_signature: { fg: '#aed686' attr: 'b' } + shape_string: '#aed686' + shape_string_interpolation: { fg: '#8adbb4' attr: 'b' } + shape_table: { fg: '#86aed6' attr: 'b' } + shape_variable: '#d6aed6' + + background: '#262626' + foreground: '#d0d0d0' + cursor: '#d0d0d0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-autumn.nu b/themes/nu-themes/tempus-autumn.nu index ca107a2..70cd7b0 100644 --- a/themes/nu-themes/tempus-autumn.nu +++ b/themes/nu-themes/tempus-autumn.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a5918a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#80a100" attr: "b" } - empty: "#7897c2" - bool: {|| if $in { "#2aa4ad" } else { "light_gray" } } - int: "#a5918a" - filesize: {|e| - if $e == 0b { - "#a5918a" - } else if $e < 1mb { - "#52a485" - } else {{ fg: "#7897c2" }} - } - duration: "#a5918a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f16c50" attr: "b" } - } else if $in < 6hr { - "#f16c50" - } else if $in < 1day { - "#ac9440" - } else if $in < 3day { - "#80a100" - } else if $in < 1wk { - { fg: "#80a100" attr: "b" } - } else if $in < 6wk { - "#52a485" - } else if $in < 52wk { - "#7897c2" - } else { "dark_gray" } - } - range: "#a5918a" - float: "#a5918a" - string: "#a5918a" - nothing: "#a5918a" - binary: "#a5918a" - cellpath: "#a5918a" - row_index: { fg: "#80a100" attr: "b" } - record: "#a5918a" - list: "#a5918a" - block: "#a5918a" - hints: "dark_gray" - search_result: { fg: "#f16c50" bg: "#a5918a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#dd758e" attr: "b" } - shape_binary: { fg: "#dd758e" attr: "b" } - shape_block: { fg: "#7897c2" attr: "b" } - shape_bool: "#2aa4ad" - shape_custom: "#80a100" - shape_datetime: { fg: "#52a485" attr: "b" } - shape_directory: "#52a485" - shape_external: "#52a485" - shape_externalarg: { fg: "#80a100" attr: "b" } - shape_filepath: "#52a485" - shape_flag: { fg: "#7897c2" attr: "b" } - shape_float: { fg: "#dd758e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#52a485" attr: "b" } - shape_int: { fg: "#dd758e" attr: "b" } - shape_internalcall: { fg: "#52a485" attr: "b" } - shape_list: { fg: "#52a485" attr: "b" } - shape_literal: "#7897c2" - shape_match_pattern: "#80a100" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2aa4ad" - shape_operator: "#ac9440" - shape_or: { fg: "#dd758e" attr: "b" } - shape_pipe: { fg: "#dd758e" attr: "b" } - shape_range: { fg: "#ac9440" attr: "b" } - shape_record: { fg: "#52a485" attr: "b" } - shape_redirection: { fg: "#dd758e" attr: "b" } - shape_signature: { fg: "#80a100" attr: "b" } - shape_string: "#80a100" - shape_string_interpolation: { fg: "#52a485" attr: "b" } - shape_table: { fg: "#7897c2" attr: "b" } - shape_variable: "#dd758e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#302420" - foreground: "#a9a2a6" - cursor: "#a9a2a6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a5918a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#80a100' attr: 'b' } + empty: '#7897c2' + bool: {|| if $in { '#2aa4ad' } else { 'light_gray' } } + int: '#a5918a' + filesize: {|e| + if $e == 0b { + '#a5918a' + } else if $e < 1mb { + '#52a485' + } else {{ fg: '#7897c2' }} + } + duration: '#a5918a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f16c50' attr: 'b' } + } else if $in < 6hr { + '#f16c50' + } else if $in < 1day { + '#ac9440' + } else if $in < 3day { + '#80a100' + } else if $in < 1wk { + { fg: '#80a100' attr: 'b' } + } else if $in < 6wk { + '#52a485' + } else if $in < 52wk { + '#7897c2' + } else { 'dark_gray' } + } + range: '#a5918a' + float: '#a5918a' + string: '#a5918a' + nothing: '#a5918a' + binary: '#a5918a' + cellpath: '#a5918a' + row_index: { fg: '#80a100' attr: 'b' } + record: '#a5918a' + list: '#a5918a' + block: '#a5918a' + hints: 'dark_gray' + search_result: { fg: '#f16c50' bg: '#a5918a' } + + shape_and: { fg: '#dd758e' attr: 'b' } + shape_binary: { fg: '#dd758e' attr: 'b' } + shape_block: { fg: '#7897c2' attr: 'b' } + shape_bool: '#2aa4ad' + shape_custom: '#80a100' + shape_datetime: { fg: '#52a485' attr: 'b' } + shape_directory: '#52a485' + shape_external: '#52a485' + shape_externalarg: { fg: '#80a100' attr: 'b' } + shape_filepath: '#52a485' + shape_flag: { fg: '#7897c2' attr: 'b' } + shape_float: { fg: '#dd758e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#52a485' attr: 'b' } + shape_int: { fg: '#dd758e' attr: 'b' } + shape_internalcall: { fg: '#52a485' attr: 'b' } + shape_list: { fg: '#52a485' attr: 'b' } + shape_literal: '#7897c2' + shape_match_pattern: '#80a100' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2aa4ad' + shape_operator: '#ac9440' + shape_or: { fg: '#dd758e' attr: 'b' } + shape_pipe: { fg: '#dd758e' attr: 'b' } + shape_range: { fg: '#ac9440' attr: 'b' } + shape_record: { fg: '#52a485' attr: 'b' } + shape_redirection: { fg: '#dd758e' attr: 'b' } + shape_signature: { fg: '#80a100' attr: 'b' } + shape_string: '#80a100' + shape_string_interpolation: { fg: '#52a485' attr: 'b' } + shape_table: { fg: '#7897c2' attr: 'b' } + shape_variable: '#dd758e' + + background: '#302420' + foreground: '#a9a2a6' + cursor: '#a9a2a6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-classic.nu b/themes/nu-themes/tempus-classic.nu index e6e9543..142603c 100644 --- a/themes/nu-themes/tempus-classic.nu +++ b/themes/nu-themes/tempus-classic.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#949d9f" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8c9e3d" attr: "b" } - empty: "#6e9cb0" - bool: {|| if $in { "#7aa880" } else { "light_gray" } } - int: "#949d9f" - filesize: {|e| - if $e == 0b { - "#949d9f" - } else if $e < 1mb { - "#6da280" - } else {{ fg: "#6e9cb0" }} - } - duration: "#949d9f" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d2813d" attr: "b" } - } else if $in < 6hr { - "#d2813d" - } else if $in < 1day { - "#b1942b" - } else if $in < 3day { - "#8c9e3d" - } else if $in < 1wk { - { fg: "#8c9e3d" attr: "b" } - } else if $in < 6wk { - "#6da280" - } else if $in < 52wk { - "#6e9cb0" - } else { "dark_gray" } - } - range: "#949d9f" - float: "#949d9f" - string: "#949d9f" - nothing: "#949d9f" - binary: "#949d9f" - cellpath: "#949d9f" - row_index: { fg: "#8c9e3d" attr: "b" } - record: "#949d9f" - list: "#949d9f" - block: "#949d9f" - hints: "dark_gray" - search_result: { fg: "#d2813d" bg: "#949d9f" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b58d88" attr: "b" } - shape_binary: { fg: "#b58d88" attr: "b" } - shape_block: { fg: "#6e9cb0" attr: "b" } - shape_bool: "#7aa880" - shape_custom: "#8c9e3d" - shape_datetime: { fg: "#6da280" attr: "b" } - shape_directory: "#6da280" - shape_external: "#6da280" - shape_externalarg: { fg: "#8c9e3d" attr: "b" } - shape_filepath: "#6da280" - shape_flag: { fg: "#6e9cb0" attr: "b" } - shape_float: { fg: "#b58d88" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6da280" attr: "b" } - shape_int: { fg: "#b58d88" attr: "b" } - shape_internalcall: { fg: "#6da280" attr: "b" } - shape_list: { fg: "#6da280" attr: "b" } - shape_literal: "#6e9cb0" - shape_match_pattern: "#8c9e3d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7aa880" - shape_operator: "#b1942b" - shape_or: { fg: "#b58d88" attr: "b" } - shape_pipe: { fg: "#b58d88" attr: "b" } - shape_range: { fg: "#b1942b" attr: "b" } - shape_record: { fg: "#6da280" attr: "b" } - shape_redirection: { fg: "#b58d88" attr: "b" } - shape_signature: { fg: "#8c9e3d" attr: "b" } - shape_string: "#8c9e3d" - shape_string_interpolation: { fg: "#6da280" attr: "b" } - shape_table: { fg: "#6e9cb0" attr: "b" } - shape_variable: "#b58d88" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#232323" - foreground: "#aeadaf" - cursor: "#aeadaf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#949d9f' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8c9e3d' attr: 'b' } + empty: '#6e9cb0' + bool: {|| if $in { '#7aa880' } else { 'light_gray' } } + int: '#949d9f' + filesize: {|e| + if $e == 0b { + '#949d9f' + } else if $e < 1mb { + '#6da280' + } else {{ fg: '#6e9cb0' }} + } + duration: '#949d9f' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d2813d' attr: 'b' } + } else if $in < 6hr { + '#d2813d' + } else if $in < 1day { + '#b1942b' + } else if $in < 3day { + '#8c9e3d' + } else if $in < 1wk { + { fg: '#8c9e3d' attr: 'b' } + } else if $in < 6wk { + '#6da280' + } else if $in < 52wk { + '#6e9cb0' + } else { 'dark_gray' } + } + range: '#949d9f' + float: '#949d9f' + string: '#949d9f' + nothing: '#949d9f' + binary: '#949d9f' + cellpath: '#949d9f' + row_index: { fg: '#8c9e3d' attr: 'b' } + record: '#949d9f' + list: '#949d9f' + block: '#949d9f' + hints: 'dark_gray' + search_result: { fg: '#d2813d' bg: '#949d9f' } + + shape_and: { fg: '#b58d88' attr: 'b' } + shape_binary: { fg: '#b58d88' attr: 'b' } + shape_block: { fg: '#6e9cb0' attr: 'b' } + shape_bool: '#7aa880' + shape_custom: '#8c9e3d' + shape_datetime: { fg: '#6da280' attr: 'b' } + shape_directory: '#6da280' + shape_external: '#6da280' + shape_externalarg: { fg: '#8c9e3d' attr: 'b' } + shape_filepath: '#6da280' + shape_flag: { fg: '#6e9cb0' attr: 'b' } + shape_float: { fg: '#b58d88' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6da280' attr: 'b' } + shape_int: { fg: '#b58d88' attr: 'b' } + shape_internalcall: { fg: '#6da280' attr: 'b' } + shape_list: { fg: '#6da280' attr: 'b' } + shape_literal: '#6e9cb0' + shape_match_pattern: '#8c9e3d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7aa880' + shape_operator: '#b1942b' + shape_or: { fg: '#b58d88' attr: 'b' } + shape_pipe: { fg: '#b58d88' attr: 'b' } + shape_range: { fg: '#b1942b' attr: 'b' } + shape_record: { fg: '#6da280' attr: 'b' } + shape_redirection: { fg: '#b58d88' attr: 'b' } + shape_signature: { fg: '#8c9e3d' attr: 'b' } + shape_string: '#8c9e3d' + shape_string_interpolation: { fg: '#6da280' attr: 'b' } + shape_table: { fg: '#6e9cb0' attr: 'b' } + shape_variable: '#b58d88' + + background: '#232323' + foreground: '#aeadaf' + cursor: '#aeadaf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-dawn.nu b/themes/nu-themes/tempus-dawn.nu index 2bdbefb..0f0380d 100644 --- a/themes/nu-themes/tempus-dawn.nu +++ b/themes/nu-themes/tempus-dawn.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#e2e4e1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#206620" attr: "b" } - empty: "#4b529a" - bool: {|| if $in { "#106e8c" } else { "light_gray" } } - int: "#e2e4e1" - filesize: {|e| - if $e == 0b { - "#e2e4e1" - } else if $e < 1mb { - "#086784" - } else {{ fg: "#4b529a" }} - } - duration: "#e2e4e1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a32a3a" attr: "b" } - } else if $in < 6hr { - "#a32a3a" - } else if $in < 1day { - "#745300" - } else if $in < 3day { - "#206620" - } else if $in < 1wk { - { fg: "#206620" attr: "b" } - } else if $in < 6wk { - "#086784" - } else if $in < 52wk { - "#4b529a" - } else { "dark_gray" } - } - range: "#e2e4e1" - float: "#e2e4e1" - string: "#e2e4e1" - nothing: "#e2e4e1" - binary: "#e2e4e1" - cellpath: "#e2e4e1" - row_index: { fg: "#206620" attr: "b" } - record: "#e2e4e1" - list: "#e2e4e1" - block: "#e2e4e1" - hints: "dark_gray" - search_result: { fg: "#a32a3a" bg: "#e2e4e1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8d377e" attr: "b" } - shape_binary: { fg: "#8d377e" attr: "b" } - shape_block: { fg: "#4b529a" attr: "b" } - shape_bool: "#106e8c" - shape_custom: "#206620" - shape_datetime: { fg: "#086784" attr: "b" } - shape_directory: "#086784" - shape_external: "#086784" - shape_externalarg: { fg: "#206620" attr: "b" } - shape_filepath: "#086784" - shape_flag: { fg: "#4b529a" attr: "b" } - shape_float: { fg: "#8d377e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#086784" attr: "b" } - shape_int: { fg: "#8d377e" attr: "b" } - shape_internalcall: { fg: "#086784" attr: "b" } - shape_list: { fg: "#086784" attr: "b" } - shape_literal: "#4b529a" - shape_match_pattern: "#206620" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#106e8c" - shape_operator: "#745300" - shape_or: { fg: "#8d377e" attr: "b" } - shape_pipe: { fg: "#8d377e" attr: "b" } - shape_range: { fg: "#745300" attr: "b" } - shape_record: { fg: "#086784" attr: "b" } - shape_redirection: { fg: "#8d377e" attr: "b" } - shape_signature: { fg: "#206620" attr: "b" } - shape_string: "#206620" - shape_string_interpolation: { fg: "#086784" attr: "b" } - shape_table: { fg: "#4b529a" attr: "b" } - shape_variable: "#8d377e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#eff0f2" - foreground: "#4a4b4e" - cursor: "#4a4b4e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#e2e4e1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#206620' attr: 'b' } + empty: '#4b529a' + bool: {|| if $in { '#106e8c' } else { 'light_gray' } } + int: '#e2e4e1' + filesize: {|e| + if $e == 0b { + '#e2e4e1' + } else if $e < 1mb { + '#086784' + } else {{ fg: '#4b529a' }} + } + duration: '#e2e4e1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a32a3a' attr: 'b' } + } else if $in < 6hr { + '#a32a3a' + } else if $in < 1day { + '#745300' + } else if $in < 3day { + '#206620' + } else if $in < 1wk { + { fg: '#206620' attr: 'b' } + } else if $in < 6wk { + '#086784' + } else if $in < 52wk { + '#4b529a' + } else { 'dark_gray' } + } + range: '#e2e4e1' + float: '#e2e4e1' + string: '#e2e4e1' + nothing: '#e2e4e1' + binary: '#e2e4e1' + cellpath: '#e2e4e1' + row_index: { fg: '#206620' attr: 'b' } + record: '#e2e4e1' + list: '#e2e4e1' + block: '#e2e4e1' + hints: 'dark_gray' + search_result: { fg: '#a32a3a' bg: '#e2e4e1' } + + shape_and: { fg: '#8d377e' attr: 'b' } + shape_binary: { fg: '#8d377e' attr: 'b' } + shape_block: { fg: '#4b529a' attr: 'b' } + shape_bool: '#106e8c' + shape_custom: '#206620' + shape_datetime: { fg: '#086784' attr: 'b' } + shape_directory: '#086784' + shape_external: '#086784' + shape_externalarg: { fg: '#206620' attr: 'b' } + shape_filepath: '#086784' + shape_flag: { fg: '#4b529a' attr: 'b' } + shape_float: { fg: '#8d377e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#086784' attr: 'b' } + shape_int: { fg: '#8d377e' attr: 'b' } + shape_internalcall: { fg: '#086784' attr: 'b' } + shape_list: { fg: '#086784' attr: 'b' } + shape_literal: '#4b529a' + shape_match_pattern: '#206620' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#106e8c' + shape_operator: '#745300' + shape_or: { fg: '#8d377e' attr: 'b' } + shape_pipe: { fg: '#8d377e' attr: 'b' } + shape_range: { fg: '#745300' attr: 'b' } + shape_record: { fg: '#086784' attr: 'b' } + shape_redirection: { fg: '#8d377e' attr: 'b' } + shape_signature: { fg: '#206620' attr: 'b' } + shape_string: '#206620' + shape_string_interpolation: { fg: '#086784' attr: 'b' } + shape_table: { fg: '#4b529a' attr: 'b' } + shape_variable: '#8d377e' + + background: '#eff0f2' + foreground: '#4a4b4e' + cursor: '#4a4b4e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-day.nu b/themes/nu-themes/tempus-day.nu index a6d0c54..cef0698 100644 --- a/themes/nu-themes/tempus-day.nu +++ b/themes/nu-themes/tempus-day.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eae9dd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#107410" attr: "b" } - empty: "#385dc4" - bool: {|| if $in { "#337087" } else { "light_gray" } } - int: "#eae9dd" - filesize: {|e| - if $e == 0b { - "#eae9dd" - } else if $e < 1mb { - "#007070" - } else {{ fg: "#385dc4" }} - } - duration: "#eae9dd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c81000" attr: "b" } - } else if $in < 6hr { - "#c81000" - } else if $in < 1day { - "#806000" - } else if $in < 3day { - "#107410" - } else if $in < 1wk { - { fg: "#107410" attr: "b" } - } else if $in < 6wk { - "#007070" - } else if $in < 52wk { - "#385dc4" - } else { "dark_gray" } - } - range: "#eae9dd" - float: "#eae9dd" - string: "#eae9dd" - nothing: "#eae9dd" - binary: "#eae9dd" - cellpath: "#eae9dd" - row_index: { fg: "#107410" attr: "b" } - record: "#eae9dd" - list: "#eae9dd" - block: "#eae9dd" - hints: "dark_gray" - search_result: { fg: "#c81000" bg: "#eae9dd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b63052" attr: "b" } - shape_binary: { fg: "#b63052" attr: "b" } - shape_block: { fg: "#385dc4" attr: "b" } - shape_bool: "#337087" - shape_custom: "#107410" - shape_datetime: { fg: "#007070" attr: "b" } - shape_directory: "#007070" - shape_external: "#007070" - shape_externalarg: { fg: "#107410" attr: "b" } - shape_filepath: "#007070" - shape_flag: { fg: "#385dc4" attr: "b" } - shape_float: { fg: "#b63052" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#007070" attr: "b" } - shape_int: { fg: "#b63052" attr: "b" } - shape_internalcall: { fg: "#007070" attr: "b" } - shape_list: { fg: "#007070" attr: "b" } - shape_literal: "#385dc4" - shape_match_pattern: "#107410" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#337087" - shape_operator: "#806000" - shape_or: { fg: "#b63052" attr: "b" } - shape_pipe: { fg: "#b63052" attr: "b" } - shape_range: { fg: "#806000" attr: "b" } - shape_record: { fg: "#007070" attr: "b" } - shape_redirection: { fg: "#b63052" attr: "b" } - shape_signature: { fg: "#107410" attr: "b" } - shape_string: "#107410" - shape_string_interpolation: { fg: "#007070" attr: "b" } - shape_table: { fg: "#385dc4" attr: "b" } - shape_variable: "#b63052" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f8f2e5" - foreground: "#464340" - cursor: "#464340" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eae9dd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#107410' attr: 'b' } + empty: '#385dc4' + bool: {|| if $in { '#337087' } else { 'light_gray' } } + int: '#eae9dd' + filesize: {|e| + if $e == 0b { + '#eae9dd' + } else if $e < 1mb { + '#007070' + } else {{ fg: '#385dc4' }} + } + duration: '#eae9dd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c81000' attr: 'b' } + } else if $in < 6hr { + '#c81000' + } else if $in < 1day { + '#806000' + } else if $in < 3day { + '#107410' + } else if $in < 1wk { + { fg: '#107410' attr: 'b' } + } else if $in < 6wk { + '#007070' + } else if $in < 52wk { + '#385dc4' + } else { 'dark_gray' } + } + range: '#eae9dd' + float: '#eae9dd' + string: '#eae9dd' + nothing: '#eae9dd' + binary: '#eae9dd' + cellpath: '#eae9dd' + row_index: { fg: '#107410' attr: 'b' } + record: '#eae9dd' + list: '#eae9dd' + block: '#eae9dd' + hints: 'dark_gray' + search_result: { fg: '#c81000' bg: '#eae9dd' } + + shape_and: { fg: '#b63052' attr: 'b' } + shape_binary: { fg: '#b63052' attr: 'b' } + shape_block: { fg: '#385dc4' attr: 'b' } + shape_bool: '#337087' + shape_custom: '#107410' + shape_datetime: { fg: '#007070' attr: 'b' } + shape_directory: '#007070' + shape_external: '#007070' + shape_externalarg: { fg: '#107410' attr: 'b' } + shape_filepath: '#007070' + shape_flag: { fg: '#385dc4' attr: 'b' } + shape_float: { fg: '#b63052' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#007070' attr: 'b' } + shape_int: { fg: '#b63052' attr: 'b' } + shape_internalcall: { fg: '#007070' attr: 'b' } + shape_list: { fg: '#007070' attr: 'b' } + shape_literal: '#385dc4' + shape_match_pattern: '#107410' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#337087' + shape_operator: '#806000' + shape_or: { fg: '#b63052' attr: 'b' } + shape_pipe: { fg: '#b63052' attr: 'b' } + shape_range: { fg: '#806000' attr: 'b' } + shape_record: { fg: '#007070' attr: 'b' } + shape_redirection: { fg: '#b63052' attr: 'b' } + shape_signature: { fg: '#107410' attr: 'b' } + shape_string: '#107410' + shape_string_interpolation: { fg: '#007070' attr: 'b' } + shape_table: { fg: '#385dc4' attr: 'b' } + shape_variable: '#b63052' + + background: '#f8f2e5' + foreground: '#464340' + cursor: '#464340' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-dusk.nu b/themes/nu-themes/tempus-dusk.nu index 72d681d..6a9cb7d 100644 --- a/themes/nu-themes/tempus-dusk.nu +++ b/themes/nu-themes/tempus-dusk.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a29899" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8ba089" attr: "b" } - empty: "#8c9abe" - bool: {|| if $in { "#8caeb6" } else { "light_gray" } } - int: "#a29899" - filesize: {|e| - if $e == 0b { - "#a29899" - } else if $e < 1mb { - "#8e9aba" - } else {{ fg: "#8c9abe" }} - } - duration: "#a29899" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cb8d56" attr: "b" } - } else if $in < 6hr { - "#cb8d56" - } else if $in < 1day { - "#a79c46" - } else if $in < 3day { - "#8ba089" - } else if $in < 1wk { - { fg: "#8ba089" attr: "b" } - } else if $in < 6wk { - "#8e9aba" - } else if $in < 52wk { - "#8c9abe" - } else { "dark_gray" } - } - range: "#a29899" - float: "#a29899" - string: "#a29899" - nothing: "#a29899" - binary: "#a29899" - cellpath: "#a29899" - row_index: { fg: "#8ba089" attr: "b" } - record: "#a29899" - list: "#a29899" - block: "#a29899" - hints: "dark_gray" - search_result: { fg: "#cb8d56" bg: "#a29899" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b190af" attr: "b" } - shape_binary: { fg: "#b190af" attr: "b" } - shape_block: { fg: "#8c9abe" attr: "b" } - shape_bool: "#8caeb6" - shape_custom: "#8ba089" - shape_datetime: { fg: "#8e9aba" attr: "b" } - shape_directory: "#8e9aba" - shape_external: "#8e9aba" - shape_externalarg: { fg: "#8ba089" attr: "b" } - shape_filepath: "#8e9aba" - shape_flag: { fg: "#8c9abe" attr: "b" } - shape_float: { fg: "#b190af" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8e9aba" attr: "b" } - shape_int: { fg: "#b190af" attr: "b" } - shape_internalcall: { fg: "#8e9aba" attr: "b" } - shape_list: { fg: "#8e9aba" attr: "b" } - shape_literal: "#8c9abe" - shape_match_pattern: "#8ba089" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8caeb6" - shape_operator: "#a79c46" - shape_or: { fg: "#b190af" attr: "b" } - shape_pipe: { fg: "#b190af" attr: "b" } - shape_range: { fg: "#a79c46" attr: "b" } - shape_record: { fg: "#8e9aba" attr: "b" } - shape_redirection: { fg: "#b190af" attr: "b" } - shape_signature: { fg: "#8ba089" attr: "b" } - shape_string: "#8ba089" - shape_string_interpolation: { fg: "#8e9aba" attr: "b" } - shape_table: { fg: "#8c9abe" attr: "b" } - shape_variable: "#b190af" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f252d" - foreground: "#a2a8ba" - cursor: "#a2a8ba" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a29899' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8ba089' attr: 'b' } + empty: '#8c9abe' + bool: {|| if $in { '#8caeb6' } else { 'light_gray' } } + int: '#a29899' + filesize: {|e| + if $e == 0b { + '#a29899' + } else if $e < 1mb { + '#8e9aba' + } else {{ fg: '#8c9abe' }} + } + duration: '#a29899' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cb8d56' attr: 'b' } + } else if $in < 6hr { + '#cb8d56' + } else if $in < 1day { + '#a79c46' + } else if $in < 3day { + '#8ba089' + } else if $in < 1wk { + { fg: '#8ba089' attr: 'b' } + } else if $in < 6wk { + '#8e9aba' + } else if $in < 52wk { + '#8c9abe' + } else { 'dark_gray' } + } + range: '#a29899' + float: '#a29899' + string: '#a29899' + nothing: '#a29899' + binary: '#a29899' + cellpath: '#a29899' + row_index: { fg: '#8ba089' attr: 'b' } + record: '#a29899' + list: '#a29899' + block: '#a29899' + hints: 'dark_gray' + search_result: { fg: '#cb8d56' bg: '#a29899' } + + shape_and: { fg: '#b190af' attr: 'b' } + shape_binary: { fg: '#b190af' attr: 'b' } + shape_block: { fg: '#8c9abe' attr: 'b' } + shape_bool: '#8caeb6' + shape_custom: '#8ba089' + shape_datetime: { fg: '#8e9aba' attr: 'b' } + shape_directory: '#8e9aba' + shape_external: '#8e9aba' + shape_externalarg: { fg: '#8ba089' attr: 'b' } + shape_filepath: '#8e9aba' + shape_flag: { fg: '#8c9abe' attr: 'b' } + shape_float: { fg: '#b190af' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8e9aba' attr: 'b' } + shape_int: { fg: '#b190af' attr: 'b' } + shape_internalcall: { fg: '#8e9aba' attr: 'b' } + shape_list: { fg: '#8e9aba' attr: 'b' } + shape_literal: '#8c9abe' + shape_match_pattern: '#8ba089' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8caeb6' + shape_operator: '#a79c46' + shape_or: { fg: '#b190af' attr: 'b' } + shape_pipe: { fg: '#b190af' attr: 'b' } + shape_range: { fg: '#a79c46' attr: 'b' } + shape_record: { fg: '#8e9aba' attr: 'b' } + shape_redirection: { fg: '#b190af' attr: 'b' } + shape_signature: { fg: '#8ba089' attr: 'b' } + shape_string: '#8ba089' + shape_string_interpolation: { fg: '#8e9aba' attr: 'b' } + shape_table: { fg: '#8c9abe' attr: 'b' } + shape_variable: '#b190af' + + background: '#1f252d' + foreground: '#a2a8ba' + cursor: '#a2a8ba' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-fugit.nu b/themes/nu-themes/tempus-fugit.nu index 72f089c..bb305b6 100644 --- a/themes/nu-themes/tempus-fugit.nu +++ b/themes/nu-themes/tempus-fugit.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f2ebe9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#357200" attr: "b" } - empty: "#1666b0" - bool: {|| if $in { "#00786a" } else { "light_gray" } } - int: "#f2ebe9" - filesize: {|e| - if $e == 0b { - "#f2ebe9" - } else if $e < 1mb { - "#007072" - } else {{ fg: "#1666b0" }} - } - duration: "#f2ebe9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c61a14" attr: "b" } - } else if $in < 6hr { - "#c61a14" - } else if $in < 1day { - "#825e00" - } else if $in < 3day { - "#357200" - } else if $in < 1wk { - { fg: "#357200" attr: "b" } - } else if $in < 6wk { - "#007072" - } else if $in < 52wk { - "#1666b0" - } else { "dark_gray" } - } - range: "#f2ebe9" - float: "#f2ebe9" - string: "#f2ebe9" - nothing: "#f2ebe9" - binary: "#f2ebe9" - cellpath: "#f2ebe9" - row_index: { fg: "#357200" attr: "b" } - record: "#f2ebe9" - list: "#f2ebe9" - block: "#f2ebe9" - hints: "dark_gray" - search_result: { fg: "#c61a14" bg: "#f2ebe9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a83884" attr: "b" } - shape_binary: { fg: "#a83884" attr: "b" } - shape_block: { fg: "#1666b0" attr: "b" } - shape_bool: "#00786a" - shape_custom: "#357200" - shape_datetime: { fg: "#007072" attr: "b" } - shape_directory: "#007072" - shape_external: "#007072" - shape_externalarg: { fg: "#357200" attr: "b" } - shape_filepath: "#007072" - shape_flag: { fg: "#1666b0" attr: "b" } - shape_float: { fg: "#a83884" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#007072" attr: "b" } - shape_int: { fg: "#a83884" attr: "b" } - shape_internalcall: { fg: "#007072" attr: "b" } - shape_list: { fg: "#007072" attr: "b" } - shape_literal: "#1666b0" - shape_match_pattern: "#357200" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00786a" - shape_operator: "#825e00" - shape_or: { fg: "#a83884" attr: "b" } - shape_pipe: { fg: "#a83884" attr: "b" } - shape_range: { fg: "#825e00" attr: "b" } - shape_record: { fg: "#007072" attr: "b" } - shape_redirection: { fg: "#a83884" attr: "b" } - shape_signature: { fg: "#357200" attr: "b" } - shape_string: "#357200" - shape_string_interpolation: { fg: "#007072" attr: "b" } - shape_table: { fg: "#1666b0" attr: "b" } - shape_variable: "#a83884" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fff5f3" - foreground: "#4d595f" - cursor: "#4d595f" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f2ebe9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#357200' attr: 'b' } + empty: '#1666b0' + bool: {|| if $in { '#00786a' } else { 'light_gray' } } + int: '#f2ebe9' + filesize: {|e| + if $e == 0b { + '#f2ebe9' + } else if $e < 1mb { + '#007072' + } else {{ fg: '#1666b0' }} + } + duration: '#f2ebe9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c61a14' attr: 'b' } + } else if $in < 6hr { + '#c61a14' + } else if $in < 1day { + '#825e00' + } else if $in < 3day { + '#357200' + } else if $in < 1wk { + { fg: '#357200' attr: 'b' } + } else if $in < 6wk { + '#007072' + } else if $in < 52wk { + '#1666b0' + } else { 'dark_gray' } + } + range: '#f2ebe9' + float: '#f2ebe9' + string: '#f2ebe9' + nothing: '#f2ebe9' + binary: '#f2ebe9' + cellpath: '#f2ebe9' + row_index: { fg: '#357200' attr: 'b' } + record: '#f2ebe9' + list: '#f2ebe9' + block: '#f2ebe9' + hints: 'dark_gray' + search_result: { fg: '#c61a14' bg: '#f2ebe9' } + + shape_and: { fg: '#a83884' attr: 'b' } + shape_binary: { fg: '#a83884' attr: 'b' } + shape_block: { fg: '#1666b0' attr: 'b' } + shape_bool: '#00786a' + shape_custom: '#357200' + shape_datetime: { fg: '#007072' attr: 'b' } + shape_directory: '#007072' + shape_external: '#007072' + shape_externalarg: { fg: '#357200' attr: 'b' } + shape_filepath: '#007072' + shape_flag: { fg: '#1666b0' attr: 'b' } + shape_float: { fg: '#a83884' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#007072' attr: 'b' } + shape_int: { fg: '#a83884' attr: 'b' } + shape_internalcall: { fg: '#007072' attr: 'b' } + shape_list: { fg: '#007072' attr: 'b' } + shape_literal: '#1666b0' + shape_match_pattern: '#357200' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00786a' + shape_operator: '#825e00' + shape_or: { fg: '#a83884' attr: 'b' } + shape_pipe: { fg: '#a83884' attr: 'b' } + shape_range: { fg: '#825e00' attr: 'b' } + shape_record: { fg: '#007072' attr: 'b' } + shape_redirection: { fg: '#a83884' attr: 'b' } + shape_signature: { fg: '#357200' attr: 'b' } + shape_string: '#357200' + shape_string_interpolation: { fg: '#007072' attr: 'b' } + shape_table: { fg: '#1666b0' attr: 'b' } + shape_variable: '#a83884' + + background: '#fff5f3' + foreground: '#4d595f' + cursor: '#4d595f' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-future.nu b/themes/nu-themes/tempus-future.nu index 7125b2b..612f978 100644 --- a/themes/nu-themes/tempus-future.nu +++ b/themes/nu-themes/tempus-future.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a59ebd" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6ab539" attr: "b" } - empty: "#4aaed3" - bool: {|| if $in { "#2cbab6" } else { "light_gray" } } - int: "#a59ebd" - filesize: {|e| - if $e == 0b { - "#a59ebd" - } else if $e < 1mb { - "#29b3bb" - } else {{ fg: "#4aaed3" }} - } - duration: "#a59ebd" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff778a" attr: "b" } - } else if $in < 6hr { - "#ff778a" - } else if $in < 1day { - "#bfa01a" - } else if $in < 3day { - "#6ab539" - } else if $in < 1wk { - { fg: "#6ab539" attr: "b" } - } else if $in < 6wk { - "#29b3bb" - } else if $in < 52wk { - "#4aaed3" - } else { "dark_gray" } - } - range: "#a59ebd" - float: "#a59ebd" - string: "#a59ebd" - nothing: "#a59ebd" - binary: "#a59ebd" - cellpath: "#a59ebd" - row_index: { fg: "#6ab539" attr: "b" } - record: "#a59ebd" - list: "#a59ebd" - block: "#a59ebd" - hints: "dark_gray" - search_result: { fg: "#ff778a" bg: "#a59ebd" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e58a82" attr: "b" } - shape_binary: { fg: "#e58a82" attr: "b" } - shape_block: { fg: "#4aaed3" attr: "b" } - shape_bool: "#2cbab6" - shape_custom: "#6ab539" - shape_datetime: { fg: "#29b3bb" attr: "b" } - shape_directory: "#29b3bb" - shape_external: "#29b3bb" - shape_externalarg: { fg: "#6ab539" attr: "b" } - shape_filepath: "#29b3bb" - shape_flag: { fg: "#4aaed3" attr: "b" } - shape_float: { fg: "#e58a82" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#29b3bb" attr: "b" } - shape_int: { fg: "#e58a82" attr: "b" } - shape_internalcall: { fg: "#29b3bb" attr: "b" } - shape_list: { fg: "#29b3bb" attr: "b" } - shape_literal: "#4aaed3" - shape_match_pattern: "#6ab539" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2cbab6" - shape_operator: "#bfa01a" - shape_or: { fg: "#e58a82" attr: "b" } - shape_pipe: { fg: "#e58a82" attr: "b" } - shape_range: { fg: "#bfa01a" attr: "b" } - shape_record: { fg: "#29b3bb" attr: "b" } - shape_redirection: { fg: "#e58a82" attr: "b" } - shape_signature: { fg: "#6ab539" attr: "b" } - shape_string: "#6ab539" - shape_string_interpolation: { fg: "#29b3bb" attr: "b" } - shape_table: { fg: "#4aaed3" attr: "b" } - shape_variable: "#e58a82" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#090a18" - foreground: "#b4abac" - cursor: "#b4abac" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a59ebd' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6ab539' attr: 'b' } + empty: '#4aaed3' + bool: {|| if $in { '#2cbab6' } else { 'light_gray' } } + int: '#a59ebd' + filesize: {|e| + if $e == 0b { + '#a59ebd' + } else if $e < 1mb { + '#29b3bb' + } else {{ fg: '#4aaed3' }} + } + duration: '#a59ebd' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff778a' attr: 'b' } + } else if $in < 6hr { + '#ff778a' + } else if $in < 1day { + '#bfa01a' + } else if $in < 3day { + '#6ab539' + } else if $in < 1wk { + { fg: '#6ab539' attr: 'b' } + } else if $in < 6wk { + '#29b3bb' + } else if $in < 52wk { + '#4aaed3' + } else { 'dark_gray' } + } + range: '#a59ebd' + float: '#a59ebd' + string: '#a59ebd' + nothing: '#a59ebd' + binary: '#a59ebd' + cellpath: '#a59ebd' + row_index: { fg: '#6ab539' attr: 'b' } + record: '#a59ebd' + list: '#a59ebd' + block: '#a59ebd' + hints: 'dark_gray' + search_result: { fg: '#ff778a' bg: '#a59ebd' } + + shape_and: { fg: '#e58a82' attr: 'b' } + shape_binary: { fg: '#e58a82' attr: 'b' } + shape_block: { fg: '#4aaed3' attr: 'b' } + shape_bool: '#2cbab6' + shape_custom: '#6ab539' + shape_datetime: { fg: '#29b3bb' attr: 'b' } + shape_directory: '#29b3bb' + shape_external: '#29b3bb' + shape_externalarg: { fg: '#6ab539' attr: 'b' } + shape_filepath: '#29b3bb' + shape_flag: { fg: '#4aaed3' attr: 'b' } + shape_float: { fg: '#e58a82' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#29b3bb' attr: 'b' } + shape_int: { fg: '#e58a82' attr: 'b' } + shape_internalcall: { fg: '#29b3bb' attr: 'b' } + shape_list: { fg: '#29b3bb' attr: 'b' } + shape_literal: '#4aaed3' + shape_match_pattern: '#6ab539' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2cbab6' + shape_operator: '#bfa01a' + shape_or: { fg: '#e58a82' attr: 'b' } + shape_pipe: { fg: '#e58a82' attr: 'b' } + shape_range: { fg: '#bfa01a' attr: 'b' } + shape_record: { fg: '#29b3bb' attr: 'b' } + shape_redirection: { fg: '#e58a82' attr: 'b' } + shape_signature: { fg: '#6ab539' attr: 'b' } + shape_string: '#6ab539' + shape_string_interpolation: { fg: '#29b3bb' attr: 'b' } + shape_table: { fg: '#4aaed3' attr: 'b' } + shape_variable: '#e58a82' + + background: '#090a18' + foreground: '#b4abac' + cursor: '#b4abac' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-night.nu b/themes/nu-themes/tempus-night.nu index c79cde7..313a6e5 100644 --- a/themes/nu-themes/tempus-night.nu +++ b/themes/nu-themes/tempus-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c4bdaf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#52ba40" attr: "b" } - empty: "#5aaaf2" - bool: {|| if $in { "#00ca9a" } else { "light_gray" } } - int: "#c4bdaf" - filesize: {|e| - if $e == 0b { - "#c4bdaf" - } else if $e < 1mb { - "#1db5c3" - } else {{ fg: "#5aaaf2" }} - } - duration: "#c4bdaf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fb7e8e" attr: "b" } - } else if $in < 6hr { - "#fb7e8e" - } else if $in < 1day { - "#b0a800" - } else if $in < 3day { - "#52ba40" - } else if $in < 1wk { - { fg: "#52ba40" attr: "b" } - } else if $in < 6wk { - "#1db5c3" - } else if $in < 52wk { - "#5aaaf2" - } else { "dark_gray" } - } - range: "#c4bdaf" - float: "#c4bdaf" - string: "#c4bdaf" - nothing: "#c4bdaf" - binary: "#c4bdaf" - cellpath: "#c4bdaf" - row_index: { fg: "#52ba40" attr: "b" } - record: "#c4bdaf" - list: "#c4bdaf" - block: "#c4bdaf" - hints: "dark_gray" - search_result: { fg: "#fb7e8e" bg: "#c4bdaf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ee80c0" attr: "b" } - shape_binary: { fg: "#ee80c0" attr: "b" } - shape_block: { fg: "#5aaaf2" attr: "b" } - shape_bool: "#00ca9a" - shape_custom: "#52ba40" - shape_datetime: { fg: "#1db5c3" attr: "b" } - shape_directory: "#1db5c3" - shape_external: "#1db5c3" - shape_externalarg: { fg: "#52ba40" attr: "b" } - shape_filepath: "#1db5c3" - shape_flag: { fg: "#5aaaf2" attr: "b" } - shape_float: { fg: "#ee80c0" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1db5c3" attr: "b" } - shape_int: { fg: "#ee80c0" attr: "b" } - shape_internalcall: { fg: "#1db5c3" attr: "b" } - shape_list: { fg: "#1db5c3" attr: "b" } - shape_literal: "#5aaaf2" - shape_match_pattern: "#52ba40" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ca9a" - shape_operator: "#b0a800" - shape_or: { fg: "#ee80c0" attr: "b" } - shape_pipe: { fg: "#ee80c0" attr: "b" } - shape_range: { fg: "#b0a800" attr: "b" } - shape_record: { fg: "#1db5c3" attr: "b" } - shape_redirection: { fg: "#ee80c0" attr: "b" } - shape_signature: { fg: "#52ba40" attr: "b" } - shape_string: "#52ba40" - shape_string_interpolation: { fg: "#1db5c3" attr: "b" } - shape_table: { fg: "#5aaaf2" attr: "b" } - shape_variable: "#ee80c0" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1a1a1a" - foreground: "#e0e0e0" - cursor: "#e0e0e0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c4bdaf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#52ba40' attr: 'b' } + empty: '#5aaaf2' + bool: {|| if $in { '#00ca9a' } else { 'light_gray' } } + int: '#c4bdaf' + filesize: {|e| + if $e == 0b { + '#c4bdaf' + } else if $e < 1mb { + '#1db5c3' + } else {{ fg: '#5aaaf2' }} + } + duration: '#c4bdaf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fb7e8e' attr: 'b' } + } else if $in < 6hr { + '#fb7e8e' + } else if $in < 1day { + '#b0a800' + } else if $in < 3day { + '#52ba40' + } else if $in < 1wk { + { fg: '#52ba40' attr: 'b' } + } else if $in < 6wk { + '#1db5c3' + } else if $in < 52wk { + '#5aaaf2' + } else { 'dark_gray' } + } + range: '#c4bdaf' + float: '#c4bdaf' + string: '#c4bdaf' + nothing: '#c4bdaf' + binary: '#c4bdaf' + cellpath: '#c4bdaf' + row_index: { fg: '#52ba40' attr: 'b' } + record: '#c4bdaf' + list: '#c4bdaf' + block: '#c4bdaf' + hints: 'dark_gray' + search_result: { fg: '#fb7e8e' bg: '#c4bdaf' } + + shape_and: { fg: '#ee80c0' attr: 'b' } + shape_binary: { fg: '#ee80c0' attr: 'b' } + shape_block: { fg: '#5aaaf2' attr: 'b' } + shape_bool: '#00ca9a' + shape_custom: '#52ba40' + shape_datetime: { fg: '#1db5c3' attr: 'b' } + shape_directory: '#1db5c3' + shape_external: '#1db5c3' + shape_externalarg: { fg: '#52ba40' attr: 'b' } + shape_filepath: '#1db5c3' + shape_flag: { fg: '#5aaaf2' attr: 'b' } + shape_float: { fg: '#ee80c0' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1db5c3' attr: 'b' } + shape_int: { fg: '#ee80c0' attr: 'b' } + shape_internalcall: { fg: '#1db5c3' attr: 'b' } + shape_list: { fg: '#1db5c3' attr: 'b' } + shape_literal: '#5aaaf2' + shape_match_pattern: '#52ba40' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ca9a' + shape_operator: '#b0a800' + shape_or: { fg: '#ee80c0' attr: 'b' } + shape_pipe: { fg: '#ee80c0' attr: 'b' } + shape_range: { fg: '#b0a800' attr: 'b' } + shape_record: { fg: '#1db5c3' attr: 'b' } + shape_redirection: { fg: '#ee80c0' attr: 'b' } + shape_signature: { fg: '#52ba40' attr: 'b' } + shape_string: '#52ba40' + shape_string_interpolation: { fg: '#1db5c3' attr: 'b' } + shape_table: { fg: '#5aaaf2' attr: 'b' } + shape_variable: '#ee80c0' + + background: '#1a1a1a' + foreground: '#e0e0e0' + cursor: '#e0e0e0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-past.nu b/themes/nu-themes/tempus-past.nu index 7309a3b..3e1637e 100644 --- a/themes/nu-themes/tempus-past.nu +++ b/themes/nu-themes/tempus-past.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ece6de" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#0a7040" attr: "b" } - empty: "#1763aa" - bool: {|| if $in { "#07737a" } else { "light_gray" } } - int: "#ece6de" - filesize: {|e| - if $e == 0b { - "#ece6de" - } else if $e < 1mb { - "#096a83" - } else {{ fg: "#1763aa" }} - } - duration: "#ece6de" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c00c50" attr: "b" } - } else if $in < 6hr { - "#c00c50" - } else if $in < 1day { - "#a6403a" - } else if $in < 3day { - "#0a7040" - } else if $in < 1wk { - { fg: "#0a7040" attr: "b" } - } else if $in < 6wk { - "#096a83" - } else if $in < 52wk { - "#1763aa" - } else { "dark_gray" } - } - range: "#ece6de" - float: "#ece6de" - string: "#ece6de" - nothing: "#ece6de" - binary: "#ece6de" - cellpath: "#ece6de" - row_index: { fg: "#0a7040" attr: "b" } - record: "#ece6de" - list: "#ece6de" - block: "#ece6de" - hints: "dark_gray" - search_result: { fg: "#c00c50" bg: "#ece6de" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b02874" attr: "b" } - shape_binary: { fg: "#b02874" attr: "b" } - shape_block: { fg: "#1763aa" attr: "b" } - shape_bool: "#07737a" - shape_custom: "#0a7040" - shape_datetime: { fg: "#096a83" attr: "b" } - shape_directory: "#096a83" - shape_external: "#096a83" - shape_externalarg: { fg: "#0a7040" attr: "b" } - shape_filepath: "#096a83" - shape_flag: { fg: "#1763aa" attr: "b" } - shape_float: { fg: "#b02874" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#096a83" attr: "b" } - shape_int: { fg: "#b02874" attr: "b" } - shape_internalcall: { fg: "#096a83" attr: "b" } - shape_list: { fg: "#096a83" attr: "b" } - shape_literal: "#1763aa" - shape_match_pattern: "#0a7040" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#07737a" - shape_operator: "#a6403a" - shape_or: { fg: "#b02874" attr: "b" } - shape_pipe: { fg: "#b02874" attr: "b" } - shape_range: { fg: "#a6403a" attr: "b" } - shape_record: { fg: "#096a83" attr: "b" } - shape_redirection: { fg: "#b02874" attr: "b" } - shape_signature: { fg: "#0a7040" attr: "b" } - shape_string: "#0a7040" - shape_string_interpolation: { fg: "#096a83" attr: "b" } - shape_table: { fg: "#1763aa" attr: "b" } - shape_variable: "#b02874" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f3f2f4" - foreground: "#53545b" - cursor: "#53545b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ece6de' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#0a7040' attr: 'b' } + empty: '#1763aa' + bool: {|| if $in { '#07737a' } else { 'light_gray' } } + int: '#ece6de' + filesize: {|e| + if $e == 0b { + '#ece6de' + } else if $e < 1mb { + '#096a83' + } else {{ fg: '#1763aa' }} + } + duration: '#ece6de' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c00c50' attr: 'b' } + } else if $in < 6hr { + '#c00c50' + } else if $in < 1day { + '#a6403a' + } else if $in < 3day { + '#0a7040' + } else if $in < 1wk { + { fg: '#0a7040' attr: 'b' } + } else if $in < 6wk { + '#096a83' + } else if $in < 52wk { + '#1763aa' + } else { 'dark_gray' } + } + range: '#ece6de' + float: '#ece6de' + string: '#ece6de' + nothing: '#ece6de' + binary: '#ece6de' + cellpath: '#ece6de' + row_index: { fg: '#0a7040' attr: 'b' } + record: '#ece6de' + list: '#ece6de' + block: '#ece6de' + hints: 'dark_gray' + search_result: { fg: '#c00c50' bg: '#ece6de' } + + shape_and: { fg: '#b02874' attr: 'b' } + shape_binary: { fg: '#b02874' attr: 'b' } + shape_block: { fg: '#1763aa' attr: 'b' } + shape_bool: '#07737a' + shape_custom: '#0a7040' + shape_datetime: { fg: '#096a83' attr: 'b' } + shape_directory: '#096a83' + shape_external: '#096a83' + shape_externalarg: { fg: '#0a7040' attr: 'b' } + shape_filepath: '#096a83' + shape_flag: { fg: '#1763aa' attr: 'b' } + shape_float: { fg: '#b02874' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#096a83' attr: 'b' } + shape_int: { fg: '#b02874' attr: 'b' } + shape_internalcall: { fg: '#096a83' attr: 'b' } + shape_list: { fg: '#096a83' attr: 'b' } + shape_literal: '#1763aa' + shape_match_pattern: '#0a7040' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#07737a' + shape_operator: '#a6403a' + shape_or: { fg: '#b02874' attr: 'b' } + shape_pipe: { fg: '#b02874' attr: 'b' } + shape_range: { fg: '#a6403a' attr: 'b' } + shape_record: { fg: '#096a83' attr: 'b' } + shape_redirection: { fg: '#b02874' attr: 'b' } + shape_signature: { fg: '#0a7040' attr: 'b' } + shape_string: '#0a7040' + shape_string_interpolation: { fg: '#096a83' attr: 'b' } + shape_table: { fg: '#1763aa' attr: 'b' } + shape_variable: '#b02874' + + background: '#f3f2f4' + foreground: '#53545b' + cursor: '#53545b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-rift.nu b/themes/nu-themes/tempus-rift.nu index 4dffd48..c5c39b4 100644 --- a/themes/nu-themes/tempus-rift.nu +++ b/themes/nu-themes/tempus-rift.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ab9aa9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#34b534" attr: "b" } - empty: "#30aeb0" - bool: {|| if $in { "#10c480" } else { "light_gray" } } - int: "#ab9aa9" - filesize: {|e| - if $e == 0b { - "#ab9aa9" - } else if $e < 1mb { - "#5fad8f" - } else {{ fg: "#30aeb0" }} - } - duration: "#ab9aa9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c19904" attr: "b" } - } else if $in < 6hr { - "#c19904" - } else if $in < 1day { - "#7fad00" - } else if $in < 3day { - "#34b534" - } else if $in < 1wk { - { fg: "#34b534" attr: "b" } - } else if $in < 6wk { - "#5fad8f" - } else if $in < 52wk { - "#30aeb0" - } else { "dark_gray" } - } - range: "#ab9aa9" - float: "#ab9aa9" - string: "#ab9aa9" - nothing: "#ab9aa9" - binary: "#ab9aa9" - cellpath: "#ab9aa9" - row_index: { fg: "#34b534" attr: "b" } - record: "#ab9aa9" - list: "#ab9aa9" - block: "#ab9aa9" - hints: "dark_gray" - search_result: { fg: "#c19904" bg: "#ab9aa9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c8954c" attr: "b" } - shape_binary: { fg: "#c8954c" attr: "b" } - shape_block: { fg: "#30aeb0" attr: "b" } - shape_bool: "#10c480" - shape_custom: "#34b534" - shape_datetime: { fg: "#5fad8f" attr: "b" } - shape_directory: "#5fad8f" - shape_external: "#5fad8f" - shape_externalarg: { fg: "#34b534" attr: "b" } - shape_filepath: "#5fad8f" - shape_flag: { fg: "#30aeb0" attr: "b" } - shape_float: { fg: "#c8954c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5fad8f" attr: "b" } - shape_int: { fg: "#c8954c" attr: "b" } - shape_internalcall: { fg: "#5fad8f" attr: "b" } - shape_list: { fg: "#5fad8f" attr: "b" } - shape_literal: "#30aeb0" - shape_match_pattern: "#34b534" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#10c480" - shape_operator: "#7fad00" - shape_or: { fg: "#c8954c" attr: "b" } - shape_pipe: { fg: "#c8954c" attr: "b" } - shape_range: { fg: "#7fad00" attr: "b" } - shape_record: { fg: "#5fad8f" attr: "b" } - shape_redirection: { fg: "#c8954c" attr: "b" } - shape_signature: { fg: "#34b534" attr: "b" } - shape_string: "#34b534" - shape_string_interpolation: { fg: "#5fad8f" attr: "b" } - shape_table: { fg: "#30aeb0" attr: "b" } - shape_variable: "#c8954c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#162c22" - foreground: "#bbbcbc" - cursor: "#bbbcbc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ab9aa9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#34b534' attr: 'b' } + empty: '#30aeb0' + bool: {|| if $in { '#10c480' } else { 'light_gray' } } + int: '#ab9aa9' + filesize: {|e| + if $e == 0b { + '#ab9aa9' + } else if $e < 1mb { + '#5fad8f' + } else {{ fg: '#30aeb0' }} + } + duration: '#ab9aa9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c19904' attr: 'b' } + } else if $in < 6hr { + '#c19904' + } else if $in < 1day { + '#7fad00' + } else if $in < 3day { + '#34b534' + } else if $in < 1wk { + { fg: '#34b534' attr: 'b' } + } else if $in < 6wk { + '#5fad8f' + } else if $in < 52wk { + '#30aeb0' + } else { 'dark_gray' } + } + range: '#ab9aa9' + float: '#ab9aa9' + string: '#ab9aa9' + nothing: '#ab9aa9' + binary: '#ab9aa9' + cellpath: '#ab9aa9' + row_index: { fg: '#34b534' attr: 'b' } + record: '#ab9aa9' + list: '#ab9aa9' + block: '#ab9aa9' + hints: 'dark_gray' + search_result: { fg: '#c19904' bg: '#ab9aa9' } + + shape_and: { fg: '#c8954c' attr: 'b' } + shape_binary: { fg: '#c8954c' attr: 'b' } + shape_block: { fg: '#30aeb0' attr: 'b' } + shape_bool: '#10c480' + shape_custom: '#34b534' + shape_datetime: { fg: '#5fad8f' attr: 'b' } + shape_directory: '#5fad8f' + shape_external: '#5fad8f' + shape_externalarg: { fg: '#34b534' attr: 'b' } + shape_filepath: '#5fad8f' + shape_flag: { fg: '#30aeb0' attr: 'b' } + shape_float: { fg: '#c8954c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5fad8f' attr: 'b' } + shape_int: { fg: '#c8954c' attr: 'b' } + shape_internalcall: { fg: '#5fad8f' attr: 'b' } + shape_list: { fg: '#5fad8f' attr: 'b' } + shape_literal: '#30aeb0' + shape_match_pattern: '#34b534' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#10c480' + shape_operator: '#7fad00' + shape_or: { fg: '#c8954c' attr: 'b' } + shape_pipe: { fg: '#c8954c' attr: 'b' } + shape_range: { fg: '#7fad00' attr: 'b' } + shape_record: { fg: '#5fad8f' attr: 'b' } + shape_redirection: { fg: '#c8954c' attr: 'b' } + shape_signature: { fg: '#34b534' attr: 'b' } + shape_string: '#34b534' + shape_string_interpolation: { fg: '#5fad8f' attr: 'b' } + shape_table: { fg: '#30aeb0' attr: 'b' } + shape_variable: '#c8954c' + + background: '#162c22' + foreground: '#bbbcbc' + cursor: '#bbbcbc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-spring.nu b/themes/nu-themes/tempus-spring.nu index b3ff40b..d6a3ed9 100644 --- a/themes/nu-themes/tempus-spring.nu +++ b/themes/nu-themes/tempus-spring.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#96aca7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5cbc4d" attr: "b" } - empty: "#39b6ce" - bool: {|| if $in { "#3cbaa6" } else { "light_gray" } } - int: "#96aca7" - filesize: {|e| - if $e == 0b { - "#96aca7" - } else if $e < 1mb { - "#36bd84" - } else {{ fg: "#39b6ce" }} - } - duration: "#96aca7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff855a" attr: "b" } - } else if $in < 6hr { - "#ff855a" - } else if $in < 1day { - "#a6af1a" - } else if $in < 3day { - "#5cbc4d" - } else if $in < 1wk { - { fg: "#5cbc4d" attr: "b" } - } else if $in < 6wk { - "#36bd84" - } else if $in < 52wk { - "#39b6ce" - } else { "dark_gray" } - } - range: "#96aca7" - float: "#96aca7" - string: "#96aca7" - nothing: "#96aca7" - binary: "#96aca7" - cellpath: "#96aca7" - row_index: { fg: "#5cbc4d" attr: "b" } - record: "#96aca7" - list: "#96aca7" - block: "#96aca7" - hints: "dark_gray" - search_result: { fg: "#ff855a" bg: "#96aca7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e69092" attr: "b" } - shape_binary: { fg: "#e69092" attr: "b" } - shape_block: { fg: "#39b6ce" attr: "b" } - shape_bool: "#3cbaa6" - shape_custom: "#5cbc4d" - shape_datetime: { fg: "#36bd84" attr: "b" } - shape_directory: "#36bd84" - shape_external: "#36bd84" - shape_externalarg: { fg: "#5cbc4d" attr: "b" } - shape_filepath: "#36bd84" - shape_flag: { fg: "#39b6ce" attr: "b" } - shape_float: { fg: "#e69092" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#36bd84" attr: "b" } - shape_int: { fg: "#e69092" attr: "b" } - shape_internalcall: { fg: "#36bd84" attr: "b" } - shape_list: { fg: "#36bd84" attr: "b" } - shape_literal: "#39b6ce" - shape_match_pattern: "#5cbc4d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3cbaa6" - shape_operator: "#a6af1a" - shape_or: { fg: "#e69092" attr: "b" } - shape_pipe: { fg: "#e69092" attr: "b" } - shape_range: { fg: "#a6af1a" attr: "b" } - shape_record: { fg: "#36bd84" attr: "b" } - shape_redirection: { fg: "#e69092" attr: "b" } - shape_signature: { fg: "#5cbc4d" attr: "b" } - shape_string: "#5cbc4d" - shape_string_interpolation: { fg: "#36bd84" attr: "b" } - shape_table: { fg: "#39b6ce" attr: "b" } - shape_variable: "#e69092" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#283a37" - foreground: "#b5b8b7" - cursor: "#b5b8b7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#96aca7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5cbc4d' attr: 'b' } + empty: '#39b6ce' + bool: {|| if $in { '#3cbaa6' } else { 'light_gray' } } + int: '#96aca7' + filesize: {|e| + if $e == 0b { + '#96aca7' + } else if $e < 1mb { + '#36bd84' + } else {{ fg: '#39b6ce' }} + } + duration: '#96aca7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff855a' attr: 'b' } + } else if $in < 6hr { + '#ff855a' + } else if $in < 1day { + '#a6af1a' + } else if $in < 3day { + '#5cbc4d' + } else if $in < 1wk { + { fg: '#5cbc4d' attr: 'b' } + } else if $in < 6wk { + '#36bd84' + } else if $in < 52wk { + '#39b6ce' + } else { 'dark_gray' } + } + range: '#96aca7' + float: '#96aca7' + string: '#96aca7' + nothing: '#96aca7' + binary: '#96aca7' + cellpath: '#96aca7' + row_index: { fg: '#5cbc4d' attr: 'b' } + record: '#96aca7' + list: '#96aca7' + block: '#96aca7' + hints: 'dark_gray' + search_result: { fg: '#ff855a' bg: '#96aca7' } + + shape_and: { fg: '#e69092' attr: 'b' } + shape_binary: { fg: '#e69092' attr: 'b' } + shape_block: { fg: '#39b6ce' attr: 'b' } + shape_bool: '#3cbaa6' + shape_custom: '#5cbc4d' + shape_datetime: { fg: '#36bd84' attr: 'b' } + shape_directory: '#36bd84' + shape_external: '#36bd84' + shape_externalarg: { fg: '#5cbc4d' attr: 'b' } + shape_filepath: '#36bd84' + shape_flag: { fg: '#39b6ce' attr: 'b' } + shape_float: { fg: '#e69092' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#36bd84' attr: 'b' } + shape_int: { fg: '#e69092' attr: 'b' } + shape_internalcall: { fg: '#36bd84' attr: 'b' } + shape_list: { fg: '#36bd84' attr: 'b' } + shape_literal: '#39b6ce' + shape_match_pattern: '#5cbc4d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3cbaa6' + shape_operator: '#a6af1a' + shape_or: { fg: '#e69092' attr: 'b' } + shape_pipe: { fg: '#e69092' attr: 'b' } + shape_range: { fg: '#a6af1a' attr: 'b' } + shape_record: { fg: '#36bd84' attr: 'b' } + shape_redirection: { fg: '#e69092' attr: 'b' } + shape_signature: { fg: '#5cbc4d' attr: 'b' } + shape_string: '#5cbc4d' + shape_string_interpolation: { fg: '#36bd84' attr: 'b' } + shape_table: { fg: '#39b6ce' attr: 'b' } + shape_variable: '#e69092' + + background: '#283a37' + foreground: '#b5b8b7' + cursor: '#b5b8b7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-summer.nu b/themes/nu-themes/tempus-summer.nu index 23934c3..d98e431 100644 --- a/themes/nu-themes/tempus-summer.nu +++ b/themes/nu-themes/tempus-summer.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#919ab9" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4eac6d" attr: "b" } - empty: "#609fda" - bool: {|| if $in { "#2aa9b6" } else { "light_gray" } } - int: "#919ab9" - filesize: {|e| - if $e == 0b { - "#919ab9" - } else if $e < 1mb { - "#3dab95" - } else {{ fg: "#609fda" }} - } - duration: "#919ab9" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f76f6e" attr: "b" } - } else if $in < 6hr { - "#f76f6e" - } else if $in < 1day { - "#af9a0a" - } else if $in < 3day { - "#4eac6d" - } else if $in < 1wk { - { fg: "#4eac6d" attr: "b" } - } else if $in < 6wk { - "#3dab95" - } else if $in < 52wk { - "#609fda" - } else { "dark_gray" } - } - range: "#919ab9" - float: "#919ab9" - string: "#919ab9" - nothing: "#919ab9" - binary: "#919ab9" - cellpath: "#919ab9" - row_index: { fg: "#4eac6d" attr: "b" } - record: "#919ab9" - list: "#919ab9" - block: "#919ab9" - hints: "dark_gray" - search_result: { fg: "#f76f6e" bg: "#919ab9" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc84ad" attr: "b" } - shape_binary: { fg: "#cc84ad" attr: "b" } - shape_block: { fg: "#609fda" attr: "b" } - shape_bool: "#2aa9b6" - shape_custom: "#4eac6d" - shape_datetime: { fg: "#3dab95" attr: "b" } - shape_directory: "#3dab95" - shape_external: "#3dab95" - shape_externalarg: { fg: "#4eac6d" attr: "b" } - shape_filepath: "#3dab95" - shape_flag: { fg: "#609fda" attr: "b" } - shape_float: { fg: "#cc84ad" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3dab95" attr: "b" } - shape_int: { fg: "#cc84ad" attr: "b" } - shape_internalcall: { fg: "#3dab95" attr: "b" } - shape_list: { fg: "#3dab95" attr: "b" } - shape_literal: "#609fda" - shape_match_pattern: "#4eac6d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#2aa9b6" - shape_operator: "#af9a0a" - shape_or: { fg: "#cc84ad" attr: "b" } - shape_pipe: { fg: "#cc84ad" attr: "b" } - shape_range: { fg: "#af9a0a" attr: "b" } - shape_record: { fg: "#3dab95" attr: "b" } - shape_redirection: { fg: "#cc84ad" attr: "b" } - shape_signature: { fg: "#4eac6d" attr: "b" } - shape_string: "#4eac6d" - shape_string_interpolation: { fg: "#3dab95" attr: "b" } - shape_table: { fg: "#609fda" attr: "b" } - shape_variable: "#cc84ad" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#202c3d" - foreground: "#a0abae" - cursor: "#a0abae" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#919ab9' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4eac6d' attr: 'b' } + empty: '#609fda' + bool: {|| if $in { '#2aa9b6' } else { 'light_gray' } } + int: '#919ab9' + filesize: {|e| + if $e == 0b { + '#919ab9' + } else if $e < 1mb { + '#3dab95' + } else {{ fg: '#609fda' }} + } + duration: '#919ab9' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f76f6e' attr: 'b' } + } else if $in < 6hr { + '#f76f6e' + } else if $in < 1day { + '#af9a0a' + } else if $in < 3day { + '#4eac6d' + } else if $in < 1wk { + { fg: '#4eac6d' attr: 'b' } + } else if $in < 6wk { + '#3dab95' + } else if $in < 52wk { + '#609fda' + } else { 'dark_gray' } + } + range: '#919ab9' + float: '#919ab9' + string: '#919ab9' + nothing: '#919ab9' + binary: '#919ab9' + cellpath: '#919ab9' + row_index: { fg: '#4eac6d' attr: 'b' } + record: '#919ab9' + list: '#919ab9' + block: '#919ab9' + hints: 'dark_gray' + search_result: { fg: '#f76f6e' bg: '#919ab9' } + + shape_and: { fg: '#cc84ad' attr: 'b' } + shape_binary: { fg: '#cc84ad' attr: 'b' } + shape_block: { fg: '#609fda' attr: 'b' } + shape_bool: '#2aa9b6' + shape_custom: '#4eac6d' + shape_datetime: { fg: '#3dab95' attr: 'b' } + shape_directory: '#3dab95' + shape_external: '#3dab95' + shape_externalarg: { fg: '#4eac6d' attr: 'b' } + shape_filepath: '#3dab95' + shape_flag: { fg: '#609fda' attr: 'b' } + shape_float: { fg: '#cc84ad' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3dab95' attr: 'b' } + shape_int: { fg: '#cc84ad' attr: 'b' } + shape_internalcall: { fg: '#3dab95' attr: 'b' } + shape_list: { fg: '#3dab95' attr: 'b' } + shape_literal: '#609fda' + shape_match_pattern: '#4eac6d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#2aa9b6' + shape_operator: '#af9a0a' + shape_or: { fg: '#cc84ad' attr: 'b' } + shape_pipe: { fg: '#cc84ad' attr: 'b' } + shape_range: { fg: '#af9a0a' attr: 'b' } + shape_record: { fg: '#3dab95' attr: 'b' } + shape_redirection: { fg: '#cc84ad' attr: 'b' } + shape_signature: { fg: '#4eac6d' attr: 'b' } + shape_string: '#4eac6d' + shape_string_interpolation: { fg: '#3dab95' attr: 'b' } + shape_table: { fg: '#609fda' attr: 'b' } + shape_variable: '#cc84ad' + + background: '#202c3d' + foreground: '#a0abae' + cursor: '#a0abae' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-tempest.nu b/themes/nu-themes/tempus-tempest.nu index 807aff4..761c2ad 100644 --- a/themes/nu-themes/tempus-tempest.nu +++ b/themes/nu-themes/tempus-tempest.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#b0c8ca" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#7ad67a" attr: "b" } - empty: "#60d4cd" - bool: {|| if $in { "#9bdfc4" } else { "light_gray" } } - int: "#b0c8ca" - filesize: {|e| - if $e == 0b { - "#b0c8ca" - } else if $e < 1mb { - "#8ad0b0" - } else {{ fg: "#60d4cd" }} - } - duration: "#b0c8ca" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c6c80a" attr: "b" } - } else if $in < 6hr { - "#c6c80a" - } else if $in < 1day { - "#bfc94a" - } else if $in < 3day { - "#7ad67a" - } else if $in < 1wk { - { fg: "#7ad67a" attr: "b" } - } else if $in < 6wk { - "#8ad0b0" - } else if $in < 52wk { - "#60d4cd" - } else { "dark_gray" } - } - range: "#b0c8ca" - float: "#b0c8ca" - string: "#b0c8ca" - nothing: "#b0c8ca" - binary: "#b0c8ca" - cellpath: "#b0c8ca" - row_index: { fg: "#7ad67a" attr: "b" } - record: "#b0c8ca" - list: "#b0c8ca" - block: "#b0c8ca" - hints: "dark_gray" - search_result: { fg: "#c6c80a" bg: "#b0c8ca" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c0c4aa" attr: "b" } - shape_binary: { fg: "#c0c4aa" attr: "b" } - shape_block: { fg: "#60d4cd" attr: "b" } - shape_bool: "#9bdfc4" - shape_custom: "#7ad67a" - shape_datetime: { fg: "#8ad0b0" attr: "b" } - shape_directory: "#8ad0b0" - shape_external: "#8ad0b0" - shape_externalarg: { fg: "#7ad67a" attr: "b" } - shape_filepath: "#8ad0b0" - shape_flag: { fg: "#60d4cd" attr: "b" } - shape_float: { fg: "#c0c4aa" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8ad0b0" attr: "b" } - shape_int: { fg: "#c0c4aa" attr: "b" } - shape_internalcall: { fg: "#8ad0b0" attr: "b" } - shape_list: { fg: "#8ad0b0" attr: "b" } - shape_literal: "#60d4cd" - shape_match_pattern: "#7ad67a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#9bdfc4" - shape_operator: "#bfc94a" - shape_or: { fg: "#c0c4aa" attr: "b" } - shape_pipe: { fg: "#c0c4aa" attr: "b" } - shape_range: { fg: "#bfc94a" attr: "b" } - shape_record: { fg: "#8ad0b0" attr: "b" } - shape_redirection: { fg: "#c0c4aa" attr: "b" } - shape_signature: { fg: "#7ad67a" attr: "b" } - shape_string: "#7ad67a" - shape_string_interpolation: { fg: "#8ad0b0" attr: "b" } - shape_table: { fg: "#60d4cd" attr: "b" } - shape_variable: "#c0c4aa" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282b2b" - foreground: "#b6e0ca" - cursor: "#b6e0ca" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#b0c8ca' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#7ad67a' attr: 'b' } + empty: '#60d4cd' + bool: {|| if $in { '#9bdfc4' } else { 'light_gray' } } + int: '#b0c8ca' + filesize: {|e| + if $e == 0b { + '#b0c8ca' + } else if $e < 1mb { + '#8ad0b0' + } else {{ fg: '#60d4cd' }} + } + duration: '#b0c8ca' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c6c80a' attr: 'b' } + } else if $in < 6hr { + '#c6c80a' + } else if $in < 1day { + '#bfc94a' + } else if $in < 3day { + '#7ad67a' + } else if $in < 1wk { + { fg: '#7ad67a' attr: 'b' } + } else if $in < 6wk { + '#8ad0b0' + } else if $in < 52wk { + '#60d4cd' + } else { 'dark_gray' } + } + range: '#b0c8ca' + float: '#b0c8ca' + string: '#b0c8ca' + nothing: '#b0c8ca' + binary: '#b0c8ca' + cellpath: '#b0c8ca' + row_index: { fg: '#7ad67a' attr: 'b' } + record: '#b0c8ca' + list: '#b0c8ca' + block: '#b0c8ca' + hints: 'dark_gray' + search_result: { fg: '#c6c80a' bg: '#b0c8ca' } + + shape_and: { fg: '#c0c4aa' attr: 'b' } + shape_binary: { fg: '#c0c4aa' attr: 'b' } + shape_block: { fg: '#60d4cd' attr: 'b' } + shape_bool: '#9bdfc4' + shape_custom: '#7ad67a' + shape_datetime: { fg: '#8ad0b0' attr: 'b' } + shape_directory: '#8ad0b0' + shape_external: '#8ad0b0' + shape_externalarg: { fg: '#7ad67a' attr: 'b' } + shape_filepath: '#8ad0b0' + shape_flag: { fg: '#60d4cd' attr: 'b' } + shape_float: { fg: '#c0c4aa' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8ad0b0' attr: 'b' } + shape_int: { fg: '#c0c4aa' attr: 'b' } + shape_internalcall: { fg: '#8ad0b0' attr: 'b' } + shape_list: { fg: '#8ad0b0' attr: 'b' } + shape_literal: '#60d4cd' + shape_match_pattern: '#7ad67a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#9bdfc4' + shape_operator: '#bfc94a' + shape_or: { fg: '#c0c4aa' attr: 'b' } + shape_pipe: { fg: '#c0c4aa' attr: 'b' } + shape_range: { fg: '#bfc94a' attr: 'b' } + shape_record: { fg: '#8ad0b0' attr: 'b' } + shape_redirection: { fg: '#c0c4aa' attr: 'b' } + shape_signature: { fg: '#7ad67a' attr: 'b' } + shape_string: '#7ad67a' + shape_string_interpolation: { fg: '#8ad0b0' attr: 'b' } + shape_table: { fg: '#60d4cd' attr: 'b' } + shape_variable: '#c0c4aa' + + background: '#282b2b' + foreground: '#b6e0ca' + cursor: '#b6e0ca' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-totus.nu b/themes/nu-themes/tempus-totus.nu index 87b6a65..fb2dc83 100644 --- a/themes/nu-themes/tempus-totus.nu +++ b/themes/nu-themes/tempus-totus.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f3f1f3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#005f26" attr: "b" } - empty: "#1d3fcf" - bool: {|| if $in { "#005589" } else { "light_gray" } } - int: "#f3f1f3" - filesize: {|e| - if $e == 0b { - "#f3f1f3" - } else if $e < 1mb { - "#185870" - } else {{ fg: "#1d3fcf" }} - } - duration: "#f3f1f3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a80000" attr: "b" } - } else if $in < 6hr { - "#a80000" - } else if $in < 1day { - "#714900" - } else if $in < 3day { - "#005f26" - } else if $in < 1wk { - { fg: "#005f26" attr: "b" } - } else if $in < 6wk { - "#185870" - } else if $in < 52wk { - "#1d3fcf" - } else { "dark_gray" } - } - range: "#f3f1f3" - float: "#f3f1f3" - string: "#f3f1f3" - nothing: "#f3f1f3" - binary: "#f3f1f3" - cellpath: "#f3f1f3" - row_index: { fg: "#005f26" attr: "b" } - record: "#f3f1f3" - list: "#f3f1f3" - block: "#f3f1f3" - hints: "dark_gray" - search_result: { fg: "#a80000" bg: "#f3f1f3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#882a7a" attr: "b" } - shape_binary: { fg: "#882a7a" attr: "b" } - shape_block: { fg: "#1d3fcf" attr: "b" } - shape_bool: "#005589" - shape_custom: "#005f26" - shape_datetime: { fg: "#185870" attr: "b" } - shape_directory: "#185870" - shape_external: "#185870" - shape_externalarg: { fg: "#005f26" attr: "b" } - shape_filepath: "#185870" - shape_flag: { fg: "#1d3fcf" attr: "b" } - shape_float: { fg: "#882a7a" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#185870" attr: "b" } - shape_int: { fg: "#882a7a" attr: "b" } - shape_internalcall: { fg: "#185870" attr: "b" } - shape_list: { fg: "#185870" attr: "b" } - shape_literal: "#1d3fcf" - shape_match_pattern: "#005f26" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#005589" - shape_operator: "#714900" - shape_or: { fg: "#882a7a" attr: "b" } - shape_pipe: { fg: "#882a7a" attr: "b" } - shape_range: { fg: "#714900" attr: "b" } - shape_record: { fg: "#185870" attr: "b" } - shape_redirection: { fg: "#882a7a" attr: "b" } - shape_signature: { fg: "#005f26" attr: "b" } - shape_string: "#005f26" - shape_string_interpolation: { fg: "#185870" attr: "b" } - shape_table: { fg: "#1d3fcf" attr: "b" } - shape_variable: "#882a7a" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#4a484d" - cursor: "#4a484d" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f3f1f3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#005f26' attr: 'b' } + empty: '#1d3fcf' + bool: {|| if $in { '#005589' } else { 'light_gray' } } + int: '#f3f1f3' + filesize: {|e| + if $e == 0b { + '#f3f1f3' + } else if $e < 1mb { + '#185870' + } else {{ fg: '#1d3fcf' }} + } + duration: '#f3f1f3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a80000' attr: 'b' } + } else if $in < 6hr { + '#a80000' + } else if $in < 1day { + '#714900' + } else if $in < 3day { + '#005f26' + } else if $in < 1wk { + { fg: '#005f26' attr: 'b' } + } else if $in < 6wk { + '#185870' + } else if $in < 52wk { + '#1d3fcf' + } else { 'dark_gray' } + } + range: '#f3f1f3' + float: '#f3f1f3' + string: '#f3f1f3' + nothing: '#f3f1f3' + binary: '#f3f1f3' + cellpath: '#f3f1f3' + row_index: { fg: '#005f26' attr: 'b' } + record: '#f3f1f3' + list: '#f3f1f3' + block: '#f3f1f3' + hints: 'dark_gray' + search_result: { fg: '#a80000' bg: '#f3f1f3' } + + shape_and: { fg: '#882a7a' attr: 'b' } + shape_binary: { fg: '#882a7a' attr: 'b' } + shape_block: { fg: '#1d3fcf' attr: 'b' } + shape_bool: '#005589' + shape_custom: '#005f26' + shape_datetime: { fg: '#185870' attr: 'b' } + shape_directory: '#185870' + shape_external: '#185870' + shape_externalarg: { fg: '#005f26' attr: 'b' } + shape_filepath: '#185870' + shape_flag: { fg: '#1d3fcf' attr: 'b' } + shape_float: { fg: '#882a7a' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#185870' attr: 'b' } + shape_int: { fg: '#882a7a' attr: 'b' } + shape_internalcall: { fg: '#185870' attr: 'b' } + shape_list: { fg: '#185870' attr: 'b' } + shape_literal: '#1d3fcf' + shape_match_pattern: '#005f26' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#005589' + shape_operator: '#714900' + shape_or: { fg: '#882a7a' attr: 'b' } + shape_pipe: { fg: '#882a7a' attr: 'b' } + shape_range: { fg: '#714900' attr: 'b' } + shape_record: { fg: '#185870' attr: 'b' } + shape_redirection: { fg: '#882a7a' attr: 'b' } + shape_signature: { fg: '#005f26' attr: 'b' } + shape_string: '#005f26' + shape_string_interpolation: { fg: '#185870' attr: 'b' } + shape_table: { fg: '#1d3fcf' attr: 'b' } + shape_variable: '#882a7a' + + background: '#ffffff' + foreground: '#4a484d' + cursor: '#4a484d' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-warp.nu b/themes/nu-themes/tempus-warp.nu index 525e487..eddd8dc 100644 --- a/themes/nu-themes/tempus-warp.nu +++ b/themes/nu-themes/tempus-warp.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#928080" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#139913" attr: "b" } - empty: "#557feb" - bool: {|| if $in { "#1da1af" } else { "light_gray" } } - int: "#928080" - filesize: {|e| - if $e == 0b { - "#928080" - } else if $e < 1mb { - "#009580" - } else {{ fg: "#557feb" }} - } - duration: "#928080" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fa3333" attr: "b" } - } else if $in < 6hr { - "#fa3333" - } else if $in < 1day { - "#9e8100" - } else if $in < 3day { - "#139913" - } else if $in < 1wk { - { fg: "#139913" attr: "b" } - } else if $in < 6wk { - "#009580" - } else if $in < 52wk { - "#557feb" - } else { "dark_gray" } - } - range: "#928080" - float: "#928080" - string: "#928080" - nothing: "#928080" - binary: "#928080" - cellpath: "#928080" - row_index: { fg: "#139913" attr: "b" } - record: "#928080" - list: "#928080" - block: "#928080" - hints: "dark_gray" - search_result: { fg: "#fa3333" bg: "#928080" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d54cbf" attr: "b" } - shape_binary: { fg: "#d54cbf" attr: "b" } - shape_block: { fg: "#557feb" attr: "b" } - shape_bool: "#1da1af" - shape_custom: "#139913" - shape_datetime: { fg: "#009580" attr: "b" } - shape_directory: "#009580" - shape_external: "#009580" - shape_externalarg: { fg: "#139913" attr: "b" } - shape_filepath: "#009580" - shape_flag: { fg: "#557feb" attr: "b" } - shape_float: { fg: "#d54cbf" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#009580" attr: "b" } - shape_int: { fg: "#d54cbf" attr: "b" } - shape_internalcall: { fg: "#009580" attr: "b" } - shape_list: { fg: "#009580" attr: "b" } - shape_literal: "#557feb" - shape_match_pattern: "#139913" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1da1af" - shape_operator: "#9e8100" - shape_or: { fg: "#d54cbf" attr: "b" } - shape_pipe: { fg: "#d54cbf" attr: "b" } - shape_range: { fg: "#9e8100" attr: "b" } - shape_record: { fg: "#009580" attr: "b" } - shape_redirection: { fg: "#d54cbf" attr: "b" } - shape_signature: { fg: "#139913" attr: "b" } - shape_string: "#139913" - shape_string_interpolation: { fg: "#009580" attr: "b" } - shape_table: { fg: "#557feb" attr: "b" } - shape_variable: "#d54cbf" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#001514" - foreground: "#a29fa0" - cursor: "#a29fa0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#928080' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#139913' attr: 'b' } + empty: '#557feb' + bool: {|| if $in { '#1da1af' } else { 'light_gray' } } + int: '#928080' + filesize: {|e| + if $e == 0b { + '#928080' + } else if $e < 1mb { + '#009580' + } else {{ fg: '#557feb' }} + } + duration: '#928080' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fa3333' attr: 'b' } + } else if $in < 6hr { + '#fa3333' + } else if $in < 1day { + '#9e8100' + } else if $in < 3day { + '#139913' + } else if $in < 1wk { + { fg: '#139913' attr: 'b' } + } else if $in < 6wk { + '#009580' + } else if $in < 52wk { + '#557feb' + } else { 'dark_gray' } + } + range: '#928080' + float: '#928080' + string: '#928080' + nothing: '#928080' + binary: '#928080' + cellpath: '#928080' + row_index: { fg: '#139913' attr: 'b' } + record: '#928080' + list: '#928080' + block: '#928080' + hints: 'dark_gray' + search_result: { fg: '#fa3333' bg: '#928080' } + + shape_and: { fg: '#d54cbf' attr: 'b' } + shape_binary: { fg: '#d54cbf' attr: 'b' } + shape_block: { fg: '#557feb' attr: 'b' } + shape_bool: '#1da1af' + shape_custom: '#139913' + shape_datetime: { fg: '#009580' attr: 'b' } + shape_directory: '#009580' + shape_external: '#009580' + shape_externalarg: { fg: '#139913' attr: 'b' } + shape_filepath: '#009580' + shape_flag: { fg: '#557feb' attr: 'b' } + shape_float: { fg: '#d54cbf' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#009580' attr: 'b' } + shape_int: { fg: '#d54cbf' attr: 'b' } + shape_internalcall: { fg: '#009580' attr: 'b' } + shape_list: { fg: '#009580' attr: 'b' } + shape_literal: '#557feb' + shape_match_pattern: '#139913' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1da1af' + shape_operator: '#9e8100' + shape_or: { fg: '#d54cbf' attr: 'b' } + shape_pipe: { fg: '#d54cbf' attr: 'b' } + shape_range: { fg: '#9e8100' attr: 'b' } + shape_record: { fg: '#009580' attr: 'b' } + shape_redirection: { fg: '#d54cbf' attr: 'b' } + shape_signature: { fg: '#139913' attr: 'b' } + shape_string: '#139913' + shape_string_interpolation: { fg: '#009580' attr: 'b' } + shape_table: { fg: '#557feb' attr: 'b' } + shape_variable: '#d54cbf' + + background: '#001514' + foreground: '#a29fa0' + cursor: '#a29fa0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tempus-winter.nu b/themes/nu-themes/tempus-winter.nu index 2d7ec4d..9120eaa 100644 --- a/themes/nu-themes/tempus-winter.nu +++ b/themes/nu-themes/tempus-winter.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#909294" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#49a61d" attr: "b" } - empty: "#798fd7" - bool: {|| if $in { "#1ba2a0" } else { "light_gray" } } - int: "#909294" - filesize: {|e| - if $e == 0b { - "#909294" - } else if $e < 1mb { - "#4fa090" - } else {{ fg: "#798fd7" }} - } - duration: "#909294" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#eb6a58" attr: "b" } - } else if $in < 6hr { - "#eb6a58" - } else if $in < 1day { - "#959721" - } else if $in < 3day { - "#49a61d" - } else if $in < 1wk { - { fg: "#49a61d" attr: "b" } - } else if $in < 6wk { - "#4fa090" - } else if $in < 52wk { - "#798fd7" - } else { "dark_gray" } - } - range: "#909294" - float: "#909294" - string: "#909294" - nothing: "#909294" - binary: "#909294" - cellpath: "#909294" - row_index: { fg: "#49a61d" attr: "b" } - record: "#909294" - list: "#909294" - block: "#909294" - hints: "dark_gray" - search_result: { fg: "#eb6a58" bg: "#909294" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cd7b7e" attr: "b" } - shape_binary: { fg: "#cd7b7e" attr: "b" } - shape_block: { fg: "#798fd7" attr: "b" } - shape_bool: "#1ba2a0" - shape_custom: "#49a61d" - shape_datetime: { fg: "#4fa090" attr: "b" } - shape_directory: "#4fa090" - shape_external: "#4fa090" - shape_externalarg: { fg: "#49a61d" attr: "b" } - shape_filepath: "#4fa090" - shape_flag: { fg: "#798fd7" attr: "b" } - shape_float: { fg: "#cd7b7e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4fa090" attr: "b" } - shape_int: { fg: "#cd7b7e" attr: "b" } - shape_internalcall: { fg: "#4fa090" attr: "b" } - shape_list: { fg: "#4fa090" attr: "b" } - shape_literal: "#798fd7" - shape_match_pattern: "#49a61d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#1ba2a0" - shape_operator: "#959721" - shape_or: { fg: "#cd7b7e" attr: "b" } - shape_pipe: { fg: "#cd7b7e" attr: "b" } - shape_range: { fg: "#959721" attr: "b" } - shape_record: { fg: "#4fa090" attr: "b" } - shape_redirection: { fg: "#cd7b7e" attr: "b" } - shape_signature: { fg: "#49a61d" attr: "b" } - shape_string: "#49a61d" - shape_string_interpolation: { fg: "#4fa090" attr: "b" } - shape_table: { fg: "#798fd7" attr: "b" } - shape_variable: "#cd7b7e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#202427" - foreground: "#8da3b8" - cursor: "#8da3b8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#909294' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#49a61d' attr: 'b' } + empty: '#798fd7' + bool: {|| if $in { '#1ba2a0' } else { 'light_gray' } } + int: '#909294' + filesize: {|e| + if $e == 0b { + '#909294' + } else if $e < 1mb { + '#4fa090' + } else {{ fg: '#798fd7' }} + } + duration: '#909294' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#eb6a58' attr: 'b' } + } else if $in < 6hr { + '#eb6a58' + } else if $in < 1day { + '#959721' + } else if $in < 3day { + '#49a61d' + } else if $in < 1wk { + { fg: '#49a61d' attr: 'b' } + } else if $in < 6wk { + '#4fa090' + } else if $in < 52wk { + '#798fd7' + } else { 'dark_gray' } + } + range: '#909294' + float: '#909294' + string: '#909294' + nothing: '#909294' + binary: '#909294' + cellpath: '#909294' + row_index: { fg: '#49a61d' attr: 'b' } + record: '#909294' + list: '#909294' + block: '#909294' + hints: 'dark_gray' + search_result: { fg: '#eb6a58' bg: '#909294' } + + shape_and: { fg: '#cd7b7e' attr: 'b' } + shape_binary: { fg: '#cd7b7e' attr: 'b' } + shape_block: { fg: '#798fd7' attr: 'b' } + shape_bool: '#1ba2a0' + shape_custom: '#49a61d' + shape_datetime: { fg: '#4fa090' attr: 'b' } + shape_directory: '#4fa090' + shape_external: '#4fa090' + shape_externalarg: { fg: '#49a61d' attr: 'b' } + shape_filepath: '#4fa090' + shape_flag: { fg: '#798fd7' attr: 'b' } + shape_float: { fg: '#cd7b7e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4fa090' attr: 'b' } + shape_int: { fg: '#cd7b7e' attr: 'b' } + shape_internalcall: { fg: '#4fa090' attr: 'b' } + shape_list: { fg: '#4fa090' attr: 'b' } + shape_literal: '#798fd7' + shape_match_pattern: '#49a61d' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#1ba2a0' + shape_operator: '#959721' + shape_or: { fg: '#cd7b7e' attr: 'b' } + shape_pipe: { fg: '#cd7b7e' attr: 'b' } + shape_range: { fg: '#959721' attr: 'b' } + shape_record: { fg: '#4fa090' attr: 'b' } + shape_redirection: { fg: '#cd7b7e' attr: 'b' } + shape_signature: { fg: '#49a61d' attr: 'b' } + shape_string: '#49a61d' + shape_string_interpolation: { fg: '#4fa090' attr: 'b' } + shape_table: { fg: '#798fd7' attr: 'b' } + shape_variable: '#cd7b7e' + + background: '#202427' + foreground: '#8da3b8' + cursor: '#8da3b8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tender.nu b/themes/nu-themes/tender.nu index 7e7589e..738fd6c 100644 --- a/themes/nu-themes/tender.nu +++ b/themes/nu-themes/tender.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#eeeeee" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c9d05c" attr: "b" } - empty: "#b3deef" - bool: {|| if $in { "#73cef4" } else { "light_gray" } } - int: "#eeeeee" - filesize: {|e| - if $e == 0b { - "#eeeeee" - } else if $e < 1mb { - "#73cef4" - } else {{ fg: "#b3deef" }} - } - duration: "#eeeeee" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f43753" attr: "b" } - } else if $in < 6hr { - "#f43753" - } else if $in < 1day { - "#ffc24b" - } else if $in < 3day { - "#c9d05c" - } else if $in < 1wk { - { fg: "#c9d05c" attr: "b" } - } else if $in < 6wk { - "#73cef4" - } else if $in < 52wk { - "#b3deef" - } else { "dark_gray" } - } - range: "#eeeeee" - float: "#eeeeee" - string: "#eeeeee" - nothing: "#eeeeee" - binary: "#eeeeee" - cellpath: "#eeeeee" - row_index: { fg: "#c9d05c" attr: "b" } - record: "#eeeeee" - list: "#eeeeee" - block: "#eeeeee" - hints: "dark_gray" - search_result: { fg: "#f43753" bg: "#eeeeee" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#d3b987" attr: "b" } - shape_binary: { fg: "#d3b987" attr: "b" } - shape_block: { fg: "#b3deef" attr: "b" } - shape_bool: "#73cef4" - shape_custom: "#c9d05c" - shape_datetime: { fg: "#73cef4" attr: "b" } - shape_directory: "#73cef4" - shape_external: "#73cef4" - shape_externalarg: { fg: "#c9d05c" attr: "b" } - shape_filepath: "#73cef4" - shape_flag: { fg: "#b3deef" attr: "b" } - shape_float: { fg: "#d3b987" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#73cef4" attr: "b" } - shape_int: { fg: "#d3b987" attr: "b" } - shape_internalcall: { fg: "#73cef4" attr: "b" } - shape_list: { fg: "#73cef4" attr: "b" } - shape_literal: "#b3deef" - shape_match_pattern: "#c9d05c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#73cef4" - shape_operator: "#ffc24b" - shape_or: { fg: "#d3b987" attr: "b" } - shape_pipe: { fg: "#d3b987" attr: "b" } - shape_range: { fg: "#ffc24b" attr: "b" } - shape_record: { fg: "#73cef4" attr: "b" } - shape_redirection: { fg: "#d3b987" attr: "b" } - shape_signature: { fg: "#c9d05c" attr: "b" } - shape_string: "#c9d05c" - shape_string_interpolation: { fg: "#73cef4" attr: "b" } - shape_table: { fg: "#b3deef" attr: "b" } - shape_variable: "#d3b987" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282828" - foreground: "#eeeeee" - cursor: "#eeeeee" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#eeeeee' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#c9d05c' attr: 'b' } + empty: '#b3deef' + bool: {|| if $in { '#73cef4' } else { 'light_gray' } } + int: '#eeeeee' + filesize: {|e| + if $e == 0b { + '#eeeeee' + } else if $e < 1mb { + '#73cef4' + } else {{ fg: '#b3deef' }} + } + duration: '#eeeeee' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f43753' attr: 'b' } + } else if $in < 6hr { + '#f43753' + } else if $in < 1day { + '#ffc24b' + } else if $in < 3day { + '#c9d05c' + } else if $in < 1wk { + { fg: '#c9d05c' attr: 'b' } + } else if $in < 6wk { + '#73cef4' + } else if $in < 52wk { + '#b3deef' + } else { 'dark_gray' } + } + range: '#eeeeee' + float: '#eeeeee' + string: '#eeeeee' + nothing: '#eeeeee' + binary: '#eeeeee' + cellpath: '#eeeeee' + row_index: { fg: '#c9d05c' attr: 'b' } + record: '#eeeeee' + list: '#eeeeee' + block: '#eeeeee' + hints: 'dark_gray' + search_result: { fg: '#f43753' bg: '#eeeeee' } + + shape_and: { fg: '#d3b987' attr: 'b' } + shape_binary: { fg: '#d3b987' attr: 'b' } + shape_block: { fg: '#b3deef' attr: 'b' } + shape_bool: '#73cef4' + shape_custom: '#c9d05c' + shape_datetime: { fg: '#73cef4' attr: 'b' } + shape_directory: '#73cef4' + shape_external: '#73cef4' + shape_externalarg: { fg: '#c9d05c' attr: 'b' } + shape_filepath: '#73cef4' + shape_flag: { fg: '#b3deef' attr: 'b' } + shape_float: { fg: '#d3b987' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#73cef4' attr: 'b' } + shape_int: { fg: '#d3b987' attr: 'b' } + shape_internalcall: { fg: '#73cef4' attr: 'b' } + shape_list: { fg: '#73cef4' attr: 'b' } + shape_literal: '#b3deef' + shape_match_pattern: '#c9d05c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#73cef4' + shape_operator: '#ffc24b' + shape_or: { fg: '#d3b987' attr: 'b' } + shape_pipe: { fg: '#d3b987' attr: 'b' } + shape_range: { fg: '#ffc24b' attr: 'b' } + shape_record: { fg: '#73cef4' attr: 'b' } + shape_redirection: { fg: '#d3b987' attr: 'b' } + shape_signature: { fg: '#c9d05c' attr: 'b' } + shape_string: '#c9d05c' + shape_string_interpolation: { fg: '#73cef4' attr: 'b' } + shape_table: { fg: '#b3deef' attr: 'b' } + shape_variable: '#d3b987' + + background: '#282828' + foreground: '#eeeeee' + cursor: '#eeeeee' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/terminal-basic.nu b/themes/nu-themes/terminal-basic.nu index 13d09f2..6b11960 100644 --- a/themes/nu-themes/terminal-basic.nu +++ b/themes/nu-themes/terminal-basic.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bfbfbf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a600" attr: "b" } - empty: "#0000b2" - bool: {|| if $in { "#00e5e5" } else { "light_gray" } } - int: "#bfbfbf" - filesize: {|e| - if $e == 0b { - "#bfbfbf" - } else if $e < 1mb { - "#00a6b2" - } else {{ fg: "#0000b2" }} - } - duration: "#bfbfbf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#990000" attr: "b" } - } else if $in < 6hr { - "#990000" - } else if $in < 1day { - "#999900" - } else if $in < 3day { - "#00a600" - } else if $in < 1wk { - { fg: "#00a600" attr: "b" } - } else if $in < 6wk { - "#00a6b2" - } else if $in < 52wk { - "#0000b2" - } else { "dark_gray" } - } - range: "#bfbfbf" - float: "#bfbfbf" - string: "#bfbfbf" - nothing: "#bfbfbf" - binary: "#bfbfbf" - cellpath: "#bfbfbf" - row_index: { fg: "#00a600" attr: "b" } - record: "#bfbfbf" - list: "#bfbfbf" - block: "#bfbfbf" - hints: "dark_gray" - search_result: { fg: "#990000" bg: "#bfbfbf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b200b2" attr: "b" } - shape_binary: { fg: "#b200b2" attr: "b" } - shape_block: { fg: "#0000b2" attr: "b" } - shape_bool: "#00e5e5" - shape_custom: "#00a600" - shape_datetime: { fg: "#00a6b2" attr: "b" } - shape_directory: "#00a6b2" - shape_external: "#00a6b2" - shape_externalarg: { fg: "#00a600" attr: "b" } - shape_filepath: "#00a6b2" - shape_flag: { fg: "#0000b2" attr: "b" } - shape_float: { fg: "#b200b2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a6b2" attr: "b" } - shape_int: { fg: "#b200b2" attr: "b" } - shape_internalcall: { fg: "#00a6b2" attr: "b" } - shape_list: { fg: "#00a6b2" attr: "b" } - shape_literal: "#0000b2" - shape_match_pattern: "#00a600" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00e5e5" - shape_operator: "#999900" - shape_or: { fg: "#b200b2" attr: "b" } - shape_pipe: { fg: "#b200b2" attr: "b" } - shape_range: { fg: "#999900" attr: "b" } - shape_record: { fg: "#00a6b2" attr: "b" } - shape_redirection: { fg: "#b200b2" attr: "b" } - shape_signature: { fg: "#00a600" attr: "b" } - shape_string: "#00a600" - shape_string_interpolation: { fg: "#00a6b2" attr: "b" } - shape_table: { fg: "#0000b2" attr: "b" } - shape_variable: "#b200b2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#000000" - cursor: "#000000" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bfbfbf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a600' attr: 'b' } + empty: '#0000b2' + bool: {|| if $in { '#00e5e5' } else { 'light_gray' } } + int: '#bfbfbf' + filesize: {|e| + if $e == 0b { + '#bfbfbf' + } else if $e < 1mb { + '#00a6b2' + } else {{ fg: '#0000b2' }} + } + duration: '#bfbfbf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#990000' attr: 'b' } + } else if $in < 6hr { + '#990000' + } else if $in < 1day { + '#999900' + } else if $in < 3day { + '#00a600' + } else if $in < 1wk { + { fg: '#00a600' attr: 'b' } + } else if $in < 6wk { + '#00a6b2' + } else if $in < 52wk { + '#0000b2' + } else { 'dark_gray' } + } + range: '#bfbfbf' + float: '#bfbfbf' + string: '#bfbfbf' + nothing: '#bfbfbf' + binary: '#bfbfbf' + cellpath: '#bfbfbf' + row_index: { fg: '#00a600' attr: 'b' } + record: '#bfbfbf' + list: '#bfbfbf' + block: '#bfbfbf' + hints: 'dark_gray' + search_result: { fg: '#990000' bg: '#bfbfbf' } + + shape_and: { fg: '#b200b2' attr: 'b' } + shape_binary: { fg: '#b200b2' attr: 'b' } + shape_block: { fg: '#0000b2' attr: 'b' } + shape_bool: '#00e5e5' + shape_custom: '#00a600' + shape_datetime: { fg: '#00a6b2' attr: 'b' } + shape_directory: '#00a6b2' + shape_external: '#00a6b2' + shape_externalarg: { fg: '#00a600' attr: 'b' } + shape_filepath: '#00a6b2' + shape_flag: { fg: '#0000b2' attr: 'b' } + shape_float: { fg: '#b200b2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a6b2' attr: 'b' } + shape_int: { fg: '#b200b2' attr: 'b' } + shape_internalcall: { fg: '#00a6b2' attr: 'b' } + shape_list: { fg: '#00a6b2' attr: 'b' } + shape_literal: '#0000b2' + shape_match_pattern: '#00a600' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00e5e5' + shape_operator: '#999900' + shape_or: { fg: '#b200b2' attr: 'b' } + shape_pipe: { fg: '#b200b2' attr: 'b' } + shape_range: { fg: '#999900' attr: 'b' } + shape_record: { fg: '#00a6b2' attr: 'b' } + shape_redirection: { fg: '#b200b2' attr: 'b' } + shape_signature: { fg: '#00a600' attr: 'b' } + shape_string: '#00a600' + shape_string_interpolation: { fg: '#00a6b2' attr: 'b' } + shape_table: { fg: '#0000b2' attr: 'b' } + shape_variable: '#b200b2' + + background: '#ffffff' + foreground: '#000000' + cursor: '#000000' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/terminix-dark.nu b/themes/nu-themes/terminix-dark.nu index cd97801..b939857 100644 --- a/themes/nu-themes/terminix-dark.nu +++ b/themes/nu-themes/terminix-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#777777" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#a1b56c" attr: "b" } - empty: "#225555" - bool: {|| if $in { "#86c1b9" } else { "light_gray" } } - int: "#777777" - filesize: {|e| - if $e == 0b { - "#777777" - } else if $e < 1mb { - "#5e8d87" - } else {{ fg: "#225555" }} - } - duration: "#777777" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a54242" attr: "b" } - } else if $in < 6hr { - "#a54242" - } else if $in < 1day { - "#de935f" - } else if $in < 3day { - "#a1b56c" - } else if $in < 1wk { - { fg: "#a1b56c" attr: "b" } - } else if $in < 6wk { - "#5e8d87" - } else if $in < 52wk { - "#225555" - } else { "dark_gray" } - } - range: "#777777" - float: "#777777" - string: "#777777" - nothing: "#777777" - binary: "#777777" - cellpath: "#777777" - row_index: { fg: "#a1b56c" attr: "b" } - record: "#777777" - list: "#777777" - block: "#777777" - hints: "dark_gray" - search_result: { fg: "#a54242" bg: "#777777" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#85678f" attr: "b" } - shape_binary: { fg: "#85678f" attr: "b" } - shape_block: { fg: "#225555" attr: "b" } - shape_bool: "#86c1b9" - shape_custom: "#a1b56c" - shape_datetime: { fg: "#5e8d87" attr: "b" } - shape_directory: "#5e8d87" - shape_external: "#5e8d87" - shape_externalarg: { fg: "#a1b56c" attr: "b" } - shape_filepath: "#5e8d87" - shape_flag: { fg: "#225555" attr: "b" } - shape_float: { fg: "#85678f" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#5e8d87" attr: "b" } - shape_int: { fg: "#85678f" attr: "b" } - shape_internalcall: { fg: "#5e8d87" attr: "b" } - shape_list: { fg: "#5e8d87" attr: "b" } - shape_literal: "#225555" - shape_match_pattern: "#a1b56c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86c1b9" - shape_operator: "#de935f" - shape_or: { fg: "#85678f" attr: "b" } - shape_pipe: { fg: "#85678f" attr: "b" } - shape_range: { fg: "#de935f" attr: "b" } - shape_record: { fg: "#5e8d87" attr: "b" } - shape_redirection: { fg: "#85678f" attr: "b" } - shape_signature: { fg: "#a1b56c" attr: "b" } - shape_string: "#a1b56c" - shape_string_interpolation: { fg: "#5e8d87" attr: "b" } - shape_table: { fg: "#225555" attr: "b" } - shape_variable: "#85678f" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#091116" - foreground: "#868a8c" - cursor: "#868a8c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#777777' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#a1b56c' attr: 'b' } + empty: '#225555' + bool: {|| if $in { '#86c1b9' } else { 'light_gray' } } + int: '#777777' + filesize: {|e| + if $e == 0b { + '#777777' + } else if $e < 1mb { + '#5e8d87' + } else {{ fg: '#225555' }} + } + duration: '#777777' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a54242' attr: 'b' } + } else if $in < 6hr { + '#a54242' + } else if $in < 1day { + '#de935f' + } else if $in < 3day { + '#a1b56c' + } else if $in < 1wk { + { fg: '#a1b56c' attr: 'b' } + } else if $in < 6wk { + '#5e8d87' + } else if $in < 52wk { + '#225555' + } else { 'dark_gray' } + } + range: '#777777' + float: '#777777' + string: '#777777' + nothing: '#777777' + binary: '#777777' + cellpath: '#777777' + row_index: { fg: '#a1b56c' attr: 'b' } + record: '#777777' + list: '#777777' + block: '#777777' + hints: 'dark_gray' + search_result: { fg: '#a54242' bg: '#777777' } + + shape_and: { fg: '#85678f' attr: 'b' } + shape_binary: { fg: '#85678f' attr: 'b' } + shape_block: { fg: '#225555' attr: 'b' } + shape_bool: '#86c1b9' + shape_custom: '#a1b56c' + shape_datetime: { fg: '#5e8d87' attr: 'b' } + shape_directory: '#5e8d87' + shape_external: '#5e8d87' + shape_externalarg: { fg: '#a1b56c' attr: 'b' } + shape_filepath: '#5e8d87' + shape_flag: { fg: '#225555' attr: 'b' } + shape_float: { fg: '#85678f' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#5e8d87' attr: 'b' } + shape_int: { fg: '#85678f' attr: 'b' } + shape_internalcall: { fg: '#5e8d87' attr: 'b' } + shape_list: { fg: '#5e8d87' attr: 'b' } + shape_literal: '#225555' + shape_match_pattern: '#a1b56c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#86c1b9' + shape_operator: '#de935f' + shape_or: { fg: '#85678f' attr: 'b' } + shape_pipe: { fg: '#85678f' attr: 'b' } + shape_range: { fg: '#de935f' attr: 'b' } + shape_record: { fg: '#5e8d87' attr: 'b' } + shape_redirection: { fg: '#85678f' attr: 'b' } + shape_signature: { fg: '#a1b56c' attr: 'b' } + shape_string: '#a1b56c' + shape_string_interpolation: { fg: '#5e8d87' attr: 'b' } + shape_table: { fg: '#225555' attr: 'b' } + shape_variable: '#85678f' + + background: '#091116' + foreground: '#868a8c' + cursor: '#868a8c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/thayer-bright.nu b/themes/nu-themes/thayer-bright.nu index 8a14de1..0c1fa48 100644 --- a/themes/nu-themes/thayer-bright.nu +++ b/themes/nu-themes/thayer-bright.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ccccc6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4df840" attr: "b" } - empty: "#2757d6" - bool: {|| if $in { "#23cfd5" } else { "light_gray" } } - int: "#ccccc6" - filesize: {|e| - if $e == 0b { - "#ccccc6" - } else if $e < 1mb { - "#38c8b5" - } else {{ fg: "#2757d6" }} - } - duration: "#ccccc6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f92672" attr: "b" } - } else if $in < 6hr { - "#f92672" - } else if $in < 1day { - "#f4fd22" - } else if $in < 3day { - "#4df840" - } else if $in < 1wk { - { fg: "#4df840" attr: "b" } - } else if $in < 6wk { - "#38c8b5" - } else if $in < 52wk { - "#2757d6" - } else { "dark_gray" } - } - range: "#ccccc6" - float: "#ccccc6" - string: "#ccccc6" - nothing: "#ccccc6" - binary: "#ccccc6" - cellpath: "#ccccc6" - row_index: { fg: "#4df840" attr: "b" } - record: "#ccccc6" - list: "#ccccc6" - block: "#ccccc6" - hints: "dark_gray" - search_result: { fg: "#f92672" bg: "#ccccc6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8c54fe" attr: "b" } - shape_binary: { fg: "#8c54fe" attr: "b" } - shape_block: { fg: "#2757d6" attr: "b" } - shape_bool: "#23cfd5" - shape_custom: "#4df840" - shape_datetime: { fg: "#38c8b5" attr: "b" } - shape_directory: "#38c8b5" - shape_external: "#38c8b5" - shape_externalarg: { fg: "#4df840" attr: "b" } - shape_filepath: "#38c8b5" - shape_flag: { fg: "#2757d6" attr: "b" } - shape_float: { fg: "#8c54fe" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#38c8b5" attr: "b" } - shape_int: { fg: "#8c54fe" attr: "b" } - shape_internalcall: { fg: "#38c8b5" attr: "b" } - shape_list: { fg: "#38c8b5" attr: "b" } - shape_literal: "#2757d6" - shape_match_pattern: "#4df840" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#23cfd5" - shape_operator: "#f4fd22" - shape_or: { fg: "#8c54fe" attr: "b" } - shape_pipe: { fg: "#8c54fe" attr: "b" } - shape_range: { fg: "#f4fd22" attr: "b" } - shape_record: { fg: "#38c8b5" attr: "b" } - shape_redirection: { fg: "#8c54fe" attr: "b" } - shape_signature: { fg: "#4df840" attr: "b" } - shape_string: "#4df840" - shape_string_interpolation: { fg: "#38c8b5" attr: "b" } - shape_table: { fg: "#2757d6" attr: "b" } - shape_variable: "#8c54fe" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1d1e" - foreground: "#f8f8f8" - cursor: "#f8f8f8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ccccc6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4df840' attr: 'b' } + empty: '#2757d6' + bool: {|| if $in { '#23cfd5' } else { 'light_gray' } } + int: '#ccccc6' + filesize: {|e| + if $e == 0b { + '#ccccc6' + } else if $e < 1mb { + '#38c8b5' + } else {{ fg: '#2757d6' }} + } + duration: '#ccccc6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f92672' attr: 'b' } + } else if $in < 6hr { + '#f92672' + } else if $in < 1day { + '#f4fd22' + } else if $in < 3day { + '#4df840' + } else if $in < 1wk { + { fg: '#4df840' attr: 'b' } + } else if $in < 6wk { + '#38c8b5' + } else if $in < 52wk { + '#2757d6' + } else { 'dark_gray' } + } + range: '#ccccc6' + float: '#ccccc6' + string: '#ccccc6' + nothing: '#ccccc6' + binary: '#ccccc6' + cellpath: '#ccccc6' + row_index: { fg: '#4df840' attr: 'b' } + record: '#ccccc6' + list: '#ccccc6' + block: '#ccccc6' + hints: 'dark_gray' + search_result: { fg: '#f92672' bg: '#ccccc6' } + + shape_and: { fg: '#8c54fe' attr: 'b' } + shape_binary: { fg: '#8c54fe' attr: 'b' } + shape_block: { fg: '#2757d6' attr: 'b' } + shape_bool: '#23cfd5' + shape_custom: '#4df840' + shape_datetime: { fg: '#38c8b5' attr: 'b' } + shape_directory: '#38c8b5' + shape_external: '#38c8b5' + shape_externalarg: { fg: '#4df840' attr: 'b' } + shape_filepath: '#38c8b5' + shape_flag: { fg: '#2757d6' attr: 'b' } + shape_float: { fg: '#8c54fe' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#38c8b5' attr: 'b' } + shape_int: { fg: '#8c54fe' attr: 'b' } + shape_internalcall: { fg: '#38c8b5' attr: 'b' } + shape_list: { fg: '#38c8b5' attr: 'b' } + shape_literal: '#2757d6' + shape_match_pattern: '#4df840' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#23cfd5' + shape_operator: '#f4fd22' + shape_or: { fg: '#8c54fe' attr: 'b' } + shape_pipe: { fg: '#8c54fe' attr: 'b' } + shape_range: { fg: '#f4fd22' attr: 'b' } + shape_record: { fg: '#38c8b5' attr: 'b' } + shape_redirection: { fg: '#8c54fe' attr: 'b' } + shape_signature: { fg: '#4df840' attr: 'b' } + shape_string: '#4df840' + shape_string_interpolation: { fg: '#38c8b5' attr: 'b' } + shape_table: { fg: '#2757d6' attr: 'b' } + shape_variable: '#8c54fe' + + background: '#1b1d1e' + foreground: '#f8f8f8' + cursor: '#f8f8f8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/the-hulk.nu b/themes/nu-themes/the-hulk.nu index 468e6cd..21ca79f 100644 --- a/themes/nu-themes/the-hulk.nu +++ b/themes/nu-themes/the-hulk.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d8d8d0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#13ce2f" attr: "b" } - empty: "#2424f4" - bool: {|| if $in { "#3f85a5" } else { "light_gray" } } - int: "#d8d8d0" - filesize: {|e| - if $e == 0b { - "#d8d8d0" - } else if $e < 1mb { - "#378ca9" - } else {{ fg: "#2424f4" }} - } - duration: "#d8d8d0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#259d1a" attr: "b" } - } else if $in < 6hr { - "#259d1a" - } else if $in < 1day { - "#62e456" - } else if $in < 3day { - "#13ce2f" - } else if $in < 1wk { - { fg: "#13ce2f" attr: "b" } - } else if $in < 6wk { - "#378ca9" - } else if $in < 52wk { - "#2424f4" - } else { "dark_gray" } - } - range: "#d8d8d0" - float: "#d8d8d0" - string: "#d8d8d0" - nothing: "#d8d8d0" - binary: "#d8d8d0" - cellpath: "#d8d8d0" - row_index: { fg: "#13ce2f" attr: "b" } - record: "#d8d8d0" - list: "#d8d8d0" - block: "#d8d8d0" - hints: "dark_gray" - search_result: { fg: "#259d1a" bg: "#d8d8d0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#641e73" attr: "b" } - shape_binary: { fg: "#641e73" attr: "b" } - shape_block: { fg: "#2424f4" attr: "b" } - shape_bool: "#3f85a5" - shape_custom: "#13ce2f" - shape_datetime: { fg: "#378ca9" attr: "b" } - shape_directory: "#378ca9" - shape_external: "#378ca9" - shape_externalarg: { fg: "#13ce2f" attr: "b" } - shape_filepath: "#378ca9" - shape_flag: { fg: "#2424f4" attr: "b" } - shape_float: { fg: "#641e73" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#378ca9" attr: "b" } - shape_int: { fg: "#641e73" attr: "b" } - shape_internalcall: { fg: "#378ca9" attr: "b" } - shape_list: { fg: "#378ca9" attr: "b" } - shape_literal: "#2424f4" - shape_match_pattern: "#13ce2f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3f85a5" - shape_operator: "#62e456" - shape_or: { fg: "#641e73" attr: "b" } - shape_pipe: { fg: "#641e73" attr: "b" } - shape_range: { fg: "#62e456" attr: "b" } - shape_record: { fg: "#378ca9" attr: "b" } - shape_redirection: { fg: "#641e73" attr: "b" } - shape_signature: { fg: "#13ce2f" attr: "b" } - shape_string: "#13ce2f" - shape_string_interpolation: { fg: "#378ca9" attr: "b" } - shape_table: { fg: "#2424f4" attr: "b" } - shape_variable: "#641e73" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1d1e" - foreground: "#b4b4b4" - cursor: "#15b61a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d8d8d0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#13ce2f' attr: 'b' } + empty: '#2424f4' + bool: {|| if $in { '#3f85a5' } else { 'light_gray' } } + int: '#d8d8d0' + filesize: {|e| + if $e == 0b { + '#d8d8d0' + } else if $e < 1mb { + '#378ca9' + } else {{ fg: '#2424f4' }} + } + duration: '#d8d8d0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#259d1a' attr: 'b' } + } else if $in < 6hr { + '#259d1a' + } else if $in < 1day { + '#62e456' + } else if $in < 3day { + '#13ce2f' + } else if $in < 1wk { + { fg: '#13ce2f' attr: 'b' } + } else if $in < 6wk { + '#378ca9' + } else if $in < 52wk { + '#2424f4' + } else { 'dark_gray' } + } + range: '#d8d8d0' + float: '#d8d8d0' + string: '#d8d8d0' + nothing: '#d8d8d0' + binary: '#d8d8d0' + cellpath: '#d8d8d0' + row_index: { fg: '#13ce2f' attr: 'b' } + record: '#d8d8d0' + list: '#d8d8d0' + block: '#d8d8d0' + hints: 'dark_gray' + search_result: { fg: '#259d1a' bg: '#d8d8d0' } + + shape_and: { fg: '#641e73' attr: 'b' } + shape_binary: { fg: '#641e73' attr: 'b' } + shape_block: { fg: '#2424f4' attr: 'b' } + shape_bool: '#3f85a5' + shape_custom: '#13ce2f' + shape_datetime: { fg: '#378ca9' attr: 'b' } + shape_directory: '#378ca9' + shape_external: '#378ca9' + shape_externalarg: { fg: '#13ce2f' attr: 'b' } + shape_filepath: '#378ca9' + shape_flag: { fg: '#2424f4' attr: 'b' } + shape_float: { fg: '#641e73' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#378ca9' attr: 'b' } + shape_int: { fg: '#641e73' attr: 'b' } + shape_internalcall: { fg: '#378ca9' attr: 'b' } + shape_list: { fg: '#378ca9' attr: 'b' } + shape_literal: '#2424f4' + shape_match_pattern: '#13ce2f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3f85a5' + shape_operator: '#62e456' + shape_or: { fg: '#641e73' attr: 'b' } + shape_pipe: { fg: '#641e73' attr: 'b' } + shape_range: { fg: '#62e456' attr: 'b' } + shape_record: { fg: '#378ca9' attr: 'b' } + shape_redirection: { fg: '#641e73' attr: 'b' } + shape_signature: { fg: '#13ce2f' attr: 'b' } + shape_string: '#13ce2f' + shape_string_interpolation: { fg: '#378ca9' attr: 'b' } + shape_table: { fg: '#2424f4' attr: 'b' } + shape_variable: '#641e73' + + background: '#1b1d1e' + foreground: '#b4b4b4' + cursor: '#15b61a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tin.nu b/themes/nu-themes/tin.nu index b4fb27d..1183eef 100644 --- a/themes/nu-themes/tin.nu +++ b/themes/nu-themes/tin.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#ffffff" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#4e8d53" attr: "b" } - empty: "#534e8d" - bool: {|| if $in { "#78b0b5" } else { "light_gray" } } - int: "#ffffff" - filesize: {|e| - if $e == 0b { - "#ffffff" - } else if $e < 1mb { - "#4e888d" - } else {{ fg: "#534e8d" }} - } - duration: "#ffffff" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#8d534e" attr: "b" } - } else if $in < 6hr { - "#8d534e" - } else if $in < 1day { - "#888d4e" - } else if $in < 3day { - "#4e8d53" - } else if $in < 1wk { - { fg: "#4e8d53" attr: "b" } - } else if $in < 6wk { - "#4e888d" - } else if $in < 52wk { - "#534e8d" - } else { "dark_gray" } - } - range: "#ffffff" - float: "#ffffff" - string: "#ffffff" - nothing: "#ffffff" - binary: "#ffffff" - cellpath: "#ffffff" - row_index: { fg: "#4e8d53" attr: "b" } - record: "#ffffff" - list: "#ffffff" - block: "#ffffff" - hints: "dark_gray" - search_result: { fg: "#8d534e" bg: "#ffffff" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8d4e88" attr: "b" } - shape_binary: { fg: "#8d4e88" attr: "b" } - shape_block: { fg: "#534e8d" attr: "b" } - shape_bool: "#78b0b5" - shape_custom: "#4e8d53" - shape_datetime: { fg: "#4e888d" attr: "b" } - shape_directory: "#4e888d" - shape_external: "#4e888d" - shape_externalarg: { fg: "#4e8d53" attr: "b" } - shape_filepath: "#4e888d" - shape_flag: { fg: "#534e8d" attr: "b" } - shape_float: { fg: "#8d4e88" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#4e888d" attr: "b" } - shape_int: { fg: "#8d4e88" attr: "b" } - shape_internalcall: { fg: "#4e888d" attr: "b" } - shape_list: { fg: "#4e888d" attr: "b" } - shape_literal: "#534e8d" - shape_match_pattern: "#4e8d53" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#78b0b5" - shape_operator: "#888d4e" - shape_or: { fg: "#8d4e88" attr: "b" } - shape_pipe: { fg: "#8d4e88" attr: "b" } - shape_range: { fg: "#888d4e" attr: "b" } - shape_record: { fg: "#4e888d" attr: "b" } - shape_redirection: { fg: "#8d4e88" attr: "b" } - shape_signature: { fg: "#4e8d53" attr: "b" } - shape_string: "#4e8d53" - shape_string_interpolation: { fg: "#4e888d" attr: "b" } - shape_table: { fg: "#534e8d" attr: "b" } - shape_variable: "#8d4e88" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2e2e35" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#ffffff' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#4e8d53' attr: 'b' } + empty: '#534e8d' + bool: {|| if $in { '#78b0b5' } else { 'light_gray' } } + int: '#ffffff' + filesize: {|e| + if $e == 0b { + '#ffffff' + } else if $e < 1mb { + '#4e888d' + } else {{ fg: '#534e8d' }} + } + duration: '#ffffff' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#8d534e' attr: 'b' } + } else if $in < 6hr { + '#8d534e' + } else if $in < 1day { + '#888d4e' + } else if $in < 3day { + '#4e8d53' + } else if $in < 1wk { + { fg: '#4e8d53' attr: 'b' } + } else if $in < 6wk { + '#4e888d' + } else if $in < 52wk { + '#534e8d' + } else { 'dark_gray' } + } + range: '#ffffff' + float: '#ffffff' + string: '#ffffff' + nothing: '#ffffff' + binary: '#ffffff' + cellpath: '#ffffff' + row_index: { fg: '#4e8d53' attr: 'b' } + record: '#ffffff' + list: '#ffffff' + block: '#ffffff' + hints: 'dark_gray' + search_result: { fg: '#8d534e' bg: '#ffffff' } + + shape_and: { fg: '#8d4e88' attr: 'b' } + shape_binary: { fg: '#8d4e88' attr: 'b' } + shape_block: { fg: '#534e8d' attr: 'b' } + shape_bool: '#78b0b5' + shape_custom: '#4e8d53' + shape_datetime: { fg: '#4e888d' attr: 'b' } + shape_directory: '#4e888d' + shape_external: '#4e888d' + shape_externalarg: { fg: '#4e8d53' attr: 'b' } + shape_filepath: '#4e888d' + shape_flag: { fg: '#534e8d' attr: 'b' } + shape_float: { fg: '#8d4e88' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#4e888d' attr: 'b' } + shape_int: { fg: '#8d4e88' attr: 'b' } + shape_internalcall: { fg: '#4e888d' attr: 'b' } + shape_list: { fg: '#4e888d' attr: 'b' } + shape_literal: '#534e8d' + shape_match_pattern: '#4e8d53' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#78b0b5' + shape_operator: '#888d4e' + shape_or: { fg: '#8d4e88' attr: 'b' } + shape_pipe: { fg: '#8d4e88' attr: 'b' } + shape_range: { fg: '#888d4e' attr: 'b' } + shape_record: { fg: '#4e888d' attr: 'b' } + shape_redirection: { fg: '#8d4e88' attr: 'b' } + shape_signature: { fg: '#4e8d53' attr: 'b' } + shape_string: '#4e8d53' + shape_string_interpolation: { fg: '#4e888d' attr: 'b' } + shape_table: { fg: '#534e8d' attr: 'b' } + shape_variable: '#8d4e88' + + background: '#2e2e35' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tokyo-day.nu b/themes/nu-themes/tokyo-day.nu index d002a36..05794ea 100644 --- a/themes/nu-themes/tokyo-day.nu +++ b/themes/nu-themes/tokyo-day.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6172b0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#587539" attr: "b" } - empty: "#2e7de9" - bool: {|| if $in { "#007197" } else { "light_gray" } } - int: "#6172b0" - filesize: {|e| - if $e == 0b { - "#6172b0" - } else if $e < 1mb { - "#007197" - } else {{ fg: "#2e7de9" }} - } - duration: "#6172b0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f52a65" attr: "b" } - } else if $in < 6hr { - "#f52a65" - } else if $in < 1day { - "#8c6c3e" - } else if $in < 3day { - "#587539" - } else if $in < 1wk { - { fg: "#587539" attr: "b" } - } else if $in < 6wk { - "#007197" - } else if $in < 52wk { - "#2e7de9" - } else { "dark_gray" } - } - range: "#6172b0" - float: "#6172b0" - string: "#6172b0" - nothing: "#6172b0" - binary: "#6172b0" - cellpath: "#6172b0" - row_index: { fg: "#587539" attr: "b" } - record: "#6172b0" - list: "#6172b0" - block: "#6172b0" - hints: "dark_gray" - search_result: { fg: "#f52a65" bg: "#6172b0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9854f1" attr: "b" } - shape_binary: { fg: "#9854f1" attr: "b" } - shape_block: { fg: "#2e7de9" attr: "b" } - shape_bool: "#007197" - shape_custom: "#587539" - shape_datetime: { fg: "#007197" attr: "b" } - shape_directory: "#007197" - shape_external: "#007197" - shape_externalarg: { fg: "#587539" attr: "b" } - shape_filepath: "#007197" - shape_flag: { fg: "#2e7de9" attr: "b" } - shape_float: { fg: "#9854f1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#007197" attr: "b" } - shape_int: { fg: "#9854f1" attr: "b" } - shape_internalcall: { fg: "#007197" attr: "b" } - shape_list: { fg: "#007197" attr: "b" } - shape_literal: "#2e7de9" - shape_match_pattern: "#587539" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#007197" - shape_operator: "#8c6c3e" - shape_or: { fg: "#9854f1" attr: "b" } - shape_pipe: { fg: "#9854f1" attr: "b" } - shape_range: { fg: "#8c6c3e" attr: "b" } - shape_record: { fg: "#007197" attr: "b" } - shape_redirection: { fg: "#9854f1" attr: "b" } - shape_signature: { fg: "#587539" attr: "b" } - shape_string: "#587539" - shape_string_interpolation: { fg: "#007197" attr: "b" } - shape_table: { fg: "#2e7de9" attr: "b" } - shape_variable: "#9854f1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#e1e2e7" - foreground: "#3760bf" - cursor: "#3760bf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6172b0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#587539' attr: 'b' } + empty: '#2e7de9' + bool: {|| if $in { '#007197' } else { 'light_gray' } } + int: '#6172b0' + filesize: {|e| + if $e == 0b { + '#6172b0' + } else if $e < 1mb { + '#007197' + } else {{ fg: '#2e7de9' }} + } + duration: '#6172b0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f52a65' attr: 'b' } + } else if $in < 6hr { + '#f52a65' + } else if $in < 1day { + '#8c6c3e' + } else if $in < 3day { + '#587539' + } else if $in < 1wk { + { fg: '#587539' attr: 'b' } + } else if $in < 6wk { + '#007197' + } else if $in < 52wk { + '#2e7de9' + } else { 'dark_gray' } + } + range: '#6172b0' + float: '#6172b0' + string: '#6172b0' + nothing: '#6172b0' + binary: '#6172b0' + cellpath: '#6172b0' + row_index: { fg: '#587539' attr: 'b' } + record: '#6172b0' + list: '#6172b0' + block: '#6172b0' + hints: 'dark_gray' + search_result: { fg: '#f52a65' bg: '#6172b0' } + + shape_and: { fg: '#9854f1' attr: 'b' } + shape_binary: { fg: '#9854f1' attr: 'b' } + shape_block: { fg: '#2e7de9' attr: 'b' } + shape_bool: '#007197' + shape_custom: '#587539' + shape_datetime: { fg: '#007197' attr: 'b' } + shape_directory: '#007197' + shape_external: '#007197' + shape_externalarg: { fg: '#587539' attr: 'b' } + shape_filepath: '#007197' + shape_flag: { fg: '#2e7de9' attr: 'b' } + shape_float: { fg: '#9854f1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#007197' attr: 'b' } + shape_int: { fg: '#9854f1' attr: 'b' } + shape_internalcall: { fg: '#007197' attr: 'b' } + shape_list: { fg: '#007197' attr: 'b' } + shape_literal: '#2e7de9' + shape_match_pattern: '#587539' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#007197' + shape_operator: '#8c6c3e' + shape_or: { fg: '#9854f1' attr: 'b' } + shape_pipe: { fg: '#9854f1' attr: 'b' } + shape_range: { fg: '#8c6c3e' attr: 'b' } + shape_record: { fg: '#007197' attr: 'b' } + shape_redirection: { fg: '#9854f1' attr: 'b' } + shape_signature: { fg: '#587539' attr: 'b' } + shape_string: '#587539' + shape_string_interpolation: { fg: '#007197' attr: 'b' } + shape_table: { fg: '#2e7de9' attr: 'b' } + shape_variable: '#9854f1' + + background: '#e1e2e7' + foreground: '#3760bf' + cursor: '#3760bf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tokyo-moon.nu b/themes/nu-themes/tokyo-moon.nu deleted file mode 100644 index dcaad42..0000000 --- a/themes/nu-themes/tokyo-moon.nu +++ /dev/null @@ -1,82 +0,0 @@ -export def main [] { return { - separator: "#828bb8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#c3e88d" attr: "b" } - empty: "#82aaff" - bool: {|| if $in { "#86e1fc" } else { "light_gray" } } - int: "#828bb8" - filesize: {|e| - if $e == 0b { - "#828bb8" - } else if $e < 1mb { - "#86e1fc" - } else {{ fg: "#82aaff" }} - } - duration: "#828bb8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff757f" attr: "b" } - } else if $in < 6hr { - "#ff757f" - } else if $in < 1day { - "#ffc777" - } else if $in < 3day { - "#c3e88d" - } else if $in < 1wk { - { fg: "#c3e88d" attr: "b" } - } else if $in < 6wk { - "#86e1fc" - } else if $in < 52wk { - "#82aaff" - } else { "dark_gray" } - } - range: "#828bb8" - float: "#828bb8" - string: "#828bb8" - nothing: "#828bb8" - binary: "#828bb8" - cellpath: "#828bb8" - row_index: { fg: "#c3e88d" attr: "b" } - record: "#828bb8" - list: "#828bb8" - block: "#828bb8" - hints: "dark_gray" - search_result: { fg: "#ff757f" bg: "#828bb8" } - - shape_and: { fg: "#c099ff" attr: "b" } - shape_binary: { fg: "#c099ff" attr: "b" } - shape_block: { fg: "#82aaff" attr: "b" } - shape_bool: "#86e1fc" - shape_custom: "#c3e88d" - shape_datetime: { fg: "#86e1fc" attr: "b" } - shape_directory: "#86e1fc" - shape_external: "#86e1fc" - shape_externalarg: { fg: "#c3e88d" attr: "b" } - shape_filepath: "#86e1fc" - shape_flag: { fg: "#82aaff" attr: "b" } - shape_float: { fg: "#c099ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#86e1fc" attr: "b" } - shape_int: { fg: "#c099ff" attr: "b" } - shape_internalcall: { fg: "#86e1fc" attr: "b" } - shape_list: { fg: "#86e1fc" attr: "b" } - shape_literal: "#82aaff" - shape_match_pattern: "#c3e88d" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#86e1fc" - shape_operator: "#ffc777" - shape_or: { fg: "#c099ff" attr: "b" } - shape_pipe: { fg: "#c099ff" attr: "b" } - shape_range: { fg: "#ffc777" attr: "b" } - shape_record: { fg: "#86e1fc" attr: "b" } - shape_redirection: { fg: "#c099ff" attr: "b" } - shape_signature: { fg: "#c3e88d" attr: "b" } - shape_string: "#c3e88d" - shape_string_interpolation: { fg: "#86e1fc" attr: "b" } - shape_table: { fg: "#82aaff" attr: "b" } - shape_variable: "#c099ff" - - background: "#222436" - foreground: "#c8d3f5" - cursor: "#c8d3f5" -}} diff --git a/themes/nu-themes/tokyo-night.nu b/themes/nu-themes/tokyo-night.nu index e70cea6..5dae70a 100644 --- a/themes/nu-themes/tokyo-night.nu +++ b/themes/nu-themes/tokyo-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a9b1d6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9ece6a" attr: "b" } - empty: "#7aa2f7" - bool: {|| if $in { "#7dcfff" } else { "light_gray" } } - int: "#a9b1d6" - filesize: {|e| - if $e == 0b { - "#a9b1d6" - } else if $e < 1mb { - "#7dcfff" - } else {{ fg: "#7aa2f7" }} - } - duration: "#a9b1d6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f7768e" attr: "b" } - } else if $in < 6hr { - "#f7768e" - } else if $in < 1day { - "#e0af68" - } else if $in < 3day { - "#9ece6a" - } else if $in < 1wk { - { fg: "#9ece6a" attr: "b" } - } else if $in < 6wk { - "#7dcfff" - } else if $in < 52wk { - "#7aa2f7" - } else { "dark_gray" } - } - range: "#a9b1d6" - float: "#a9b1d6" - string: "#a9b1d6" - nothing: "#a9b1d6" - binary: "#a9b1d6" - cellpath: "#a9b1d6" - row_index: { fg: "#9ece6a" attr: "b" } - record: "#a9b1d6" - list: "#a9b1d6" - block: "#a9b1d6" - hints: "dark_gray" - search_result: { fg: "#f7768e" bg: "#a9b1d6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb9af7" attr: "b" } - shape_binary: { fg: "#bb9af7" attr: "b" } - shape_block: { fg: "#7aa2f7" attr: "b" } - shape_bool: "#7dcfff" - shape_custom: "#9ece6a" - shape_datetime: { fg: "#7dcfff" attr: "b" } - shape_directory: "#7dcfff" - shape_external: "#7dcfff" - shape_externalarg: { fg: "#9ece6a" attr: "b" } - shape_filepath: "#7dcfff" - shape_flag: { fg: "#7aa2f7" attr: "b" } - shape_float: { fg: "#bb9af7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7dcfff" attr: "b" } - shape_int: { fg: "#bb9af7" attr: "b" } - shape_internalcall: { fg: "#7dcfff" attr: "b" } - shape_list: { fg: "#7dcfff" attr: "b" } - shape_literal: "#7aa2f7" - shape_match_pattern: "#9ece6a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7dcfff" - shape_operator: "#e0af68" - shape_or: { fg: "#bb9af7" attr: "b" } - shape_pipe: { fg: "#bb9af7" attr: "b" } - shape_range: { fg: "#e0af68" attr: "b" } - shape_record: { fg: "#7dcfff" attr: "b" } - shape_redirection: { fg: "#bb9af7" attr: "b" } - shape_signature: { fg: "#9ece6a" attr: "b" } - shape_string: "#9ece6a" - shape_string_interpolation: { fg: "#7dcfff" attr: "b" } - shape_table: { fg: "#7aa2f7" attr: "b" } - shape_variable: "#bb9af7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1a1b26" - foreground: "#c0caf5" - cursor: "#c0caf5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a9b1d6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9ece6a' attr: 'b' } + empty: '#7aa2f7' + bool: {|| if $in { '#7dcfff' } else { 'light_gray' } } + int: '#a9b1d6' + filesize: {|e| + if $e == 0b { + '#a9b1d6' + } else if $e < 1mb { + '#7dcfff' + } else {{ fg: '#7aa2f7' }} + } + duration: '#a9b1d6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f7768e' attr: 'b' } + } else if $in < 6hr { + '#f7768e' + } else if $in < 1day { + '#e0af68' + } else if $in < 3day { + '#9ece6a' + } else if $in < 1wk { + { fg: '#9ece6a' attr: 'b' } + } else if $in < 6wk { + '#7dcfff' + } else if $in < 52wk { + '#7aa2f7' + } else { 'dark_gray' } + } + range: '#a9b1d6' + float: '#a9b1d6' + string: '#a9b1d6' + nothing: '#a9b1d6' + binary: '#a9b1d6' + cellpath: '#a9b1d6' + row_index: { fg: '#9ece6a' attr: 'b' } + record: '#a9b1d6' + list: '#a9b1d6' + block: '#a9b1d6' + hints: 'dark_gray' + search_result: { fg: '#f7768e' bg: '#a9b1d6' } + + shape_and: { fg: '#bb9af7' attr: 'b' } + shape_binary: { fg: '#bb9af7' attr: 'b' } + shape_block: { fg: '#7aa2f7' attr: 'b' } + shape_bool: '#7dcfff' + shape_custom: '#9ece6a' + shape_datetime: { fg: '#7dcfff' attr: 'b' } + shape_directory: '#7dcfff' + shape_external: '#7dcfff' + shape_externalarg: { fg: '#9ece6a' attr: 'b' } + shape_filepath: '#7dcfff' + shape_flag: { fg: '#7aa2f7' attr: 'b' } + shape_float: { fg: '#bb9af7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7dcfff' attr: 'b' } + shape_int: { fg: '#bb9af7' attr: 'b' } + shape_internalcall: { fg: '#7dcfff' attr: 'b' } + shape_list: { fg: '#7dcfff' attr: 'b' } + shape_literal: '#7aa2f7' + shape_match_pattern: '#9ece6a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7dcfff' + shape_operator: '#e0af68' + shape_or: { fg: '#bb9af7' attr: 'b' } + shape_pipe: { fg: '#bb9af7' attr: 'b' } + shape_range: { fg: '#e0af68' attr: 'b' } + shape_record: { fg: '#7dcfff' attr: 'b' } + shape_redirection: { fg: '#bb9af7' attr: 'b' } + shape_signature: { fg: '#9ece6a' attr: 'b' } + shape_string: '#9ece6a' + shape_string_interpolation: { fg: '#7dcfff' attr: 'b' } + shape_table: { fg: '#7aa2f7' attr: 'b' } + shape_variable: '#bb9af7' + + background: '#1a1b26' + foreground: '#c0caf5' + cursor: '#c0caf5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tokyo-storm.nu b/themes/nu-themes/tokyo-storm.nu index 64497a4..858de85 100644 --- a/themes/nu-themes/tokyo-storm.nu +++ b/themes/nu-themes/tokyo-storm.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a9b1d6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#9ece6a" attr: "b" } - empty: "#7aa2f7" - bool: {|| if $in { "#7dcfff" } else { "light_gray" } } - int: "#a9b1d6" - filesize: {|e| - if $e == 0b { - "#a9b1d6" - } else if $e < 1mb { - "#7dcfff" - } else {{ fg: "#7aa2f7" }} - } - duration: "#a9b1d6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f7768e" attr: "b" } - } else if $in < 6hr { - "#f7768e" - } else if $in < 1day { - "#e0af68" - } else if $in < 3day { - "#9ece6a" - } else if $in < 1wk { - { fg: "#9ece6a" attr: "b" } - } else if $in < 6wk { - "#7dcfff" - } else if $in < 52wk { - "#7aa2f7" - } else { "dark_gray" } - } - range: "#a9b1d6" - float: "#a9b1d6" - string: "#a9b1d6" - nothing: "#a9b1d6" - binary: "#a9b1d6" - cellpath: "#a9b1d6" - row_index: { fg: "#9ece6a" attr: "b" } - record: "#a9b1d6" - list: "#a9b1d6" - block: "#a9b1d6" - hints: "dark_gray" - search_result: { fg: "#f7768e" bg: "#a9b1d6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb9af7" attr: "b" } - shape_binary: { fg: "#bb9af7" attr: "b" } - shape_block: { fg: "#7aa2f7" attr: "b" } - shape_bool: "#7dcfff" - shape_custom: "#9ece6a" - shape_datetime: { fg: "#7dcfff" attr: "b" } - shape_directory: "#7dcfff" - shape_external: "#7dcfff" - shape_externalarg: { fg: "#9ece6a" attr: "b" } - shape_filepath: "#7dcfff" - shape_flag: { fg: "#7aa2f7" attr: "b" } - shape_float: { fg: "#bb9af7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7dcfff" attr: "b" } - shape_int: { fg: "#bb9af7" attr: "b" } - shape_internalcall: { fg: "#7dcfff" attr: "b" } - shape_list: { fg: "#7dcfff" attr: "b" } - shape_literal: "#7aa2f7" - shape_match_pattern: "#9ece6a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#7dcfff" - shape_operator: "#e0af68" - shape_or: { fg: "#bb9af7" attr: "b" } - shape_pipe: { fg: "#bb9af7" attr: "b" } - shape_range: { fg: "#e0af68" attr: "b" } - shape_record: { fg: "#7dcfff" attr: "b" } - shape_redirection: { fg: "#bb9af7" attr: "b" } - shape_signature: { fg: "#9ece6a" attr: "b" } - shape_string: "#9ece6a" - shape_string_interpolation: { fg: "#7dcfff" attr: "b" } - shape_table: { fg: "#7aa2f7" attr: "b" } - shape_variable: "#bb9af7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#24283b" - foreground: "#c0caf5" - cursor: "#c0caf5" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a9b1d6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#9ece6a' attr: 'b' } + empty: '#7aa2f7' + bool: {|| if $in { '#7dcfff' } else { 'light_gray' } } + int: '#a9b1d6' + filesize: {|e| + if $e == 0b { + '#a9b1d6' + } else if $e < 1mb { + '#7dcfff' + } else {{ fg: '#7aa2f7' }} + } + duration: '#a9b1d6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f7768e' attr: 'b' } + } else if $in < 6hr { + '#f7768e' + } else if $in < 1day { + '#e0af68' + } else if $in < 3day { + '#9ece6a' + } else if $in < 1wk { + { fg: '#9ece6a' attr: 'b' } + } else if $in < 6wk { + '#7dcfff' + } else if $in < 52wk { + '#7aa2f7' + } else { 'dark_gray' } + } + range: '#a9b1d6' + float: '#a9b1d6' + string: '#a9b1d6' + nothing: '#a9b1d6' + binary: '#a9b1d6' + cellpath: '#a9b1d6' + row_index: { fg: '#9ece6a' attr: 'b' } + record: '#a9b1d6' + list: '#a9b1d6' + block: '#a9b1d6' + hints: 'dark_gray' + search_result: { fg: '#f7768e' bg: '#a9b1d6' } + + shape_and: { fg: '#bb9af7' attr: 'b' } + shape_binary: { fg: '#bb9af7' attr: 'b' } + shape_block: { fg: '#7aa2f7' attr: 'b' } + shape_bool: '#7dcfff' + shape_custom: '#9ece6a' + shape_datetime: { fg: '#7dcfff' attr: 'b' } + shape_directory: '#7dcfff' + shape_external: '#7dcfff' + shape_externalarg: { fg: '#9ece6a' attr: 'b' } + shape_filepath: '#7dcfff' + shape_flag: { fg: '#7aa2f7' attr: 'b' } + shape_float: { fg: '#bb9af7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7dcfff' attr: 'b' } + shape_int: { fg: '#bb9af7' attr: 'b' } + shape_internalcall: { fg: '#7dcfff' attr: 'b' } + shape_list: { fg: '#7dcfff' attr: 'b' } + shape_literal: '#7aa2f7' + shape_match_pattern: '#9ece6a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#7dcfff' + shape_operator: '#e0af68' + shape_or: { fg: '#bb9af7' attr: 'b' } + shape_pipe: { fg: '#bb9af7' attr: 'b' } + shape_range: { fg: '#e0af68' attr: 'b' } + shape_record: { fg: '#7dcfff' attr: 'b' } + shape_redirection: { fg: '#bb9af7' attr: 'b' } + shape_signature: { fg: '#9ece6a' attr: 'b' } + shape_string: '#9ece6a' + shape_string_interpolation: { fg: '#7dcfff' attr: 'b' } + shape_table: { fg: '#7aa2f7' attr: 'b' } + shape_variable: '#bb9af7' + + background: '#24283b' + foreground: '#c0caf5' + cursor: '#c0caf5' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tomorrow-night-blue.nu b/themes/nu-themes/tomorrow-night-blue.nu index 471763e..12063d0 100644 --- a/themes/nu-themes/tomorrow-night-blue.nu +++ b/themes/nu-themes/tomorrow-night-blue.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fffefe" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#d1f1a9" attr: "b" } - empty: "#bbdaff" - bool: {|| if $in { "#99ffff" } else { "light_gray" } } - int: "#fffefe" - filesize: {|e| - if $e == 0b { - "#fffefe" - } else if $e < 1mb { - "#99ffff" - } else {{ fg: "#bbdaff" }} - } - duration: "#fffefe" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff9da3" attr: "b" } - } else if $in < 6hr { - "#ff9da3" - } else if $in < 1day { - "#ffeead" - } else if $in < 3day { - "#d1f1a9" - } else if $in < 1wk { - { fg: "#d1f1a9" attr: "b" } - } else if $in < 6wk { - "#99ffff" - } else if $in < 52wk { - "#bbdaff" - } else { "dark_gray" } - } - range: "#fffefe" - float: "#fffefe" - string: "#fffefe" - nothing: "#fffefe" - binary: "#fffefe" - cellpath: "#fffefe" - row_index: { fg: "#d1f1a9" attr: "b" } - record: "#fffefe" - list: "#fffefe" - block: "#fffefe" - hints: "dark_gray" - search_result: { fg: "#ff9da3" bg: "#fffefe" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ebbbff" attr: "b" } - shape_binary: { fg: "#ebbbff" attr: "b" } - shape_block: { fg: "#bbdaff" attr: "b" } - shape_bool: "#99ffff" - shape_custom: "#d1f1a9" - shape_datetime: { fg: "#99ffff" attr: "b" } - shape_directory: "#99ffff" - shape_external: "#99ffff" - shape_externalarg: { fg: "#d1f1a9" attr: "b" } - shape_filepath: "#99ffff" - shape_flag: { fg: "#bbdaff" attr: "b" } - shape_float: { fg: "#ebbbff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#99ffff" attr: "b" } - shape_int: { fg: "#ebbbff" attr: "b" } - shape_internalcall: { fg: "#99ffff" attr: "b" } - shape_list: { fg: "#99ffff" attr: "b" } - shape_literal: "#bbdaff" - shape_match_pattern: "#d1f1a9" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#99ffff" - shape_operator: "#ffeead" - shape_or: { fg: "#ebbbff" attr: "b" } - shape_pipe: { fg: "#ebbbff" attr: "b" } - shape_range: { fg: "#ffeead" attr: "b" } - shape_record: { fg: "#99ffff" attr: "b" } - shape_redirection: { fg: "#ebbbff" attr: "b" } - shape_signature: { fg: "#d1f1a9" attr: "b" } - shape_string: "#d1f1a9" - shape_string_interpolation: { fg: "#99ffff" attr: "b" } - shape_table: { fg: "#bbdaff" attr: "b" } - shape_variable: "#ebbbff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#002451" - foreground: "#fffefe" - cursor: "#fffefe" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fffefe' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#d1f1a9' attr: 'b' } + empty: '#bbdaff' + bool: {|| if $in { '#99ffff' } else { 'light_gray' } } + int: '#fffefe' + filesize: {|e| + if $e == 0b { + '#fffefe' + } else if $e < 1mb { + '#99ffff' + } else {{ fg: '#bbdaff' }} + } + duration: '#fffefe' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff9da3' attr: 'b' } + } else if $in < 6hr { + '#ff9da3' + } else if $in < 1day { + '#ffeead' + } else if $in < 3day { + '#d1f1a9' + } else if $in < 1wk { + { fg: '#d1f1a9' attr: 'b' } + } else if $in < 6wk { + '#99ffff' + } else if $in < 52wk { + '#bbdaff' + } else { 'dark_gray' } + } + range: '#fffefe' + float: '#fffefe' + string: '#fffefe' + nothing: '#fffefe' + binary: '#fffefe' + cellpath: '#fffefe' + row_index: { fg: '#d1f1a9' attr: 'b' } + record: '#fffefe' + list: '#fffefe' + block: '#fffefe' + hints: 'dark_gray' + search_result: { fg: '#ff9da3' bg: '#fffefe' } + + shape_and: { fg: '#ebbbff' attr: 'b' } + shape_binary: { fg: '#ebbbff' attr: 'b' } + shape_block: { fg: '#bbdaff' attr: 'b' } + shape_bool: '#99ffff' + shape_custom: '#d1f1a9' + shape_datetime: { fg: '#99ffff' attr: 'b' } + shape_directory: '#99ffff' + shape_external: '#99ffff' + shape_externalarg: { fg: '#d1f1a9' attr: 'b' } + shape_filepath: '#99ffff' + shape_flag: { fg: '#bbdaff' attr: 'b' } + shape_float: { fg: '#ebbbff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#99ffff' attr: 'b' } + shape_int: { fg: '#ebbbff' attr: 'b' } + shape_internalcall: { fg: '#99ffff' attr: 'b' } + shape_list: { fg: '#99ffff' attr: 'b' } + shape_literal: '#bbdaff' + shape_match_pattern: '#d1f1a9' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#99ffff' + shape_operator: '#ffeead' + shape_or: { fg: '#ebbbff' attr: 'b' } + shape_pipe: { fg: '#ebbbff' attr: 'b' } + shape_range: { fg: '#ffeead' attr: 'b' } + shape_record: { fg: '#99ffff' attr: 'b' } + shape_redirection: { fg: '#ebbbff' attr: 'b' } + shape_signature: { fg: '#d1f1a9' attr: 'b' } + shape_string: '#d1f1a9' + shape_string_interpolation: { fg: '#99ffff' attr: 'b' } + shape_table: { fg: '#bbdaff' attr: 'b' } + shape_variable: '#ebbbff' + + background: '#002451' + foreground: '#fffefe' + cursor: '#fffefe' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tomorrow-night-bright.nu b/themes/nu-themes/tomorrow-night-bright.nu index ff27b1a..d6a3899 100644 --- a/themes/nu-themes/tomorrow-night-bright.nu +++ b/themes/nu-themes/tomorrow-night-bright.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fffefe" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b9ca49" attr: "b" } - empty: "#79a6da" - bool: {|| if $in { "#70c0b1" } else { "light_gray" } } - int: "#fffefe" - filesize: {|e| - if $e == 0b { - "#fffefe" - } else if $e < 1mb { - "#70c0b1" - } else {{ fg: "#79a6da" }} - } - duration: "#fffefe" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d54e53" attr: "b" } - } else if $in < 6hr { - "#d54e53" - } else if $in < 1day { - "#e7c547" - } else if $in < 3day { - "#b9ca49" - } else if $in < 1wk { - { fg: "#b9ca49" attr: "b" } - } else if $in < 6wk { - "#70c0b1" - } else if $in < 52wk { - "#79a6da" - } else { "dark_gray" } - } - range: "#fffefe" - float: "#fffefe" - string: "#fffefe" - nothing: "#fffefe" - binary: "#fffefe" - cellpath: "#fffefe" - row_index: { fg: "#b9ca49" attr: "b" } - record: "#fffefe" - list: "#fffefe" - block: "#fffefe" - hints: "dark_gray" - search_result: { fg: "#d54e53" bg: "#fffefe" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c397d8" attr: "b" } - shape_binary: { fg: "#c397d8" attr: "b" } - shape_block: { fg: "#79a6da" attr: "b" } - shape_bool: "#70c0b1" - shape_custom: "#b9ca49" - shape_datetime: { fg: "#70c0b1" attr: "b" } - shape_directory: "#70c0b1" - shape_external: "#70c0b1" - shape_externalarg: { fg: "#b9ca49" attr: "b" } - shape_filepath: "#70c0b1" - shape_flag: { fg: "#79a6da" attr: "b" } - shape_float: { fg: "#c397d8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#70c0b1" attr: "b" } - shape_int: { fg: "#c397d8" attr: "b" } - shape_internalcall: { fg: "#70c0b1" attr: "b" } - shape_list: { fg: "#70c0b1" attr: "b" } - shape_literal: "#79a6da" - shape_match_pattern: "#b9ca49" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#70c0b1" - shape_operator: "#e7c547" - shape_or: { fg: "#c397d8" attr: "b" } - shape_pipe: { fg: "#c397d8" attr: "b" } - shape_range: { fg: "#e7c547" attr: "b" } - shape_record: { fg: "#70c0b1" attr: "b" } - shape_redirection: { fg: "#c397d8" attr: "b" } - shape_signature: { fg: "#b9ca49" attr: "b" } - shape_string: "#b9ca49" - shape_string_interpolation: { fg: "#70c0b1" attr: "b" } - shape_table: { fg: "#79a6da" attr: "b" } - shape_variable: "#c397d8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#e9e9e9" - cursor: "#e9e9e9" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fffefe' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b9ca49' attr: 'b' } + empty: '#79a6da' + bool: {|| if $in { '#70c0b1' } else { 'light_gray' } } + int: '#fffefe' + filesize: {|e| + if $e == 0b { + '#fffefe' + } else if $e < 1mb { + '#70c0b1' + } else {{ fg: '#79a6da' }} + } + duration: '#fffefe' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d54e53' attr: 'b' } + } else if $in < 6hr { + '#d54e53' + } else if $in < 1day { + '#e7c547' + } else if $in < 3day { + '#b9ca49' + } else if $in < 1wk { + { fg: '#b9ca49' attr: 'b' } + } else if $in < 6wk { + '#70c0b1' + } else if $in < 52wk { + '#79a6da' + } else { 'dark_gray' } + } + range: '#fffefe' + float: '#fffefe' + string: '#fffefe' + nothing: '#fffefe' + binary: '#fffefe' + cellpath: '#fffefe' + row_index: { fg: '#b9ca49' attr: 'b' } + record: '#fffefe' + list: '#fffefe' + block: '#fffefe' + hints: 'dark_gray' + search_result: { fg: '#d54e53' bg: '#fffefe' } + + shape_and: { fg: '#c397d8' attr: 'b' } + shape_binary: { fg: '#c397d8' attr: 'b' } + shape_block: { fg: '#79a6da' attr: 'b' } + shape_bool: '#70c0b1' + shape_custom: '#b9ca49' + shape_datetime: { fg: '#70c0b1' attr: 'b' } + shape_directory: '#70c0b1' + shape_external: '#70c0b1' + shape_externalarg: { fg: '#b9ca49' attr: 'b' } + shape_filepath: '#70c0b1' + shape_flag: { fg: '#79a6da' attr: 'b' } + shape_float: { fg: '#c397d8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#70c0b1' attr: 'b' } + shape_int: { fg: '#c397d8' attr: 'b' } + shape_internalcall: { fg: '#70c0b1' attr: 'b' } + shape_list: { fg: '#70c0b1' attr: 'b' } + shape_literal: '#79a6da' + shape_match_pattern: '#b9ca49' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#70c0b1' + shape_operator: '#e7c547' + shape_or: { fg: '#c397d8' attr: 'b' } + shape_pipe: { fg: '#c397d8' attr: 'b' } + shape_range: { fg: '#e7c547' attr: 'b' } + shape_record: { fg: '#70c0b1' attr: 'b' } + shape_redirection: { fg: '#c397d8' attr: 'b' } + shape_signature: { fg: '#b9ca49' attr: 'b' } + shape_string: '#b9ca49' + shape_string_interpolation: { fg: '#70c0b1' attr: 'b' } + shape_table: { fg: '#79a6da' attr: 'b' } + shape_variable: '#c397d8' + + background: '#000000' + foreground: '#e9e9e9' + cursor: '#e9e9e9' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tomorrow-night-eighties.nu b/themes/nu-themes/tomorrow-night-eighties.nu index 2c8ee34..db828c3 100644 --- a/themes/nu-themes/tomorrow-night-eighties.nu +++ b/themes/nu-themes/tomorrow-night-eighties.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#99cc99" attr: "b" } - empty: "#6699cc" - bool: {|| if $in { "#66cccc" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#66cccc" - } else {{ fg: "#6699cc" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#f2777a" attr: "b" } - } else if $in < 6hr { - "#f2777a" - } else if $in < 1day { - "#ffcc66" - } else if $in < 3day { - "#99cc99" - } else if $in < 1wk { - { fg: "#99cc99" attr: "b" } - } else if $in < 6wk { - "#66cccc" - } else if $in < 52wk { - "#6699cc" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#99cc99" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#f2777a" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc99cc" attr: "b" } - shape_binary: { fg: "#cc99cc" attr: "b" } - shape_block: { fg: "#6699cc" attr: "b" } - shape_bool: "#66cccc" - shape_custom: "#99cc99" - shape_datetime: { fg: "#66cccc" attr: "b" } - shape_directory: "#66cccc" - shape_external: "#66cccc" - shape_externalarg: { fg: "#99cc99" attr: "b" } - shape_filepath: "#66cccc" - shape_flag: { fg: "#6699cc" attr: "b" } - shape_float: { fg: "#cc99cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#66cccc" attr: "b" } - shape_int: { fg: "#cc99cc" attr: "b" } - shape_internalcall: { fg: "#66cccc" attr: "b" } - shape_list: { fg: "#66cccc" attr: "b" } - shape_literal: "#6699cc" - shape_match_pattern: "#99cc99" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#66cccc" - shape_operator: "#ffcc66" - shape_or: { fg: "#cc99cc" attr: "b" } - shape_pipe: { fg: "#cc99cc" attr: "b" } - shape_range: { fg: "#ffcc66" attr: "b" } - shape_record: { fg: "#66cccc" attr: "b" } - shape_redirection: { fg: "#cc99cc" attr: "b" } - shape_signature: { fg: "#99cc99" attr: "b" } - shape_string: "#99cc99" - shape_string_interpolation: { fg: "#66cccc" attr: "b" } - shape_table: { fg: "#6699cc" attr: "b" } - shape_variable: "#cc99cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2d2d2d" - foreground: "#cccccc" - cursor: "#cccccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#99cc99' attr: 'b' } + empty: '#6699cc' + bool: {|| if $in { '#66cccc' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#66cccc' + } else {{ fg: '#6699cc' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#f2777a' attr: 'b' } + } else if $in < 6hr { + '#f2777a' + } else if $in < 1day { + '#ffcc66' + } else if $in < 3day { + '#99cc99' + } else if $in < 1wk { + { fg: '#99cc99' attr: 'b' } + } else if $in < 6wk { + '#66cccc' + } else if $in < 52wk { + '#6699cc' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#99cc99' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#f2777a' bg: '#cccccc' } + + shape_and: { fg: '#cc99cc' attr: 'b' } + shape_binary: { fg: '#cc99cc' attr: 'b' } + shape_block: { fg: '#6699cc' attr: 'b' } + shape_bool: '#66cccc' + shape_custom: '#99cc99' + shape_datetime: { fg: '#66cccc' attr: 'b' } + shape_directory: '#66cccc' + shape_external: '#66cccc' + shape_externalarg: { fg: '#99cc99' attr: 'b' } + shape_filepath: '#66cccc' + shape_flag: { fg: '#6699cc' attr: 'b' } + shape_float: { fg: '#cc99cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#66cccc' attr: 'b' } + shape_int: { fg: '#cc99cc' attr: 'b' } + shape_internalcall: { fg: '#66cccc' attr: 'b' } + shape_list: { fg: '#66cccc' attr: 'b' } + shape_literal: '#6699cc' + shape_match_pattern: '#99cc99' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#66cccc' + shape_operator: '#ffcc66' + shape_or: { fg: '#cc99cc' attr: 'b' } + shape_pipe: { fg: '#cc99cc' attr: 'b' } + shape_range: { fg: '#ffcc66' attr: 'b' } + shape_record: { fg: '#66cccc' attr: 'b' } + shape_redirection: { fg: '#cc99cc' attr: 'b' } + shape_signature: { fg: '#99cc99' attr: 'b' } + shape_string: '#99cc99' + shape_string_interpolation: { fg: '#66cccc' attr: 'b' } + shape_table: { fg: '#6699cc' attr: 'b' } + shape_variable: '#cc99cc' + + background: '#2d2d2d' + foreground: '#cccccc' + cursor: '#cccccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tomorrow-night.nu b/themes/nu-themes/tomorrow-night.nu index 97ee051..7047c16 100644 --- a/themes/nu-themes/tomorrow-night.nu +++ b/themes/nu-themes/tomorrow-night.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c5c8c6" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b5bd68" attr: "b" } - empty: "#81a2be" - bool: {|| if $in { "#8abeb7" } else { "light_gray" } } - int: "#c5c8c6" - filesize: {|e| - if $e == 0b { - "#c5c8c6" - } else if $e < 1mb { - "#8abeb7" - } else {{ fg: "#81a2be" }} - } - duration: "#c5c8c6" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc6666" attr: "b" } - } else if $in < 6hr { - "#cc6666" - } else if $in < 1day { - "#f0c674" - } else if $in < 3day { - "#b5bd68" - } else if $in < 1wk { - { fg: "#b5bd68" attr: "b" } - } else if $in < 6wk { - "#8abeb7" - } else if $in < 52wk { - "#81a2be" - } else { "dark_gray" } - } - range: "#c5c8c6" - float: "#c5c8c6" - string: "#c5c8c6" - nothing: "#c5c8c6" - binary: "#c5c8c6" - cellpath: "#c5c8c6" - row_index: { fg: "#b5bd68" attr: "b" } - record: "#c5c8c6" - list: "#c5c8c6" - block: "#c5c8c6" - hints: "dark_gray" - search_result: { fg: "#cc6666" bg: "#c5c8c6" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b294bb" attr: "b" } - shape_binary: { fg: "#b294bb" attr: "b" } - shape_block: { fg: "#81a2be" attr: "b" } - shape_bool: "#8abeb7" - shape_custom: "#b5bd68" - shape_datetime: { fg: "#8abeb7" attr: "b" } - shape_directory: "#8abeb7" - shape_external: "#8abeb7" - shape_externalarg: { fg: "#b5bd68" attr: "b" } - shape_filepath: "#8abeb7" - shape_flag: { fg: "#81a2be" attr: "b" } - shape_float: { fg: "#b294bb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8abeb7" attr: "b" } - shape_int: { fg: "#b294bb" attr: "b" } - shape_internalcall: { fg: "#8abeb7" attr: "b" } - shape_list: { fg: "#8abeb7" attr: "b" } - shape_literal: "#81a2be" - shape_match_pattern: "#b5bd68" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#8abeb7" - shape_operator: "#f0c674" - shape_or: { fg: "#b294bb" attr: "b" } - shape_pipe: { fg: "#b294bb" attr: "b" } - shape_range: { fg: "#f0c674" attr: "b" } - shape_record: { fg: "#8abeb7" attr: "b" } - shape_redirection: { fg: "#b294bb" attr: "b" } - shape_signature: { fg: "#b5bd68" attr: "b" } - shape_string: "#b5bd68" - shape_string_interpolation: { fg: "#8abeb7" attr: "b" } - shape_table: { fg: "#81a2be" attr: "b" } - shape_variable: "#b294bb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1d1f21" - foreground: "#c5c8c6" - cursor: "#c5c8c6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c5c8c6' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b5bd68' attr: 'b' } + empty: '#81a2be' + bool: {|| if $in { '#8abeb7' } else { 'light_gray' } } + int: '#c5c8c6' + filesize: {|e| + if $e == 0b { + '#c5c8c6' + } else if $e < 1mb { + '#8abeb7' + } else {{ fg: '#81a2be' }} + } + duration: '#c5c8c6' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc6666' attr: 'b' } + } else if $in < 6hr { + '#cc6666' + } else if $in < 1day { + '#f0c674' + } else if $in < 3day { + '#b5bd68' + } else if $in < 1wk { + { fg: '#b5bd68' attr: 'b' } + } else if $in < 6wk { + '#8abeb7' + } else if $in < 52wk { + '#81a2be' + } else { 'dark_gray' } + } + range: '#c5c8c6' + float: '#c5c8c6' + string: '#c5c8c6' + nothing: '#c5c8c6' + binary: '#c5c8c6' + cellpath: '#c5c8c6' + row_index: { fg: '#b5bd68' attr: 'b' } + record: '#c5c8c6' + list: '#c5c8c6' + block: '#c5c8c6' + hints: 'dark_gray' + search_result: { fg: '#cc6666' bg: '#c5c8c6' } + + shape_and: { fg: '#b294bb' attr: 'b' } + shape_binary: { fg: '#b294bb' attr: 'b' } + shape_block: { fg: '#81a2be' attr: 'b' } + shape_bool: '#8abeb7' + shape_custom: '#b5bd68' + shape_datetime: { fg: '#8abeb7' attr: 'b' } + shape_directory: '#8abeb7' + shape_external: '#8abeb7' + shape_externalarg: { fg: '#b5bd68' attr: 'b' } + shape_filepath: '#8abeb7' + shape_flag: { fg: '#81a2be' attr: 'b' } + shape_float: { fg: '#b294bb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8abeb7' attr: 'b' } + shape_int: { fg: '#b294bb' attr: 'b' } + shape_internalcall: { fg: '#8abeb7' attr: 'b' } + shape_list: { fg: '#8abeb7' attr: 'b' } + shape_literal: '#81a2be' + shape_match_pattern: '#b5bd68' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#8abeb7' + shape_operator: '#f0c674' + shape_or: { fg: '#b294bb' attr: 'b' } + shape_pipe: { fg: '#b294bb' attr: 'b' } + shape_range: { fg: '#f0c674' attr: 'b' } + shape_record: { fg: '#8abeb7' attr: 'b' } + shape_redirection: { fg: '#b294bb' attr: 'b' } + shape_signature: { fg: '#b5bd68' attr: 'b' } + shape_string: '#b5bd68' + shape_string_interpolation: { fg: '#8abeb7' attr: 'b' } + shape_table: { fg: '#81a2be' attr: 'b' } + shape_variable: '#b294bb' + + background: '#1d1f21' + foreground: '#c5c8c6' + cursor: '#c5c8c6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tomorrow.nu b/themes/nu-themes/tomorrow.nu index 12f4bc8..3f905bb 100644 --- a/themes/nu-themes/tomorrow.nu +++ b/themes/nu-themes/tomorrow.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#4d4d4c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#718c00" attr: "b" } - empty: "#4271ae" - bool: {|| if $in { "#3e999f" } else { "light_gray" } } - int: "#4d4d4c" - filesize: {|e| - if $e == 0b { - "#4d4d4c" - } else if $e < 1mb { - "#3e999f" - } else {{ fg: "#4271ae" }} - } - duration: "#4d4d4c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c82829" attr: "b" } - } else if $in < 6hr { - "#c82829" - } else if $in < 1day { - "#eab700" - } else if $in < 3day { - "#718c00" - } else if $in < 1wk { - { fg: "#718c00" attr: "b" } - } else if $in < 6wk { - "#3e999f" - } else if $in < 52wk { - "#4271ae" - } else { "dark_gray" } - } - range: "#4d4d4c" - float: "#4d4d4c" - string: "#4d4d4c" - nothing: "#4d4d4c" - binary: "#4d4d4c" - cellpath: "#4d4d4c" - row_index: { fg: "#718c00" attr: "b" } - record: "#4d4d4c" - list: "#4d4d4c" - block: "#4d4d4c" - hints: "dark_gray" - search_result: { fg: "#c82829" bg: "#4d4d4c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8959a8" attr: "b" } - shape_binary: { fg: "#8959a8" attr: "b" } - shape_block: { fg: "#4271ae" attr: "b" } - shape_bool: "#3e999f" - shape_custom: "#718c00" - shape_datetime: { fg: "#3e999f" attr: "b" } - shape_directory: "#3e999f" - shape_external: "#3e999f" - shape_externalarg: { fg: "#718c00" attr: "b" } - shape_filepath: "#3e999f" - shape_flag: { fg: "#4271ae" attr: "b" } - shape_float: { fg: "#8959a8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3e999f" attr: "b" } - shape_int: { fg: "#8959a8" attr: "b" } - shape_internalcall: { fg: "#3e999f" attr: "b" } - shape_list: { fg: "#3e999f" attr: "b" } - shape_literal: "#4271ae" - shape_match_pattern: "#718c00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3e999f" - shape_operator: "#eab700" - shape_or: { fg: "#8959a8" attr: "b" } - shape_pipe: { fg: "#8959a8" attr: "b" } - shape_range: { fg: "#eab700" attr: "b" } - shape_record: { fg: "#3e999f" attr: "b" } - shape_redirection: { fg: "#8959a8" attr: "b" } - shape_signature: { fg: "#718c00" attr: "b" } - shape_string: "#718c00" - shape_string_interpolation: { fg: "#3e999f" attr: "b" } - shape_table: { fg: "#4271ae" attr: "b" } - shape_variable: "#8959a8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#4d4d4c" - cursor: "#4d4d4c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#4d4d4c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#718c00' attr: 'b' } + empty: '#4271ae' + bool: {|| if $in { '#3e999f' } else { 'light_gray' } } + int: '#4d4d4c' + filesize: {|e| + if $e == 0b { + '#4d4d4c' + } else if $e < 1mb { + '#3e999f' + } else {{ fg: '#4271ae' }} + } + duration: '#4d4d4c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c82829' attr: 'b' } + } else if $in < 6hr { + '#c82829' + } else if $in < 1day { + '#eab700' + } else if $in < 3day { + '#718c00' + } else if $in < 1wk { + { fg: '#718c00' attr: 'b' } + } else if $in < 6wk { + '#3e999f' + } else if $in < 52wk { + '#4271ae' + } else { 'dark_gray' } + } + range: '#4d4d4c' + float: '#4d4d4c' + string: '#4d4d4c' + nothing: '#4d4d4c' + binary: '#4d4d4c' + cellpath: '#4d4d4c' + row_index: { fg: '#718c00' attr: 'b' } + record: '#4d4d4c' + list: '#4d4d4c' + block: '#4d4d4c' + hints: 'dark_gray' + search_result: { fg: '#c82829' bg: '#4d4d4c' } + + shape_and: { fg: '#8959a8' attr: 'b' } + shape_binary: { fg: '#8959a8' attr: 'b' } + shape_block: { fg: '#4271ae' attr: 'b' } + shape_bool: '#3e999f' + shape_custom: '#718c00' + shape_datetime: { fg: '#3e999f' attr: 'b' } + shape_directory: '#3e999f' + shape_external: '#3e999f' + shape_externalarg: { fg: '#718c00' attr: 'b' } + shape_filepath: '#3e999f' + shape_flag: { fg: '#4271ae' attr: 'b' } + shape_float: { fg: '#8959a8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3e999f' attr: 'b' } + shape_int: { fg: '#8959a8' attr: 'b' } + shape_internalcall: { fg: '#3e999f' attr: 'b' } + shape_list: { fg: '#3e999f' attr: 'b' } + shape_literal: '#4271ae' + shape_match_pattern: '#718c00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3e999f' + shape_operator: '#eab700' + shape_or: { fg: '#8959a8' attr: 'b' } + shape_pipe: { fg: '#8959a8' attr: 'b' } + shape_range: { fg: '#eab700' attr: 'b' } + shape_record: { fg: '#3e999f' attr: 'b' } + shape_redirection: { fg: '#8959a8' attr: 'b' } + shape_signature: { fg: '#718c00' attr: 'b' } + shape_string: '#718c00' + shape_string_interpolation: { fg: '#3e999f' attr: 'b' } + shape_table: { fg: '#4271ae' attr: 'b' } + shape_variable: '#8959a8' + + background: '#ffffff' + foreground: '#4d4d4c' + cursor: '#4d4d4c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/toy-chest.nu b/themes/nu-themes/toy-chest.nu index 68c0f2e..652ed1c 100644 --- a/themes/nu-themes/toy-chest.nu +++ b/themes/nu-themes/toy-chest.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#23d183" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#1a9172" attr: "b" } - empty: "#325d96" - bool: {|| if $in { "#42c3ae" } else { "light_gray" } } - int: "#23d183" - filesize: {|e| - if $e == 0b { - "#23d183" - } else if $e < 1mb { - "#35a08f" - } else {{ fg: "#325d96" }} - } - duration: "#23d183" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#be2d26" attr: "b" } - } else if $in < 6hr { - "#be2d26" - } else if $in < 1day { - "#db8e27" - } else if $in < 3day { - "#1a9172" - } else if $in < 1wk { - { fg: "#1a9172" attr: "b" } - } else if $in < 6wk { - "#35a08f" - } else if $in < 52wk { - "#325d96" - } else { "dark_gray" } - } - range: "#23d183" - float: "#23d183" - string: "#23d183" - nothing: "#23d183" - binary: "#23d183" - cellpath: "#23d183" - row_index: { fg: "#1a9172" attr: "b" } - record: "#23d183" - list: "#23d183" - block: "#23d183" - hints: "dark_gray" - search_result: { fg: "#be2d26" bg: "#23d183" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#8a5edc" attr: "b" } - shape_binary: { fg: "#8a5edc" attr: "b" } - shape_block: { fg: "#325d96" attr: "b" } - shape_bool: "#42c3ae" - shape_custom: "#1a9172" - shape_datetime: { fg: "#35a08f" attr: "b" } - shape_directory: "#35a08f" - shape_external: "#35a08f" - shape_externalarg: { fg: "#1a9172" attr: "b" } - shape_filepath: "#35a08f" - shape_flag: { fg: "#325d96" attr: "b" } - shape_float: { fg: "#8a5edc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#35a08f" attr: "b" } - shape_int: { fg: "#8a5edc" attr: "b" } - shape_internalcall: { fg: "#35a08f" attr: "b" } - shape_list: { fg: "#35a08f" attr: "b" } - shape_literal: "#325d96" - shape_match_pattern: "#1a9172" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#42c3ae" - shape_operator: "#db8e27" - shape_or: { fg: "#8a5edc" attr: "b" } - shape_pipe: { fg: "#8a5edc" attr: "b" } - shape_range: { fg: "#db8e27" attr: "b" } - shape_record: { fg: "#35a08f" attr: "b" } - shape_redirection: { fg: "#8a5edc" attr: "b" } - shape_signature: { fg: "#1a9172" attr: "b" } - shape_string: "#1a9172" - shape_string_interpolation: { fg: "#35a08f" attr: "b" } - shape_table: { fg: "#325d96" attr: "b" } - shape_variable: "#8a5edc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#24364b" - foreground: "#31d07b" - cursor: "#31d07b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#23d183' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#1a9172' attr: 'b' } + empty: '#325d96' + bool: {|| if $in { '#42c3ae' } else { 'light_gray' } } + int: '#23d183' + filesize: {|e| + if $e == 0b { + '#23d183' + } else if $e < 1mb { + '#35a08f' + } else {{ fg: '#325d96' }} + } + duration: '#23d183' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#be2d26' attr: 'b' } + } else if $in < 6hr { + '#be2d26' + } else if $in < 1day { + '#db8e27' + } else if $in < 3day { + '#1a9172' + } else if $in < 1wk { + { fg: '#1a9172' attr: 'b' } + } else if $in < 6wk { + '#35a08f' + } else if $in < 52wk { + '#325d96' + } else { 'dark_gray' } + } + range: '#23d183' + float: '#23d183' + string: '#23d183' + nothing: '#23d183' + binary: '#23d183' + cellpath: '#23d183' + row_index: { fg: '#1a9172' attr: 'b' } + record: '#23d183' + list: '#23d183' + block: '#23d183' + hints: 'dark_gray' + search_result: { fg: '#be2d26' bg: '#23d183' } + + shape_and: { fg: '#8a5edc' attr: 'b' } + shape_binary: { fg: '#8a5edc' attr: 'b' } + shape_block: { fg: '#325d96' attr: 'b' } + shape_bool: '#42c3ae' + shape_custom: '#1a9172' + shape_datetime: { fg: '#35a08f' attr: 'b' } + shape_directory: '#35a08f' + shape_external: '#35a08f' + shape_externalarg: { fg: '#1a9172' attr: 'b' } + shape_filepath: '#35a08f' + shape_flag: { fg: '#325d96' attr: 'b' } + shape_float: { fg: '#8a5edc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#35a08f' attr: 'b' } + shape_int: { fg: '#8a5edc' attr: 'b' } + shape_internalcall: { fg: '#35a08f' attr: 'b' } + shape_list: { fg: '#35a08f' attr: 'b' } + shape_literal: '#325d96' + shape_match_pattern: '#1a9172' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#42c3ae' + shape_operator: '#db8e27' + shape_or: { fg: '#8a5edc' attr: 'b' } + shape_pipe: { fg: '#8a5edc' attr: 'b' } + shape_range: { fg: '#db8e27' attr: 'b' } + shape_record: { fg: '#35a08f' attr: 'b' } + shape_redirection: { fg: '#8a5edc' attr: 'b' } + shape_signature: { fg: '#1a9172' attr: 'b' } + shape_string: '#1a9172' + shape_string_interpolation: { fg: '#35a08f' attr: 'b' } + shape_table: { fg: '#325d96' attr: 'b' } + shape_variable: '#8a5edc' + + background: '#24364b' + foreground: '#31d07b' + cursor: '#31d07b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/treehouse.nu b/themes/nu-themes/treehouse.nu index c02d7d3..6b4216f 100644 --- a/themes/nu-themes/treehouse.nu +++ b/themes/nu-themes/treehouse.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#786b53" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#44a900" attr: "b" } - empty: "#58859a" - bool: {|| if $in { "#f07d14" } else { "light_gray" } } - int: "#786b53" - filesize: {|e| - if $e == 0b { - "#786b53" - } else if $e < 1mb { - "#b25a1e" - } else {{ fg: "#58859a" }} - } - duration: "#786b53" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b2270e" attr: "b" } - } else if $in < 6hr { - "#b2270e" - } else if $in < 1day { - "#aa820c" - } else if $in < 3day { - "#44a900" - } else if $in < 1wk { - { fg: "#44a900" attr: "b" } - } else if $in < 6wk { - "#b25a1e" - } else if $in < 52wk { - "#58859a" - } else { "dark_gray" } - } - range: "#786b53" - float: "#786b53" - string: "#786b53" - nothing: "#786b53" - binary: "#786b53" - cellpath: "#786b53" - row_index: { fg: "#44a900" attr: "b" } - record: "#786b53" - list: "#786b53" - block: "#786b53" - hints: "dark_gray" - search_result: { fg: "#b2270e" bg: "#786b53" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#97363d" attr: "b" } - shape_binary: { fg: "#97363d" attr: "b" } - shape_block: { fg: "#58859a" attr: "b" } - shape_bool: "#f07d14" - shape_custom: "#44a900" - shape_datetime: { fg: "#b25a1e" attr: "b" } - shape_directory: "#b25a1e" - shape_external: "#b25a1e" - shape_externalarg: { fg: "#44a900" attr: "b" } - shape_filepath: "#b25a1e" - shape_flag: { fg: "#58859a" attr: "b" } - shape_float: { fg: "#97363d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#b25a1e" attr: "b" } - shape_int: { fg: "#97363d" attr: "b" } - shape_internalcall: { fg: "#b25a1e" attr: "b" } - shape_list: { fg: "#b25a1e" attr: "b" } - shape_literal: "#58859a" - shape_match_pattern: "#44a900" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#f07d14" - shape_operator: "#aa820c" - shape_or: { fg: "#97363d" attr: "b" } - shape_pipe: { fg: "#97363d" attr: "b" } - shape_range: { fg: "#aa820c" attr: "b" } - shape_record: { fg: "#b25a1e" attr: "b" } - shape_redirection: { fg: "#97363d" attr: "b" } - shape_signature: { fg: "#44a900" attr: "b" } - shape_string: "#44a900" - shape_string_interpolation: { fg: "#b25a1e" attr: "b" } - shape_table: { fg: "#58859a" attr: "b" } - shape_variable: "#97363d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191919" - foreground: "#786b53" - cursor: "#786b53" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#786b53' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#44a900' attr: 'b' } + empty: '#58859a' + bool: {|| if $in { '#f07d14' } else { 'light_gray' } } + int: '#786b53' + filesize: {|e| + if $e == 0b { + '#786b53' + } else if $e < 1mb { + '#b25a1e' + } else {{ fg: '#58859a' }} + } + duration: '#786b53' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b2270e' attr: 'b' } + } else if $in < 6hr { + '#b2270e' + } else if $in < 1day { + '#aa820c' + } else if $in < 3day { + '#44a900' + } else if $in < 1wk { + { fg: '#44a900' attr: 'b' } + } else if $in < 6wk { + '#b25a1e' + } else if $in < 52wk { + '#58859a' + } else { 'dark_gray' } + } + range: '#786b53' + float: '#786b53' + string: '#786b53' + nothing: '#786b53' + binary: '#786b53' + cellpath: '#786b53' + row_index: { fg: '#44a900' attr: 'b' } + record: '#786b53' + list: '#786b53' + block: '#786b53' + hints: 'dark_gray' + search_result: { fg: '#b2270e' bg: '#786b53' } + + shape_and: { fg: '#97363d' attr: 'b' } + shape_binary: { fg: '#97363d' attr: 'b' } + shape_block: { fg: '#58859a' attr: 'b' } + shape_bool: '#f07d14' + shape_custom: '#44a900' + shape_datetime: { fg: '#b25a1e' attr: 'b' } + shape_directory: '#b25a1e' + shape_external: '#b25a1e' + shape_externalarg: { fg: '#44a900' attr: 'b' } + shape_filepath: '#b25a1e' + shape_flag: { fg: '#58859a' attr: 'b' } + shape_float: { fg: '#97363d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#b25a1e' attr: 'b' } + shape_int: { fg: '#97363d' attr: 'b' } + shape_internalcall: { fg: '#b25a1e' attr: 'b' } + shape_list: { fg: '#b25a1e' attr: 'b' } + shape_literal: '#58859a' + shape_match_pattern: '#44a900' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#f07d14' + shape_operator: '#aa820c' + shape_or: { fg: '#97363d' attr: 'b' } + shape_pipe: { fg: '#97363d' attr: 'b' } + shape_range: { fg: '#aa820c' attr: 'b' } + shape_record: { fg: '#b25a1e' attr: 'b' } + shape_redirection: { fg: '#97363d' attr: 'b' } + shape_signature: { fg: '#44a900' attr: 'b' } + shape_string: '#44a900' + shape_string_interpolation: { fg: '#b25a1e' attr: 'b' } + shape_table: { fg: '#58859a' attr: 'b' } + shape_variable: '#97363d' + + background: '#191919' + foreground: '#786b53' + cursor: '#786b53' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/tube.nu b/themes/nu-themes/tube.nu index 7510db3..f1fa698 100644 --- a/themes/nu-themes/tube.nu +++ b/themes/nu-themes/tube.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d9d8d8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00853e" attr: "b" } - empty: "#009ddc" - bool: {|| if $in { "#85cebc" } else { "light_gray" } } - int: "#d9d8d8" - filesize: {|e| - if $e == 0b { - "#d9d8d8" - } else if $e < 1mb { - "#85cebc" - } else {{ fg: "#009ddc" }} - } - duration: "#d9d8d8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ee2e24" attr: "b" } - } else if $in < 6hr { - "#ee2e24" - } else if $in < 1day { - "#ffd204" - } else if $in < 3day { - "#00853e" - } else if $in < 1wk { - { fg: "#00853e" attr: "b" } - } else if $in < 6wk { - "#85cebc" - } else if $in < 52wk { - "#009ddc" - } else { "dark_gray" } - } - range: "#d9d8d8" - float: "#d9d8d8" - string: "#d9d8d8" - nothing: "#d9d8d8" - binary: "#d9d8d8" - cellpath: "#d9d8d8" - row_index: { fg: "#00853e" attr: "b" } - record: "#d9d8d8" - list: "#d9d8d8" - block: "#d9d8d8" - hints: "dark_gray" - search_result: { fg: "#ee2e24" bg: "#d9d8d8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#98005d" attr: "b" } - shape_binary: { fg: "#98005d" attr: "b" } - shape_block: { fg: "#009ddc" attr: "b" } - shape_bool: "#85cebc" - shape_custom: "#00853e" - shape_datetime: { fg: "#85cebc" attr: "b" } - shape_directory: "#85cebc" - shape_external: "#85cebc" - shape_externalarg: { fg: "#00853e" attr: "b" } - shape_filepath: "#85cebc" - shape_flag: { fg: "#009ddc" attr: "b" } - shape_float: { fg: "#98005d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#85cebc" attr: "b" } - shape_int: { fg: "#98005d" attr: "b" } - shape_internalcall: { fg: "#85cebc" attr: "b" } - shape_list: { fg: "#85cebc" attr: "b" } - shape_literal: "#009ddc" - shape_match_pattern: "#00853e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#85cebc" - shape_operator: "#ffd204" - shape_or: { fg: "#98005d" attr: "b" } - shape_pipe: { fg: "#98005d" attr: "b" } - shape_range: { fg: "#ffd204" attr: "b" } - shape_record: { fg: "#85cebc" attr: "b" } - shape_redirection: { fg: "#98005d" attr: "b" } - shape_signature: { fg: "#00853e" attr: "b" } - shape_string: "#00853e" - shape_string_interpolation: { fg: "#85cebc" attr: "b" } - shape_table: { fg: "#009ddc" attr: "b" } - shape_variable: "#98005d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#231f20" - foreground: "#d9d8d8" - cursor: "#d9d8d8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d9d8d8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00853e' attr: 'b' } + empty: '#009ddc' + bool: {|| if $in { '#85cebc' } else { 'light_gray' } } + int: '#d9d8d8' + filesize: {|e| + if $e == 0b { + '#d9d8d8' + } else if $e < 1mb { + '#85cebc' + } else {{ fg: '#009ddc' }} + } + duration: '#d9d8d8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ee2e24' attr: 'b' } + } else if $in < 6hr { + '#ee2e24' + } else if $in < 1day { + '#ffd204' + } else if $in < 3day { + '#00853e' + } else if $in < 1wk { + { fg: '#00853e' attr: 'b' } + } else if $in < 6wk { + '#85cebc' + } else if $in < 52wk { + '#009ddc' + } else { 'dark_gray' } + } + range: '#d9d8d8' + float: '#d9d8d8' + string: '#d9d8d8' + nothing: '#d9d8d8' + binary: '#d9d8d8' + cellpath: '#d9d8d8' + row_index: { fg: '#00853e' attr: 'b' } + record: '#d9d8d8' + list: '#d9d8d8' + block: '#d9d8d8' + hints: 'dark_gray' + search_result: { fg: '#ee2e24' bg: '#d9d8d8' } + + shape_and: { fg: '#98005d' attr: 'b' } + shape_binary: { fg: '#98005d' attr: 'b' } + shape_block: { fg: '#009ddc' attr: 'b' } + shape_bool: '#85cebc' + shape_custom: '#00853e' + shape_datetime: { fg: '#85cebc' attr: 'b' } + shape_directory: '#85cebc' + shape_external: '#85cebc' + shape_externalarg: { fg: '#00853e' attr: 'b' } + shape_filepath: '#85cebc' + shape_flag: { fg: '#009ddc' attr: 'b' } + shape_float: { fg: '#98005d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#85cebc' attr: 'b' } + shape_int: { fg: '#98005d' attr: 'b' } + shape_internalcall: { fg: '#85cebc' attr: 'b' } + shape_list: { fg: '#85cebc' attr: 'b' } + shape_literal: '#009ddc' + shape_match_pattern: '#00853e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#85cebc' + shape_operator: '#ffd204' + shape_or: { fg: '#98005d' attr: 'b' } + shape_pipe: { fg: '#98005d' attr: 'b' } + shape_range: { fg: '#ffd204' attr: 'b' } + shape_record: { fg: '#85cebc' attr: 'b' } + shape_redirection: { fg: '#98005d' attr: 'b' } + shape_signature: { fg: '#00853e' attr: 'b' } + shape_string: '#00853e' + shape_string_interpolation: { fg: '#85cebc' attr: 'b' } + shape_table: { fg: '#009ddc' attr: 'b' } + shape_variable: '#98005d' + + background: '#231f20' + foreground: '#d9d8d8' + cursor: '#d9d8d8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/twilight.nu b/themes/nu-themes/twilight.nu index 15d3ffc..b8daa38 100644 --- a/themes/nu-themes/twilight.nu +++ b/themes/nu-themes/twilight.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a7a7a7" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#8f9d6a" attr: "b" } - empty: "#7587a6" - bool: {|| if $in { "#afc4db" } else { "light_gray" } } - int: "#a7a7a7" - filesize: {|e| - if $e == 0b { - "#a7a7a7" - } else if $e < 1mb { - "#afc4db" - } else {{ fg: "#7587a6" }} - } - duration: "#a7a7a7" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cf6a4c" attr: "b" } - } else if $in < 6hr { - "#cf6a4c" - } else if $in < 1day { - "#f9ee98" - } else if $in < 3day { - "#8f9d6a" - } else if $in < 1wk { - { fg: "#8f9d6a" attr: "b" } - } else if $in < 6wk { - "#afc4db" - } else if $in < 52wk { - "#7587a6" - } else { "dark_gray" } - } - range: "#a7a7a7" - float: "#a7a7a7" - string: "#a7a7a7" - nothing: "#a7a7a7" - binary: "#a7a7a7" - cellpath: "#a7a7a7" - row_index: { fg: "#8f9d6a" attr: "b" } - record: "#a7a7a7" - list: "#a7a7a7" - block: "#a7a7a7" - hints: "dark_gray" - search_result: { fg: "#cf6a4c" bg: "#a7a7a7" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9b859d" attr: "b" } - shape_binary: { fg: "#9b859d" attr: "b" } - shape_block: { fg: "#7587a6" attr: "b" } - shape_bool: "#afc4db" - shape_custom: "#8f9d6a" - shape_datetime: { fg: "#afc4db" attr: "b" } - shape_directory: "#afc4db" - shape_external: "#afc4db" - shape_externalarg: { fg: "#8f9d6a" attr: "b" } - shape_filepath: "#afc4db" - shape_flag: { fg: "#7587a6" attr: "b" } - shape_float: { fg: "#9b859d" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#afc4db" attr: "b" } - shape_int: { fg: "#9b859d" attr: "b" } - shape_internalcall: { fg: "#afc4db" attr: "b" } - shape_list: { fg: "#afc4db" attr: "b" } - shape_literal: "#7587a6" - shape_match_pattern: "#8f9d6a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#afc4db" - shape_operator: "#f9ee98" - shape_or: { fg: "#9b859d" attr: "b" } - shape_pipe: { fg: "#9b859d" attr: "b" } - shape_range: { fg: "#f9ee98" attr: "b" } - shape_record: { fg: "#afc4db" attr: "b" } - shape_redirection: { fg: "#9b859d" attr: "b" } - shape_signature: { fg: "#8f9d6a" attr: "b" } - shape_string: "#8f9d6a" - shape_string_interpolation: { fg: "#afc4db" attr: "b" } - shape_table: { fg: "#7587a6" attr: "b" } - shape_variable: "#9b859d" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e1e1e" - foreground: "#a7a7a7" - cursor: "#a7a7a7" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a7a7a7' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#8f9d6a' attr: 'b' } + empty: '#7587a6' + bool: {|| if $in { '#afc4db' } else { 'light_gray' } } + int: '#a7a7a7' + filesize: {|e| + if $e == 0b { + '#a7a7a7' + } else if $e < 1mb { + '#afc4db' + } else {{ fg: '#7587a6' }} + } + duration: '#a7a7a7' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cf6a4c' attr: 'b' } + } else if $in < 6hr { + '#cf6a4c' + } else if $in < 1day { + '#f9ee98' + } else if $in < 3day { + '#8f9d6a' + } else if $in < 1wk { + { fg: '#8f9d6a' attr: 'b' } + } else if $in < 6wk { + '#afc4db' + } else if $in < 52wk { + '#7587a6' + } else { 'dark_gray' } + } + range: '#a7a7a7' + float: '#a7a7a7' + string: '#a7a7a7' + nothing: '#a7a7a7' + binary: '#a7a7a7' + cellpath: '#a7a7a7' + row_index: { fg: '#8f9d6a' attr: 'b' } + record: '#a7a7a7' + list: '#a7a7a7' + block: '#a7a7a7' + hints: 'dark_gray' + search_result: { fg: '#cf6a4c' bg: '#a7a7a7' } + + shape_and: { fg: '#9b859d' attr: 'b' } + shape_binary: { fg: '#9b859d' attr: 'b' } + shape_block: { fg: '#7587a6' attr: 'b' } + shape_bool: '#afc4db' + shape_custom: '#8f9d6a' + shape_datetime: { fg: '#afc4db' attr: 'b' } + shape_directory: '#afc4db' + shape_external: '#afc4db' + shape_externalarg: { fg: '#8f9d6a' attr: 'b' } + shape_filepath: '#afc4db' + shape_flag: { fg: '#7587a6' attr: 'b' } + shape_float: { fg: '#9b859d' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#afc4db' attr: 'b' } + shape_int: { fg: '#9b859d' attr: 'b' } + shape_internalcall: { fg: '#afc4db' attr: 'b' } + shape_list: { fg: '#afc4db' attr: 'b' } + shape_literal: '#7587a6' + shape_match_pattern: '#8f9d6a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#afc4db' + shape_operator: '#f9ee98' + shape_or: { fg: '#9b859d' attr: 'b' } + shape_pipe: { fg: '#9b859d' attr: 'b' } + shape_range: { fg: '#f9ee98' attr: 'b' } + shape_record: { fg: '#afc4db' attr: 'b' } + shape_redirection: { fg: '#9b859d' attr: 'b' } + shape_signature: { fg: '#8f9d6a' attr: 'b' } + shape_string: '#8f9d6a' + shape_string_interpolation: { fg: '#afc4db' attr: 'b' } + shape_table: { fg: '#7587a6' attr: 'b' } + shape_variable: '#9b859d' + + background: '#1e1e1e' + foreground: '#a7a7a7' + cursor: '#a7a7a7' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/two-firewatch.nu b/themes/nu-themes/two-firewatch.nu index c6a116a..da7208f 100644 --- a/themes/nu-themes/two-firewatch.nu +++ b/themes/nu-themes/two-firewatch.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dcdfe4" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#98c379" attr: "b" } - empty: "#61afef" - bool: {|| if $in { "#56b6c2" } else { "light_gray" } } - int: "#dcdfe4" - filesize: {|e| - if $e == 0b { - "#dcdfe4" - } else if $e < 1mb { - "#56b6c2" - } else {{ fg: "#61afef" }} - } - duration: "#dcdfe4" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e06c75" attr: "b" } - } else if $in < 6hr { - "#e06c75" - } else if $in < 1day { - "#e5c07b" - } else if $in < 3day { - "#98c379" - } else if $in < 1wk { - { fg: "#98c379" attr: "b" } - } else if $in < 6wk { - "#56b6c2" - } else if $in < 52wk { - "#61afef" - } else { "dark_gray" } - } - range: "#dcdfe4" - float: "#dcdfe4" - string: "#dcdfe4" - nothing: "#dcdfe4" - binary: "#dcdfe4" - cellpath: "#dcdfe4" - row_index: { fg: "#98c379" attr: "b" } - record: "#dcdfe4" - list: "#dcdfe4" - block: "#dcdfe4" - hints: "dark_gray" - search_result: { fg: "#e06c75" bg: "#dcdfe4" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#c678dd" attr: "b" } - shape_binary: { fg: "#c678dd" attr: "b" } - shape_block: { fg: "#61afef" attr: "b" } - shape_bool: "#56b6c2" - shape_custom: "#98c379" - shape_datetime: { fg: "#56b6c2" attr: "b" } - shape_directory: "#56b6c2" - shape_external: "#56b6c2" - shape_externalarg: { fg: "#98c379" attr: "b" } - shape_filepath: "#56b6c2" - shape_flag: { fg: "#61afef" attr: "b" } - shape_float: { fg: "#c678dd" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#56b6c2" attr: "b" } - shape_int: { fg: "#c678dd" attr: "b" } - shape_internalcall: { fg: "#56b6c2" attr: "b" } - shape_list: { fg: "#56b6c2" attr: "b" } - shape_literal: "#61afef" - shape_match_pattern: "#98c379" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#56b6c2" - shape_operator: "#e5c07b" - shape_or: { fg: "#c678dd" attr: "b" } - shape_pipe: { fg: "#c678dd" attr: "b" } - shape_range: { fg: "#e5c07b" attr: "b" } - shape_record: { fg: "#56b6c2" attr: "b" } - shape_redirection: { fg: "#c678dd" attr: "b" } - shape_signature: { fg: "#98c379" attr: "b" } - shape_string: "#98c379" - shape_string_interpolation: { fg: "#56b6c2" attr: "b" } - shape_table: { fg: "#61afef" attr: "b" } - shape_variable: "#c678dd" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282c34" - foreground: "#abb2bf" - cursor: "#abb2bf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dcdfe4' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#98c379' attr: 'b' } + empty: '#61afef' + bool: {|| if $in { '#56b6c2' } else { 'light_gray' } } + int: '#dcdfe4' + filesize: {|e| + if $e == 0b { + '#dcdfe4' + } else if $e < 1mb { + '#56b6c2' + } else {{ fg: '#61afef' }} + } + duration: '#dcdfe4' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e06c75' attr: 'b' } + } else if $in < 6hr { + '#e06c75' + } else if $in < 1day { + '#e5c07b' + } else if $in < 3day { + '#98c379' + } else if $in < 1wk { + { fg: '#98c379' attr: 'b' } + } else if $in < 6wk { + '#56b6c2' + } else if $in < 52wk { + '#61afef' + } else { 'dark_gray' } + } + range: '#dcdfe4' + float: '#dcdfe4' + string: '#dcdfe4' + nothing: '#dcdfe4' + binary: '#dcdfe4' + cellpath: '#dcdfe4' + row_index: { fg: '#98c379' attr: 'b' } + record: '#dcdfe4' + list: '#dcdfe4' + block: '#dcdfe4' + hints: 'dark_gray' + search_result: { fg: '#e06c75' bg: '#dcdfe4' } + + shape_and: { fg: '#c678dd' attr: 'b' } + shape_binary: { fg: '#c678dd' attr: 'b' } + shape_block: { fg: '#61afef' attr: 'b' } + shape_bool: '#56b6c2' + shape_custom: '#98c379' + shape_datetime: { fg: '#56b6c2' attr: 'b' } + shape_directory: '#56b6c2' + shape_external: '#56b6c2' + shape_externalarg: { fg: '#98c379' attr: 'b' } + shape_filepath: '#56b6c2' + shape_flag: { fg: '#61afef' attr: 'b' } + shape_float: { fg: '#c678dd' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#56b6c2' attr: 'b' } + shape_int: { fg: '#c678dd' attr: 'b' } + shape_internalcall: { fg: '#56b6c2' attr: 'b' } + shape_list: { fg: '#56b6c2' attr: 'b' } + shape_literal: '#61afef' + shape_match_pattern: '#98c379' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#56b6c2' + shape_operator: '#e5c07b' + shape_or: { fg: '#c678dd' attr: 'b' } + shape_pipe: { fg: '#c678dd' attr: 'b' } + shape_range: { fg: '#e5c07b' attr: 'b' } + shape_record: { fg: '#56b6c2' attr: 'b' } + shape_redirection: { fg: '#c678dd' attr: 'b' } + shape_signature: { fg: '#98c379' attr: 'b' } + shape_string: '#98c379' + shape_string_interpolation: { fg: '#56b6c2' attr: 'b' } + shape_table: { fg: '#61afef' attr: 'b' } + shape_variable: '#c678dd' + + background: '#282c34' + foreground: '#abb2bf' + cursor: '#abb2bf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/unikitty-dark.nu b/themes/nu-themes/unikitty-dark.nu index 3a52c07..29ed310 100644 --- a/themes/nu-themes/unikitty-dark.nu +++ b/themes/nu-themes/unikitty-dark.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#bcbabe" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#17ad98" attr: "b" } - empty: "#796af5" - bool: {|| if $in { "#149bda" } else { "light_gray" } } - int: "#bcbabe" - filesize: {|e| - if $e == 0b { - "#bcbabe" - } else if $e < 1mb { - "#149bda" - } else {{ fg: "#796af5" }} - } - duration: "#bcbabe" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d8137f" attr: "b" } - } else if $in < 6hr { - "#d8137f" - } else if $in < 1day { - "#dc8a0e" - } else if $in < 3day { - "#17ad98" - } else if $in < 1wk { - { fg: "#17ad98" attr: "b" } - } else if $in < 6wk { - "#149bda" - } else if $in < 52wk { - "#796af5" - } else { "dark_gray" } - } - range: "#bcbabe" - float: "#bcbabe" - string: "#bcbabe" - nothing: "#bcbabe" - binary: "#bcbabe" - cellpath: "#bcbabe" - row_index: { fg: "#17ad98" attr: "b" } - record: "#bcbabe" - list: "#bcbabe" - block: "#bcbabe" - hints: "dark_gray" - search_result: { fg: "#d8137f" bg: "#bcbabe" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb60ea" attr: "b" } - shape_binary: { fg: "#bb60ea" attr: "b" } - shape_block: { fg: "#796af5" attr: "b" } - shape_bool: "#149bda" - shape_custom: "#17ad98" - shape_datetime: { fg: "#149bda" attr: "b" } - shape_directory: "#149bda" - shape_external: "#149bda" - shape_externalarg: { fg: "#17ad98" attr: "b" } - shape_filepath: "#149bda" - shape_flag: { fg: "#796af5" attr: "b" } - shape_float: { fg: "#bb60ea" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#149bda" attr: "b" } - shape_int: { fg: "#bb60ea" attr: "b" } - shape_internalcall: { fg: "#149bda" attr: "b" } - shape_list: { fg: "#149bda" attr: "b" } - shape_literal: "#796af5" - shape_match_pattern: "#17ad98" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#149bda" - shape_operator: "#dc8a0e" - shape_or: { fg: "#bb60ea" attr: "b" } - shape_pipe: { fg: "#bb60ea" attr: "b" } - shape_range: { fg: "#dc8a0e" attr: "b" } - shape_record: { fg: "#149bda" attr: "b" } - shape_redirection: { fg: "#bb60ea" attr: "b" } - shape_signature: { fg: "#17ad98" attr: "b" } - shape_string: "#17ad98" - shape_string_interpolation: { fg: "#149bda" attr: "b" } - shape_table: { fg: "#796af5" attr: "b" } - shape_variable: "#bb60ea" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#2e2a31" - foreground: "#bcbabe" - cursor: "#bcbabe" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#bcbabe' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#17ad98' attr: 'b' } + empty: '#796af5' + bool: {|| if $in { '#149bda' } else { 'light_gray' } } + int: '#bcbabe' + filesize: {|e| + if $e == 0b { + '#bcbabe' + } else if $e < 1mb { + '#149bda' + } else {{ fg: '#796af5' }} + } + duration: '#bcbabe' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d8137f' attr: 'b' } + } else if $in < 6hr { + '#d8137f' + } else if $in < 1day { + '#dc8a0e' + } else if $in < 3day { + '#17ad98' + } else if $in < 1wk { + { fg: '#17ad98' attr: 'b' } + } else if $in < 6wk { + '#149bda' + } else if $in < 52wk { + '#796af5' + } else { 'dark_gray' } + } + range: '#bcbabe' + float: '#bcbabe' + string: '#bcbabe' + nothing: '#bcbabe' + binary: '#bcbabe' + cellpath: '#bcbabe' + row_index: { fg: '#17ad98' attr: 'b' } + record: '#bcbabe' + list: '#bcbabe' + block: '#bcbabe' + hints: 'dark_gray' + search_result: { fg: '#d8137f' bg: '#bcbabe' } + + shape_and: { fg: '#bb60ea' attr: 'b' } + shape_binary: { fg: '#bb60ea' attr: 'b' } + shape_block: { fg: '#796af5' attr: 'b' } + shape_bool: '#149bda' + shape_custom: '#17ad98' + shape_datetime: { fg: '#149bda' attr: 'b' } + shape_directory: '#149bda' + shape_external: '#149bda' + shape_externalarg: { fg: '#17ad98' attr: 'b' } + shape_filepath: '#149bda' + shape_flag: { fg: '#796af5' attr: 'b' } + shape_float: { fg: '#bb60ea' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#149bda' attr: 'b' } + shape_int: { fg: '#bb60ea' attr: 'b' } + shape_internalcall: { fg: '#149bda' attr: 'b' } + shape_list: { fg: '#149bda' attr: 'b' } + shape_literal: '#796af5' + shape_match_pattern: '#17ad98' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#149bda' + shape_operator: '#dc8a0e' + shape_or: { fg: '#bb60ea' attr: 'b' } + shape_pipe: { fg: '#bb60ea' attr: 'b' } + shape_range: { fg: '#dc8a0e' attr: 'b' } + shape_record: { fg: '#149bda' attr: 'b' } + shape_redirection: { fg: '#bb60ea' attr: 'b' } + shape_signature: { fg: '#17ad98' attr: 'b' } + shape_string: '#17ad98' + shape_string_interpolation: { fg: '#149bda' attr: 'b' } + shape_table: { fg: '#796af5' attr: 'b' } + shape_variable: '#bb60ea' + + background: '#2e2a31' + foreground: '#bcbabe' + cursor: '#bcbabe' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/unikitty-light.nu b/themes/nu-themes/unikitty-light.nu index 684016c..80a7276 100644 --- a/themes/nu-themes/unikitty-light.nu +++ b/themes/nu-themes/unikitty-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#6c696e" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#17ad98" attr: "b" } - empty: "#775dff" - bool: {|| if $in { "#149bda" } else { "light_gray" } } - int: "#6c696e" - filesize: {|e| - if $e == 0b { - "#6c696e" - } else if $e < 1mb { - "#149bda" - } else {{ fg: "#775dff" }} - } - duration: "#6c696e" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d8137f" attr: "b" } - } else if $in < 6hr { - "#d8137f" - } else if $in < 1day { - "#dc8a0e" - } else if $in < 3day { - "#17ad98" - } else if $in < 1wk { - { fg: "#17ad98" attr: "b" } - } else if $in < 6wk { - "#149bda" - } else if $in < 52wk { - "#775dff" - } else { "dark_gray" } - } - range: "#6c696e" - float: "#6c696e" - string: "#6c696e" - nothing: "#6c696e" - binary: "#6c696e" - cellpath: "#6c696e" - row_index: { fg: "#17ad98" attr: "b" } - record: "#6c696e" - list: "#6c696e" - block: "#6c696e" - hints: "dark_gray" - search_result: { fg: "#d8137f" bg: "#6c696e" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#aa17e6" attr: "b" } - shape_binary: { fg: "#aa17e6" attr: "b" } - shape_block: { fg: "#775dff" attr: "b" } - shape_bool: "#149bda" - shape_custom: "#17ad98" - shape_datetime: { fg: "#149bda" attr: "b" } - shape_directory: "#149bda" - shape_external: "#149bda" - shape_externalarg: { fg: "#17ad98" attr: "b" } - shape_filepath: "#149bda" - shape_flag: { fg: "#775dff" attr: "b" } - shape_float: { fg: "#aa17e6" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#149bda" attr: "b" } - shape_int: { fg: "#aa17e6" attr: "b" } - shape_internalcall: { fg: "#149bda" attr: "b" } - shape_list: { fg: "#149bda" attr: "b" } - shape_literal: "#775dff" - shape_match_pattern: "#17ad98" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#149bda" - shape_operator: "#dc8a0e" - shape_or: { fg: "#aa17e6" attr: "b" } - shape_pipe: { fg: "#aa17e6" attr: "b" } - shape_range: { fg: "#dc8a0e" attr: "b" } - shape_record: { fg: "#149bda" attr: "b" } - shape_redirection: { fg: "#aa17e6" attr: "b" } - shape_signature: { fg: "#17ad98" attr: "b" } - shape_string: "#17ad98" - shape_string_interpolation: { fg: "#149bda" attr: "b" } - shape_table: { fg: "#775dff" attr: "b" } - shape_variable: "#aa17e6" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#6c696e" - cursor: "#6c696e" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#6c696e' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#17ad98' attr: 'b' } + empty: '#775dff' + bool: {|| if $in { '#149bda' } else { 'light_gray' } } + int: '#6c696e' + filesize: {|e| + if $e == 0b { + '#6c696e' + } else if $e < 1mb { + '#149bda' + } else {{ fg: '#775dff' }} + } + duration: '#6c696e' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d8137f' attr: 'b' } + } else if $in < 6hr { + '#d8137f' + } else if $in < 1day { + '#dc8a0e' + } else if $in < 3day { + '#17ad98' + } else if $in < 1wk { + { fg: '#17ad98' attr: 'b' } + } else if $in < 6wk { + '#149bda' + } else if $in < 52wk { + '#775dff' + } else { 'dark_gray' } + } + range: '#6c696e' + float: '#6c696e' + string: '#6c696e' + nothing: '#6c696e' + binary: '#6c696e' + cellpath: '#6c696e' + row_index: { fg: '#17ad98' attr: 'b' } + record: '#6c696e' + list: '#6c696e' + block: '#6c696e' + hints: 'dark_gray' + search_result: { fg: '#d8137f' bg: '#6c696e' } + + shape_and: { fg: '#aa17e6' attr: 'b' } + shape_binary: { fg: '#aa17e6' attr: 'b' } + shape_block: { fg: '#775dff' attr: 'b' } + shape_bool: '#149bda' + shape_custom: '#17ad98' + shape_datetime: { fg: '#149bda' attr: 'b' } + shape_directory: '#149bda' + shape_external: '#149bda' + shape_externalarg: { fg: '#17ad98' attr: 'b' } + shape_filepath: '#149bda' + shape_flag: { fg: '#775dff' attr: 'b' } + shape_float: { fg: '#aa17e6' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#149bda' attr: 'b' } + shape_int: { fg: '#aa17e6' attr: 'b' } + shape_internalcall: { fg: '#149bda' attr: 'b' } + shape_list: { fg: '#149bda' attr: 'b' } + shape_literal: '#775dff' + shape_match_pattern: '#17ad98' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#149bda' + shape_operator: '#dc8a0e' + shape_or: { fg: '#aa17e6' attr: 'b' } + shape_pipe: { fg: '#aa17e6' attr: 'b' } + shape_range: { fg: '#dc8a0e' attr: 'b' } + shape_record: { fg: '#149bda' attr: 'b' } + shape_redirection: { fg: '#aa17e6' attr: 'b' } + shape_signature: { fg: '#17ad98' attr: 'b' } + shape_string: '#17ad98' + shape_string_interpolation: { fg: '#149bda' attr: 'b' } + shape_table: { fg: '#775dff' attr: 'b' } + shape_variable: '#aa17e6' + + background: '#ffffff' + foreground: '#6c696e' + cursor: '#6c696e' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/ura.nu b/themes/nu-themes/ura.nu index ce85d9e..7fb7ca3 100644 --- a/themes/nu-themes/ura.nu +++ b/themes/nu-themes/ura.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#808080" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#6fc21b" attr: "b" } - empty: "#1b6fc2" - bool: {|| if $in { "#84eeb9" } else { "light_gray" } } - int: "#808080" - filesize: {|e| - if $e == 0b { - "#808080" - } else if $e < 1mb { - "#1bc26f" - } else {{ fg: "#1b6fc2" }} - } - duration: "#808080" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c21b6f" attr: "b" } - } else if $in < 6hr { - "#c21b6f" - } else if $in < 1day { - "#c26f1b" - } else if $in < 3day { - "#6fc21b" - } else if $in < 1wk { - { fg: "#6fc21b" attr: "b" } - } else if $in < 6wk { - "#1bc26f" - } else if $in < 52wk { - "#1b6fc2" - } else { "dark_gray" } - } - range: "#808080" - float: "#808080" - string: "#808080" - nothing: "#808080" - binary: "#808080" - cellpath: "#808080" - row_index: { fg: "#6fc21b" attr: "b" } - record: "#808080" - list: "#808080" - block: "#808080" - hints: "dark_gray" - search_result: { fg: "#c21b6f" bg: "#808080" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6f1bc2" attr: "b" } - shape_binary: { fg: "#6f1bc2" attr: "b" } - shape_block: { fg: "#1b6fc2" attr: "b" } - shape_bool: "#84eeb9" - shape_custom: "#6fc21b" - shape_datetime: { fg: "#1bc26f" attr: "b" } - shape_directory: "#1bc26f" - shape_external: "#1bc26f" - shape_externalarg: { fg: "#6fc21b" attr: "b" } - shape_filepath: "#1bc26f" - shape_flag: { fg: "#1b6fc2" attr: "b" } - shape_float: { fg: "#6f1bc2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#1bc26f" attr: "b" } - shape_int: { fg: "#6f1bc2" attr: "b" } - shape_internalcall: { fg: "#1bc26f" attr: "b" } - shape_list: { fg: "#1bc26f" attr: "b" } - shape_literal: "#1b6fc2" - shape_match_pattern: "#6fc21b" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#84eeb9" - shape_operator: "#c26f1b" - shape_or: { fg: "#6f1bc2" attr: "b" } - shape_pipe: { fg: "#6f1bc2" attr: "b" } - shape_range: { fg: "#c26f1b" attr: "b" } - shape_record: { fg: "#1bc26f" attr: "b" } - shape_redirection: { fg: "#6f1bc2" attr: "b" } - shape_signature: { fg: "#6fc21b" attr: "b" } - shape_string: "#6fc21b" - shape_string_interpolation: { fg: "#1bc26f" attr: "b" } - shape_table: { fg: "#1b6fc2" attr: "b" } - shape_variable: "#6f1bc2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#feffee" - foreground: "#23476a" - cursor: "#23476a" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#808080' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#6fc21b' attr: 'b' } + empty: '#1b6fc2' + bool: {|| if $in { '#84eeb9' } else { 'light_gray' } } + int: '#808080' + filesize: {|e| + if $e == 0b { + '#808080' + } else if $e < 1mb { + '#1bc26f' + } else {{ fg: '#1b6fc2' }} + } + duration: '#808080' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c21b6f' attr: 'b' } + } else if $in < 6hr { + '#c21b6f' + } else if $in < 1day { + '#c26f1b' + } else if $in < 3day { + '#6fc21b' + } else if $in < 1wk { + { fg: '#6fc21b' attr: 'b' } + } else if $in < 6wk { + '#1bc26f' + } else if $in < 52wk { + '#1b6fc2' + } else { 'dark_gray' } + } + range: '#808080' + float: '#808080' + string: '#808080' + nothing: '#808080' + binary: '#808080' + cellpath: '#808080' + row_index: { fg: '#6fc21b' attr: 'b' } + record: '#808080' + list: '#808080' + block: '#808080' + hints: 'dark_gray' + search_result: { fg: '#c21b6f' bg: '#808080' } + + shape_and: { fg: '#6f1bc2' attr: 'b' } + shape_binary: { fg: '#6f1bc2' attr: 'b' } + shape_block: { fg: '#1b6fc2' attr: 'b' } + shape_bool: '#84eeb9' + shape_custom: '#6fc21b' + shape_datetime: { fg: '#1bc26f' attr: 'b' } + shape_directory: '#1bc26f' + shape_external: '#1bc26f' + shape_externalarg: { fg: '#6fc21b' attr: 'b' } + shape_filepath: '#1bc26f' + shape_flag: { fg: '#1b6fc2' attr: 'b' } + shape_float: { fg: '#6f1bc2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#1bc26f' attr: 'b' } + shape_int: { fg: '#6f1bc2' attr: 'b' } + shape_internalcall: { fg: '#1bc26f' attr: 'b' } + shape_list: { fg: '#1bc26f' attr: 'b' } + shape_literal: '#1b6fc2' + shape_match_pattern: '#6fc21b' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#84eeb9' + shape_operator: '#c26f1b' + shape_or: { fg: '#6f1bc2' attr: 'b' } + shape_pipe: { fg: '#6f1bc2' attr: 'b' } + shape_range: { fg: '#c26f1b' attr: 'b' } + shape_record: { fg: '#1bc26f' attr: 'b' } + shape_redirection: { fg: '#6f1bc2' attr: 'b' } + shape_signature: { fg: '#6fc21b' attr: 'b' } + shape_string: '#6fc21b' + shape_string_interpolation: { fg: '#1bc26f' attr: 'b' } + shape_table: { fg: '#1b6fc2' attr: 'b' } + shape_variable: '#6f1bc2' + + background: '#feffee' + foreground: '#23476a' + cursor: '#23476a' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/urple.nu b/themes/nu-themes/urple.nu index 7f02a33..414ec6a 100644 --- a/themes/nu-themes/urple.nu +++ b/themes/nu-themes/urple.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#87799c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#37a415" attr: "b" } - empty: "#564d9b" - bool: {|| if $in { "#eaeaea" } else { "light_gray" } } - int: "#87799c" - filesize: {|e| - if $e == 0b { - "#87799c" - } else if $e < 1mb { - "#808080" - } else {{ fg: "#564d9b" }} - } - duration: "#87799c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b0425b" attr: "b" } - } else if $in < 6hr { - "#b0425b" - } else if $in < 1day { - "#ad5c42" - } else if $in < 3day { - "#37a415" - } else if $in < 1wk { - { fg: "#37a415" attr: "b" } - } else if $in < 6wk { - "#808080" - } else if $in < 52wk { - "#564d9b" - } else { "dark_gray" } - } - range: "#87799c" - float: "#87799c" - string: "#87799c" - nothing: "#87799c" - binary: "#87799c" - cellpath: "#87799c" - row_index: { fg: "#37a415" attr: "b" } - record: "#87799c" - list: "#87799c" - block: "#87799c" - hints: "dark_gray" - search_result: { fg: "#b0425b" bg: "#87799c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#6c3ca1" attr: "b" } - shape_binary: { fg: "#6c3ca1" attr: "b" } - shape_block: { fg: "#564d9b" attr: "b" } - shape_bool: "#eaeaea" - shape_custom: "#37a415" - shape_datetime: { fg: "#808080" attr: "b" } - shape_directory: "#808080" - shape_external: "#808080" - shape_externalarg: { fg: "#37a415" attr: "b" } - shape_filepath: "#808080" - shape_flag: { fg: "#564d9b" attr: "b" } - shape_float: { fg: "#6c3ca1" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#808080" attr: "b" } - shape_int: { fg: "#6c3ca1" attr: "b" } - shape_internalcall: { fg: "#808080" attr: "b" } - shape_list: { fg: "#808080" attr: "b" } - shape_literal: "#564d9b" - shape_match_pattern: "#37a415" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#eaeaea" - shape_operator: "#ad5c42" - shape_or: { fg: "#6c3ca1" attr: "b" } - shape_pipe: { fg: "#6c3ca1" attr: "b" } - shape_range: { fg: "#ad5c42" attr: "b" } - shape_record: { fg: "#808080" attr: "b" } - shape_redirection: { fg: "#6c3ca1" attr: "b" } - shape_signature: { fg: "#37a415" attr: "b" } - shape_string: "#37a415" - shape_string_interpolation: { fg: "#808080" attr: "b" } - shape_table: { fg: "#564d9b" attr: "b" } - shape_variable: "#6c3ca1" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1b1b23" - foreground: "#877a9b" - cursor: "#877a9b" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#87799c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#37a415' attr: 'b' } + empty: '#564d9b' + bool: {|| if $in { '#eaeaea' } else { 'light_gray' } } + int: '#87799c' + filesize: {|e| + if $e == 0b { + '#87799c' + } else if $e < 1mb { + '#808080' + } else {{ fg: '#564d9b' }} + } + duration: '#87799c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b0425b' attr: 'b' } + } else if $in < 6hr { + '#b0425b' + } else if $in < 1day { + '#ad5c42' + } else if $in < 3day { + '#37a415' + } else if $in < 1wk { + { fg: '#37a415' attr: 'b' } + } else if $in < 6wk { + '#808080' + } else if $in < 52wk { + '#564d9b' + } else { 'dark_gray' } + } + range: '#87799c' + float: '#87799c' + string: '#87799c' + nothing: '#87799c' + binary: '#87799c' + cellpath: '#87799c' + row_index: { fg: '#37a415' attr: 'b' } + record: '#87799c' + list: '#87799c' + block: '#87799c' + hints: 'dark_gray' + search_result: { fg: '#b0425b' bg: '#87799c' } + + shape_and: { fg: '#6c3ca1' attr: 'b' } + shape_binary: { fg: '#6c3ca1' attr: 'b' } + shape_block: { fg: '#564d9b' attr: 'b' } + shape_bool: '#eaeaea' + shape_custom: '#37a415' + shape_datetime: { fg: '#808080' attr: 'b' } + shape_directory: '#808080' + shape_external: '#808080' + shape_externalarg: { fg: '#37a415' attr: 'b' } + shape_filepath: '#808080' + shape_flag: { fg: '#564d9b' attr: 'b' } + shape_float: { fg: '#6c3ca1' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#808080' attr: 'b' } + shape_int: { fg: '#6c3ca1' attr: 'b' } + shape_internalcall: { fg: '#808080' attr: 'b' } + shape_list: { fg: '#808080' attr: 'b' } + shape_literal: '#564d9b' + shape_match_pattern: '#37a415' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#eaeaea' + shape_operator: '#ad5c42' + shape_or: { fg: '#6c3ca1' attr: 'b' } + shape_pipe: { fg: '#6c3ca1' attr: 'b' } + shape_range: { fg: '#ad5c42' attr: 'b' } + shape_record: { fg: '#808080' attr: 'b' } + shape_redirection: { fg: '#6c3ca1' attr: 'b' } + shape_signature: { fg: '#37a415' attr: 'b' } + shape_string: '#37a415' + shape_string_interpolation: { fg: '#808080' attr: 'b' } + shape_table: { fg: '#564d9b' attr: 'b' } + shape_variable: '#6c3ca1' + + background: '#1b1b23' + foreground: '#877a9b' + cursor: '#877a9b' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/vag.nu b/themes/nu-themes/vag.nu index 2bc3464..2d8d75a 100644 --- a/themes/nu-themes/vag.nu +++ b/themes/nu-themes/vag.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#8a8a8a" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#39a871" attr: "b" } - empty: "#7139a8" - bool: {|| if $in { "#3b76b0" } else { "light_gray" } } - int: "#8a8a8a" - filesize: {|e| - if $e == 0b { - "#8a8a8a" - } else if $e < 1mb { - "#3971a8" - } else {{ fg: "#7139a8" }} - } - duration: "#8a8a8a" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a87139" attr: "b" } - } else if $in < 6hr { - "#a87139" - } else if $in < 1day { - "#71a839" - } else if $in < 3day { - "#39a871" - } else if $in < 1wk { - { fg: "#39a871" attr: "b" } - } else if $in < 6wk { - "#3971a8" - } else if $in < 52wk { - "#7139a8" - } else { "dark_gray" } - } - range: "#8a8a8a" - float: "#8a8a8a" - string: "#8a8a8a" - nothing: "#8a8a8a" - binary: "#8a8a8a" - cellpath: "#8a8a8a" - row_index: { fg: "#39a871" attr: "b" } - record: "#8a8a8a" - list: "#8a8a8a" - block: "#8a8a8a" - hints: "dark_gray" - search_result: { fg: "#a87139" bg: "#8a8a8a" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a83971" attr: "b" } - shape_binary: { fg: "#a83971" attr: "b" } - shape_block: { fg: "#7139a8" attr: "b" } - shape_bool: "#3b76b0" - shape_custom: "#39a871" - shape_datetime: { fg: "#3971a8" attr: "b" } - shape_directory: "#3971a8" - shape_external: "#3971a8" - shape_externalarg: { fg: "#39a871" attr: "b" } - shape_filepath: "#3971a8" - shape_flag: { fg: "#7139a8" attr: "b" } - shape_float: { fg: "#a83971" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3971a8" attr: "b" } - shape_int: { fg: "#a83971" attr: "b" } - shape_internalcall: { fg: "#3971a8" attr: "b" } - shape_list: { fg: "#3971a8" attr: "b" } - shape_literal: "#7139a8" - shape_match_pattern: "#39a871" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3b76b0" - shape_operator: "#71a839" - shape_or: { fg: "#a83971" attr: "b" } - shape_pipe: { fg: "#a83971" attr: "b" } - shape_range: { fg: "#71a839" attr: "b" } - shape_record: { fg: "#3971a8" attr: "b" } - shape_redirection: { fg: "#a83971" attr: "b" } - shape_signature: { fg: "#39a871" attr: "b" } - shape_string: "#39a871" - shape_string_interpolation: { fg: "#3971a8" attr: "b" } - shape_table: { fg: "#7139a8" attr: "b" } - shape_variable: "#a83971" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#191f1d" - foreground: "#d9e6f2" - cursor: "#d9e6f2" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#8a8a8a' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#39a871' attr: 'b' } + empty: '#7139a8' + bool: {|| if $in { '#3b76b0' } else { 'light_gray' } } + int: '#8a8a8a' + filesize: {|e| + if $e == 0b { + '#8a8a8a' + } else if $e < 1mb { + '#3971a8' + } else {{ fg: '#7139a8' }} + } + duration: '#8a8a8a' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a87139' attr: 'b' } + } else if $in < 6hr { + '#a87139' + } else if $in < 1day { + '#71a839' + } else if $in < 3day { + '#39a871' + } else if $in < 1wk { + { fg: '#39a871' attr: 'b' } + } else if $in < 6wk { + '#3971a8' + } else if $in < 52wk { + '#7139a8' + } else { 'dark_gray' } + } + range: '#8a8a8a' + float: '#8a8a8a' + string: '#8a8a8a' + nothing: '#8a8a8a' + binary: '#8a8a8a' + cellpath: '#8a8a8a' + row_index: { fg: '#39a871' attr: 'b' } + record: '#8a8a8a' + list: '#8a8a8a' + block: '#8a8a8a' + hints: 'dark_gray' + search_result: { fg: '#a87139' bg: '#8a8a8a' } + + shape_and: { fg: '#a83971' attr: 'b' } + shape_binary: { fg: '#a83971' attr: 'b' } + shape_block: { fg: '#7139a8' attr: 'b' } + shape_bool: '#3b76b0' + shape_custom: '#39a871' + shape_datetime: { fg: '#3971a8' attr: 'b' } + shape_directory: '#3971a8' + shape_external: '#3971a8' + shape_externalarg: { fg: '#39a871' attr: 'b' } + shape_filepath: '#3971a8' + shape_flag: { fg: '#7139a8' attr: 'b' } + shape_float: { fg: '#a83971' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3971a8' attr: 'b' } + shape_int: { fg: '#a83971' attr: 'b' } + shape_internalcall: { fg: '#3971a8' attr: 'b' } + shape_list: { fg: '#3971a8' attr: 'b' } + shape_literal: '#7139a8' + shape_match_pattern: '#39a871' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3b76b0' + shape_operator: '#71a839' + shape_or: { fg: '#a83971' attr: 'b' } + shape_pipe: { fg: '#a83971' attr: 'b' } + shape_range: { fg: '#71a839' attr: 'b' } + shape_record: { fg: '#3971a8' attr: 'b' } + shape_redirection: { fg: '#a83971' attr: 'b' } + shape_signature: { fg: '#39a871' attr: 'b' } + shape_string: '#39a871' + shape_string_interpolation: { fg: '#3971a8' attr: 'b' } + shape_table: { fg: '#7139a8' attr: 'b' } + shape_variable: '#a83971' + + background: '#191f1d' + foreground: '#d9e6f2' + cursor: '#d9e6f2' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/vaughn.nu b/themes/nu-themes/vaughn.nu index 812fb02..49f12ed 100644 --- a/themes/nu-themes/vaughn.nu +++ b/themes/nu-themes/vaughn.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#709080" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#60b48a" attr: "b" } - empty: "#5555ff" - bool: {|| if $in { "#93e0e3" } else { "light_gray" } } - int: "#709080" - filesize: {|e| - if $e == 0b { - "#709080" - } else if $e < 1mb { - "#8cd0d3" - } else {{ fg: "#5555ff" }} - } - duration: "#709080" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#705050" attr: "b" } - } else if $in < 6hr { - "#705050" - } else if $in < 1day { - "#dfaf8f" - } else if $in < 3day { - "#60b48a" - } else if $in < 1wk { - { fg: "#60b48a" attr: "b" } - } else if $in < 6wk { - "#8cd0d3" - } else if $in < 52wk { - "#5555ff" - } else { "dark_gray" } - } - range: "#709080" - float: "#709080" - string: "#709080" - nothing: "#709080" - binary: "#709080" - cellpath: "#709080" - row_index: { fg: "#60b48a" attr: "b" } - record: "#709080" - list: "#709080" - block: "#709080" - hints: "dark_gray" - search_result: { fg: "#705050" bg: "#709080" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f08cc3" attr: "b" } - shape_binary: { fg: "#f08cc3" attr: "b" } - shape_block: { fg: "#5555ff" attr: "b" } - shape_bool: "#93e0e3" - shape_custom: "#60b48a" - shape_datetime: { fg: "#8cd0d3" attr: "b" } - shape_directory: "#8cd0d3" - shape_external: "#8cd0d3" - shape_externalarg: { fg: "#60b48a" attr: "b" } - shape_filepath: "#8cd0d3" - shape_flag: { fg: "#5555ff" attr: "b" } - shape_float: { fg: "#f08cc3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#8cd0d3" attr: "b" } - shape_int: { fg: "#f08cc3" attr: "b" } - shape_internalcall: { fg: "#8cd0d3" attr: "b" } - shape_list: { fg: "#8cd0d3" attr: "b" } - shape_literal: "#5555ff" - shape_match_pattern: "#60b48a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#93e0e3" - shape_operator: "#dfaf8f" - shape_or: { fg: "#f08cc3" attr: "b" } - shape_pipe: { fg: "#f08cc3" attr: "b" } - shape_range: { fg: "#dfaf8f" attr: "b" } - shape_record: { fg: "#8cd0d3" attr: "b" } - shape_redirection: { fg: "#f08cc3" attr: "b" } - shape_signature: { fg: "#60b48a" attr: "b" } - shape_string: "#60b48a" - shape_string_interpolation: { fg: "#8cd0d3" attr: "b" } - shape_table: { fg: "#5555ff" attr: "b" } - shape_variable: "#f08cc3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#25234f" - foreground: "#dcdccc" - cursor: "#dcdccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#709080' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#60b48a' attr: 'b' } + empty: '#5555ff' + bool: {|| if $in { '#93e0e3' } else { 'light_gray' } } + int: '#709080' + filesize: {|e| + if $e == 0b { + '#709080' + } else if $e < 1mb { + '#8cd0d3' + } else {{ fg: '#5555ff' }} + } + duration: '#709080' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#705050' attr: 'b' } + } else if $in < 6hr { + '#705050' + } else if $in < 1day { + '#dfaf8f' + } else if $in < 3day { + '#60b48a' + } else if $in < 1wk { + { fg: '#60b48a' attr: 'b' } + } else if $in < 6wk { + '#8cd0d3' + } else if $in < 52wk { + '#5555ff' + } else { 'dark_gray' } + } + range: '#709080' + float: '#709080' + string: '#709080' + nothing: '#709080' + binary: '#709080' + cellpath: '#709080' + row_index: { fg: '#60b48a' attr: 'b' } + record: '#709080' + list: '#709080' + block: '#709080' + hints: 'dark_gray' + search_result: { fg: '#705050' bg: '#709080' } + + shape_and: { fg: '#f08cc3' attr: 'b' } + shape_binary: { fg: '#f08cc3' attr: 'b' } + shape_block: { fg: '#5555ff' attr: 'b' } + shape_bool: '#93e0e3' + shape_custom: '#60b48a' + shape_datetime: { fg: '#8cd0d3' attr: 'b' } + shape_directory: '#8cd0d3' + shape_external: '#8cd0d3' + shape_externalarg: { fg: '#60b48a' attr: 'b' } + shape_filepath: '#8cd0d3' + shape_flag: { fg: '#5555ff' attr: 'b' } + shape_float: { fg: '#f08cc3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#8cd0d3' attr: 'b' } + shape_int: { fg: '#f08cc3' attr: 'b' } + shape_internalcall: { fg: '#8cd0d3' attr: 'b' } + shape_list: { fg: '#8cd0d3' attr: 'b' } + shape_literal: '#5555ff' + shape_match_pattern: '#60b48a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#93e0e3' + shape_operator: '#dfaf8f' + shape_or: { fg: '#f08cc3' attr: 'b' } + shape_pipe: { fg: '#f08cc3' attr: 'b' } + shape_range: { fg: '#dfaf8f' attr: 'b' } + shape_record: { fg: '#8cd0d3' attr: 'b' } + shape_redirection: { fg: '#f08cc3' attr: 'b' } + shape_signature: { fg: '#60b48a' attr: 'b' } + shape_string: '#60b48a' + shape_string_interpolation: { fg: '#8cd0d3' attr: 'b' } + shape_table: { fg: '#5555ff' attr: 'b' } + shape_variable: '#f08cc3' + + background: '#25234f' + foreground: '#dcdccc' + cursor: '#dcdccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/vibrant-ink.nu b/themes/nu-themes/vibrant-ink.nu index 585d28b..51dc020 100644 --- a/themes/nu-themes/vibrant-ink.nu +++ b/themes/nu-themes/vibrant-ink.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#f5f5f5" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#ccff04" attr: "b" } - empty: "#44b4cc" - bool: {|| if $in { "#00ffff" } else { "light_gray" } } - int: "#f5f5f5" - filesize: {|e| - if $e == 0b { - "#f5f5f5" - } else if $e < 1mb { - "#44b4cc" - } else {{ fg: "#44b4cc" }} - } - duration: "#f5f5f5" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff6600" attr: "b" } - } else if $in < 6hr { - "#ff6600" - } else if $in < 1day { - "#ffcc00" - } else if $in < 3day { - "#ccff04" - } else if $in < 1wk { - { fg: "#ccff04" attr: "b" } - } else if $in < 6wk { - "#44b4cc" - } else if $in < 52wk { - "#44b4cc" - } else { "dark_gray" } - } - range: "#f5f5f5" - float: "#f5f5f5" - string: "#f5f5f5" - nothing: "#f5f5f5" - binary: "#f5f5f5" - cellpath: "#f5f5f5" - row_index: { fg: "#ccff04" attr: "b" } - record: "#f5f5f5" - list: "#f5f5f5" - block: "#f5f5f5" - hints: "dark_gray" - search_result: { fg: "#ff6600" bg: "#f5f5f5" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9933cc" attr: "b" } - shape_binary: { fg: "#9933cc" attr: "b" } - shape_block: { fg: "#44b4cc" attr: "b" } - shape_bool: "#00ffff" - shape_custom: "#ccff04" - shape_datetime: { fg: "#44b4cc" attr: "b" } - shape_directory: "#44b4cc" - shape_external: "#44b4cc" - shape_externalarg: { fg: "#ccff04" attr: "b" } - shape_filepath: "#44b4cc" - shape_flag: { fg: "#44b4cc" attr: "b" } - shape_float: { fg: "#9933cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#44b4cc" attr: "b" } - shape_int: { fg: "#9933cc" attr: "b" } - shape_internalcall: { fg: "#44b4cc" attr: "b" } - shape_list: { fg: "#44b4cc" attr: "b" } - shape_literal: "#44b4cc" - shape_match_pattern: "#ccff04" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ffff" - shape_operator: "#ffcc00" - shape_or: { fg: "#9933cc" attr: "b" } - shape_pipe: { fg: "#9933cc" attr: "b" } - shape_range: { fg: "#ffcc00" attr: "b" } - shape_record: { fg: "#44b4cc" attr: "b" } - shape_redirection: { fg: "#9933cc" attr: "b" } - shape_signature: { fg: "#ccff04" attr: "b" } - shape_string: "#ccff04" - shape_string_interpolation: { fg: "#44b4cc" attr: "b" } - shape_table: { fg: "#44b4cc" attr: "b" } - shape_variable: "#9933cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#ffffff" - cursor: "#ffffff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#f5f5f5' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#ccff04' attr: 'b' } + empty: '#44b4cc' + bool: {|| if $in { '#00ffff' } else { 'light_gray' } } + int: '#f5f5f5' + filesize: {|e| + if $e == 0b { + '#f5f5f5' + } else if $e < 1mb { + '#44b4cc' + } else {{ fg: '#44b4cc' }} + } + duration: '#f5f5f5' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff6600' attr: 'b' } + } else if $in < 6hr { + '#ff6600' + } else if $in < 1day { + '#ffcc00' + } else if $in < 3day { + '#ccff04' + } else if $in < 1wk { + { fg: '#ccff04' attr: 'b' } + } else if $in < 6wk { + '#44b4cc' + } else if $in < 52wk { + '#44b4cc' + } else { 'dark_gray' } + } + range: '#f5f5f5' + float: '#f5f5f5' + string: '#f5f5f5' + nothing: '#f5f5f5' + binary: '#f5f5f5' + cellpath: '#f5f5f5' + row_index: { fg: '#ccff04' attr: 'b' } + record: '#f5f5f5' + list: '#f5f5f5' + block: '#f5f5f5' + hints: 'dark_gray' + search_result: { fg: '#ff6600' bg: '#f5f5f5' } + + shape_and: { fg: '#9933cc' attr: 'b' } + shape_binary: { fg: '#9933cc' attr: 'b' } + shape_block: { fg: '#44b4cc' attr: 'b' } + shape_bool: '#00ffff' + shape_custom: '#ccff04' + shape_datetime: { fg: '#44b4cc' attr: 'b' } + shape_directory: '#44b4cc' + shape_external: '#44b4cc' + shape_externalarg: { fg: '#ccff04' attr: 'b' } + shape_filepath: '#44b4cc' + shape_flag: { fg: '#44b4cc' attr: 'b' } + shape_float: { fg: '#9933cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#44b4cc' attr: 'b' } + shape_int: { fg: '#9933cc' attr: 'b' } + shape_internalcall: { fg: '#44b4cc' attr: 'b' } + shape_list: { fg: '#44b4cc' attr: 'b' } + shape_literal: '#44b4cc' + shape_match_pattern: '#ccff04' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ffff' + shape_operator: '#ffcc00' + shape_or: { fg: '#9933cc' attr: 'b' } + shape_pipe: { fg: '#9933cc' attr: 'b' } + shape_range: { fg: '#ffcc00' attr: 'b' } + shape_record: { fg: '#44b4cc' attr: 'b' } + shape_redirection: { fg: '#9933cc' attr: 'b' } + shape_signature: { fg: '#ccff04' attr: 'b' } + shape_string: '#ccff04' + shape_string_interpolation: { fg: '#44b4cc' attr: 'b' } + shape_table: { fg: '#44b4cc' attr: 'b' } + shape_variable: '#9933cc' + + background: '#000000' + foreground: '#ffffff' + cursor: '#ffffff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/vs-code-dark-plus.nu b/themes/nu-themes/vs-code-dark-plus.nu index b487a76..a634b47 100644 --- a/themes/nu-themes/vs-code-dark-plus.nu +++ b/themes/nu-themes/vs-code-dark-plus.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c3dde1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#39e9a8" attr: "b" } - empty: "#44aae6" - bool: {|| if $in { "#5fffff" } else { "light_gray" } } - int: "#c3dde1" - filesize: {|e| - if $e == 0b { - "#c3dde1" - } else if $e < 1mb { - "#3dd5e7" - } else {{ fg: "#44aae6" }} - } - duration: "#c3dde1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e9653b" attr: "b" } - } else if $in < 6hr { - "#e9653b" - } else if $in < 1day { - "#e5b684" - } else if $in < 3day { - "#39e9a8" - } else if $in < 1wk { - { fg: "#39e9a8" attr: "b" } - } else if $in < 6wk { - "#3dd5e7" - } else if $in < 52wk { - "#44aae6" - } else { "dark_gray" } - } - range: "#c3dde1" - float: "#c3dde1" - string: "#c3dde1" - nothing: "#c3dde1" - binary: "#c3dde1" - cellpath: "#c3dde1" - row_index: { fg: "#39e9a8" attr: "b" } - record: "#c3dde1" - list: "#c3dde1" - block: "#c3dde1" - hints: "dark_gray" - search_result: { fg: "#e9653b" bg: "#c3dde1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e17599" attr: "b" } - shape_binary: { fg: "#e17599" attr: "b" } - shape_block: { fg: "#44aae6" attr: "b" } - shape_bool: "#5fffff" - shape_custom: "#39e9a8" - shape_datetime: { fg: "#3dd5e7" attr: "b" } - shape_directory: "#3dd5e7" - shape_external: "#3dd5e7" - shape_externalarg: { fg: "#39e9a8" attr: "b" } - shape_filepath: "#3dd5e7" - shape_flag: { fg: "#44aae6" attr: "b" } - shape_float: { fg: "#e17599" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3dd5e7" attr: "b" } - shape_int: { fg: "#e17599" attr: "b" } - shape_internalcall: { fg: "#3dd5e7" attr: "b" } - shape_list: { fg: "#3dd5e7" attr: "b" } - shape_literal: "#44aae6" - shape_match_pattern: "#39e9a8" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5fffff" - shape_operator: "#e5b684" - shape_or: { fg: "#e17599" attr: "b" } - shape_pipe: { fg: "#e17599" attr: "b" } - shape_range: { fg: "#e5b684" attr: "b" } - shape_record: { fg: "#3dd5e7" attr: "b" } - shape_redirection: { fg: "#e17599" attr: "b" } - shape_signature: { fg: "#39e9a8" attr: "b" } - shape_string: "#39e9a8" - shape_string_interpolation: { fg: "#3dd5e7" attr: "b" } - shape_table: { fg: "#44aae6" attr: "b" } - shape_variable: "#e17599" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1e1e1e" - foreground: "#cccccc" - cursor: "#cccccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c3dde1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#39e9a8' attr: 'b' } + empty: '#44aae6' + bool: {|| if $in { '#5fffff' } else { 'light_gray' } } + int: '#c3dde1' + filesize: {|e| + if $e == 0b { + '#c3dde1' + } else if $e < 1mb { + '#3dd5e7' + } else {{ fg: '#44aae6' }} + } + duration: '#c3dde1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e9653b' attr: 'b' } + } else if $in < 6hr { + '#e9653b' + } else if $in < 1day { + '#e5b684' + } else if $in < 3day { + '#39e9a8' + } else if $in < 1wk { + { fg: '#39e9a8' attr: 'b' } + } else if $in < 6wk { + '#3dd5e7' + } else if $in < 52wk { + '#44aae6' + } else { 'dark_gray' } + } + range: '#c3dde1' + float: '#c3dde1' + string: '#c3dde1' + nothing: '#c3dde1' + binary: '#c3dde1' + cellpath: '#c3dde1' + row_index: { fg: '#39e9a8' attr: 'b' } + record: '#c3dde1' + list: '#c3dde1' + block: '#c3dde1' + hints: 'dark_gray' + search_result: { fg: '#e9653b' bg: '#c3dde1' } + + shape_and: { fg: '#e17599' attr: 'b' } + shape_binary: { fg: '#e17599' attr: 'b' } + shape_block: { fg: '#44aae6' attr: 'b' } + shape_bool: '#5fffff' + shape_custom: '#39e9a8' + shape_datetime: { fg: '#3dd5e7' attr: 'b' } + shape_directory: '#3dd5e7' + shape_external: '#3dd5e7' + shape_externalarg: { fg: '#39e9a8' attr: 'b' } + shape_filepath: '#3dd5e7' + shape_flag: { fg: '#44aae6' attr: 'b' } + shape_float: { fg: '#e17599' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3dd5e7' attr: 'b' } + shape_int: { fg: '#e17599' attr: 'b' } + shape_internalcall: { fg: '#3dd5e7' attr: 'b' } + shape_list: { fg: '#3dd5e7' attr: 'b' } + shape_literal: '#44aae6' + shape_match_pattern: '#39e9a8' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5fffff' + shape_operator: '#e5b684' + shape_or: { fg: '#e17599' attr: 'b' } + shape_pipe: { fg: '#e17599' attr: 'b' } + shape_range: { fg: '#e5b684' attr: 'b' } + shape_record: { fg: '#3dd5e7' attr: 'b' } + shape_redirection: { fg: '#e17599' attr: 'b' } + shape_signature: { fg: '#39e9a8' attr: 'b' } + shape_string: '#39e9a8' + shape_string_interpolation: { fg: '#3dd5e7' attr: 'b' } + shape_table: { fg: '#44aae6' attr: 'b' } + shape_variable: '#e17599' + + background: '#1e1e1e' + foreground: '#cccccc' + cursor: '#cccccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/vulcan.nu b/themes/nu-themes/vulcan.nu index 0dc33e2..f4f79ee 100644 --- a/themes/nu-themes/vulcan.nu +++ b/themes/nu-themes/vulcan.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#5b778c" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#977d7c" attr: "b" } - empty: "#977d7c" - bool: {|| if $in { "#977d7c" } else { "light_gray" } } - int: "#5b778c" - filesize: {|e| - if $e == 0b { - "#5b778c" - } else if $e < 1mb { - "#977d7c" - } else {{ fg: "#977d7c" }} - } - duration: "#5b778c" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#818591" attr: "b" } - } else if $in < 6hr { - "#818591" - } else if $in < 1day { - "#adb4b9" - } else if $in < 3day { - "#977d7c" - } else if $in < 1wk { - { fg: "#977d7c" attr: "b" } - } else if $in < 6wk { - "#977d7c" - } else if $in < 52wk { - "#977d7c" - } else { "dark_gray" } - } - range: "#5b778c" - float: "#5b778c" - string: "#5b778c" - nothing: "#5b778c" - binary: "#5b778c" - cellpath: "#5b778c" - row_index: { fg: "#977d7c" attr: "b" } - record: "#5b778c" - list: "#5b778c" - block: "#5b778c" - hints: "dark_gray" - search_result: { fg: "#818591" bg: "#5b778c" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9198a3" attr: "b" } - shape_binary: { fg: "#9198a3" attr: "b" } - shape_block: { fg: "#977d7c" attr: "b" } - shape_bool: "#977d7c" - shape_custom: "#977d7c" - shape_datetime: { fg: "#977d7c" attr: "b" } - shape_directory: "#977d7c" - shape_external: "#977d7c" - shape_externalarg: { fg: "#977d7c" attr: "b" } - shape_filepath: "#977d7c" - shape_flag: { fg: "#977d7c" attr: "b" } - shape_float: { fg: "#9198a3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#977d7c" attr: "b" } - shape_int: { fg: "#9198a3" attr: "b" } - shape_internalcall: { fg: "#977d7c" attr: "b" } - shape_list: { fg: "#977d7c" attr: "b" } - shape_literal: "#977d7c" - shape_match_pattern: "#977d7c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#977d7c" - shape_operator: "#adb4b9" - shape_or: { fg: "#9198a3" attr: "b" } - shape_pipe: { fg: "#9198a3" attr: "b" } - shape_range: { fg: "#adb4b9" attr: "b" } - shape_record: { fg: "#977d7c" attr: "b" } - shape_redirection: { fg: "#9198a3" attr: "b" } - shape_signature: { fg: "#977d7c" attr: "b" } - shape_string: "#977d7c" - shape_string_interpolation: { fg: "#977d7c" attr: "b" } - shape_table: { fg: "#977d7c" attr: "b" } - shape_variable: "#9198a3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#041523" - foreground: "#5b778c" - cursor: "#5b778c" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#5b778c' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#977d7c' attr: 'b' } + empty: '#977d7c' + bool: {|| if $in { '#977d7c' } else { 'light_gray' } } + int: '#5b778c' + filesize: {|e| + if $e == 0b { + '#5b778c' + } else if $e < 1mb { + '#977d7c' + } else {{ fg: '#977d7c' }} + } + duration: '#5b778c' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#818591' attr: 'b' } + } else if $in < 6hr { + '#818591' + } else if $in < 1day { + '#adb4b9' + } else if $in < 3day { + '#977d7c' + } else if $in < 1wk { + { fg: '#977d7c' attr: 'b' } + } else if $in < 6wk { + '#977d7c' + } else if $in < 52wk { + '#977d7c' + } else { 'dark_gray' } + } + range: '#5b778c' + float: '#5b778c' + string: '#5b778c' + nothing: '#5b778c' + binary: '#5b778c' + cellpath: '#5b778c' + row_index: { fg: '#977d7c' attr: 'b' } + record: '#5b778c' + list: '#5b778c' + block: '#5b778c' + hints: 'dark_gray' + search_result: { fg: '#818591' bg: '#5b778c' } + + shape_and: { fg: '#9198a3' attr: 'b' } + shape_binary: { fg: '#9198a3' attr: 'b' } + shape_block: { fg: '#977d7c' attr: 'b' } + shape_bool: '#977d7c' + shape_custom: '#977d7c' + shape_datetime: { fg: '#977d7c' attr: 'b' } + shape_directory: '#977d7c' + shape_external: '#977d7c' + shape_externalarg: { fg: '#977d7c' attr: 'b' } + shape_filepath: '#977d7c' + shape_flag: { fg: '#977d7c' attr: 'b' } + shape_float: { fg: '#9198a3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#977d7c' attr: 'b' } + shape_int: { fg: '#9198a3' attr: 'b' } + shape_internalcall: { fg: '#977d7c' attr: 'b' } + shape_list: { fg: '#977d7c' attr: 'b' } + shape_literal: '#977d7c' + shape_match_pattern: '#977d7c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#977d7c' + shape_operator: '#adb4b9' + shape_or: { fg: '#9198a3' attr: 'b' } + shape_pipe: { fg: '#9198a3' attr: 'b' } + shape_range: { fg: '#adb4b9' attr: 'b' } + shape_record: { fg: '#977d7c' attr: 'b' } + shape_redirection: { fg: '#9198a3' attr: 'b' } + shape_signature: { fg: '#977d7c' attr: 'b' } + shape_string: '#977d7c' + shape_string_interpolation: { fg: '#977d7c' attr: 'b' } + shape_table: { fg: '#977d7c' attr: 'b' } + shape_variable: '#9198a3' + + background: '#041523' + foreground: '#5b778c' + cursor: '#5b778c' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/warm-neon.nu b/themes/nu-themes/warm-neon.nu index da3b379..dcb753f 100644 --- a/themes/nu-themes/warm-neon.nu +++ b/themes/nu-themes/warm-neon.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#d0b8a3" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#39b13a" attr: "b" } - empty: "#4261c5" - bool: {|| if $in { "#5ed1e5" } else { "light_gray" } } - int: "#d0b8a3" - filesize: {|e| - if $e == 0b { - "#d0b8a3" - } else if $e < 1mb { - "#2abbd4" - } else {{ fg: "#4261c5" }} - } - duration: "#d0b8a3" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e24346" attr: "b" } - } else if $in < 6hr { - "#e24346" - } else if $in < 1day { - "#dae145" - } else if $in < 3day { - "#39b13a" - } else if $in < 1wk { - { fg: "#39b13a" attr: "b" } - } else if $in < 6wk { - "#2abbd4" - } else if $in < 52wk { - "#4261c5" - } else { "dark_gray" } - } - range: "#d0b8a3" - float: "#d0b8a3" - string: "#d0b8a3" - nothing: "#d0b8a3" - binary: "#d0b8a3" - cellpath: "#d0b8a3" - row_index: { fg: "#39b13a" attr: "b" } - record: "#d0b8a3" - list: "#d0b8a3" - block: "#d0b8a3" - hints: "dark_gray" - search_result: { fg: "#e24346" bg: "#d0b8a3" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#f920fb" attr: "b" } - shape_binary: { fg: "#f920fb" attr: "b" } - shape_block: { fg: "#4261c5" attr: "b" } - shape_bool: "#5ed1e5" - shape_custom: "#39b13a" - shape_datetime: { fg: "#2abbd4" attr: "b" } - shape_directory: "#2abbd4" - shape_external: "#2abbd4" - shape_externalarg: { fg: "#39b13a" attr: "b" } - shape_filepath: "#2abbd4" - shape_flag: { fg: "#4261c5" attr: "b" } - shape_float: { fg: "#f920fb" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#2abbd4" attr: "b" } - shape_int: { fg: "#f920fb" attr: "b" } - shape_internalcall: { fg: "#2abbd4" attr: "b" } - shape_list: { fg: "#2abbd4" attr: "b" } - shape_literal: "#4261c5" - shape_match_pattern: "#39b13a" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#5ed1e5" - shape_operator: "#dae145" - shape_or: { fg: "#f920fb" attr: "b" } - shape_pipe: { fg: "#f920fb" attr: "b" } - shape_range: { fg: "#dae145" attr: "b" } - shape_record: { fg: "#2abbd4" attr: "b" } - shape_redirection: { fg: "#f920fb" attr: "b" } - shape_signature: { fg: "#39b13a" attr: "b" } - shape_string: "#39b13a" - shape_string_interpolation: { fg: "#2abbd4" attr: "b" } - shape_table: { fg: "#4261c5" attr: "b" } - shape_variable: "#f920fb" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#404040" - foreground: "#afdab6" - cursor: "#afdab6" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#d0b8a3' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#39b13a' attr: 'b' } + empty: '#4261c5' + bool: {|| if $in { '#5ed1e5' } else { 'light_gray' } } + int: '#d0b8a3' + filesize: {|e| + if $e == 0b { + '#d0b8a3' + } else if $e < 1mb { + '#2abbd4' + } else {{ fg: '#4261c5' }} + } + duration: '#d0b8a3' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e24346' attr: 'b' } + } else if $in < 6hr { + '#e24346' + } else if $in < 1day { + '#dae145' + } else if $in < 3day { + '#39b13a' + } else if $in < 1wk { + { fg: '#39b13a' attr: 'b' } + } else if $in < 6wk { + '#2abbd4' + } else if $in < 52wk { + '#4261c5' + } else { 'dark_gray' } + } + range: '#d0b8a3' + float: '#d0b8a3' + string: '#d0b8a3' + nothing: '#d0b8a3' + binary: '#d0b8a3' + cellpath: '#d0b8a3' + row_index: { fg: '#39b13a' attr: 'b' } + record: '#d0b8a3' + list: '#d0b8a3' + block: '#d0b8a3' + hints: 'dark_gray' + search_result: { fg: '#e24346' bg: '#d0b8a3' } + + shape_and: { fg: '#f920fb' attr: 'b' } + shape_binary: { fg: '#f920fb' attr: 'b' } + shape_block: { fg: '#4261c5' attr: 'b' } + shape_bool: '#5ed1e5' + shape_custom: '#39b13a' + shape_datetime: { fg: '#2abbd4' attr: 'b' } + shape_directory: '#2abbd4' + shape_external: '#2abbd4' + shape_externalarg: { fg: '#39b13a' attr: 'b' } + shape_filepath: '#2abbd4' + shape_flag: { fg: '#4261c5' attr: 'b' } + shape_float: { fg: '#f920fb' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#2abbd4' attr: 'b' } + shape_int: { fg: '#f920fb' attr: 'b' } + shape_internalcall: { fg: '#2abbd4' attr: 'b' } + shape_list: { fg: '#2abbd4' attr: 'b' } + shape_literal: '#4261c5' + shape_match_pattern: '#39b13a' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#5ed1e5' + shape_operator: '#dae145' + shape_or: { fg: '#f920fb' attr: 'b' } + shape_pipe: { fg: '#f920fb' attr: 'b' } + shape_range: { fg: '#dae145' attr: 'b' } + shape_record: { fg: '#2abbd4' attr: 'b' } + shape_redirection: { fg: '#f920fb' attr: 'b' } + shape_signature: { fg: '#39b13a' attr: 'b' } + shape_string: '#39b13a' + shape_string_interpolation: { fg: '#2abbd4' attr: 'b' } + shape_table: { fg: '#4261c5' attr: 'b' } + shape_variable: '#f920fb' + + background: '#404040' + foreground: '#afdab6' + cursor: '#afdab6' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/wez.nu b/themes/nu-themes/wez.nu index eaa539b..a526557 100644 --- a/themes/nu-themes/wez.nu +++ b/themes/nu-themes/wez.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#55cc55" attr: "b" } - empty: "#5555cc" - bool: {|| if $in { "#55ffff" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#7acaca" - } else {{ fg: "#5555cc" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#cc5555" attr: "b" } - } else if $in < 6hr { - "#cc5555" - } else if $in < 1day { - "#cdcd55" - } else if $in < 3day { - "#55cc55" - } else if $in < 1wk { - { fg: "#55cc55" attr: "b" } - } else if $in < 6wk { - "#7acaca" - } else if $in < 52wk { - "#5555cc" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#55cc55" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#cc5555" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#cc55cc" attr: "b" } - shape_binary: { fg: "#cc55cc" attr: "b" } - shape_block: { fg: "#5555cc" attr: "b" } - shape_bool: "#55ffff" - shape_custom: "#55cc55" - shape_datetime: { fg: "#7acaca" attr: "b" } - shape_directory: "#7acaca" - shape_external: "#7acaca" - shape_externalarg: { fg: "#55cc55" attr: "b" } - shape_filepath: "#7acaca" - shape_flag: { fg: "#5555cc" attr: "b" } - shape_float: { fg: "#cc55cc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#7acaca" attr: "b" } - shape_int: { fg: "#cc55cc" attr: "b" } - shape_internalcall: { fg: "#7acaca" attr: "b" } - shape_list: { fg: "#7acaca" attr: "b" } - shape_literal: "#5555cc" - shape_match_pattern: "#55cc55" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#55ffff" - shape_operator: "#cdcd55" - shape_or: { fg: "#cc55cc" attr: "b" } - shape_pipe: { fg: "#cc55cc" attr: "b" } - shape_range: { fg: "#cdcd55" attr: "b" } - shape_record: { fg: "#7acaca" attr: "b" } - shape_redirection: { fg: "#cc55cc" attr: "b" } - shape_signature: { fg: "#55cc55" attr: "b" } - shape_string: "#55cc55" - shape_string_interpolation: { fg: "#7acaca" attr: "b" } - shape_table: { fg: "#5555cc" attr: "b" } - shape_variable: "#cc55cc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#b3b3b3" - cursor: "#b3b3b3" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#55cc55' attr: 'b' } + empty: '#5555cc' + bool: {|| if $in { '#55ffff' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#7acaca' + } else {{ fg: '#5555cc' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#cc5555' attr: 'b' } + } else if $in < 6hr { + '#cc5555' + } else if $in < 1day { + '#cdcd55' + } else if $in < 3day { + '#55cc55' + } else if $in < 1wk { + { fg: '#55cc55' attr: 'b' } + } else if $in < 6wk { + '#7acaca' + } else if $in < 52wk { + '#5555cc' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#55cc55' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#cc5555' bg: '#cccccc' } + + shape_and: { fg: '#cc55cc' attr: 'b' } + shape_binary: { fg: '#cc55cc' attr: 'b' } + shape_block: { fg: '#5555cc' attr: 'b' } + shape_bool: '#55ffff' + shape_custom: '#55cc55' + shape_datetime: { fg: '#7acaca' attr: 'b' } + shape_directory: '#7acaca' + shape_external: '#7acaca' + shape_externalarg: { fg: '#55cc55' attr: 'b' } + shape_filepath: '#7acaca' + shape_flag: { fg: '#5555cc' attr: 'b' } + shape_float: { fg: '#cc55cc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#7acaca' attr: 'b' } + shape_int: { fg: '#cc55cc' attr: 'b' } + shape_internalcall: { fg: '#7acaca' attr: 'b' } + shape_list: { fg: '#7acaca' attr: 'b' } + shape_literal: '#5555cc' + shape_match_pattern: '#55cc55' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#55ffff' + shape_operator: '#cdcd55' + shape_or: { fg: '#cc55cc' attr: 'b' } + shape_pipe: { fg: '#cc55cc' attr: 'b' } + shape_range: { fg: '#cdcd55' attr: 'b' } + shape_record: { fg: '#7acaca' attr: 'b' } + shape_redirection: { fg: '#cc55cc' attr: 'b' } + shape_signature: { fg: '#55cc55' attr: 'b' } + shape_string: '#55cc55' + shape_string_interpolation: { fg: '#7acaca' attr: 'b' } + shape_table: { fg: '#5555cc' attr: 'b' } + shape_variable: '#cc55cc' + + background: '#000000' + foreground: '#b3b3b3' + cursor: '#b3b3b3' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/wild-cherry.nu b/themes/nu-themes/wild-cherry.nu index c6e3d20..9d4b343 100644 --- a/themes/nu-themes/wild-cherry.nu +++ b/themes/nu-themes/wild-cherry.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#fff8de" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#2ab250" attr: "b" } - empty: "#883cdc" - bool: {|| if $in { "#ff919d" } else { "light_gray" } } - int: "#fff8de" - filesize: {|e| - if $e == 0b { - "#fff8de" - } else if $e < 1mb { - "#c1b8b7" - } else {{ fg: "#883cdc" }} - } - duration: "#fff8de" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d94085" attr: "b" } - } else if $in < 6hr { - "#d94085" - } else if $in < 1day { - "#ffd16f" - } else if $in < 3day { - "#2ab250" - } else if $in < 1wk { - { fg: "#2ab250" attr: "b" } - } else if $in < 6wk { - "#c1b8b7" - } else if $in < 52wk { - "#883cdc" - } else { "dark_gray" } - } - range: "#fff8de" - float: "#fff8de" - string: "#fff8de" - nothing: "#fff8de" - binary: "#fff8de" - cellpath: "#fff8de" - row_index: { fg: "#2ab250" attr: "b" } - record: "#fff8de" - list: "#fff8de" - block: "#fff8de" - hints: "dark_gray" - search_result: { fg: "#d94085" bg: "#fff8de" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ececec" attr: "b" } - shape_binary: { fg: "#ececec" attr: "b" } - shape_block: { fg: "#883cdc" attr: "b" } - shape_bool: "#ff919d" - shape_custom: "#2ab250" - shape_datetime: { fg: "#c1b8b7" attr: "b" } - shape_directory: "#c1b8b7" - shape_external: "#c1b8b7" - shape_externalarg: { fg: "#2ab250" attr: "b" } - shape_filepath: "#c1b8b7" - shape_flag: { fg: "#883cdc" attr: "b" } - shape_float: { fg: "#ececec" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#c1b8b7" attr: "b" } - shape_int: { fg: "#ececec" attr: "b" } - shape_internalcall: { fg: "#c1b8b7" attr: "b" } - shape_list: { fg: "#c1b8b7" attr: "b" } - shape_literal: "#883cdc" - shape_match_pattern: "#2ab250" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ff919d" - shape_operator: "#ffd16f" - shape_or: { fg: "#ececec" attr: "b" } - shape_pipe: { fg: "#ececec" attr: "b" } - shape_range: { fg: "#ffd16f" attr: "b" } - shape_record: { fg: "#c1b8b7" attr: "b" } - shape_redirection: { fg: "#ececec" attr: "b" } - shape_signature: { fg: "#2ab250" attr: "b" } - shape_string: "#2ab250" - shape_string_interpolation: { fg: "#c1b8b7" attr: "b" } - shape_table: { fg: "#883cdc" attr: "b" } - shape_variable: "#ececec" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#1f1726" - foreground: "#dafaff" - cursor: "#dafaff" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#fff8de' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#2ab250' attr: 'b' } + empty: '#883cdc' + bool: {|| if $in { '#ff919d' } else { 'light_gray' } } + int: '#fff8de' + filesize: {|e| + if $e == 0b { + '#fff8de' + } else if $e < 1mb { + '#c1b8b7' + } else {{ fg: '#883cdc' }} + } + duration: '#fff8de' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d94085' attr: 'b' } + } else if $in < 6hr { + '#d94085' + } else if $in < 1day { + '#ffd16f' + } else if $in < 3day { + '#2ab250' + } else if $in < 1wk { + { fg: '#2ab250' attr: 'b' } + } else if $in < 6wk { + '#c1b8b7' + } else if $in < 52wk { + '#883cdc' + } else { 'dark_gray' } + } + range: '#fff8de' + float: '#fff8de' + string: '#fff8de' + nothing: '#fff8de' + binary: '#fff8de' + cellpath: '#fff8de' + row_index: { fg: '#2ab250' attr: 'b' } + record: '#fff8de' + list: '#fff8de' + block: '#fff8de' + hints: 'dark_gray' + search_result: { fg: '#d94085' bg: '#fff8de' } + + shape_and: { fg: '#ececec' attr: 'b' } + shape_binary: { fg: '#ececec' attr: 'b' } + shape_block: { fg: '#883cdc' attr: 'b' } + shape_bool: '#ff919d' + shape_custom: '#2ab250' + shape_datetime: { fg: '#c1b8b7' attr: 'b' } + shape_directory: '#c1b8b7' + shape_external: '#c1b8b7' + shape_externalarg: { fg: '#2ab250' attr: 'b' } + shape_filepath: '#c1b8b7' + shape_flag: { fg: '#883cdc' attr: 'b' } + shape_float: { fg: '#ececec' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#c1b8b7' attr: 'b' } + shape_int: { fg: '#ececec' attr: 'b' } + shape_internalcall: { fg: '#c1b8b7' attr: 'b' } + shape_list: { fg: '#c1b8b7' attr: 'b' } + shape_literal: '#883cdc' + shape_match_pattern: '#2ab250' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ff919d' + shape_operator: '#ffd16f' + shape_or: { fg: '#ececec' attr: 'b' } + shape_pipe: { fg: '#ececec' attr: 'b' } + shape_range: { fg: '#ffd16f' attr: 'b' } + shape_record: { fg: '#c1b8b7' attr: 'b' } + shape_redirection: { fg: '#ececec' attr: 'b' } + shape_signature: { fg: '#2ab250' attr: 'b' } + shape_string: '#2ab250' + shape_string_interpolation: { fg: '#c1b8b7' attr: 'b' } + shape_table: { fg: '#883cdc' attr: 'b' } + shape_variable: '#ececec' + + background: '#1f1726' + foreground: '#dafaff' + cursor: '#dafaff' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-10-light.nu b/themes/nu-themes/windows-10-light.nu index e7e47c5..c9bfde7 100644 --- a/themes/nu-themes/windows-10-light.nu +++ b/themes/nu-themes/windows-10-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#767676" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#13a10e" attr: "b" } - empty: "#0037da" - bool: {|| if $in { "#3a96dd" } else { "light_gray" } } - int: "#767676" - filesize: {|e| - if $e == 0b { - "#767676" - } else if $e < 1mb { - "#3a96dd" - } else {{ fg: "#0037da" }} - } - duration: "#767676" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#c50f1f" attr: "b" } - } else if $in < 6hr { - "#c50f1f" - } else if $in < 1day { - "#c19c00" - } else if $in < 3day { - "#13a10e" - } else if $in < 1wk { - { fg: "#13a10e" attr: "b" } - } else if $in < 6wk { - "#3a96dd" - } else if $in < 52wk { - "#0037da" - } else { "dark_gray" } - } - range: "#767676" - float: "#767676" - string: "#767676" - nothing: "#767676" - binary: "#767676" - cellpath: "#767676" - row_index: { fg: "#13a10e" attr: "b" } - record: "#767676" - list: "#767676" - block: "#767676" - hints: "dark_gray" - search_result: { fg: "#c50f1f" bg: "#767676" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#881798" attr: "b" } - shape_binary: { fg: "#881798" attr: "b" } - shape_block: { fg: "#0037da" attr: "b" } - shape_bool: "#3a96dd" - shape_custom: "#13a10e" - shape_datetime: { fg: "#3a96dd" attr: "b" } - shape_directory: "#3a96dd" - shape_external: "#3a96dd" - shape_externalarg: { fg: "#13a10e" attr: "b" } - shape_filepath: "#3a96dd" - shape_flag: { fg: "#0037da" attr: "b" } - shape_float: { fg: "#881798" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#3a96dd" attr: "b" } - shape_int: { fg: "#881798" attr: "b" } - shape_internalcall: { fg: "#3a96dd" attr: "b" } - shape_list: { fg: "#3a96dd" attr: "b" } - shape_literal: "#0037da" - shape_match_pattern: "#13a10e" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#3a96dd" - shape_operator: "#c19c00" - shape_or: { fg: "#881798" attr: "b" } - shape_pipe: { fg: "#881798" attr: "b" } - shape_range: { fg: "#c19c00" attr: "b" } - shape_record: { fg: "#3a96dd" attr: "b" } - shape_redirection: { fg: "#881798" attr: "b" } - shape_signature: { fg: "#13a10e" attr: "b" } - shape_string: "#13a10e" - shape_string_interpolation: { fg: "#3a96dd" attr: "b" } - shape_table: { fg: "#0037da" attr: "b" } - shape_variable: "#881798" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#f2f2f2" - foreground: "#767676" - cursor: "#767676" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#767676' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#13a10e' attr: 'b' } + empty: '#0037da' + bool: {|| if $in { '#3a96dd' } else { 'light_gray' } } + int: '#767676' + filesize: {|e| + if $e == 0b { + '#767676' + } else if $e < 1mb { + '#3a96dd' + } else {{ fg: '#0037da' }} + } + duration: '#767676' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#c50f1f' attr: 'b' } + } else if $in < 6hr { + '#c50f1f' + } else if $in < 1day { + '#c19c00' + } else if $in < 3day { + '#13a10e' + } else if $in < 1wk { + { fg: '#13a10e' attr: 'b' } + } else if $in < 6wk { + '#3a96dd' + } else if $in < 52wk { + '#0037da' + } else { 'dark_gray' } + } + range: '#767676' + float: '#767676' + string: '#767676' + nothing: '#767676' + binary: '#767676' + cellpath: '#767676' + row_index: { fg: '#13a10e' attr: 'b' } + record: '#767676' + list: '#767676' + block: '#767676' + hints: 'dark_gray' + search_result: { fg: '#c50f1f' bg: '#767676' } + + shape_and: { fg: '#881798' attr: 'b' } + shape_binary: { fg: '#881798' attr: 'b' } + shape_block: { fg: '#0037da' attr: 'b' } + shape_bool: '#3a96dd' + shape_custom: '#13a10e' + shape_datetime: { fg: '#3a96dd' attr: 'b' } + shape_directory: '#3a96dd' + shape_external: '#3a96dd' + shape_externalarg: { fg: '#13a10e' attr: 'b' } + shape_filepath: '#3a96dd' + shape_flag: { fg: '#0037da' attr: 'b' } + shape_float: { fg: '#881798' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#3a96dd' attr: 'b' } + shape_int: { fg: '#881798' attr: 'b' } + shape_internalcall: { fg: '#3a96dd' attr: 'b' } + shape_list: { fg: '#3a96dd' attr: 'b' } + shape_literal: '#0037da' + shape_match_pattern: '#13a10e' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#3a96dd' + shape_operator: '#c19c00' + shape_or: { fg: '#881798' attr: 'b' } + shape_pipe: { fg: '#881798' attr: 'b' } + shape_range: { fg: '#c19c00' attr: 'b' } + shape_record: { fg: '#3a96dd' attr: 'b' } + shape_redirection: { fg: '#881798' attr: 'b' } + shape_signature: { fg: '#13a10e' attr: 'b' } + shape_string: '#13a10e' + shape_string_interpolation: { fg: '#3a96dd' attr: 'b' } + shape_table: { fg: '#0037da' attr: 'b' } + shape_variable: '#881798' + + background: '#f2f2f2' + foreground: '#767676' + cursor: '#767676' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-10.nu b/themes/nu-themes/windows-10.nu index 52c8f03..936c0a8 100644 --- a/themes/nu-themes/windows-10.nu +++ b/themes/nu-themes/windows-10.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cccccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#16c60c" attr: "b" } - empty: "#3b78ff" - bool: {|| if $in { "#61d6d6" } else { "light_gray" } } - int: "#cccccc" - filesize: {|e| - if $e == 0b { - "#cccccc" - } else if $e < 1mb { - "#61d6d6" - } else {{ fg: "#3b78ff" }} - } - duration: "#cccccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#e74856" attr: "b" } - } else if $in < 6hr { - "#e74856" - } else if $in < 1day { - "#f9f1a5" - } else if $in < 3day { - "#16c60c" - } else if $in < 1wk { - { fg: "#16c60c" attr: "b" } - } else if $in < 6wk { - "#61d6d6" - } else if $in < 52wk { - "#3b78ff" - } else { "dark_gray" } - } - range: "#cccccc" - float: "#cccccc" - string: "#cccccc" - nothing: "#cccccc" - binary: "#cccccc" - cellpath: "#cccccc" - row_index: { fg: "#16c60c" attr: "b" } - record: "#cccccc" - list: "#cccccc" - block: "#cccccc" - hints: "dark_gray" - search_result: { fg: "#e74856" bg: "#cccccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b4009e" attr: "b" } - shape_binary: { fg: "#b4009e" attr: "b" } - shape_block: { fg: "#3b78ff" attr: "b" } - shape_bool: "#61d6d6" - shape_custom: "#16c60c" - shape_datetime: { fg: "#61d6d6" attr: "b" } - shape_directory: "#61d6d6" - shape_external: "#61d6d6" - shape_externalarg: { fg: "#16c60c" attr: "b" } - shape_filepath: "#61d6d6" - shape_flag: { fg: "#3b78ff" attr: "b" } - shape_float: { fg: "#b4009e" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#61d6d6" attr: "b" } - shape_int: { fg: "#b4009e" attr: "b" } - shape_internalcall: { fg: "#61d6d6" attr: "b" } - shape_list: { fg: "#61d6d6" attr: "b" } - shape_literal: "#3b78ff" - shape_match_pattern: "#16c60c" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#61d6d6" - shape_operator: "#f9f1a5" - shape_or: { fg: "#b4009e" attr: "b" } - shape_pipe: { fg: "#b4009e" attr: "b" } - shape_range: { fg: "#f9f1a5" attr: "b" } - shape_record: { fg: "#61d6d6" attr: "b" } - shape_redirection: { fg: "#b4009e" attr: "b" } - shape_signature: { fg: "#16c60c" attr: "b" } - shape_string: "#16c60c" - shape_string_interpolation: { fg: "#61d6d6" attr: "b" } - shape_table: { fg: "#3b78ff" attr: "b" } - shape_variable: "#b4009e" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#0c0c0c" - foreground: "#cccccc" - cursor: "#cccccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cccccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#16c60c' attr: 'b' } + empty: '#3b78ff' + bool: {|| if $in { '#61d6d6' } else { 'light_gray' } } + int: '#cccccc' + filesize: {|e| + if $e == 0b { + '#cccccc' + } else if $e < 1mb { + '#61d6d6' + } else {{ fg: '#3b78ff' }} + } + duration: '#cccccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#e74856' attr: 'b' } + } else if $in < 6hr { + '#e74856' + } else if $in < 1day { + '#f9f1a5' + } else if $in < 3day { + '#16c60c' + } else if $in < 1wk { + { fg: '#16c60c' attr: 'b' } + } else if $in < 6wk { + '#61d6d6' + } else if $in < 52wk { + '#3b78ff' + } else { 'dark_gray' } + } + range: '#cccccc' + float: '#cccccc' + string: '#cccccc' + nothing: '#cccccc' + binary: '#cccccc' + cellpath: '#cccccc' + row_index: { fg: '#16c60c' attr: 'b' } + record: '#cccccc' + list: '#cccccc' + block: '#cccccc' + hints: 'dark_gray' + search_result: { fg: '#e74856' bg: '#cccccc' } + + shape_and: { fg: '#b4009e' attr: 'b' } + shape_binary: { fg: '#b4009e' attr: 'b' } + shape_block: { fg: '#3b78ff' attr: 'b' } + shape_bool: '#61d6d6' + shape_custom: '#16c60c' + shape_datetime: { fg: '#61d6d6' attr: 'b' } + shape_directory: '#61d6d6' + shape_external: '#61d6d6' + shape_externalarg: { fg: '#16c60c' attr: 'b' } + shape_filepath: '#61d6d6' + shape_flag: { fg: '#3b78ff' attr: 'b' } + shape_float: { fg: '#b4009e' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#61d6d6' attr: 'b' } + shape_int: { fg: '#b4009e' attr: 'b' } + shape_internalcall: { fg: '#61d6d6' attr: 'b' } + shape_list: { fg: '#61d6d6' attr: 'b' } + shape_literal: '#3b78ff' + shape_match_pattern: '#16c60c' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#61d6d6' + shape_operator: '#f9f1a5' + shape_or: { fg: '#b4009e' attr: 'b' } + shape_pipe: { fg: '#b4009e' attr: 'b' } + shape_range: { fg: '#f9f1a5' attr: 'b' } + shape_record: { fg: '#61d6d6' attr: 'b' } + shape_redirection: { fg: '#b4009e' attr: 'b' } + shape_signature: { fg: '#16c60c' attr: 'b' } + shape_string: '#16c60c' + shape_string_interpolation: { fg: '#61d6d6' attr: 'b' } + shape_table: { fg: '#3b78ff' attr: 'b' } + shape_variable: '#b4009e' + + background: '#0c0c0c' + foreground: '#cccccc' + cursor: '#cccccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-95-light.nu b/themes/nu-themes/windows-95-light.nu index 3e5dc81..a45867d 100644 --- a/themes/nu-themes/windows-95-light.nu +++ b/themes/nu-themes/windows-95-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#545454" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00a800" attr: "b" } - empty: "#0000a8" - bool: {|| if $in { "#00a8a8" } else { "light_gray" } } - int: "#545454" - filesize: {|e| - if $e == 0b { - "#545454" - } else if $e < 1mb { - "#00a8a8" - } else {{ fg: "#0000a8" }} - } - duration: "#545454" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#a80000" attr: "b" } - } else if $in < 6hr { - "#a80000" - } else if $in < 1day { - "#a85400" - } else if $in < 3day { - "#00a800" - } else if $in < 1wk { - { fg: "#00a800" attr: "b" } - } else if $in < 6wk { - "#00a8a8" - } else if $in < 52wk { - "#0000a8" - } else { "dark_gray" } - } - range: "#545454" - float: "#545454" - string: "#545454" - nothing: "#545454" - binary: "#545454" - cellpath: "#545454" - row_index: { fg: "#00a800" attr: "b" } - record: "#545454" - list: "#545454" - block: "#545454" - hints: "dark_gray" - search_result: { fg: "#a80000" bg: "#545454" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#a800a8" attr: "b" } - shape_binary: { fg: "#a800a8" attr: "b" } - shape_block: { fg: "#0000a8" attr: "b" } - shape_bool: "#00a8a8" - shape_custom: "#00a800" - shape_datetime: { fg: "#00a8a8" attr: "b" } - shape_directory: "#00a8a8" - shape_external: "#00a8a8" - shape_externalarg: { fg: "#00a800" attr: "b" } - shape_filepath: "#00a8a8" - shape_flag: { fg: "#0000a8" attr: "b" } - shape_float: { fg: "#a800a8" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a8a8" attr: "b" } - shape_int: { fg: "#a800a8" attr: "b" } - shape_internalcall: { fg: "#00a8a8" attr: "b" } - shape_list: { fg: "#00a8a8" attr: "b" } - shape_literal: "#0000a8" - shape_match_pattern: "#00a800" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00a8a8" - shape_operator: "#a85400" - shape_or: { fg: "#a800a8" attr: "b" } - shape_pipe: { fg: "#a800a8" attr: "b" } - shape_range: { fg: "#a85400" attr: "b" } - shape_record: { fg: "#00a8a8" attr: "b" } - shape_redirection: { fg: "#a800a8" attr: "b" } - shape_signature: { fg: "#00a800" attr: "b" } - shape_string: "#00a800" - shape_string_interpolation: { fg: "#00a8a8" attr: "b" } - shape_table: { fg: "#0000a8" attr: "b" } - shape_variable: "#a800a8" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fcfcfc" - foreground: "#545454" - cursor: "#545454" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#545454' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00a800' attr: 'b' } + empty: '#0000a8' + bool: {|| if $in { '#00a8a8' } else { 'light_gray' } } + int: '#545454' + filesize: {|e| + if $e == 0b { + '#545454' + } else if $e < 1mb { + '#00a8a8' + } else {{ fg: '#0000a8' }} + } + duration: '#545454' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#a80000' attr: 'b' } + } else if $in < 6hr { + '#a80000' + } else if $in < 1day { + '#a85400' + } else if $in < 3day { + '#00a800' + } else if $in < 1wk { + { fg: '#00a800' attr: 'b' } + } else if $in < 6wk { + '#00a8a8' + } else if $in < 52wk { + '#0000a8' + } else { 'dark_gray' } + } + range: '#545454' + float: '#545454' + string: '#545454' + nothing: '#545454' + binary: '#545454' + cellpath: '#545454' + row_index: { fg: '#00a800' attr: 'b' } + record: '#545454' + list: '#545454' + block: '#545454' + hints: 'dark_gray' + search_result: { fg: '#a80000' bg: '#545454' } + + shape_and: { fg: '#a800a8' attr: 'b' } + shape_binary: { fg: '#a800a8' attr: 'b' } + shape_block: { fg: '#0000a8' attr: 'b' } + shape_bool: '#00a8a8' + shape_custom: '#00a800' + shape_datetime: { fg: '#00a8a8' attr: 'b' } + shape_directory: '#00a8a8' + shape_external: '#00a8a8' + shape_externalarg: { fg: '#00a800' attr: 'b' } + shape_filepath: '#00a8a8' + shape_flag: { fg: '#0000a8' attr: 'b' } + shape_float: { fg: '#a800a8' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a8a8' attr: 'b' } + shape_int: { fg: '#a800a8' attr: 'b' } + shape_internalcall: { fg: '#00a8a8' attr: 'b' } + shape_list: { fg: '#00a8a8' attr: 'b' } + shape_literal: '#0000a8' + shape_match_pattern: '#00a800' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00a8a8' + shape_operator: '#a85400' + shape_or: { fg: '#a800a8' attr: 'b' } + shape_pipe: { fg: '#a800a8' attr: 'b' } + shape_range: { fg: '#a85400' attr: 'b' } + shape_record: { fg: '#00a8a8' attr: 'b' } + shape_redirection: { fg: '#a800a8' attr: 'b' } + shape_signature: { fg: '#00a800' attr: 'b' } + shape_string: '#00a800' + shape_string_interpolation: { fg: '#00a8a8' attr: 'b' } + shape_table: { fg: '#0000a8' attr: 'b' } + shape_variable: '#a800a8' + + background: '#fcfcfc' + foreground: '#545454' + cursor: '#545454' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-95.nu b/themes/nu-themes/windows-95.nu index 845cca1..9359d96 100644 --- a/themes/nu-themes/windows-95.nu +++ b/themes/nu-themes/windows-95.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a8a8a8" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#54fc54" attr: "b" } - empty: "#5454fc" - bool: {|| if $in { "#54fcfc" } else { "light_gray" } } - int: "#a8a8a8" - filesize: {|e| - if $e == 0b { - "#a8a8a8" - } else if $e < 1mb { - "#54fcfc" - } else {{ fg: "#5454fc" }} - } - duration: "#a8a8a8" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fc5454" attr: "b" } - } else if $in < 6hr { - "#fc5454" - } else if $in < 1day { - "#fcfc54" - } else if $in < 3day { - "#54fc54" - } else if $in < 1wk { - { fg: "#54fc54" attr: "b" } - } else if $in < 6wk { - "#54fcfc" - } else if $in < 52wk { - "#5454fc" - } else { "dark_gray" } - } - range: "#a8a8a8" - float: "#a8a8a8" - string: "#a8a8a8" - nothing: "#a8a8a8" - binary: "#a8a8a8" - cellpath: "#a8a8a8" - row_index: { fg: "#54fc54" attr: "b" } - record: "#a8a8a8" - list: "#a8a8a8" - block: "#a8a8a8" - hints: "dark_gray" - search_result: { fg: "#fc5454" bg: "#a8a8a8" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fc54fc" attr: "b" } - shape_binary: { fg: "#fc54fc" attr: "b" } - shape_block: { fg: "#5454fc" attr: "b" } - shape_bool: "#54fcfc" - shape_custom: "#54fc54" - shape_datetime: { fg: "#54fcfc" attr: "b" } - shape_directory: "#54fcfc" - shape_external: "#54fcfc" - shape_externalarg: { fg: "#54fc54" attr: "b" } - shape_filepath: "#54fcfc" - shape_flag: { fg: "#5454fc" attr: "b" } - shape_float: { fg: "#fc54fc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#54fcfc" attr: "b" } - shape_int: { fg: "#fc54fc" attr: "b" } - shape_internalcall: { fg: "#54fcfc" attr: "b" } - shape_list: { fg: "#54fcfc" attr: "b" } - shape_literal: "#5454fc" - shape_match_pattern: "#54fc54" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#54fcfc" - shape_operator: "#fcfc54" - shape_or: { fg: "#fc54fc" attr: "b" } - shape_pipe: { fg: "#fc54fc" attr: "b" } - shape_range: { fg: "#fcfc54" attr: "b" } - shape_record: { fg: "#54fcfc" attr: "b" } - shape_redirection: { fg: "#fc54fc" attr: "b" } - shape_signature: { fg: "#54fc54" attr: "b" } - shape_string: "#54fc54" - shape_string_interpolation: { fg: "#54fcfc" attr: "b" } - shape_table: { fg: "#5454fc" attr: "b" } - shape_variable: "#fc54fc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#a8a8a8" - cursor: "#a8a8a8" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a8a8a8' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#54fc54' attr: 'b' } + empty: '#5454fc' + bool: {|| if $in { '#54fcfc' } else { 'light_gray' } } + int: '#a8a8a8' + filesize: {|e| + if $e == 0b { + '#a8a8a8' + } else if $e < 1mb { + '#54fcfc' + } else {{ fg: '#5454fc' }} + } + duration: '#a8a8a8' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fc5454' attr: 'b' } + } else if $in < 6hr { + '#fc5454' + } else if $in < 1day { + '#fcfc54' + } else if $in < 3day { + '#54fc54' + } else if $in < 1wk { + { fg: '#54fc54' attr: 'b' } + } else if $in < 6wk { + '#54fcfc' + } else if $in < 52wk { + '#5454fc' + } else { 'dark_gray' } + } + range: '#a8a8a8' + float: '#a8a8a8' + string: '#a8a8a8' + nothing: '#a8a8a8' + binary: '#a8a8a8' + cellpath: '#a8a8a8' + row_index: { fg: '#54fc54' attr: 'b' } + record: '#a8a8a8' + list: '#a8a8a8' + block: '#a8a8a8' + hints: 'dark_gray' + search_result: { fg: '#fc5454' bg: '#a8a8a8' } + + shape_and: { fg: '#fc54fc' attr: 'b' } + shape_binary: { fg: '#fc54fc' attr: 'b' } + shape_block: { fg: '#5454fc' attr: 'b' } + shape_bool: '#54fcfc' + shape_custom: '#54fc54' + shape_datetime: { fg: '#54fcfc' attr: 'b' } + shape_directory: '#54fcfc' + shape_external: '#54fcfc' + shape_externalarg: { fg: '#54fc54' attr: 'b' } + shape_filepath: '#54fcfc' + shape_flag: { fg: '#5454fc' attr: 'b' } + shape_float: { fg: '#fc54fc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#54fcfc' attr: 'b' } + shape_int: { fg: '#fc54fc' attr: 'b' } + shape_internalcall: { fg: '#54fcfc' attr: 'b' } + shape_list: { fg: '#54fcfc' attr: 'b' } + shape_literal: '#5454fc' + shape_match_pattern: '#54fc54' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#54fcfc' + shape_operator: '#fcfc54' + shape_or: { fg: '#fc54fc' attr: 'b' } + shape_pipe: { fg: '#fc54fc' attr: 'b' } + shape_range: { fg: '#fcfc54' attr: 'b' } + shape_record: { fg: '#54fcfc' attr: 'b' } + shape_redirection: { fg: '#fc54fc' attr: 'b' } + shape_signature: { fg: '#54fc54' attr: 'b' } + shape_string: '#54fc54' + shape_string_interpolation: { fg: '#54fcfc' attr: 'b' } + shape_table: { fg: '#5454fc' attr: 'b' } + shape_variable: '#fc54fc' + + background: '#000000' + foreground: '#a8a8a8' + cursor: '#a8a8a8' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-highcontrast-light.nu b/themes/nu-themes/windows-highcontrast-light.nu index dfd2aaa..ad389ff 100644 --- a/themes/nu-themes/windows-highcontrast-light.nu +++ b/themes/nu-themes/windows-highcontrast-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#545454" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#008000" attr: "b" } - empty: "#000080" - bool: {|| if $in { "#008080" } else { "light_gray" } } - int: "#545454" - filesize: {|e| - if $e == 0b { - "#545454" - } else if $e < 1mb { - "#008080" - } else {{ fg: "#000080" }} - } - duration: "#545454" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#800000" attr: "b" } - } else if $in < 6hr { - "#800000" - } else if $in < 1day { - "#808000" - } else if $in < 3day { - "#008000" - } else if $in < 1wk { - { fg: "#008000" attr: "b" } - } else if $in < 6wk { - "#008080" - } else if $in < 52wk { - "#000080" - } else { "dark_gray" } - } - range: "#545454" - float: "#545454" - string: "#545454" - nothing: "#545454" - binary: "#545454" - cellpath: "#545454" - row_index: { fg: "#008000" attr: "b" } - record: "#545454" - list: "#545454" - block: "#545454" - hints: "dark_gray" - search_result: { fg: "#800000" bg: "#545454" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#800080" attr: "b" } - shape_binary: { fg: "#800080" attr: "b" } - shape_block: { fg: "#000080" attr: "b" } - shape_bool: "#008080" - shape_custom: "#008000" - shape_datetime: { fg: "#008080" attr: "b" } - shape_directory: "#008080" - shape_external: "#008080" - shape_externalarg: { fg: "#008000" attr: "b" } - shape_filepath: "#008080" - shape_flag: { fg: "#000080" attr: "b" } - shape_float: { fg: "#800080" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#008080" attr: "b" } - shape_int: { fg: "#800080" attr: "b" } - shape_internalcall: { fg: "#008080" attr: "b" } - shape_list: { fg: "#008080" attr: "b" } - shape_literal: "#000080" - shape_match_pattern: "#008000" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#008080" - shape_operator: "#808000" - shape_or: { fg: "#800080" attr: "b" } - shape_pipe: { fg: "#800080" attr: "b" } - shape_range: { fg: "#808000" attr: "b" } - shape_record: { fg: "#008080" attr: "b" } - shape_redirection: { fg: "#800080" attr: "b" } - shape_signature: { fg: "#008000" attr: "b" } - shape_string: "#008000" - shape_string_interpolation: { fg: "#008080" attr: "b" } - shape_table: { fg: "#000080" attr: "b" } - shape_variable: "#800080" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#fcfcfc" - foreground: "#545454" - cursor: "#545454" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#545454' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#008000' attr: 'b' } + empty: '#000080' + bool: {|| if $in { '#008080' } else { 'light_gray' } } + int: '#545454' + filesize: {|e| + if $e == 0b { + '#545454' + } else if $e < 1mb { + '#008080' + } else {{ fg: '#000080' }} + } + duration: '#545454' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#800000' attr: 'b' } + } else if $in < 6hr { + '#800000' + } else if $in < 1day { + '#808000' + } else if $in < 3day { + '#008000' + } else if $in < 1wk { + { fg: '#008000' attr: 'b' } + } else if $in < 6wk { + '#008080' + } else if $in < 52wk { + '#000080' + } else { 'dark_gray' } + } + range: '#545454' + float: '#545454' + string: '#545454' + nothing: '#545454' + binary: '#545454' + cellpath: '#545454' + row_index: { fg: '#008000' attr: 'b' } + record: '#545454' + list: '#545454' + block: '#545454' + hints: 'dark_gray' + search_result: { fg: '#800000' bg: '#545454' } + + shape_and: { fg: '#800080' attr: 'b' } + shape_binary: { fg: '#800080' attr: 'b' } + shape_block: { fg: '#000080' attr: 'b' } + shape_bool: '#008080' + shape_custom: '#008000' + shape_datetime: { fg: '#008080' attr: 'b' } + shape_directory: '#008080' + shape_external: '#008080' + shape_externalarg: { fg: '#008000' attr: 'b' } + shape_filepath: '#008080' + shape_flag: { fg: '#000080' attr: 'b' } + shape_float: { fg: '#800080' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#008080' attr: 'b' } + shape_int: { fg: '#800080' attr: 'b' } + shape_internalcall: { fg: '#008080' attr: 'b' } + shape_list: { fg: '#008080' attr: 'b' } + shape_literal: '#000080' + shape_match_pattern: '#008000' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#008080' + shape_operator: '#808000' + shape_or: { fg: '#800080' attr: 'b' } + shape_pipe: { fg: '#800080' attr: 'b' } + shape_range: { fg: '#808000' attr: 'b' } + shape_record: { fg: '#008080' attr: 'b' } + shape_redirection: { fg: '#800080' attr: 'b' } + shape_signature: { fg: '#008000' attr: 'b' } + shape_string: '#008000' + shape_string_interpolation: { fg: '#008080' attr: 'b' } + shape_table: { fg: '#000080' attr: 'b' } + shape_variable: '#800080' + + background: '#fcfcfc' + foreground: '#545454' + cursor: '#545454' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-highcontrast.nu b/themes/nu-themes/windows-highcontrast.nu index 806030f..67a64cf 100644 --- a/themes/nu-themes/windows-highcontrast.nu +++ b/themes/nu-themes/windows-highcontrast.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c0c0c0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#54fc54" attr: "b" } - empty: "#5454fc" - bool: {|| if $in { "#54fcfc" } else { "light_gray" } } - int: "#c0c0c0" - filesize: {|e| - if $e == 0b { - "#c0c0c0" - } else if $e < 1mb { - "#54fcfc" - } else {{ fg: "#5454fc" }} - } - duration: "#c0c0c0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#fc5454" attr: "b" } - } else if $in < 6hr { - "#fc5454" - } else if $in < 1day { - "#fcfc54" - } else if $in < 3day { - "#54fc54" - } else if $in < 1wk { - { fg: "#54fc54" attr: "b" } - } else if $in < 6wk { - "#54fcfc" - } else if $in < 52wk { - "#5454fc" - } else { "dark_gray" } - } - range: "#c0c0c0" - float: "#c0c0c0" - string: "#c0c0c0" - nothing: "#c0c0c0" - binary: "#c0c0c0" - cellpath: "#c0c0c0" - row_index: { fg: "#54fc54" attr: "b" } - record: "#c0c0c0" - list: "#c0c0c0" - block: "#c0c0c0" - hints: "dark_gray" - search_result: { fg: "#fc5454" bg: "#c0c0c0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#fc54fc" attr: "b" } - shape_binary: { fg: "#fc54fc" attr: "b" } - shape_block: { fg: "#5454fc" attr: "b" } - shape_bool: "#54fcfc" - shape_custom: "#54fc54" - shape_datetime: { fg: "#54fcfc" attr: "b" } - shape_directory: "#54fcfc" - shape_external: "#54fcfc" - shape_externalarg: { fg: "#54fc54" attr: "b" } - shape_filepath: "#54fcfc" - shape_flag: { fg: "#5454fc" attr: "b" } - shape_float: { fg: "#fc54fc" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#54fcfc" attr: "b" } - shape_int: { fg: "#fc54fc" attr: "b" } - shape_internalcall: { fg: "#54fcfc" attr: "b" } - shape_list: { fg: "#54fcfc" attr: "b" } - shape_literal: "#5454fc" - shape_match_pattern: "#54fc54" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#54fcfc" - shape_operator: "#fcfc54" - shape_or: { fg: "#fc54fc" attr: "b" } - shape_pipe: { fg: "#fc54fc" attr: "b" } - shape_range: { fg: "#fcfc54" attr: "b" } - shape_record: { fg: "#54fcfc" attr: "b" } - shape_redirection: { fg: "#fc54fc" attr: "b" } - shape_signature: { fg: "#54fc54" attr: "b" } - shape_string: "#54fc54" - shape_string_interpolation: { fg: "#54fcfc" attr: "b" } - shape_table: { fg: "#5454fc" attr: "b" } - shape_variable: "#fc54fc" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c0c0c0" - cursor: "#c0c0c0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c0c0c0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#54fc54' attr: 'b' } + empty: '#5454fc' + bool: {|| if $in { '#54fcfc' } else { 'light_gray' } } + int: '#c0c0c0' + filesize: {|e| + if $e == 0b { + '#c0c0c0' + } else if $e < 1mb { + '#54fcfc' + } else {{ fg: '#5454fc' }} + } + duration: '#c0c0c0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#fc5454' attr: 'b' } + } else if $in < 6hr { + '#fc5454' + } else if $in < 1day { + '#fcfc54' + } else if $in < 3day { + '#54fc54' + } else if $in < 1wk { + { fg: '#54fc54' attr: 'b' } + } else if $in < 6wk { + '#54fcfc' + } else if $in < 52wk { + '#5454fc' + } else { 'dark_gray' } + } + range: '#c0c0c0' + float: '#c0c0c0' + string: '#c0c0c0' + nothing: '#c0c0c0' + binary: '#c0c0c0' + cellpath: '#c0c0c0' + row_index: { fg: '#54fc54' attr: 'b' } + record: '#c0c0c0' + list: '#c0c0c0' + block: '#c0c0c0' + hints: 'dark_gray' + search_result: { fg: '#fc5454' bg: '#c0c0c0' } + + shape_and: { fg: '#fc54fc' attr: 'b' } + shape_binary: { fg: '#fc54fc' attr: 'b' } + shape_block: { fg: '#5454fc' attr: 'b' } + shape_bool: '#54fcfc' + shape_custom: '#54fc54' + shape_datetime: { fg: '#54fcfc' attr: 'b' } + shape_directory: '#54fcfc' + shape_external: '#54fcfc' + shape_externalarg: { fg: '#54fc54' attr: 'b' } + shape_filepath: '#54fcfc' + shape_flag: { fg: '#5454fc' attr: 'b' } + shape_float: { fg: '#fc54fc' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#54fcfc' attr: 'b' } + shape_int: { fg: '#fc54fc' attr: 'b' } + shape_internalcall: { fg: '#54fcfc' attr: 'b' } + shape_list: { fg: '#54fcfc' attr: 'b' } + shape_literal: '#5454fc' + shape_match_pattern: '#54fc54' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#54fcfc' + shape_operator: '#fcfc54' + shape_or: { fg: '#fc54fc' attr: 'b' } + shape_pipe: { fg: '#fc54fc' attr: 'b' } + shape_range: { fg: '#fcfc54' attr: 'b' } + shape_record: { fg: '#54fcfc' attr: 'b' } + shape_redirection: { fg: '#fc54fc' attr: 'b' } + shape_signature: { fg: '#54fc54' attr: 'b' } + shape_string: '#54fc54' + shape_string_interpolation: { fg: '#54fcfc' attr: 'b' } + shape_table: { fg: '#5454fc' attr: 'b' } + shape_variable: '#fc54fc' + + background: '#000000' + foreground: '#c0c0c0' + cursor: '#c0c0c0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-nt-light.nu b/themes/nu-themes/windows-nt-light.nu index 1a6f7c1..6f61b20 100644 --- a/themes/nu-themes/windows-nt-light.nu +++ b/themes/nu-themes/windows-nt-light.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#808080" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#008000" attr: "b" } - empty: "#000080" - bool: {|| if $in { "#008080" } else { "light_gray" } } - int: "#808080" - filesize: {|e| - if $e == 0b { - "#808080" - } else if $e < 1mb { - "#008080" - } else {{ fg: "#000080" }} - } - duration: "#808080" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#800000" attr: "b" } - } else if $in < 6hr { - "#800000" - } else if $in < 1day { - "#808000" - } else if $in < 3day { - "#008000" - } else if $in < 1wk { - { fg: "#008000" attr: "b" } - } else if $in < 6wk { - "#008080" - } else if $in < 52wk { - "#000080" - } else { "dark_gray" } - } - range: "#808080" - float: "#808080" - string: "#808080" - nothing: "#808080" - binary: "#808080" - cellpath: "#808080" - row_index: { fg: "#008000" attr: "b" } - record: "#808080" - list: "#808080" - block: "#808080" - hints: "dark_gray" - search_result: { fg: "#800000" bg: "#808080" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#800080" attr: "b" } - shape_binary: { fg: "#800080" attr: "b" } - shape_block: { fg: "#000080" attr: "b" } - shape_bool: "#008080" - shape_custom: "#008000" - shape_datetime: { fg: "#008080" attr: "b" } - shape_directory: "#008080" - shape_external: "#008080" - shape_externalarg: { fg: "#008000" attr: "b" } - shape_filepath: "#008080" - shape_flag: { fg: "#000080" attr: "b" } - shape_float: { fg: "#800080" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#008080" attr: "b" } - shape_int: { fg: "#800080" attr: "b" } - shape_internalcall: { fg: "#008080" attr: "b" } - shape_list: { fg: "#008080" attr: "b" } - shape_literal: "#000080" - shape_match_pattern: "#008000" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#008080" - shape_operator: "#808000" - shape_or: { fg: "#800080" attr: "b" } - shape_pipe: { fg: "#800080" attr: "b" } - shape_range: { fg: "#808000" attr: "b" } - shape_record: { fg: "#008080" attr: "b" } - shape_redirection: { fg: "#800080" attr: "b" } - shape_signature: { fg: "#008000" attr: "b" } - shape_string: "#008000" - shape_string_interpolation: { fg: "#008080" attr: "b" } - shape_table: { fg: "#000080" attr: "b" } - shape_variable: "#800080" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#ffffff" - foreground: "#808080" - cursor: "#808080" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#808080' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#008000' attr: 'b' } + empty: '#000080' + bool: {|| if $in { '#008080' } else { 'light_gray' } } + int: '#808080' + filesize: {|e| + if $e == 0b { + '#808080' + } else if $e < 1mb { + '#008080' + } else {{ fg: '#000080' }} + } + duration: '#808080' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#800000' attr: 'b' } + } else if $in < 6hr { + '#800000' + } else if $in < 1day { + '#808000' + } else if $in < 3day { + '#008000' + } else if $in < 1wk { + { fg: '#008000' attr: 'b' } + } else if $in < 6wk { + '#008080' + } else if $in < 52wk { + '#000080' + } else { 'dark_gray' } + } + range: '#808080' + float: '#808080' + string: '#808080' + nothing: '#808080' + binary: '#808080' + cellpath: '#808080' + row_index: { fg: '#008000' attr: 'b' } + record: '#808080' + list: '#808080' + block: '#808080' + hints: 'dark_gray' + search_result: { fg: '#800000' bg: '#808080' } + + shape_and: { fg: '#800080' attr: 'b' } + shape_binary: { fg: '#800080' attr: 'b' } + shape_block: { fg: '#000080' attr: 'b' } + shape_bool: '#008080' + shape_custom: '#008000' + shape_datetime: { fg: '#008080' attr: 'b' } + shape_directory: '#008080' + shape_external: '#008080' + shape_externalarg: { fg: '#008000' attr: 'b' } + shape_filepath: '#008080' + shape_flag: { fg: '#000080' attr: 'b' } + shape_float: { fg: '#800080' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#008080' attr: 'b' } + shape_int: { fg: '#800080' attr: 'b' } + shape_internalcall: { fg: '#008080' attr: 'b' } + shape_list: { fg: '#008080' attr: 'b' } + shape_literal: '#000080' + shape_match_pattern: '#008000' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#008080' + shape_operator: '#808000' + shape_or: { fg: '#800080' attr: 'b' } + shape_pipe: { fg: '#800080' attr: 'b' } + shape_range: { fg: '#808000' attr: 'b' } + shape_record: { fg: '#008080' attr: 'b' } + shape_redirection: { fg: '#800080' attr: 'b' } + shape_signature: { fg: '#008000' attr: 'b' } + shape_string: '#008000' + shape_string_interpolation: { fg: '#008080' attr: 'b' } + shape_table: { fg: '#000080' attr: 'b' } + shape_variable: '#800080' + + background: '#ffffff' + foreground: '#808080' + cursor: '#808080' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/windows-nt.nu b/themes/nu-themes/windows-nt.nu index 9d2135c..9e45498 100644 --- a/themes/nu-themes/windows-nt.nu +++ b/themes/nu-themes/windows-nt.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#c0c0c0" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#00ff00" attr: "b" } - empty: "#0000ff" - bool: {|| if $in { "#00ffff" } else { "light_gray" } } - int: "#c0c0c0" - filesize: {|e| - if $e == 0b { - "#c0c0c0" - } else if $e < 1mb { - "#00ffff" - } else {{ fg: "#0000ff" }} - } - duration: "#c0c0c0" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff0000" attr: "b" } - } else if $in < 6hr { - "#ff0000" - } else if $in < 1day { - "#ffff00" - } else if $in < 3day { - "#00ff00" - } else if $in < 1wk { - { fg: "#00ff00" attr: "b" } - } else if $in < 6wk { - "#00ffff" - } else if $in < 52wk { - "#0000ff" - } else { "dark_gray" } - } - range: "#c0c0c0" - float: "#c0c0c0" - string: "#c0c0c0" - nothing: "#c0c0c0" - binary: "#c0c0c0" - cellpath: "#c0c0c0" - row_index: { fg: "#00ff00" attr: "b" } - record: "#c0c0c0" - list: "#c0c0c0" - block: "#c0c0c0" - hints: "dark_gray" - search_result: { fg: "#ff0000" bg: "#c0c0c0" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#ff00ff" attr: "b" } - shape_binary: { fg: "#ff00ff" attr: "b" } - shape_block: { fg: "#0000ff" attr: "b" } - shape_bool: "#00ffff" - shape_custom: "#00ff00" - shape_datetime: { fg: "#00ffff" attr: "b" } - shape_directory: "#00ffff" - shape_external: "#00ffff" - shape_externalarg: { fg: "#00ff00" attr: "b" } - shape_filepath: "#00ffff" - shape_flag: { fg: "#0000ff" attr: "b" } - shape_float: { fg: "#ff00ff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00ffff" attr: "b" } - shape_int: { fg: "#ff00ff" attr: "b" } - shape_internalcall: { fg: "#00ffff" attr: "b" } - shape_list: { fg: "#00ffff" attr: "b" } - shape_literal: "#0000ff" - shape_match_pattern: "#00ff00" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00ffff" - shape_operator: "#ffff00" - shape_or: { fg: "#ff00ff" attr: "b" } - shape_pipe: { fg: "#ff00ff" attr: "b" } - shape_range: { fg: "#ffff00" attr: "b" } - shape_record: { fg: "#00ffff" attr: "b" } - shape_redirection: { fg: "#ff00ff" attr: "b" } - shape_signature: { fg: "#00ff00" attr: "b" } - shape_string: "#00ff00" - shape_string_interpolation: { fg: "#00ffff" attr: "b" } - shape_table: { fg: "#0000ff" attr: "b" } - shape_variable: "#ff00ff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#000000" - foreground: "#c0c0c0" - cursor: "#c0c0c0" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#c0c0c0' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#00ff00' attr: 'b' } + empty: '#0000ff' + bool: {|| if $in { '#00ffff' } else { 'light_gray' } } + int: '#c0c0c0' + filesize: {|e| + if $e == 0b { + '#c0c0c0' + } else if $e < 1mb { + '#00ffff' + } else {{ fg: '#0000ff' }} + } + duration: '#c0c0c0' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff0000' attr: 'b' } + } else if $in < 6hr { + '#ff0000' + } else if $in < 1day { + '#ffff00' + } else if $in < 3day { + '#00ff00' + } else if $in < 1wk { + { fg: '#00ff00' attr: 'b' } + } else if $in < 6wk { + '#00ffff' + } else if $in < 52wk { + '#0000ff' + } else { 'dark_gray' } + } + range: '#c0c0c0' + float: '#c0c0c0' + string: '#c0c0c0' + nothing: '#c0c0c0' + binary: '#c0c0c0' + cellpath: '#c0c0c0' + row_index: { fg: '#00ff00' attr: 'b' } + record: '#c0c0c0' + list: '#c0c0c0' + block: '#c0c0c0' + hints: 'dark_gray' + search_result: { fg: '#ff0000' bg: '#c0c0c0' } + + shape_and: { fg: '#ff00ff' attr: 'b' } + shape_binary: { fg: '#ff00ff' attr: 'b' } + shape_block: { fg: '#0000ff' attr: 'b' } + shape_bool: '#00ffff' + shape_custom: '#00ff00' + shape_datetime: { fg: '#00ffff' attr: 'b' } + shape_directory: '#00ffff' + shape_external: '#00ffff' + shape_externalarg: { fg: '#00ff00' attr: 'b' } + shape_filepath: '#00ffff' + shape_flag: { fg: '#0000ff' attr: 'b' } + shape_float: { fg: '#ff00ff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00ffff' attr: 'b' } + shape_int: { fg: '#ff00ff' attr: 'b' } + shape_internalcall: { fg: '#00ffff' attr: 'b' } + shape_list: { fg: '#00ffff' attr: 'b' } + shape_literal: '#0000ff' + shape_match_pattern: '#00ff00' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00ffff' + shape_operator: '#ffff00' + shape_or: { fg: '#ff00ff' attr: 'b' } + shape_pipe: { fg: '#ff00ff' attr: 'b' } + shape_range: { fg: '#ffff00' attr: 'b' } + shape_record: { fg: '#00ffff' attr: 'b' } + shape_redirection: { fg: '#ff00ff' attr: 'b' } + shape_signature: { fg: '#00ff00' attr: 'b' } + shape_string: '#00ff00' + shape_string_interpolation: { fg: '#00ffff' attr: 'b' } + shape_table: { fg: '#0000ff' attr: 'b' } + shape_variable: '#ff00ff' + + background: '#000000' + foreground: '#c0c0c0' + cursor: '#c0c0c0' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/wombat.nu b/themes/nu-themes/wombat.nu index 2100e18..3889dbd 100644 --- a/themes/nu-themes/wombat.nu +++ b/themes/nu-themes/wombat.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dedacf" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b1e969" attr: "b" } - empty: "#5da9f6" - bool: {|| if $in { "#b7fff9" } else { "light_gray" } } - int: "#dedacf" - filesize: {|e| - if $e == 0b { - "#dedacf" - } else if $e < 1mb { - "#82fff7" - } else {{ fg: "#5da9f6" }} - } - duration: "#dedacf" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#ff615a" attr: "b" } - } else if $in < 6hr { - "#ff615a" - } else if $in < 1day { - "#ebd99c" - } else if $in < 3day { - "#b1e969" - } else if $in < 1wk { - { fg: "#b1e969" attr: "b" } - } else if $in < 6wk { - "#82fff7" - } else if $in < 52wk { - "#5da9f6" - } else { "dark_gray" } - } - range: "#dedacf" - float: "#dedacf" - string: "#dedacf" - nothing: "#dedacf" - binary: "#dedacf" - cellpath: "#dedacf" - row_index: { fg: "#b1e969" attr: "b" } - record: "#dedacf" - list: "#dedacf" - block: "#dedacf" - hints: "dark_gray" - search_result: { fg: "#ff615a" bg: "#dedacf" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#e86aff" attr: "b" } - shape_binary: { fg: "#e86aff" attr: "b" } - shape_block: { fg: "#5da9f6" attr: "b" } - shape_bool: "#b7fff9" - shape_custom: "#b1e969" - shape_datetime: { fg: "#82fff7" attr: "b" } - shape_directory: "#82fff7" - shape_external: "#82fff7" - shape_externalarg: { fg: "#b1e969" attr: "b" } - shape_filepath: "#82fff7" - shape_flag: { fg: "#5da9f6" attr: "b" } - shape_float: { fg: "#e86aff" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#82fff7" attr: "b" } - shape_int: { fg: "#e86aff" attr: "b" } - shape_internalcall: { fg: "#82fff7" attr: "b" } - shape_list: { fg: "#82fff7" attr: "b" } - shape_literal: "#5da9f6" - shape_match_pattern: "#b1e969" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#b7fff9" - shape_operator: "#ebd99c" - shape_or: { fg: "#e86aff" attr: "b" } - shape_pipe: { fg: "#e86aff" attr: "b" } - shape_range: { fg: "#ebd99c" attr: "b" } - shape_record: { fg: "#82fff7" attr: "b" } - shape_redirection: { fg: "#e86aff" attr: "b" } - shape_signature: { fg: "#b1e969" attr: "b" } - shape_string: "#b1e969" - shape_string_interpolation: { fg: "#82fff7" attr: "b" } - shape_table: { fg: "#5da9f6" attr: "b" } - shape_variable: "#e86aff" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#171717" - foreground: "#dedacf" - cursor: "#dedacf" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dedacf' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b1e969' attr: 'b' } + empty: '#5da9f6' + bool: {|| if $in { '#b7fff9' } else { 'light_gray' } } + int: '#dedacf' + filesize: {|e| + if $e == 0b { + '#dedacf' + } else if $e < 1mb { + '#82fff7' + } else {{ fg: '#5da9f6' }} + } + duration: '#dedacf' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#ff615a' attr: 'b' } + } else if $in < 6hr { + '#ff615a' + } else if $in < 1day { + '#ebd99c' + } else if $in < 3day { + '#b1e969' + } else if $in < 1wk { + { fg: '#b1e969' attr: 'b' } + } else if $in < 6wk { + '#82fff7' + } else if $in < 52wk { + '#5da9f6' + } else { 'dark_gray' } + } + range: '#dedacf' + float: '#dedacf' + string: '#dedacf' + nothing: '#dedacf' + binary: '#dedacf' + cellpath: '#dedacf' + row_index: { fg: '#b1e969' attr: 'b' } + record: '#dedacf' + list: '#dedacf' + block: '#dedacf' + hints: 'dark_gray' + search_result: { fg: '#ff615a' bg: '#dedacf' } + + shape_and: { fg: '#e86aff' attr: 'b' } + shape_binary: { fg: '#e86aff' attr: 'b' } + shape_block: { fg: '#5da9f6' attr: 'b' } + shape_bool: '#b7fff9' + shape_custom: '#b1e969' + shape_datetime: { fg: '#82fff7' attr: 'b' } + shape_directory: '#82fff7' + shape_external: '#82fff7' + shape_externalarg: { fg: '#b1e969' attr: 'b' } + shape_filepath: '#82fff7' + shape_flag: { fg: '#5da9f6' attr: 'b' } + shape_float: { fg: '#e86aff' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#82fff7' attr: 'b' } + shape_int: { fg: '#e86aff' attr: 'b' } + shape_internalcall: { fg: '#82fff7' attr: 'b' } + shape_list: { fg: '#82fff7' attr: 'b' } + shape_literal: '#5da9f6' + shape_match_pattern: '#b1e969' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#b7fff9' + shape_operator: '#ebd99c' + shape_or: { fg: '#e86aff' attr: 'b' } + shape_pipe: { fg: '#e86aff' attr: 'b' } + shape_range: { fg: '#ebd99c' attr: 'b' } + shape_record: { fg: '#82fff7' attr: 'b' } + shape_redirection: { fg: '#e86aff' attr: 'b' } + shape_signature: { fg: '#b1e969' attr: 'b' } + shape_string: '#b1e969' + shape_string_interpolation: { fg: '#82fff7' attr: 'b' } + shape_table: { fg: '#5da9f6' attr: 'b' } + shape_variable: '#e86aff' + + background: '#171717' + foreground: '#dedacf' + cursor: '#dedacf' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/woodland.nu b/themes/nu-themes/woodland.nu index dbd5cc8..e04b5d6 100644 --- a/themes/nu-themes/woodland.nu +++ b/themes/nu-themes/woodland.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#cabcb1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b7ba53" attr: "b" } - empty: "#88a4d3" - bool: {|| if $in { "#6eb958" } else { "light_gray" } } - int: "#cabcb1" - filesize: {|e| - if $e == 0b { - "#cabcb1" - } else if $e < 1mb { - "#6eb958" - } else {{ fg: "#88a4d3" }} - } - duration: "#cabcb1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#d35c5c" attr: "b" } - } else if $in < 6hr { - "#d35c5c" - } else if $in < 1day { - "#e0ac16" - } else if $in < 3day { - "#b7ba53" - } else if $in < 1wk { - { fg: "#b7ba53" attr: "b" } - } else if $in < 6wk { - "#6eb958" - } else if $in < 52wk { - "#88a4d3" - } else { "dark_gray" } - } - range: "#cabcb1" - float: "#cabcb1" - string: "#cabcb1" - nothing: "#cabcb1" - binary: "#cabcb1" - cellpath: "#cabcb1" - row_index: { fg: "#b7ba53" attr: "b" } - record: "#cabcb1" - list: "#cabcb1" - block: "#cabcb1" - hints: "dark_gray" - search_result: { fg: "#d35c5c" bg: "#cabcb1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#bb90e2" attr: "b" } - shape_binary: { fg: "#bb90e2" attr: "b" } - shape_block: { fg: "#88a4d3" attr: "b" } - shape_bool: "#6eb958" - shape_custom: "#b7ba53" - shape_datetime: { fg: "#6eb958" attr: "b" } - shape_directory: "#6eb958" - shape_external: "#6eb958" - shape_externalarg: { fg: "#b7ba53" attr: "b" } - shape_filepath: "#6eb958" - shape_flag: { fg: "#88a4d3" attr: "b" } - shape_float: { fg: "#bb90e2" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#6eb958" attr: "b" } - shape_int: { fg: "#bb90e2" attr: "b" } - shape_internalcall: { fg: "#6eb958" attr: "b" } - shape_list: { fg: "#6eb958" attr: "b" } - shape_literal: "#88a4d3" - shape_match_pattern: "#b7ba53" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6eb958" - shape_operator: "#e0ac16" - shape_or: { fg: "#bb90e2" attr: "b" } - shape_pipe: { fg: "#bb90e2" attr: "b" } - shape_range: { fg: "#e0ac16" attr: "b" } - shape_record: { fg: "#6eb958" attr: "b" } - shape_redirection: { fg: "#bb90e2" attr: "b" } - shape_signature: { fg: "#b7ba53" attr: "b" } - shape_string: "#b7ba53" - shape_string_interpolation: { fg: "#6eb958" attr: "b" } - shape_table: { fg: "#88a4d3" attr: "b" } - shape_variable: "#bb90e2" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#231e18" - foreground: "#cabcb1" - cursor: "#cabcb1" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#cabcb1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b7ba53' attr: 'b' } + empty: '#88a4d3' + bool: {|| if $in { '#6eb958' } else { 'light_gray' } } + int: '#cabcb1' + filesize: {|e| + if $e == 0b { + '#cabcb1' + } else if $e < 1mb { + '#6eb958' + } else {{ fg: '#88a4d3' }} + } + duration: '#cabcb1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#d35c5c' attr: 'b' } + } else if $in < 6hr { + '#d35c5c' + } else if $in < 1day { + '#e0ac16' + } else if $in < 3day { + '#b7ba53' + } else if $in < 1wk { + { fg: '#b7ba53' attr: 'b' } + } else if $in < 6wk { + '#6eb958' + } else if $in < 52wk { + '#88a4d3' + } else { 'dark_gray' } + } + range: '#cabcb1' + float: '#cabcb1' + string: '#cabcb1' + nothing: '#cabcb1' + binary: '#cabcb1' + cellpath: '#cabcb1' + row_index: { fg: '#b7ba53' attr: 'b' } + record: '#cabcb1' + list: '#cabcb1' + block: '#cabcb1' + hints: 'dark_gray' + search_result: { fg: '#d35c5c' bg: '#cabcb1' } + + shape_and: { fg: '#bb90e2' attr: 'b' } + shape_binary: { fg: '#bb90e2' attr: 'b' } + shape_block: { fg: '#88a4d3' attr: 'b' } + shape_bool: '#6eb958' + shape_custom: '#b7ba53' + shape_datetime: { fg: '#6eb958' attr: 'b' } + shape_directory: '#6eb958' + shape_external: '#6eb958' + shape_externalarg: { fg: '#b7ba53' attr: 'b' } + shape_filepath: '#6eb958' + shape_flag: { fg: '#88a4d3' attr: 'b' } + shape_float: { fg: '#bb90e2' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#6eb958' attr: 'b' } + shape_int: { fg: '#bb90e2' attr: 'b' } + shape_internalcall: { fg: '#6eb958' attr: 'b' } + shape_list: { fg: '#6eb958' attr: 'b' } + shape_literal: '#88a4d3' + shape_match_pattern: '#b7ba53' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6eb958' + shape_operator: '#e0ac16' + shape_or: { fg: '#bb90e2' attr: 'b' } + shape_pipe: { fg: '#bb90e2' attr: 'b' } + shape_range: { fg: '#e0ac16' attr: 'b' } + shape_record: { fg: '#6eb958' attr: 'b' } + shape_redirection: { fg: '#bb90e2' attr: 'b' } + shape_signature: { fg: '#b7ba53' attr: 'b' } + shape_string: '#b7ba53' + shape_string_interpolation: { fg: '#6eb958' attr: 'b' } + shape_table: { fg: '#88a4d3' attr: 'b' } + shape_variable: '#bb90e2' + + background: '#231e18' + foreground: '#cabcb1' + cursor: '#cabcb1' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/wryan.nu b/themes/nu-themes/wryan.nu index 5cb6044..036cd02 100644 --- a/themes/nu-themes/wryan.nu +++ b/themes/nu-themes/wryan.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#899ca1" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#287373" attr: "b" } - empty: "#395573" - bool: {|| if $in { "#6096bf" } else { "light_gray" } } - int: "#899ca1" - filesize: {|e| - if $e == 0b { - "#899ca1" - } else if $e < 1mb { - "#31658c" - } else {{ fg: "#395573" }} - } - duration: "#899ca1" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#8c4665" attr: "b" } - } else if $in < 6hr { - "#8c4665" - } else if $in < 1day { - "#7c7c99" - } else if $in < 3day { - "#287373" - } else if $in < 1wk { - { fg: "#287373" attr: "b" } - } else if $in < 6wk { - "#31658c" - } else if $in < 52wk { - "#395573" - } else { "dark_gray" } - } - range: "#899ca1" - float: "#899ca1" - string: "#899ca1" - nothing: "#899ca1" - binary: "#899ca1" - cellpath: "#899ca1" - row_index: { fg: "#287373" attr: "b" } - record: "#899ca1" - list: "#899ca1" - block: "#899ca1" - hints: "dark_gray" - search_result: { fg: "#8c4665" bg: "#899ca1" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#5e468c" attr: "b" } - shape_binary: { fg: "#5e468c" attr: "b" } - shape_block: { fg: "#395573" attr: "b" } - shape_bool: "#6096bf" - shape_custom: "#287373" - shape_datetime: { fg: "#31658c" attr: "b" } - shape_directory: "#31658c" - shape_external: "#31658c" - shape_externalarg: { fg: "#287373" attr: "b" } - shape_filepath: "#31658c" - shape_flag: { fg: "#395573" attr: "b" } - shape_float: { fg: "#5e468c" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#31658c" attr: "b" } - shape_int: { fg: "#5e468c" attr: "b" } - shape_internalcall: { fg: "#31658c" attr: "b" } - shape_list: { fg: "#31658c" attr: "b" } - shape_literal: "#395573" - shape_match_pattern: "#287373" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#6096bf" - shape_operator: "#7c7c99" - shape_or: { fg: "#5e468c" attr: "b" } - shape_pipe: { fg: "#5e468c" attr: "b" } - shape_range: { fg: "#7c7c99" attr: "b" } - shape_record: { fg: "#31658c" attr: "b" } - shape_redirection: { fg: "#5e468c" attr: "b" } - shape_signature: { fg: "#287373" attr: "b" } - shape_string: "#287373" - shape_string_interpolation: { fg: "#31658c" attr: "b" } - shape_table: { fg: "#395573" attr: "b" } - shape_variable: "#5e468c" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#101010" - foreground: "#999993" - cursor: "#999993" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#899ca1' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#287373' attr: 'b' } + empty: '#395573' + bool: {|| if $in { '#6096bf' } else { 'light_gray' } } + int: '#899ca1' + filesize: {|e| + if $e == 0b { + '#899ca1' + } else if $e < 1mb { + '#31658c' + } else {{ fg: '#395573' }} + } + duration: '#899ca1' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#8c4665' attr: 'b' } + } else if $in < 6hr { + '#8c4665' + } else if $in < 1day { + '#7c7c99' + } else if $in < 3day { + '#287373' + } else if $in < 1wk { + { fg: '#287373' attr: 'b' } + } else if $in < 6wk { + '#31658c' + } else if $in < 52wk { + '#395573' + } else { 'dark_gray' } + } + range: '#899ca1' + float: '#899ca1' + string: '#899ca1' + nothing: '#899ca1' + binary: '#899ca1' + cellpath: '#899ca1' + row_index: { fg: '#287373' attr: 'b' } + record: '#899ca1' + list: '#899ca1' + block: '#899ca1' + hints: 'dark_gray' + search_result: { fg: '#8c4665' bg: '#899ca1' } + + shape_and: { fg: '#5e468c' attr: 'b' } + shape_binary: { fg: '#5e468c' attr: 'b' } + shape_block: { fg: '#395573' attr: 'b' } + shape_bool: '#6096bf' + shape_custom: '#287373' + shape_datetime: { fg: '#31658c' attr: 'b' } + shape_directory: '#31658c' + shape_external: '#31658c' + shape_externalarg: { fg: '#287373' attr: 'b' } + shape_filepath: '#31658c' + shape_flag: { fg: '#395573' attr: 'b' } + shape_float: { fg: '#5e468c' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#31658c' attr: 'b' } + shape_int: { fg: '#5e468c' attr: 'b' } + shape_internalcall: { fg: '#31658c' attr: 'b' } + shape_list: { fg: '#31658c' attr: 'b' } + shape_literal: '#395573' + shape_match_pattern: '#287373' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#6096bf' + shape_operator: '#7c7c99' + shape_or: { fg: '#5e468c' attr: 'b' } + shape_pipe: { fg: '#5e468c' attr: 'b' } + shape_range: { fg: '#7c7c99' attr: 'b' } + shape_record: { fg: '#31658c' attr: 'b' } + shape_redirection: { fg: '#5e468c' attr: 'b' } + shape_signature: { fg: '#287373' attr: 'b' } + shape_string: '#287373' + shape_string_interpolation: { fg: '#31658c' attr: 'b' } + shape_table: { fg: '#395573' attr: 'b' } + shape_variable: '#5e468c' + + background: '#101010' + foreground: '#999993' + cursor: '#999993' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/xcode-dusk.nu b/themes/nu-themes/xcode-dusk.nu index fa98dbf..61dc668 100644 --- a/themes/nu-themes/xcode-dusk.nu +++ b/themes/nu-themes/xcode-dusk.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#939599" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#df0002" attr: "b" } - empty: "#790ead" - bool: {|| if $in { "#00a0be" } else { "light_gray" } } - int: "#939599" - filesize: {|e| - if $e == 0b { - "#939599" - } else if $e < 1mb { - "#00a0be" - } else {{ fg: "#790ead" }} - } - duration: "#939599" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#b21889" attr: "b" } - } else if $in < 6hr { - "#b21889" - } else if $in < 1day { - "#438288" - } else if $in < 3day { - "#df0002" - } else if $in < 1wk { - { fg: "#df0002" attr: "b" } - } else if $in < 6wk { - "#00a0be" - } else if $in < 52wk { - "#790ead" - } else { "dark_gray" } - } - range: "#939599" - float: "#939599" - string: "#939599" - nothing: "#939599" - binary: "#939599" - cellpath: "#939599" - row_index: { fg: "#df0002" attr: "b" } - record: "#939599" - list: "#939599" - block: "#939599" - hints: "dark_gray" - search_result: { fg: "#b21889" bg: "#939599" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#b21889" attr: "b" } - shape_binary: { fg: "#b21889" attr: "b" } - shape_block: { fg: "#790ead" attr: "b" } - shape_bool: "#00a0be" - shape_custom: "#df0002" - shape_datetime: { fg: "#00a0be" attr: "b" } - shape_directory: "#00a0be" - shape_external: "#00a0be" - shape_externalarg: { fg: "#df0002" attr: "b" } - shape_filepath: "#00a0be" - shape_flag: { fg: "#790ead" attr: "b" } - shape_float: { fg: "#b21889" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#00a0be" attr: "b" } - shape_int: { fg: "#b21889" attr: "b" } - shape_internalcall: { fg: "#00a0be" attr: "b" } - shape_list: { fg: "#00a0be" attr: "b" } - shape_literal: "#790ead" - shape_match_pattern: "#df0002" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#00a0be" - shape_operator: "#438288" - shape_or: { fg: "#b21889" attr: "b" } - shape_pipe: { fg: "#b21889" attr: "b" } - shape_range: { fg: "#438288" attr: "b" } - shape_record: { fg: "#00a0be" attr: "b" } - shape_redirection: { fg: "#b21889" attr: "b" } - shape_signature: { fg: "#df0002" attr: "b" } - shape_string: "#df0002" - shape_string_interpolation: { fg: "#00a0be" attr: "b" } - shape_table: { fg: "#790ead" attr: "b" } - shape_variable: "#b21889" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#282b35" - foreground: "#939599" - cursor: "#939599" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#939599' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#df0002' attr: 'b' } + empty: '#790ead' + bool: {|| if $in { '#00a0be' } else { 'light_gray' } } + int: '#939599' + filesize: {|e| + if $e == 0b { + '#939599' + } else if $e < 1mb { + '#00a0be' + } else {{ fg: '#790ead' }} + } + duration: '#939599' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#b21889' attr: 'b' } + } else if $in < 6hr { + '#b21889' + } else if $in < 1day { + '#438288' + } else if $in < 3day { + '#df0002' + } else if $in < 1wk { + { fg: '#df0002' attr: 'b' } + } else if $in < 6wk { + '#00a0be' + } else if $in < 52wk { + '#790ead' + } else { 'dark_gray' } + } + range: '#939599' + float: '#939599' + string: '#939599' + nothing: '#939599' + binary: '#939599' + cellpath: '#939599' + row_index: { fg: '#df0002' attr: 'b' } + record: '#939599' + list: '#939599' + block: '#939599' + hints: 'dark_gray' + search_result: { fg: '#b21889' bg: '#939599' } + + shape_and: { fg: '#b21889' attr: 'b' } + shape_binary: { fg: '#b21889' attr: 'b' } + shape_block: { fg: '#790ead' attr: 'b' } + shape_bool: '#00a0be' + shape_custom: '#df0002' + shape_datetime: { fg: '#00a0be' attr: 'b' } + shape_directory: '#00a0be' + shape_external: '#00a0be' + shape_externalarg: { fg: '#df0002' attr: 'b' } + shape_filepath: '#00a0be' + shape_flag: { fg: '#790ead' attr: 'b' } + shape_float: { fg: '#b21889' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#00a0be' attr: 'b' } + shape_int: { fg: '#b21889' attr: 'b' } + shape_internalcall: { fg: '#00a0be' attr: 'b' } + shape_list: { fg: '#00a0be' attr: 'b' } + shape_literal: '#790ead' + shape_match_pattern: '#df0002' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#00a0be' + shape_operator: '#438288' + shape_or: { fg: '#b21889' attr: 'b' } + shape_pipe: { fg: '#b21889' attr: 'b' } + shape_range: { fg: '#438288' attr: 'b' } + shape_record: { fg: '#00a0be' attr: 'b' } + shape_redirection: { fg: '#b21889' attr: 'b' } + shape_signature: { fg: '#df0002' attr: 'b' } + shape_string: '#df0002' + shape_string_interpolation: { fg: '#00a0be' attr: 'b' } + shape_table: { fg: '#790ead' attr: 'b' } + shape_variable: '#b21889' + + background: '#282b35' + foreground: '#939599' + cursor: '#939599' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/yachiyo.nu b/themes/nu-themes/yachiyo.nu index 6d5dc65..27a703c 100644 --- a/themes/nu-themes/yachiyo.nu +++ b/themes/nu-themes/yachiyo.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#a0be99" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#b9a9d7" attr: "b" } - empty: "#ada883" - bool: {|| if $in { "#ff9c9c" } else { "light_gray" } } - int: "#a0be99" - filesize: {|e| - if $e == 0b { - "#a0be99" - } else if $e < 1mb { - "#ff9c9c" - } else {{ fg: "#ada883" }} - } - duration: "#a0be99" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#86b79b" attr: "b" } - } else if $in < 6hr { - "#86b79b" - } else if $in < 1day { - "#d4b34e" - } else if $in < 3day { - "#b9a9d7" - } else if $in < 1wk { - { fg: "#b9a9d7" attr: "b" } - } else if $in < 6wk { - "#ff9c9c" - } else if $in < 52wk { - "#ada883" - } else { "dark_gray" } - } - range: "#a0be99" - float: "#a0be99" - string: "#a0be99" - nothing: "#a0be99" - binary: "#a0be99" - cellpath: "#a0be99" - row_index: { fg: "#b9a9d7" attr: "b" } - record: "#a0be99" - list: "#a0be99" - block: "#a0be99" - hints: "dark_gray" - search_result: { fg: "#86b79b" bg: "#a0be99" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#9298e7" attr: "b" } - shape_binary: { fg: "#9298e7" attr: "b" } - shape_block: { fg: "#ada883" attr: "b" } - shape_bool: "#ff9c9c" - shape_custom: "#b9a9d7" - shape_datetime: { fg: "#ff9c9c" attr: "b" } - shape_directory: "#ff9c9c" - shape_external: "#ff9c9c" - shape_externalarg: { fg: "#b9a9d7" attr: "b" } - shape_filepath: "#ff9c9c" - shape_flag: { fg: "#ada883" attr: "b" } - shape_float: { fg: "#9298e7" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#ff9c9c" attr: "b" } - shape_int: { fg: "#9298e7" attr: "b" } - shape_internalcall: { fg: "#ff9c9c" attr: "b" } - shape_list: { fg: "#ff9c9c" attr: "b" } - shape_literal: "#ada883" - shape_match_pattern: "#b9a9d7" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#ff9c9c" - shape_operator: "#d4b34e" - shape_or: { fg: "#9298e7" attr: "b" } - shape_pipe: { fg: "#9298e7" attr: "b" } - shape_range: { fg: "#d4b34e" attr: "b" } - shape_record: { fg: "#ff9c9c" attr: "b" } - shape_redirection: { fg: "#9298e7" attr: "b" } - shape_signature: { fg: "#b9a9d7" attr: "b" } - shape_string: "#b9a9d7" - shape_string_interpolation: { fg: "#ff9c9c" attr: "b" } - shape_table: { fg: "#ada883" attr: "b" } - shape_variable: "#9298e7" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#44515d" - foreground: "#ffb692" - cursor: "#ffb692" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#a0be99' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#b9a9d7' attr: 'b' } + empty: '#ada883' + bool: {|| if $in { '#ff9c9c' } else { 'light_gray' } } + int: '#a0be99' + filesize: {|e| + if $e == 0b { + '#a0be99' + } else if $e < 1mb { + '#ff9c9c' + } else {{ fg: '#ada883' }} + } + duration: '#a0be99' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#86b79b' attr: 'b' } + } else if $in < 6hr { + '#86b79b' + } else if $in < 1day { + '#d4b34e' + } else if $in < 3day { + '#b9a9d7' + } else if $in < 1wk { + { fg: '#b9a9d7' attr: 'b' } + } else if $in < 6wk { + '#ff9c9c' + } else if $in < 52wk { + '#ada883' + } else { 'dark_gray' } + } + range: '#a0be99' + float: '#a0be99' + string: '#a0be99' + nothing: '#a0be99' + binary: '#a0be99' + cellpath: '#a0be99' + row_index: { fg: '#b9a9d7' attr: 'b' } + record: '#a0be99' + list: '#a0be99' + block: '#a0be99' + hints: 'dark_gray' + search_result: { fg: '#86b79b' bg: '#a0be99' } + + shape_and: { fg: '#9298e7' attr: 'b' } + shape_binary: { fg: '#9298e7' attr: 'b' } + shape_block: { fg: '#ada883' attr: 'b' } + shape_bool: '#ff9c9c' + shape_custom: '#b9a9d7' + shape_datetime: { fg: '#ff9c9c' attr: 'b' } + shape_directory: '#ff9c9c' + shape_external: '#ff9c9c' + shape_externalarg: { fg: '#b9a9d7' attr: 'b' } + shape_filepath: '#ff9c9c' + shape_flag: { fg: '#ada883' attr: 'b' } + shape_float: { fg: '#9298e7' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#ff9c9c' attr: 'b' } + shape_int: { fg: '#9298e7' attr: 'b' } + shape_internalcall: { fg: '#ff9c9c' attr: 'b' } + shape_list: { fg: '#ff9c9c' attr: 'b' } + shape_literal: '#ada883' + shape_match_pattern: '#b9a9d7' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#ff9c9c' + shape_operator: '#d4b34e' + shape_or: { fg: '#9298e7' attr: 'b' } + shape_pipe: { fg: '#9298e7' attr: 'b' } + shape_range: { fg: '#d4b34e' attr: 'b' } + shape_record: { fg: '#ff9c9c' attr: 'b' } + shape_redirection: { fg: '#9298e7' attr: 'b' } + shape_signature: { fg: '#b9a9d7' attr: 'b' } + shape_string: '#b9a9d7' + shape_string_interpolation: { fg: '#ff9c9c' attr: 'b' } + shape_table: { fg: '#ada883' attr: 'b' } + shape_variable: '#9298e7' + + background: '#44515d' + foreground: '#ffb692' + cursor: '#ffb692' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/zenburn.nu b/themes/nu-themes/zenburn.nu index b80e329..3b64e76 100644 --- a/themes/nu-themes/zenburn.nu +++ b/themes/nu-themes/zenburn.nu @@ -1,82 +1,121 @@ -export def main [] { return { - separator: "#dcdccc" - leading_trailing_space_bg: { attr: "n" } - header: { fg: "#5f7f5f" attr: "b" } - empty: "#7cb8bb" - bool: {|| if $in { "#93e0e3" } else { "light_gray" } } - int: "#dcdccc" - filesize: {|e| - if $e == 0b { - "#dcdccc" - } else if $e < 1mb { - "#93e0e3" - } else {{ fg: "#7cb8bb" }} - } - duration: "#dcdccc" - date: {|| (date now) - $in | - if $in < 1hr { - { fg: "#dca3a3" attr: "b" } - } else if $in < 6hr { - "#dca3a3" - } else if $in < 1day { - "#e0cf9f" - } else if $in < 3day { - "#5f7f5f" - } else if $in < 1wk { - { fg: "#5f7f5f" attr: "b" } - } else if $in < 6wk { - "#93e0e3" - } else if $in < 52wk { - "#7cb8bb" - } else { "dark_gray" } - } - range: "#dcdccc" - float: "#dcdccc" - string: "#dcdccc" - nothing: "#dcdccc" - binary: "#dcdccc" - cellpath: "#dcdccc" - row_index: { fg: "#5f7f5f" attr: "b" } - record: "#dcdccc" - list: "#dcdccc" - block: "#dcdccc" - hints: "dark_gray" - search_result: { fg: "#dca3a3" bg: "#dcdccc" } +# Update terminal colors +export def "update terminal" [] { + let theme = (main) - shape_and: { fg: "#dc8cc3" attr: "b" } - shape_binary: { fg: "#dc8cc3" attr: "b" } - shape_block: { fg: "#7cb8bb" attr: "b" } - shape_bool: "#93e0e3" - shape_custom: "#5f7f5f" - shape_datetime: { fg: "#93e0e3" attr: "b" } - shape_directory: "#93e0e3" - shape_external: "#93e0e3" - shape_externalarg: { fg: "#5f7f5f" attr: "b" } - shape_filepath: "#93e0e3" - shape_flag: { fg: "#7cb8bb" attr: "b" } - shape_float: { fg: "#dc8cc3" attr: "b" } - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" } - shape_globpattern: { fg: "#93e0e3" attr: "b" } - shape_int: { fg: "#dc8cc3" attr: "b" } - shape_internalcall: { fg: "#93e0e3" attr: "b" } - shape_list: { fg: "#93e0e3" attr: "b" } - shape_literal: "#7cb8bb" - shape_match_pattern: "#5f7f5f" - shape_matching_brackets: { attr: "u" } - shape_nothing: "#93e0e3" - shape_operator: "#e0cf9f" - shape_or: { fg: "#dc8cc3" attr: "b" } - shape_pipe: { fg: "#dc8cc3" attr: "b" } - shape_range: { fg: "#e0cf9f" attr: "b" } - shape_record: { fg: "#93e0e3" attr: "b" } - shape_redirection: { fg: "#dc8cc3" attr: "b" } - shape_signature: { fg: "#5f7f5f" attr: "b" } - shape_string: "#5f7f5f" - shape_string_interpolation: { fg: "#93e0e3" attr: "b" } - shape_table: { fg: "#7cb8bb" attr: "b" } - shape_variable: "#dc8cc3" + # Set terminal colors + let osc_screen_foreground_color = '10;' + let osc_screen_background_color = '11;' + let osc_cursor_color = '12;' + + $" + (ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel) + (ansi -o $osc_screen_background_color)($theme.background)(char bel) + (ansi -o $osc_cursor_color)($theme.cursor)(char bel) + " + # Line breaks above are just for source readability + # but create extra whitespace when activating. Collapse + # to one line + | str replace --all "\n" '' + | print $in +} - background: "#383838" - foreground: "#dcdccc" - cursor: "#dcdccc" -}} \ No newline at end of file +# Update the Nushell configuration +export def --env "set color_config" [] { + $env.config.color_config = (main) +} + +# Retrieve the theme settings +export def main [] { + return { + separator: '#dcdccc' + leading_trailing_space_bg: { attr: 'n' } + header: { fg: '#5f7f5f' attr: 'b' } + empty: '#7cb8bb' + bool: {|| if $in { '#93e0e3' } else { 'light_gray' } } + int: '#dcdccc' + filesize: {|e| + if $e == 0b { + '#dcdccc' + } else if $e < 1mb { + '#93e0e3' + } else {{ fg: '#7cb8bb' }} + } + duration: '#dcdccc' + date: {|| (date now) - $in | + if $in < 1hr { + { fg: '#dca3a3' attr: 'b' } + } else if $in < 6hr { + '#dca3a3' + } else if $in < 1day { + '#e0cf9f' + } else if $in < 3day { + '#5f7f5f' + } else if $in < 1wk { + { fg: '#5f7f5f' attr: 'b' } + } else if $in < 6wk { + '#93e0e3' + } else if $in < 52wk { + '#7cb8bb' + } else { 'dark_gray' } + } + range: '#dcdccc' + float: '#dcdccc' + string: '#dcdccc' + nothing: '#dcdccc' + binary: '#dcdccc' + cellpath: '#dcdccc' + row_index: { fg: '#5f7f5f' attr: 'b' } + record: '#dcdccc' + list: '#dcdccc' + block: '#dcdccc' + hints: 'dark_gray' + search_result: { fg: '#dca3a3' bg: '#dcdccc' } + + shape_and: { fg: '#dc8cc3' attr: 'b' } + shape_binary: { fg: '#dc8cc3' attr: 'b' } + shape_block: { fg: '#7cb8bb' attr: 'b' } + shape_bool: '#93e0e3' + shape_custom: '#5f7f5f' + shape_datetime: { fg: '#93e0e3' attr: 'b' } + shape_directory: '#93e0e3' + shape_external: '#93e0e3' + shape_externalarg: { fg: '#5f7f5f' attr: 'b' } + shape_filepath: '#93e0e3' + shape_flag: { fg: '#7cb8bb' attr: 'b' } + shape_float: { fg: '#dc8cc3' attr: 'b' } + shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' } + shape_globpattern: { fg: '#93e0e3' attr: 'b' } + shape_int: { fg: '#dc8cc3' attr: 'b' } + shape_internalcall: { fg: '#93e0e3' attr: 'b' } + shape_list: { fg: '#93e0e3' attr: 'b' } + shape_literal: '#7cb8bb' + shape_match_pattern: '#5f7f5f' + shape_matching_brackets: { attr: 'u' } + shape_nothing: '#93e0e3' + shape_operator: '#e0cf9f' + shape_or: { fg: '#dc8cc3' attr: 'b' } + shape_pipe: { fg: '#dc8cc3' attr: 'b' } + shape_range: { fg: '#e0cf9f' attr: 'b' } + shape_record: { fg: '#93e0e3' attr: 'b' } + shape_redirection: { fg: '#dc8cc3' attr: 'b' } + shape_signature: { fg: '#5f7f5f' attr: 'b' } + shape_string: '#5f7f5f' + shape_string_interpolation: { fg: '#93e0e3' attr: 'b' } + shape_table: { fg: '#7cb8bb' attr: 'b' } + shape_variable: '#dc8cc3' + + background: '#383838' + foreground: '#dcdccc' + cursor: '#dcdccc' + } +} + +export module activate { + export-env { + set color_config + update terminal + } +} + +# Activate the theme when sourced +use activate \ No newline at end of file diff --git a/themes/nu-themes/preview-generate-script.nu b/themes/screenshots/scripts/preview-generate-script.nu similarity index 100% rename from themes/nu-themes/preview-generate-script.nu rename to themes/screenshots/scripts/preview-generate-script.nu diff --git a/themes/nu-themes/preview-screenshot-script.nu b/themes/screenshots/scripts/preview-screenshot-script.nu similarity index 100% rename from themes/nu-themes/preview-screenshot-script.nu rename to themes/screenshots/scripts/preview-screenshot-script.nu diff --git a/themes/nu-themes/preview-terminal.nu b/themes/screenshots/scripts/preview-terminal.nu similarity index 100% rename from themes/nu-themes/preview-terminal.nu rename to themes/screenshots/scripts/preview-terminal.nu diff --git a/themes/nu-themes/preview-theme.nu b/themes/screenshots/scripts/preview-theme.nu similarity index 100% rename from themes/nu-themes/preview-theme.nu rename to themes/screenshots/scripts/preview-theme.nu