From 03314adbb7a3adeb004fc289d844fb27744195fe Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 25 Jan 2023 18:14:28 -0800 Subject: [PATCH 1/5] Delete TODO --- TODO.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 TODO.md diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 38b33a2..0000000 --- a/TODO.md +++ /dev/null @@ -1,8 +0,0 @@ -### TODO - -- Make startpage fully generic for both Nord and Everforest - -### Needs checking - -- Fix issue where wireless connection dies after suspend, even after restarting NetworkManager: not an issue on T430, still problem on X220? -- Fix/map media keys (already declared within [`i3.nix`](i3.nix) but are non-functional: not an issue on T430, still problem on X220? From 14b83dfac1ee52599ccb6c9367f0906574d9c151 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 25 Jan 2023 18:15:31 -0800 Subject: [PATCH 2/5] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/275ab728912006eecb549338a50f24f294a7cfb7' (2023-01-20) → 'github:nix-community/home-manager/c59f0eac51da91c6989fd13a68e156f63c0e60b6' (2023-01-24) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/d7705c01ef0a39c8ef532d1033bace8845a07d35' (2023-01-19) → 'github:nixos/nixpkgs/1b1f50645af2a70dc93eae18bfd88d330bfbcf7f' (2023-01-23) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 1377feb..5e10b6b 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1674250603, - "narHash": "sha256-SBolFspxBHpW3hCCDNAFXUiO2mucmkVmf17UmSIK3Cs=", + "lastModified": 1674556204, + "narHash": "sha256-HCRmkZsq01h2Evch08zpgE9jeHdMtGdT1okWotyvuhY=", "owner": "nix-community", "repo": "home-manager", - "rev": "275ab728912006eecb549338a50f24f294a7cfb7", + "rev": "c59f0eac51da91c6989fd13a68e156f63c0e60b6", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1674120619, - "narHash": "sha256-xLT1FQl7/jNPOEq5q/vmc3AExt1V9LtcjM+QY2+MUpA=", + "lastModified": 1674459583, + "narHash": "sha256-L0UZl/u2H3HGsrhN+by42c5kNYeKtdmJiPzIRvEVeiM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d7705c01ef0a39c8ef532d1033bace8845a07d35", + "rev": "1b1f50645af2a70dc93eae18bfd88d330bfbcf7f", "type": "github" }, "original": { From 5d9fc8f4f3ff0ea1abe7a02a79e36f3177b69dbe Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 25 Jan 2023 18:23:23 -0800 Subject: [PATCH 3/5] Switch to nixpkgs pureref --- hosts/home.nix | 2 +- pureref.nix | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 pureref.nix diff --git a/hosts/home.nix b/hosts/home.nix index 69f05db..9c58f99 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -114,7 +114,7 @@ in inkscape obs-studio qbittorrent - (pkgs.callPackage ../pureref.nix { }) + pureref libreoffice gnome.ghex tudu diff --git a/pureref.nix b/pureref.nix deleted file mode 100644 index 5a0774a..0000000 --- a/pureref.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, appimageTools, requireFile }: - -appimageTools.wrapType1 rec { - pname = "pureref"; - version = "1.11.1"; - - src = requireFile { - name = "PureRef-${version}_x64.Appimage"; - sha256 = "05naywdgykqrsgc3xybskr418cyvbx7vqs994yv9w8zf98gxvbvm"; - url = "https://www.pureref.com/download.php"; - }; - - extraInstallCommands = '' - mv $out/bin/${pname}-${version} $out/bin/${pname} - ''; - - meta = with lib; { - description = "Reference Image Viewer"; - homepage = "https://www.pureref.com"; - license = licenses.unfree; - maintainers = with maintainers; [ elnudev ]; - platforms = [ "x86_64-linux" ]; - sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; - }; -} From a548fbba06efd5093fec293bf84c29c7287c5f30 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 25 Jan 2023 19:05:59 -0800 Subject: [PATCH 4/5] Rename colors to theme, clean up color usage --- fcitx5/theme.nix | 17 ++++++----- hosts/desktop.nix | 8 ++--- hosts/home.nix | 8 ++--- i3.nix | 38 ++++++++++++------------ polybar/default.nix | 32 ++++++++++---------- rofi/default.nix | 6 ++-- startpage/default.nix | 4 +-- terminal.nix | 4 +-- {colors => theme}/default.nix | 3 +- {colors => theme}/everforest/default.nix | 0 {colors => theme}/everforest/gtk.nix | 0 {colors => theme}/nord/default.nix | 0 12 files changed, 60 insertions(+), 60 deletions(-) rename {colors => theme}/default.nix (67%) rename {colors => theme}/everforest/default.nix (100%) rename {colors => theme}/everforest/gtk.nix (100%) rename {colors => theme}/nord/default.nix (100%) diff --git a/fcitx5/theme.nix b/fcitx5/theme.nix index 764db5d..b9e0ea3 100644 --- a/fcitx5/theme.nix +++ b/fcitx5/theme.nix @@ -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] diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 002cd0b..a63fdbe 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -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 diff --git a/hosts/home.nix b/hosts/home.nix index 9c58f99..38081c9 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -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}/"; diff --git a/i3.nix b/i3.nix index a215b8f..ed79147 100644 --- a/i3.nix +++ b/i3.nix @@ -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 = [ diff --git a/polybar/default.nix b/polybar/default.nix index e7bbd33..c0fcf6d 100644 --- a/polybar/default.nix +++ b/polybar/default.nix @@ -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}"; }; }; }; diff --git a/rofi/default.nix b/rofi/default.nix index a1948be..527740e 100644 --- a/rofi/default.nix +++ b/rofi/default.nix @@ -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); } diff --git a/startpage/default.nix b/startpage/default.nix index 18fdde6..535e343 100644 --- a/startpage/default.nix +++ b/startpage/default.nix @@ -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"] '' diff --git a/terminal.nix b/terminal.nix index c92ef6f..96c9e89 100644 --- a/terminal.nix +++ b/terminal.nix @@ -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; diff --git a/colors/default.nix b/theme/default.nix similarity index 67% rename from colors/default.nix rename to theme/default.nix index d221312..c79489e 100644 --- a/colors/default.nix +++ b/theme/default.nix @@ -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; } diff --git a/colors/everforest/default.nix b/theme/everforest/default.nix similarity index 100% rename from colors/everforest/default.nix rename to theme/everforest/default.nix diff --git a/colors/everforest/gtk.nix b/theme/everforest/gtk.nix similarity index 100% rename from colors/everforest/gtk.nix rename to theme/everforest/gtk.nix diff --git a/colors/nord/default.nix b/theme/nord/default.nix similarity index 100% rename from colors/nord/default.nix rename to theme/nord/default.nix From e42f845f0950348e44d77e8d19fb1243eed02a71 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 25 Jan 2023 19:25:35 -0800 Subject: [PATCH 5/5] Use substituteAll for fcitx5 theming --- fcitx5/default.nix | 12 ++++++++---- fcitx5/{theme.nix => theme.conf} | 29 ++++++++++------------------- 2 files changed, 18 insertions(+), 23 deletions(-) rename fcitx5/{theme.nix => theme.conf} (61%) diff --git a/fcitx5/default.nix b/fcitx5/default.nix index 4ad50e5..adb4c33 100644 --- a/fcitx5/default.nix +++ b/fcitx5/default.nix @@ -1,7 +1,7 @@ { pkgs, ... }: -let - themeFolder = ".local/share/fcitx5/themes/Theme/"; +with import ../theme; let + themeFolder = ".local/share/fcitx5/themes/${theme}/"; in { i18n.inputMethod = { @@ -10,9 +10,13 @@ in }; home.file = { - "${themeFolder}theme.conf".text = import ./theme.nix; + "${themeFolder}theme.conf".source = with colors; pkgs.substituteAll ({ + src = ./theme.conf; + background = "${bg1}80"; + highlight = bg0; + } // colors); "${themeFolder}arrow.png".source = ./arrow.png; "${themeFolder}radio.png".source = ./radio.png; - ".config/fcitx5/conf/classicui.conf".text = "Theme=Theme"; + ".config/fcitx5/conf/classicui.conf".text = "Theme=${theme}"; }; } diff --git a/fcitx5/theme.nix b/fcitx5/theme.conf similarity index 61% rename from fcitx5/theme.nix rename to fcitx5/theme.conf index b9e0ea3..ac6f54e 100644 --- a/fcitx5/theme.nix +++ b/fcitx5/theme.conf @@ -1,20 +1,12 @@ -# Modified from https://github.com/tonyfettes/fcitx5-nord -let - theme = import ../theme; -in with theme.colors; let - background = "${bg1}80"; - highlight = "${bg0}"; -in -'' [Metadata] ScaleWithDPI=True [InputPanel] Font=Sans 13 -NormalColor=${fg0} -HighlightCandidateColor=${fg1}; -HighlightColor=${undefined} -HighlightBackgroundColor=${undefined} +NormalColor=@fg0@ +HighlightCandidateColor=@fg1@; +HighlightColor=@undefined@ +HighlightBackgroundColor=@undefined@ Spacing=3 [InputPanel/TextMargin] @@ -24,7 +16,7 @@ Top=6 Bottom=6 [InputPanel/Background] -Color=${background} +Color=@background@ [InputPanel/Background/Margin] Left=2 @@ -33,7 +25,7 @@ Top=2 Bottom=2 [InputPanel/Highlight] -Color=${highlight} +Color=@highlight@ [InputPanel/Highlight/Margin] Left=10 @@ -43,11 +35,11 @@ Bottom=7 [Menu] Font=Sans 10 -NormalColor=${fg0} +NormalColor=@fg0@ Spacing=3 [Menu/Background] -Color=${background} +Color=@background@ [Menu/Background/Margin] Left=2 @@ -62,7 +54,7 @@ Top=2 Bottom=2 [Menu/Highlight] -Color=${highlight} +Color=@highlight@ [Menu/Highlight/Margin] Left=10 @@ -71,7 +63,7 @@ Top=5 Bottom=5 [Menu/Separator] -Color=${highlight} +Color=@highlight@ [Menu/CheckBox] Image=radio.png @@ -84,4 +76,3 @@ Left=5 Right=5 Top=5 Bottom=5 -''