Giter Club home page Giter Club logo

themenix's Introduction

ThemeNix

Theme your NixOS configuration consistently.

Usage

Firstly, add the flake to your inputs. You don't need to pin anything since it doesn't depend on anything.

Then you can use any theme you'd like by selecting an attribute, like themes.gruvbox-dark-hard. Then you can select a color by using base16 attributes, like themes.gruvbox-dark-hard.base0A, base00, base06 etc.

Or you can make your own theme:

let
  myTheme = themes.custom {
    name   = "My Awesome Theme";
    author = "RGBCube";
    base00 = "000000";
    # ...
  };
in {}

If you want to create your own theme based on an included theme, you can do this:

let
  myTheme = themes.custom (themes.raw.tango // {
    base00 = "2E3436";                # Overriding the background color...
    accent = themes.raw.tango.base0A; # Custom properties also work!
  });
in {}

You can also use the visualize.nu script to visualize any theme in the terminal:

./visualize.nu themes/chalk.nix
All themes
3024 (Hey, if you want to use this theme, you'll have to do `themes."3024"`)
apathy
apprentice
ashes
atelier-cave-light
atelier-cave
atelier-dune-light
atelier-dune
atelier-estuary-light
atelier-estuary
atelier-forest-light
atelier-forest
atelier-heath-light
atelier-heath
atelier-lakeside-light
atelier-lakeside
atelier-plateau-light
atelier-plateau
atelier-savanna-light
atelier-savanna
atelier-seaside-light
atelier-seaside
atelier-sulphurpool-light
atelier-sulphurpool
atlas
ayu-dark
ayu-light
ayu-mirage
bespin
black-metal-bathory
black-metal-burzum
black-metal-dark-funeral
black-metal-gorgoroth
black-metal-immortal
black-metal-khold
black-metal-marduk
black-metal-mayhem
black-metal-nile
black-metal-venom
black-metal
blueforest
blueish
brewer
bright
brogrammer
brushtrees-dark
brushtrees
caroline
catppuccin-frappe
catppuccin-latte
catppuccin-macchiato
catppuccin-mocha
chalk
circus
classic-dark
classic-light
codeschool
colors
cupcake
cupertino
da-one-black
da-one-gray
da-one-ocean
da-one-paper
da-one-sea
da-one-white
danqing-light
danqing
darcula
darkmoss
darktooth
darkviolet
decaf
default-dark
default-light
dirtysea
dracula
edge-dark
edge-light
eighties
embers
emil
equilibrium-dark
equilibrium-gray-dark
equilibrium-gray-light
equilibrium-light
eris
espresso
eva-dim
eva
evenok-dark
everforest-dark-hard
everforest
flat
framer
fruit-soda
gigavolt
github
google-dark
google-light
gotham
grayscale-dark
grayscale-light
greenscreen
gruber
gruvbox-dark-hard
gruvbox-dark-medium
gruvbox-dark-pale
gruvbox-dark-soft
gruvbox-light-hard
gruvbox-light-medium
gruvbox-light-soft
gruvbox-material-dark-hard
gruvbox-material-dark-medium
gruvbox-material-dark-soft
gruvbox-material-light-hard
gruvbox-material-light-medium
gruvbox-material-light-soft
hardcore
harmonic16-dark
harmonic16-light
heetch-light
heetch
helios
hopscotch
horizon-dark
horizon-light
horizon-terminal-dark
horizon-terminal-light
humanoid-dark
humanoid-light
ia-dark
ia-light
icy
irblack
isotope
kanagawa
katy
kimber
lime
macintosh
marrakesh
materia
material-darker
material-lighter
material-palenight
material-vivid
material
mellow-purple
mexico-light
mocha
monokai
mountain
nebula
nord
nova
ocean
oceanicnext
one-light
onedark
outrun-dark
oxocarbon-dark
oxocarbon-light
pandora
papercolor-dark
papercolor-light
paraiso
pasque
phd
pico
pinky
pop
porple
primer-dark-dimmed
primer-dark
primer-light
purpledream
qualia
railscasts
rebecca
rose-pine-dawn
rose-pine-moon
rose-pine
sagelight
sakura
sandcastle
selenized-black
selenized-dark
selenized-light
selenized-white
seti
shades-of-purple
shadesmear-dark
shadesmear-light
shapeshifter
silk-dark
silk-light
snazzy
solarflare-light
solarflare
solarized-dark
solarized-light
spaceduck
spacemacs
standardized-dark
standardized-light
stella
still-alive
summercamp
summerfruit-dark
summerfruit-light
synth-midnight-dark
synth-midnight-light
tango
tarot
tender
tokyo-city-dark
tokyo-city-light
tokyo-city-terminal-dark
tokyo-city-terminal-light
tokyo-night-dark
tokyo-night-light
tokyo-night-storm
tokyo-night-terminal-dark
tokyo-night-terminal-light
tokyo-night-terminal-storm
tokyodark-terminal
tokyodark
tomorrow-night-eighties
tomorrow-night
tomorrow
tube
twilight
unikitty-dark
unikitty-light
unikitty-reversible
uwunicorn
vice
vulcan
windows-10-light
windows-10
windows-95-light
windows-95
windows-highcontrast-light
windows-highcontrast
windows-nt-light
windows-nt
woodland
xcode-dusk
zenbones
zenburn

Themes have 2 special color properties, which are with0x and withHashtag. This will prefix every color with the thing you selected.

let
  normal   = themes.windows-95.base00; # => 000000
  with0x   = themes.windows-95.with0x.base00; # => 0x000000
  wHashtag = themes.windows-95.withHashtag.base00; # => #000000
in {}

Themes also have templates, which generate templates with the color scheme. You can use a template by doing themes.gruvboxbox-dark-hard.<template-name>.

There are instructions on how to use these in the file they are located. Check templates/<template>.nix

All templates
adwaitaGtkCss
btopTheme
discordCss
firefoxTheme
ghosttyConfig
tmTheme

Here is a minimal usage example:

{
  description = "Dankest NixOS configuration.";

  inputs = {
    nixpkgs = {
      url = "github:NixOS/nixpkgs/nixos-unstable";
    };

    homeManager = {
      url                    = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    themes = {
      url = "github:RGBCube/ThemeNix";
    };
  };

  outputs = { nixpkgs, themes, ... }: let
    pkgs = import nixpkgs { system = "x86_64-linux"; };
    theme = themes.tango;
  in {
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        homeManager.nixosModules.default
        {
          home-manager.users.myuser = {
            programs.kitty.settings = with theme.withHashtag; {
              color0  = base00;
              color1  = base08;
              color2  = base0B;
              color3  = base0A;
              color4  = base0D;
              color5  = base0E;
              color6  = base0C;
              color7  = base05;
              color8  = base03;
              color9  = base08;
              color10 = base0B;
              color11 = base0A;
              color12 = base0D;
              color13 = base0E;
              color14 = base0C;
              color15 = base07;
              color16 = base09;
              color17 = base0F;
              color18 = base01;
              color19 = base02;
              color20 = base04;
              color21 = base06;
            };

            # Using templates??? Wow, that's so cool!
            programs.bat = {
              config.theme = "base16";
              themes.base16.src = pkgs.writeText "base16.tmTheme" theme.tmTheme;
            };
          };
        }
      ];
    };
  }
}

Credits

License

MIT License

Copyright (c) 2023-present RGBCube

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

themenix's People

Contributors

rgbcube avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

orhnk

themenix's Issues

Feature request/proposition

Following our discussion on Discord I'm going to detail my thought here:

It would be great to have a way to define an accent color (optional) for each color scheme.

My wish is to have a uniform naming scheme for each color scheme, so that I can just change the theme I use and the calls to colors will still be valid everywhere.

I thought about something like that :

let
  myTheme = themes.custom {
    name   = "My Awesome Theme";
    author = "RGBCube";
    base00 = mkAccent "000000";    
    # ...
  };

or :

let
  myTheme = themes.custom {
    name   = "My Awesome Theme";
    author = "RGBCube";
    base00 = mkAllias "accent" "000000";    
    # ...
  };

So then I can do :

            programs.kitty.settings = with theme.withHashtag; {
              color0  = accent;
            }

Maybe extend functionality so that I can use a pre-made color theme with my own aliases, so that I don't have to change every call to the theme manager whenever I wanna change the theme:

theme = themes mkAliasedTheme tango {
  background = "base00";
  accent= "base0F";
};

I hope I'm being clear !

If you don't want to implement it but appreciate the idea I could make a PR for it One Day:tm:

Wallpaper Hooks

Changing the colors is cool, but It's not sufficient for a complete "theme manager"
adding a possible option for wallpapers would be really cool!

let
  myTheme = themes.custom {
    name   = "My Awesome Theme";
    author = "RGBCube";
    base00 = "000000";
    # ...
    wallpapers = [
        "MyCustomTheme/" # / postfix indicates a directory of wallpapers
        "cool-wallpaper.png" # file
    ]
  };
in {}

And you can expose some functions API functions for:

  • Querying currently selected wallpaper
  • Calling a custom function to change the wallpaper.
  • Some built-in functions to change the wallpaper:
    - Change the wallpaper in a period of time. (maybe the user can supply a custom wallpaper selector algorithm e.g random, respectfully etc.)

Challenges

Changing the wallpaper is not straight forward. It depends.

For window systems like X you can supply some popular options built-in:

# ThemeNix initialization config:
backend = "feh"; # xsetroot, hsetroot

And for those who uses a tool that is not built-in (PR it btw)

# ThemeNix initialization config:
# %s represents the wallpaper path here. You may find a better solution (like exposing the following wallpaper to the API)
script = ''
feh --bg-fill %s
''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.