Rename colors to theme, clean up color usage

inky
Elnu 1 year ago
parent 5d9fc8f4f3
commit a548fbba06

@ -1,8 +1,9 @@
# Modified from https://github.com/tonyfettes/fcitx5-nord
let
colors = import ../colors;
background = "${colors.bg1}80";
highlight = "${colors.bg0}";
theme = import ../theme;
in with theme.colors; let
background = "${bg1}80";
highlight = "${bg0}";
in
''
[Metadata]
@ -10,10 +11,10 @@ ScaleWithDPI=True
[InputPanel]
Font=Sans 13
NormalColor=${colors.fg0}
HighlightCandidateColor=${colors.fg1};
HighlightColor=${colors.undefined}
HighlightBackgroundColor=${colors.undefined}
NormalColor=${fg0}
HighlightCandidateColor=${fg1};
HighlightColor=${undefined}
HighlightBackgroundColor=${undefined}
Spacing=3
[InputPanel/TextMargin]
@ -42,7 +43,7 @@ Bottom=7
[Menu]
Font=Sans 10
NormalColor=${colors.fg0}
NormalColor=${fg0}
Spacing=3
[Menu/Background]

@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
let
colors = import ../colors;
theme = import ../theme;
in
{
services = {
@ -13,9 +13,9 @@ in
enable = true;
greeters.gtk = {
enable = true;
theme = colors.gtkTheme pkgs;
theme = theme.gtkTheme pkgs;
};
background = ../wallpapers/${colors.wallpaper};
background = ../wallpapers/${theme.wallpaper};
};
defaultSession = "none+i3";
};
@ -32,7 +32,7 @@ in
environment.sessionVariables = {
# GTK Theme won't display with GTK4 (e.g. nautilus) otherwise
# Doesn't work in some scenarios, such as open containing folder in Firefox, when declared in home.sessionVariables
GTK_THEME = (colors.gtkTheme pkgs).name;
GTK_THEME = (theme.gtkTheme pkgs).name;
};
# Enable OpenTabletDriver, GUI configurator is otd-gui

@ -1,7 +1,7 @@
{ config, pkgs, user, ... }:
let
colors = import ../colors;
theme = import ../theme;
in
{
imports = [
@ -19,7 +19,7 @@ in
../emacs
];
home.file."./.background-image".source = ../wallpapers/${colors.wallpaper};
home.file."./.background-image".source = ../wallpapers/${theme.wallpaper};
programs.home-manager.enable = true;
@ -49,8 +49,8 @@ in
gtk = {
enable = true;
iconTheme = colors.gtkIconTheme pkgs;
theme = colors.gtkTheme pkgs;
iconTheme = theme.gtkIconTheme pkgs;
theme = theme.gtkTheme pkgs;
gtk3 = {
bookmarks = let
home = "file://${config.home.homeDirectory}/";

@ -1,9 +1,9 @@
{ pkgs, lib, ... }:
let
colors = import ./colors;
theme = import ./theme;
mod = "Mod4";
in {
in with theme.colors; {
# Dependencies
home.packages = with pkgs; [
playerctl # pactl comes with PulseAudio
@ -19,8 +19,8 @@ in {
showStartupLaunchMessage = false;
showHelp = false;
showSidePanelButton = false;
uiColor = "${colors.bg1}";
contrastUiColor = "${colors.bg0}";
uiColor = "${bg1}";
contrastUiColor = "${bg0}";
drawColor = "#ffffff";
};
};
@ -37,25 +37,25 @@ in {
};
colors = {
focused = {
border = "${colors.bg1}";
background = "${colors.bg1}";
text = "${colors.fg0}";
indicator = "${colors.undefined}";
childBorder = "${colors.undefined}";
border = "${bg1}";
background = "${bg1}";
text = "${fg0}";
indicator = "${undefined}";
childBorder = "${undefined}";
};
focusedInactive = {
border = "${colors.bg1}";
background = "${colors.bg1}";
text = "${colors.fg0}";
indicator = "${colors.undefined}";
childBorder = "${colors.undefined}";
border = "${bg1}";
background = "${bg1}";
text = "${fg0}";
indicator = "${undefined}";
childBorder = "${undefined}";
};
unfocused = {
border = "${colors.bg0}";
background = "${colors.bg0}";
text = "${colors.fg0}";
indicator = "${colors.undefined}";
childBorder = "${colors.undefined}";
border = "${bg0}";
background = "${bg0}";
text = "${fg0}";
indicator = "${undefined}";
childBorder = "${undefined}";
};
};
startup = [

@ -1,8 +1,8 @@
{ pkgs, lib, ... }:
let
colors = import ../colors;
in
theme = import ../theme;
in with theme.colors;
{
# Dependencies
home.packages = with pkgs; [
@ -21,15 +21,15 @@ in
tray-position = "right";
font-0 = "Noto Sans Mono;2";
font-1 = "M+ 2p;2";
background = "${colors.bg0}";
foreground = "${colors.fg0}";
background = "${bg0}";
foreground = "${fg0}";
width = "100%";
height = "24pt";
line-size = "3pt";
padding-right = 1;
module-margin = 1;
separator = "|";
separator-foreground = "${colors.disabled}";
separator-foreground = "${disabled}";
cursor-click = "pointer";
cursor-scroll = "ns-resize";
modules-left = [
@ -51,16 +51,16 @@ in
"module/xworkspaces" = {
type = "internal/xworkspaces";
label-active-background = "${colors.bg1}";
label-active-underline = "${colors.primary}";
label-active-background = "${bg1}";
label-active-underline = "${primary}";
label-active-padding-right = 1;
label-occupied-padding-right = 1;
label-urgent-background = "${colors.alert}";
label-urgent-background = "${alert}";
label-urgent-padding-right = 1;
label-empty-foreground = "${colors.disabled}";
label-empty-foreground = "${disabled}";
label-empty-padding-right = 1;
};
"module/xwindow" = {
@ -88,18 +88,18 @@ in
interval = 25;
mount-0 = "/";
label-mounted = "%{F${colors.primary}}%mountpoint%%{F-} %percentage_used%%";
label-mounted = "%{F${primary}}%mountpoint%%{F-} %percentage_used%%";
label-unmounted = "%mountpoint% not mounted";
label-unmounted-foreground = "${colors.disabled}";
label-unmounted-foreground = "${disabled}";
};
"module/pulseaudio" = {
type = "internal/pulseaudio";
format-volume-prefix = "VOL ";
format-volume-prefix-foreground = "${colors.primary}";
format-volume-prefix-foreground = "${primary}";
label-muted = "muted";
label-muted-foreground = "${colors.disabled}";
label-muted-foreground = "${disabled}";
};
"module/memory" = {
type = "internal/memory";
@ -107,7 +107,7 @@ in
interval = 2;
format-prefix = "RAM ";
format-prefix-foreground = "${colors.primary}";
format-prefix-foreground = "${primary}";
};
"module/cpu" = {
type = "internal/cpu";
@ -115,7 +115,7 @@ in
interval = 2;
format-prefix = "CPU ";
format-prefix-foreground = "${colors.primary}";
format-prefix-foreground = "${primary}";
};
"module/date" = {
type = "internal/date";
@ -125,7 +125,7 @@ in
date = "%H:%M";
date-alt = "%Y-%m-%d %H:%M:%S";
label-foreground = "${colors.primary}";
label-foreground = "${primary}";
};
};
};

@ -1,8 +1,8 @@
{ pkgs, ... }:
let
colors = import ../colors;
theme = colors.theme;
_theme = import ../theme;
theme = _theme.theme; # Theme name
in {
home.packages = with pkgs; [
(pkgs.callPackage ./power.nix { })
@ -14,5 +14,5 @@ in {
};
home.file.".config/rofi/${theme}.rasi".source = pkgs.substituteAll ({
src = ./theme.rasi;
} // colors.colors);
} // _theme.colors);
}

@ -1,7 +1,7 @@
{ pkgs, lib, ... }:
let
colors = import ../colors;
theme = import ../theme;
startpageDir = import ./dir.nix;
out = "${startpageDir}.tmp/";
in
@ -11,7 +11,7 @@ in
source = ./html;
recursive = true;
};
"${out}colors.css".text = ":root {\n" + (colors.css lib) + "\n}";
"${out}colors.css".text = ":root {\n" + (theme.css lib) + "\n}";
};
# Make files not symlinks, this causes issues displaying in Firefox
home.activation.startpage = lib.hm.dag.entryAfter["writeBoundary"] ''

@ -1,13 +1,13 @@
{ ... }:
let
colors = import ./colors;
theme = import ./theme;
in
{
programs.kitty = {
enable = true;
# https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json
theme = "${colors.kitty-theme}";
theme = "${theme.kitty-theme}";
font = {
name = "FiraCode Nerd Font Mono";
size = 12;

@ -8,5 +8,4 @@ in
{
css = lib: lib.strings.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: " --${k}: ${v};") theme.colors));
}
// colors // theme.colors # Root colors
// theme // { colors = theme.colors // colors; } # Dedicated color set
// theme // { colors = theme.colors // colors; }
Loading…
Cancel
Save