summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-06-23 10:42:17 +0200
committerMinijackson <minijackson@riseup.net>2021-06-23 10:42:17 +0200
commit3a842d0beff32a5a647c6b6a4364f83846df81ac (patch)
tree6ef69d2417ff578bad310ec3961a0c0d7904f2be /lib
parentdee2e21beb99eff5da164501d03d31342d32c67a (diff)
downloadnixos-config-reborn-3a842d0beff32a5a647c6b6a4364f83846df81ac.tar.gz
nixos-config-reborn-3a842d0beff32a5a647c6b6a4364f83846df81ac.zip
graphical: set icon and gtk theme
Diffstat (limited to 'lib')
-rw-r--r--lib/override-arc-theme.nix110
1 files changed, 110 insertions, 0 deletions
diff --git a/lib/override-arc-theme.nix b/lib/override-arc-theme.nix
new file mode 100644
index 0000000..614cffd
--- /dev/null
+++ b/lib/override-arc-theme.nix
@@ -0,0 +1,110 @@
1{ lib, themeConfig, ... }:
2
3let
4 # Thank you:
5 # https://github.com/vedard/Arc-Theme-Generator/blob/master/arc-theme-generator.py
6 colorMapping = with themeConfig.colors;
7 with import ./theme.nix { inherit lib; };
8 let
9 hex2RgbaPrefix = color:
10 let rgb = hex2RGB color;
11 in "rgba(${toString rgb.red}, ${toString rgb.green}, ${toString rgb.blue}";
12 in {
13 "#5294e2" = dominant; # Dominant color
14 # Same but allows opacity
15 "rgba(82, 148, 226" = hex2RgbaPrefix dominant;
16 "#6ba4e7" = dominant; # Dominant color but in icons
17
18 # TODO: this should be slightly lighter
19 "#4dadd4" = dominant; # Lighter Dominant color
20 # Same but allows opacity
21 "rgba(77, 173, 212" = hex2RgbaPrefix dominant;
22
23 #"#252a35" = "#121212"; # Gnome Panel Background
24 #"#262932" = "#101010"; # Dark WM bordard
25 "#2f343f" = background0; # Dark Header BG
26 # Same but allows opacity
27 "rgba(47, 52, 63" = hex2RgbaPrefix background0; # Dark Header BG
28 #"#e7e8eb" = "#e8e8e8"; # Light Header BG
29 "#383c4a" = background; # Dark Background
30 # Same but allows opacity
31 "rgba(56, 60, 74" = hex2RgbaPrefix background;
32 "#d3dae3" = foreground; # Dark Foreground
33 # Same but allows opacity
34 "rgba(211, 218, 227" = hex2RgbaPrefix foreground;
35 "#f5f6f7" = lightBackground; # Light Background
36 "#3b3e45" = foreground; # Light Foreground
37
38 "#404552" = softBackground; # Dark Base Background (ListBox)
39 # Same but allows opacity
40 "rgba(64, 69, 82" = hex2RgbaPrefix softBackground;
41 "#3c4150" = softBackground; # Sidebars
42 "#353945" = softBackground; # Dark SideBar Background (Nautilus)
43 "rgba(53, 57, 69, 0.95)" = background2; # Nautilus SideBar
44 "#bac3cf" = foreground; # Dark SideBar Foreground (Nautilus)
45
46 "rgba(95, 105, 127, 0.37)" = background2; # Buttons?
47 "rgba(134, 144, 165, 0.37)" = background3; # Buttons? hover
48 "#484c59" = background2; # Popover menu button hover
49
50 # Lots of text
51 "rgba(207, 218, 231" = hex2RgbaPrefix foreground;
52 # Some more labels (list sorting)
53 "#b6bcc6" = dimForeground;
54 # Action icons
55 "#9699a2" = dimForeground;
56 # Links
57 "#a9caf1" = brightBlue;
58
59 # List element Hover / Selected
60 "#4a85cb" = dimDominant;
61
62 #"#323644" = "#202020"; # Dark Gnome Shell Modal background
63
64 # Light Gnome Shell Foreground
65 "#5c616c" = foreground;
66 "rgba(92, 97, 108" = hex2RgbaPrefix foreground;
67
68 #"#2d323d" = "#171717"; # Dark Checkbox Background
69 #"#5b627b" = "#505050"; # Dark Switch Background
70 #"#353a47" = "#232323"; # Dark Switch Circle
71 #"#cfd6e6" = "#dbdbdb"; # Light Switch Background
72 "#444a58" = background2; # Gtk2 Dark Button Background
73 "#505666" = background3; # Gtk2 Dark Button-Hover Background
74 "#3e4351" = background; # Gtk2 Dark Button-insensitive Background
75 "#2e3340" = background0; # Gtk2 Dark Button-active Background
76 # More insensitive buttons :'-(
77 "rgba(68, 74, 88" = hex2RgbaPrefix background0;
78
79 "#4b5162" = background; # Gtk2 Dark Tooltips Background
80 "#3e4350" = background0; # Gtk2 Dark Insensitive Background
81 #"#262934" = "#0E0E0E"; # Gtk2 Dark checkbox-unchecked border
82 #"#2b303b" = "#151515"; # Gtk2 Dark checkbox-unchecked Background
83 #"#3e434f" = "#282828"; # Gtk2 Dark scrollbar Background
84 #"#2d303b" = "#151515"; # Gtk2 Dark trough Background
85 #"#767b87" = "#606060"; # Gtk2 Dark slider Background
86 #"#303440" = "#191919"; # Gtk2 Dark border insensitive
87 #"#2b2e39" = "#131313"; # Gtk2 Dark border
88 "#313541" = background0; # Gtk2 Dark inline toolbar
89 };
90
91 #substituteArguments = with lib; concatStrings (foldAttrs (previousColor: newColor: "--replace ${previousColor} ${newColor} ") [] [colorMapping]);
92 substituteArguments = with lib;
93 concatStrings
94 (mapAttrsToList
95 (previousColor: newColor: "--replace '${previousColor}' '${newColor}' --replace '${toUpper previousColor}' '${newColor}' ")
96 colorMapping);
97in
98 package:
99
100package.overrideAttrs (oldAttrs: {
101 name = if (oldAttrs ? name)
102 then "gruvbox-${oldAttrs.name}"
103 else "gruvbox-${oldAttrs.pname}-${oldAttrs.version}";
104 postPatch = ''
105 # For every plaintext file
106 for file in $(find . -type f -exec grep -Iq . {} \; -and -print); do
107 substituteInPlace "$file" ${substituteArguments} 2>/dev/null
108 done
109 '';
110})