From f6976cd478768b2b91486fabecb2d86b846db31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 23 Apr 2022 17:31:50 +0200 Subject: [PATCH] :rocket: add theming with base16 --- flake.lock | 37 +++ flake.nix | 9 +- modules/default.nix | 1 + modules/desktop/apps/kitty.nix | 51 ---- modules/desktop/apps/rofi/default.nix | 1 - modules/desktop/apps/zathura.nix | 59 +---- modules/desktop/bspwm/default.nix | 8 +- modules/desktop/bspwm/polybar.nix | 73 +++--- modules/theming.nix | 330 ++++++++++++++++++++++++++ 9 files changed, 416 insertions(+), 153 deletions(-) create mode 100644 modules/theming.nix diff --git a/flake.lock b/flake.lock index 5257ad4..6dcc9ef 100644 --- a/flake.lock +++ b/flake.lock @@ -50,6 +50,42 @@ "type": "github" } }, + "base16": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1643556194, + "narHash": "sha256-mU/pD30cIRcodLROhbIpRuEoEsO9aV5lDrYav0ZSIUA=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "abc25e69d0e18ce54dbe6d95a531c4d63ed59932", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "asus-touchpad-numpad-driver": { + "flake": false, + "locked": { + "lastModified": 1646981564, + "narHash": "sha256-qanPTmP2Sctq4ybiUFzIiADP2gZH8HhajBORUSIXb04=", + "owner": "mohamed-badaoui", + "repo": "asus-touchpad-numpad-driver", + "rev": "a2bada610ebb3fc002fceb53ddf93bc799241867", + "type": "github" + }, + "original": { + "owner": "mohamed-badaoui", + "repo": "asus-touchpad-numpad-driver", + "type": "github" + } + }, "dracula-fish": { "flake": false, "locked": { @@ -270,6 +306,7 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", + "base16": "base16", "dracula-fish": "dracula-fish", "emacs-overlay": "emacs-overlay", "forgit-git": "forgit-git", diff --git a/flake.nix b/flake.nix index 031f98c..b9992b1 100644 --- a/flake.nix +++ b/flake.nix @@ -41,9 +41,15 @@ url = "github:arkenfox/user.js"; flake = false; }; + + # Theming + base16 = { + url = "github:SenchoPens/base16.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = inputs@{ self, agenix, home-manager, nixpkgs, utils, ... }: + outputs = inputs@{ self, agenix, home-manager, nixpkgs, utils, base16, ... }: utils.lib.mkFlake { inherit self inputs; @@ -84,6 +90,7 @@ } self.nixosModules.default agenix.nixosModules.age + base16.nixosModule ]; hosts.nixos-laptop.modules = diff --git a/modules/default.nix b/modules/default.nix index 97da4da..374e56e 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -9,6 +9,7 @@ ./gaming.nix ./security.nix ./services + ./theming.nix ]; # USERS diff --git a/modules/desktop/apps/kitty.nix b/modules/desktop/apps/kitty.nix index 692ccf3..1d785cd 100644 --- a/modules/desktop/apps/kitty.nix +++ b/modules/desktop/apps/kitty.nix @@ -14,57 +14,6 @@ "ctrl+plus" = "change_font_size all +2.0"; "ctrl+minus" = "change_font_size all -2.0"; }; - extraConfig = '' - foreground #f8f8f2 - background #282a36 - #background #000000 - selection_foreground #44475a - selection_background #f8f8f2 - - url_color #ffb86c - - # black - color0 #21222c - color8 #6272a4 - - # red - color1 #ff5555 - color9 #ff6e6e - - # green - color2 #50fa7b - color10 #69ff94 - - # yellow - color3 #f1fa8c - color11 #ffffa5 - - # blue - color4 #bd93f9 - color12 #d6acff - - # magenta - color5 #ff79c6 - color13 #ff92df - - # cyan - color6 #8be9fd - color14 #a4ffff - - # white - color7 #f8f8f2 - color15 #ffffff - - # Cursor colors - cursor #6272a4 - cursor_text_color background - - # Tab bar colors - active_tab_foreground #44475a - active_tab_background #f8f8f2 - inactive_tab_foreground #282a36 - inactive_tab_background #6272a4 - ''; font = { name = "FiraCode Nerd Font"; size = 10; diff --git a/modules/desktop/apps/rofi/default.nix b/modules/desktop/apps/rofi/default.nix index 77ab8cb..87af2fa 100644 --- a/modules/desktop/apps/rofi/default.nix +++ b/modules/desktop/apps/rofi/default.nix @@ -7,7 +7,6 @@ enable = true; package = pkgs.rofi.override { plugins = with pkgs; [ rofi-calc rofi-emoji ]; }; - theme = ./dracula.rasi; extraConfig = { combi-modi = "drun,window,emoji"; }; }; home.packages = with pkgs; diff --git a/modules/desktop/apps/zathura.nix b/modules/desktop/apps/zathura.nix index 0d8ac11..99cb46d 100644 --- a/modules/desktop/apps/zathura.nix +++ b/modules/desktop/apps/zathura.nix @@ -1,58 +1,13 @@ { config, lib, pkgs, ... }: { - home-manager.users.moritz = { - programs.zathura = { - enable = true; - options = { - # - # Startup Options - # - recolor = true; - adjust-open = "width"; - - # - # Dracula Theme - # - completion-bg = "#282a36"; - completion-fg = "#ff79c6"; - completion-group-bg = "#282a36"; - completion-group-fg = "#6272a4"; - completion-highlight-bg = "#44475a"; - completion-highlight-fg = "#f8f8f2"; - - notification-error-bg = "#ff5555"; - notification-error-fg = "#f8f8f2"; - notification-warning-bg = "#ffb86c"; - notification-warning-fg = "#44475a"; - notification-bg = "#282a36"; - notification-fg = "#f8f8f2"; - - index-bg = "#282a36"; - index-fg = "#f8f8f2"; - index-active-bg = "#44475a"; - index-active-fg = "#f8f8f2"; - - default-bg = "#44475a"; - default-fg = "#bd93f9"; - - inputbar-bg = "#282a36"; - inputbar-fg = "#8be9fd"; - statusbar-bg = "#282a36"; - statusbar-fg = "#f8f8f2"; - - render-loading = true; - render-loading-fg = "#282a36"; - render-loading-bg = "#f8f8f2"; - - # - # Recolor settings - # - recolor-lightcolor = "#282a36"; - recolor-darkcolor = "#f8f8f2"; - - font = "Jetbrains Mono 9"; - }; + home-manager.users.moritz.programs.zathura = { + enable = true; + options = { + recolor = true; + adjust-open = "width"; + font = "Jetbrains Mono 9"; + selection-clipboard = "clipboard"; }; }; } diff --git a/modules/desktop/bspwm/default.nix b/modules/desktop/bspwm/default.nix index 03e6a76..1208514 100644 --- a/modules/desktop/bspwm/default.nix +++ b/modules/desktop/bspwm/default.nix @@ -34,7 +34,7 @@ in { "feh" = { state = "floating"; }; "Vampire_Survivors" = { state = "fullscreen"; }; }; - settings = { + settings = with config.scheme.withHashtag; { border_width = 2; window_gap = 5; borderless_monocle = true; @@ -42,9 +42,9 @@ in { focus_follows_pointer = true; # Dracula theme # - focused_border_color = "#bd93f9"; - normal_border_color = "#44475a"; - active_border_color = "#6272a4"; + focused_border_color = base0D; + normal_border_color = base03; + active_border_color = base03; }; startupPrograms = [ "${pkgs.systemd}/bin/systemctl --user start polybar.service" diff --git a/modules/desktop/bspwm/polybar.nix b/modules/desktop/bspwm/polybar.nix index 2722df1..73c46bc 100644 --- a/modules/desktop/bspwm/polybar.nix +++ b/modules/desktop/bspwm/polybar.nix @@ -12,22 +12,7 @@ in { MONITOR=$m polybar --reload bottom & done ''; - config = let - colors = { - background = "#282a36"; - current-line = "#44475a"; - foreground = "#f8f8f2"; - comment = "#6272a4"; - - cyan = "#8be9fd"; - green = "#50fa7b"; - orange = "#ffb86c"; - pink = "#ff79c6"; - purple = "#bd93f9"; - red = "#ff5555"; - yellow = "#f1fa8c"; - }; - in { + config = with config.scheme.withHashtag; { "global/wm" = { margin-top = 5; }; "bar/bottom" = { # position @@ -35,18 +20,18 @@ in { bottom = true; width = "100%:-20"; heigth = 25; - background = colors.background; - foreground = colors.foreground; + background = base00; + foreground = base05; radius = 10; offset-x = 10; offset-y = 5; padding = 1; line-size = 3; - line-color = colors.pink; + line-color = base06; module-margin = 1; - separator = "%{F${colors.comment}}◆%{F-}"; + separator = "%{F${base03}}◆%{F-}"; font-0 = "FiraCode Nerd Font:size=10;0"; @@ -69,10 +54,10 @@ in { time-format = "%H:%M"; format-charging = - "%{F${colors.green}}%{F-} "; + "%{F${base0B}}%{F-} "; format-discharging = - "%{F${colors.red}}%{F-} "; - format-full = "%{F${colors.green}} %{F-} "; + "%{F${base08}}%{F-} "; + format-full = "%{F${base08}} %{F-} "; label-charging = "%percentage%% %time% remaining"; label-discharging = "%percentage%% %time% remaining"; @@ -96,23 +81,23 @@ in { type = "internal/bspwm"; label-focused = ""; - label-focused-foreground = colors.purple; + label-focused-foreground = base0E; label-focused-padding = 1; label-occupied = ""; - label-occupied-foreground = colors.comment; + label-occupied-foreground = base03; label-occupied-padding = 1; label-urgent = ""; - label-urgent-foreground = colors.red; + label-urgent-foreground = base08; label-urgent-padding = 1; label-empty = ""; - label-empty-foreground = colors.comment; + label-empty-foreground = base03; label-empty-padding = 1; label-separator = " "; - label-separator-foreground = colors.cyan; + label-separator-foreground = base0C; label-separator-padding = 1; pin-workspaces = true; @@ -123,11 +108,11 @@ in { format = "